Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/: .cvsignore Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/: BUGS.ja diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/COPYING /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/COPYING --- work/emacs-w3m-1.4.4/COPYING 2002-03-02 16:44:16.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/COPYING 2005-07-06 08:52:27.000000000 +0900 @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. Only in work/emacs-w3m-1.4.4/: Makefile diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/Makefile.in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/Makefile.in --- work/emacs-w3m-1.4.4/Makefile.in 2013-06-14 14:07:24.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/Makefile.in 2012-01-06 11:02:58.000000000 +0900 @@ -1,6 +1,7 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ prefix = @prefix@ +datarootdir = @datarootdir@ datadir = @datadir@ infodir = @infodir@ lispdir = @lispdir@ @@ -16,6 +17,12 @@ VANILLA_FLAG = @VANILLA_FLAG@ FLAGS = $(VANILLA_FLAG) -batch -l $(srcdir)/w3mhack.el $(ADDITIONAL_LOAD_PATH) +## This is used to set the environment variable XEMACSDEBUG for XEmacs +## 21.5 in order to suppress warnings for Lisp shadows when XEmacs 21.5 +## starts. This is used also for not installing w3m-ems.el for XEmacs +## and w3m-xmas.el for GNU Emacs. +XEMACSDEBUG = @XEMACSDEBUG@ + IGNORES = w3mhack.el PACKAGE = emacs-w3m @@ -33,10 +40,11 @@ lisp: Makefile env test ! -f w3m-util.elc -o w3m-util.elc -nt w3m-util.el || $(MAKE) clean env test ! -f w3m-proc.elc -o w3m-proc.elc -nt w3m-proc.el || $(MAKE) clean - $(EMACS) $(FLAGS) -f w3mhack-compile + $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-compile +# `w3mhack-what-where' respects DESTDIR what-where: - @$(EMACS) $(FLAGS) -f w3mhack-what-where\ + @$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-what-where\ "$(lispdir)" "$(ICONDIR)" "$(PACKAGEDIR)" "$(infodir)" info: @@ -55,84 +63,101 @@ install-ja: install-lisp install-info-ja install-lisp: lisp - @$(SHELL) $(srcdir)/mkinstalldirs $(lispdir);\ - for p in ChangeLog* *.el; do\ - case "$$p" in\ - $(IGNORES)) ;;\ - *) echo " $(INSTALL_DATA) $$p $(lispdir)/$$p";\ - $(INSTALL_DATA) $$p $(lispdir)/$$p;;\ - esac;\ + @$(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(lispdir)";\ + for p in ChangeLog ChangeLog.[1-9] ChangeLog.[1-9][0-9] *.el; do\ + if test -f "$$p"; then\ + case "$$p" in\ + $(IGNORES)) ;;\ + w3m-ems\.el) if test -z "$(XEMACSDEBUG)"; then\ + echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p"; fi;;\ + w3m-xmas\.el) if test -n "$(XEMACSDEBUG)"; then\ + echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p"; fi;;\ + *) echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p";;\ + esac;\ + fi;\ done;\ for p in *.elc; do\ if test -f "$$p"; then\ - echo " $(INSTALL_DATA) $$p $(lispdir)/$$p";\ - $(INSTALL_DATA) $$p $(lispdir)/$$p;\ + echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p";\ fi;\ done;\ if test -f shimbun/shimbun.elc; then\ + for p in `cd shimbun && echo ChangeLog ChangeLog.[1-9] ChangeLog.[1-9][0-9]`; do\ + if test -f "shimbun/$$p"; then\ + echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/s$$p\"";\ + $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/s$$p";\ + fi;\ + done;\ for p in `cd shimbun && echo *.el`; do\ - echo " $(INSTALL_DATA) shimbun/$$p $(lispdir)/$$p";\ - $(INSTALL_DATA) shimbun/$$p $(lispdir)/$$p;\ + echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/$$p";\ done;\ for p in `cd shimbun && echo *.elc`; do\ - echo " $(INSTALL_DATA) shimbun/$$p $(lispdir)/$$p";\ - $(INSTALL_DATA) shimbun/$$p $(lispdir)/$$p;\ + echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/$$p\"";\ + $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/$$p";\ done;\ fi install-icons: - @if test $(ICONDIR) = NONE; then\ + @if test "$(ICONDIR)" = NONE; then\ echo "You don't have to install icon files for \"$(EMACS)\".";\ else\ - $(SHELL) $(srcdir)/mkinstalldirs $(ICONDIR);\ - for i in `cd icons && echo *.gif *.xpm`; do\ - echo " $(INSTALL_DATA) icons/$$i $(ICONDIR)/$$i";\ - $(INSTALL_DATA) icons/$$i $(ICONDIR)/$$i;\ + $(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(ICONDIR)";\ + for i in `cd icons && echo *.gif *.png *.xpm`; do\ + echo "$(INSTALL_DATA) icons/$$i \"$(DESTDIR)$(ICONDIR)/$$i\"";\ + $(INSTALL_DATA) icons/$$i "$(DESTDIR)$(ICONDIR)/$$i";\ done;\ fi install-icons30: - @if test $(ICONDIR) = NONE; then\ + @if test "$(ICONDIR)" = NONE; then\ echo "You don't have to install icon files for \"$(EMACS)\".";\ else\ - $(SHELL) $(srcdir)/mkinstalldirs $(ICONDIR);\ - for i in `cd icons30 && echo *.gif *.xpm`; do\ - echo " $(INSTALL_DATA) icons30/$$i $(ICONDIR)/$$i";\ - $(INSTALL_DATA) icons30/$$i $(ICONDIR)/$$i;\ + $(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(ICONDIR)";\ + for i in `cd icons30 && echo *.gif *.png *.xpm`; do\ + echo "$(INSTALL_DATA) icons30/$$i \"$(DESTDIR)$(ICONDIR)/$$i\"";\ + $(INSTALL_DATA) icons30/$$i "$(DESTDIR)$(ICONDIR)/$$i";\ done;\ fi install-info: info + @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install";\ cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install install-info-en: info-en + @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install-en";\ cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install-en install-info-ja: info-ja + @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install-ja";\ cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install-ja install-package: @if test $(PACKAGEDIR) = NONE; then\ echo "What a pity! Your \"$(EMACS)\" does not support"\ - "a package system.";\ + "the package system.";\ else\ $(MAKE) lispdir="$(PACKAGEDIR)/lisp/w3m" install-lisp;\ - $(MAKE) ICONDIR="$(PACKAGEDIR)/etc/w3m" install-icons30;\ + $(MAKE) ICONDIR="$(PACKAGEDIR)/etc/images/w3m" install-icons30;\ $(MAKE) infodir="$(PACKAGEDIR)/info" install-info;\ - echo "$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR)";\ - $(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR);\ + echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR)";\ + $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR);\ fi install-package-ja: @if test $(PACKAGEDIR) = NONE; then\ echo "What a pity! Your \"$(EMACS)\" does not support"\ - "a package system.";\ + "the package system.";\ else\ $(MAKE) lispdir="$(PACKAGEDIR)/lisp/w3m" install-lisp;\ - $(MAKE) ICONDIR="$(PACKAGEDIR)/etc/w3m" install-icons30;\ + $(MAKE) ICONDIR="$(PACKAGEDIR)/etc/images/w3m" install-icons30;\ $(MAKE) infodir="$(PACKAGEDIR)/info" install-info-ja;\ - echo "$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR)";\ - $(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR);\ + echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR)";\ + $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR);\ fi Makefile: Makefile.in config.status @@ -146,14 +171,14 @@ dist: Makefile w3m.elc $(MAKE) tarball \ - VERSION=`$(EMACS) $(FLAGS) -f w3mhack-version 2>/dev/null` \ + VERSION=`$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-version 2>/dev/null` \ BRANCH=`cvs status Makefile.in|grep "Sticky Tag:"|awk '{print $$3}'|sed 's,(none),HEAD,'` tarball: CVS/Root CVS/Repository -rm -rf $(DISTDIR) $(TARBALL) `basename $(TARBALL) .gz` cvs -d `cat CVS/Root` -w export -d $(DISTDIR) -r $(BRANCH) `cat CVS/Repository` -cvs diff |( cd $(DISTDIR) && patch -p0 ) - for f in BUGS.ja w3m-e23.el; do\ + for f in BUGS.ja; do\ if [ -f $(DISTDIR)/$${f} ]; then\ rm -f $(DISTDIR)/$${f} || exit 1;\ fi;\ @@ -169,56 +194,48 @@ clean: -rm -rf $(PACKAGE)* ;\ - rm -f *~ *.elc shimbun/*.elc w3m-load.el w3m-kwds.el ;\ - rm -f doc/*~ doc/*.info doc/*.info-[0-9] doc/*.info-[0-9][0-9] + rm -f *~ *.elc shimbun/*.elc w3m-load.el ;\ + rm -f doc/*~ doc/*.info doc/*.info-[0-9] doc/*.info-[0-9][0-9]\ + doc/version.texi distclean: clean -rm -f config.log config.status config.cache Makefile doc/Makefile;\ rm -fr autom4te*.cache -## Rules for the developers to check a portability for each module. +## Rules for the developers to check the portability for each module. .SUFFIXES: .elc .el .el.elc: - echo "$(EMACS) $(FLAGS) -f w3mhack-batch-compile $*.el";\ - $(EMACS) $(FLAGS) -f w3mhack-batch-compile $*.el + @echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f batch-byte-compile $*.el";\ + $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f batch-byte-compile $*.el slow: Makefile - @for i in `$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ + @for i in `$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ do $(MAKE) -s $$i; done -very-slow: clean keywords Makefile +very-slow: clean Makefile @args="$(VANILLA_FLAG) -batch";\ args="$$args -l $(srcdir)/attic/addpath.el $(ADDITIONAL_LOAD_PATH)";\ echo "=============================================";\ echo "Compiling the 1st stage-----without elc files";\ echo "=============================================";\ - for i in `$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ + for i in `$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ do\ j=`echo $$i| sed 's/elc$$/el/g'`;\ - echo "$(EMACS) ARGS -f batch-byte-compile $$j";\ - $(EMACS) $$args -f batch-byte-compile $$j;\ + echo "$(XEMACSDEBUG)$(EMACS) ARGS -f batch-byte-compile $$j";\ + $(XEMACSDEBUG)$(EMACS) $$args -f batch-byte-compile $$j;\ mv $$i $$j"x";\ done;\ for i in `echo *.elx shimbun/*.elx`; do\ j=`echo $$i| sed 's/elx$$/elc/g'`;\ - if test -f $$i; then mv $$i $$j; fi\ + if test -f $$i; then mv $$i $$j; fi;\ done;\ echo "==============================================";\ echo "Compiling the 2nd stage-----with all elc files";\ echo "==============================================";\ - for i in `$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ + for i in `$(XEMACSDEBUG)$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-examine-modules 2>/dev/null`;\ do\ j=`echo $$i| sed 's/elc$$/el/g'`;\ - echo "$(EMACS) ARGS -f batch-byte-compile $$j";\ - $(EMACS) $$args -f batch-byte-compile $$j;\ + echo "$(XEMACSDEBUG)$(EMACS) ARGS -f batch-byte-compile $$j";\ + $(XEMACSDEBUG)$(EMACS) $$args -f batch-byte-compile $$j;\ done - -## Create the file w3m-kwds.el if it is needed for $(EMACS). -keywords: - @ echo "$(EMACS) $(FLAGS)";\ - $(EMACS) $(FLAGS) -f w3mhack-check-colon-keywords-file ;\ - if test ! -f w3m-kwds.el; then\ - echo "There is no need to bind colon keywords for \"$(EMACS)\".";\ - echo "The file w3m-kwds.el is not created.";\ - fi Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/: NEWS Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/: NEWS.ja diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/aclocal.m4 /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/aclocal.m4 --- work/emacs-w3m-1.4.4/aclocal.m4 2005-02-21 21:31:13.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/aclocal.m4 2012-01-06 11:02:58.000000000 +0900 @@ -8,6 +8,17 @@ fi AC_SUBST(VANILLA_FLAG)]) +AC_DEFUN(AC_SET_XEMACSDEBUG, + [dnl Set the XEMACSDEBUG environment variable, which is eval'd when + dnl XEmacs 21.5 starts, in order to suppress warnings for Lisp shadows + dnl when XEmacs 21.5 starts. + if test "${VANILLA_FLAG}" = "-vanilla"; then + XEMACSDEBUG='XEMACSDEBUG='\''(setq log-warning-minimum-level (quote error))'\'' ' + else + XEMACSDEBUG= + fi + AC_SUBST(XEMACSDEBUG)]) + AC_DEFUN(AC_EMACS_LISP, [ elisp="$2" if test -z "$3"; then @@ -15,8 +26,8 @@ fi AC_CACHE_VAL(EMACS_cv_SYS_$1,[ OUTPUT=./conftest-$$ - echo ${EMACS}' '${VANILLA_FLAG}' -batch -eval '\''(let ((x '"${elisp}"')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1 - eval ${EMACS}' '${VANILLA_FLAG}' -batch -eval '\''(let ((x '"${elisp}"')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1 + echo ${XEMACSDEBUG}${EMACS}' '${VANILLA_FLAG}' -batch -eval '\''(let ((x '"${elisp}"')) (write-region (format "%s" x) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1 + eval ${XEMACSDEBUG}${EMACS}' '${VANILLA_FLAG}' -batch -eval '\''(let ((x '"${elisp}"')) (write-region (format "%s" x) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1 retval="`cat ${OUTPUT}`" echo "=> ${retval}" >& AC_FD_CC 2>&1 rm -f ${OUTPUT} @@ -39,9 +50,9 @@ unset ac_cv_prog_EMACS; unset EMACS_cv_SYS_flavor; AC_ARG_WITH(emacs, - [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs, mule...]], + [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...]], [if test "${withval}" = yes -o -z "${withval}"; then - AC_PATH_PROGS(EMACS, emacs xemacs mule, emacs) + AC_PATH_PROGS(EMACS, emacs xemacs, emacs) else AC_PATH_PROG(EMACS, ${withval}, ${withval}, emacs) fi]) @@ -52,43 +63,59 @@ else AC_PATH_PROG(EMACS, $withval, $withval, xemacs) fi]) - test -z "${EMACS}" && AC_PATH_PROGS(EMACS, emacs xemacs mule, emacs) + test -z "${EMACS}" && AC_PATH_PROGS(EMACS, emacs xemacs, emacs) AC_SUBST(EMACS) AC_SET_VANILLA_FLAG + AC_SET_XEMACSDEBUG AC_MSG_CHECKING([what a flavor does ${EMACS} have]) AC_EMACS_LISP(flavor, - (cond ((featurep (quote xemacs)) \"XEmacs\")\ - ((and (boundp (quote emacs-major-version))\ - (>= emacs-major-version 21))\ - (format \"Emacs %d\" emacs-major-version))\ - ((boundp (quote MULE)) \"MULE\")\ - (t \"Emacs\")), + (if (featurep (quote xemacs)) + \"XEmacs\" + (concat \"Emacs \" + (mapconcat (function identity) + (nreverse + (cdr (nreverse + (split-string emacs-version + (concat (vector 92 46)))))) + \".\"))), noecho) case "${flavor}" in XEmacs) EMACS_FLAVOR=xemacs;; - MULE) - EMACS_FLAVOR=mule;; - Emacs\ 2[[123]]) - EMACS_FLAVOR=emacs21;; - *) + Emacs\ 2[[1234]]\.*) EMACS_FLAVOR=emacs;; + *) + EMACS_FLAVOR=unsupported;; esac - AC_MSG_RESULT(${flavor})]) + AC_MSG_RESULT(${flavor}) + if test ${EMACS_FLAVOR} = unsupported; then + AC_MSG_ERROR(${flavor} is not supported.) + exit 1 + fi]) AC_DEFUN(AC_EXAMINE_PACKAGEDIR, [dnl Examine PACKAGEDIR. AC_EMACS_LISP(PACKAGEDIR, (let ((prefix \"${prefix}\")\ (dirs (append\ + (cond ((boundp (quote early-package-hierarchies))\ + (append (if early-package-load-path\ + early-package-hierarchies)\ + (if late-package-load-path\ + late-package-hierarchies)\ + (if last-package-load-path\ + last-package-hierarchies)))\ + ((boundp (quote early-packages))\ + (append (if early-package-load-path\ + early-packages)\ + (if late-package-load-path\ + late-packages)\ + (if last-package-load-path\ + last-packages))))\ (if (and (boundp (quote configure-package-path))\ (listp configure-package-path))\ - (delete \"\" configure-package-path))\ - (if (boundp (quote early-packages))\ - (append (if early-package-load-path early-packages)\ - (if late-package-load-path late-packages)\ - (if last-package-load-path last-packages)))))\ + (delete \"\" configure-package-path))))\ package-dir)\ (while (and dirs (not package-dir))\ (if (file-directory-p (car dirs))\ @@ -132,17 +159,17 @@ AC_SUBST(PACKAGEDIR)]) AC_DEFUN(AC_PATH_LISPDIR, [ - if test ${EMACS_FLAVOR} = emacs21; then + if test ${EMACS_FLAVOR} = emacs; then tribe=emacs else tribe=${EMACS_FLAVOR} fi - if test ${prefix} = NONE; then - AC_MSG_CHECKING([prefix for ${EMACS}]) + AC_MSG_CHECKING([prefix for ${EMACS}]) + if test "${prefix}" = NONE; then AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),noecho) prefix=${EMACS_cv_SYS_prefix} - AC_MSG_RESULT(${prefix}) fi + AC_MSG_RESULT(${prefix}) AC_ARG_WITH(lispdir, [ --with-lispdir=DIR where lisp files should go (use --with-packagedir for XEmacs package)], @@ -150,14 +177,15 @@ AC_MSG_CHECKING([where lisp files should go]) if test -z "${lispdir}"; then dnl Set the default value. - theprefix=${prefix} - if test x${theprefix} = xNONE; then + theprefix="${prefix}" + if test "${theprefix}" = NONE; then theprefix=${ac_default_prefix} fi lispdir="\$(datadir)/${tribe}/site-lisp/w3m" for thedir in share lib; do potential= - if test -d ${theprefix}/${thedir}/${tribe}/site-lisp; then + dnl The directory name should be quoted because it might contain spaces. + if test -d "${theprefix}/${thedir}/${tribe}/site-lisp"; then lispdir="\$(prefix)/${thedir}/${tribe}/site-lisp/w3m" break fi @@ -177,7 +205,7 @@ dnl Ignore cache. unset EMACS_cv_SYS_icondir; - if test ${EMACS_FLAVOR} = xemacs -o ${EMACS_FLAVOR} = emacs21; then + if test ${EMACS_FLAVOR} = xemacs -o ${EMACS_FLAVOR} = emacs; then AC_ARG_WITH(icondir, [ --with-icondir=ICONDIR directory for icons [\$(data-directory)/images/w3m]], ICONDIR="${withval}") @@ -217,9 +245,9 @@ ADDITIONAL_LOAD_PATH="${withval}" else if test x"$USER" != xroot -a x"$HOME" != x -a -f "$HOME"/.emacs; then - ADDITIONAL_LOAD_PATH=`"$EMACS" -batch -l "$HOME"/.emacs -l w3mhack.el NONE -f w3mhack-load-path 2>/dev/null | $EGREP -v '^$'` + ADDITIONAL_LOAD_PATH=`${XEMACSDEBUG}${EMACS} -batch -l "$HOME"/.emacs -l w3mhack.el NONE -f w3mhack-load-path 2>/dev/null | $EGREP -v '^$'` else - ADDITIONAL_LOAD_PATH=`"$EMACS" -batch -l w3mhack.el NONE -f w3mhack-load-path 2>/dev/null | $EGREP -v '^$'` + ADDITIONAL_LOAD_PATH=`${XEMACSDEBUG}${EMACS} -batch -l w3mhack.el NONE -f w3mhack-load-path 2>/dev/null | $EGREP -v '^$'` fi fi AC_MSG_RESULT(${ADDITIONAL_LOAD_PATH})], @@ -234,32 +262,8 @@ ADDITIONAL_LOAD_PATH=${ADDITIONAL_LOAD_PATH}:`pwd`/attic fi fi]) - retval=`eval $EMACS' '${VANILLA_FLAG}' -batch -l w3mhack.el '${ADDITIONAL_LOAD_PATH}' -f w3mhack-print-status'` + retval=`eval ${XEMACSDEBUG}${EMACS}' '${VANILLA_FLAG}' -batch -l w3mhack.el '${ADDITIONAL_LOAD_PATH}' -f w3mhack-print-status 2>/dev/null | $EGREP -v '\''^$'\'` if test x"$retval" != xOK; then AC_MSG_ERROR([Process couldn't proceed. See the above messages.]) fi AC_SUBST(ADDITIONAL_LOAD_PATH)]) - -AC_DEFUN(AC_CHECK_ELISP, - [dnl Check for requried elisp library. - AC_MSG_CHECKING(for $1) - retval=`eval $EMACS' '${VANILLA_FLAG}' -batch -l w3mhack.el '${ADDITIONAL_LOAD_PATH}' -f w3mhack-locate-library '$1' 2>/dev/null | $EGREP -v '\''^$'\'` - if test x"$retval" != x; then - AC_MSG_RESULT(${retval}) - else - AC_MSG_ERROR($1.el is missing) - fi]) - -AC_DEFUN(AC_CHECK_XML, - [RSS=no - AC_ARG_WITH(xml, - [ --with-xml compile shimbun modules using xml.el [default: no]], - [if test "x${withval}" = xyes; then - RSS=yes - else - RSS=no - fi] - []) - if test "x${RSS}" = xyes; then - AC_CHECK_ELISP(xml) - fi]) Only in work/emacs-w3m-1.4.4/attic: regexp-opt.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/attic: rfc2368.el Only in work/emacs-w3m-1.4.4/attic: vm-w3m.el Only in work/emacs-w3m-1.4.4/attic: xml.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/: bookmark-w3m.el Only in work/emacs-w3m-1.4.4/: config.log Only in work/emacs-w3m-1.4.4/: config.status Only in work/emacs-w3m-1.4.4/: configure diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/configure.in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/configure.in --- work/emacs-w3m-1.4.4/configure.in 2004-04-28 13:09:30.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/configure.in 2006-01-16 20:49:49.000000000 +0900 @@ -5,12 +5,12 @@ AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, false) AC_CHECK_PROG(PTEX, ptex, ptex, false) AC_CHECK_PROG(JBIBTEX, jbibtex, jbibtex, false) +AC_CHECK_PROG(DVIPDFMX, dvipdfmx, dvipdfmx, false) +AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, false) AC_CHECK_PROGS(EGREP, egrep grep, ) AC_PATH_EMACS AC_PATH_LISPDIR AC_PATH_PACKAGEDIR AC_PATH_ICONDIR AC_ADD_LOAD_PATH -AC_CHECK_ELISP(regexp-opt) -AC_CHECK_XML AC_OUTPUT(Makefile doc/Makefile) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc: .cvsignore Only in work/emacs-w3m-1.4.4/doc: Makefile diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/doc/Makefile.in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/Makefile.in --- work/emacs-w3m-1.4.4/doc/Makefile.in 2005-01-05 16:52:22.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/Makefile.in 2012-01-06 11:03:00.000000000 +0900 @@ -1,9 +1,10 @@ -.SUFFIXES: .texi .info +.SUFFIXES: .texi .info .pdf INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_INFO = install-info prefix = @prefix@ +datarootdir = @datarootdir@ infodir = @infodir@ srcdir = @srcdir@ subdir = doc @@ -17,10 +18,18 @@ TEXI2DVI = @TEXI2DVI@ PTEX = @PTEX@ JBIBTEX = @JBIBTEX@ +DVIPDFMX = @DVIPDFMX@ +TEXI2PDF = @TEXI2PDF@ EMACS = @EMACS@ VANILLA_FLAG = @VANILLA_FLAG@ FLAGS = $(VANILLA_FLAG) -batch -l ./w3mhack.el $(ADDITIONAL_LOAD_PATH) -EMACSINFO = cd $(top_srcdir) && $(EMACS) $(FLAGS) -f w3mhack-makeinfo + +## This is used to set the environment variable XEMACSDEBUG for +## XEmacs 21.5 in order to suppress warnings for Lisp shadows +## when XEmacs 21.5 starts. +XEMACSDEBUG = @XEMACSDEBUG@ + +EMACSINFO = cd $(top_srcdir) && $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-makeinfo INFO_DEPS_EN = emacs-w3m.info INFO_DEPS_JA = emacs-w3m-ja.info @@ -34,7 +43,7 @@ version.texi: $(top_srcdir)/w3m.el @version=`cd $(top_srcdir)\ - && $(EMACS) $(FLAGS) -f w3mhack-version 2>/dev/null`;\ + && $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-version 2>/dev/null`;\ echo "@set VERSION $$version"> version.texi emacs-w3m.info: version.texi emacs-w3m.texi @@ -53,39 +62,41 @@ $(EMACSINFO) $$texi ;\ else \ echo "Formatting $$texi using $(MAKEINFO)..." ;\ - LC_ALL=C $(MAKEINFO) -o $@ $$texi ;\ + LC_ALL=C $(MAKEINFO) --no-split -o $@ $$texi ;\ echo "Formatting $$texi using $(MAKEINFO)...done" ;\ fi ;;\ esac install: $(INFO_DEPS) - $(SHELL) $(top_srcdir)/mkinstalldirs $(infodir) - @list='$(INFO_DEPS)';\ - for file in $$list; do\ - for ifile in `echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do\ - if test -f $$ifile; then\ - echo " $(INSTALL_DATA) $$ifile $(infodir)/$$ifile";\ - $(INSTALL_DATA) $$ifile $(infodir)/$$ifile;\ - else : ; fi;\ - done;\ + $(SHELL) $(top_srcdir)/mkinstalldirs "$(DESTDIR)$(infodir)" + @for file in $(INFO_DEPS); do\ + if test -f $$file; then\ + for old in `cd "$(DESTDIR)$(infodir)" && echo $$file-[0-9]`; do\ + if test -f "$(DESTDIR)$(infodir)/$$old"; then\ + echo "rm -f \"$(DESTDIR)$(infodir)/$$old\"";\ + rm -f "$(DESTDIR)$(infodir)/$$old";\ + fi;\ + done;\ + echo "$(INSTALL_DATA) $$file \"$(DESTDIR)$(infodir)/$$file\"";\ + $(INSTALL_DATA) $$file "$(DESTDIR)$(infodir)/$$file";\ + else : ; fi;\ done @if $(SHELL) -c $(INSTALL_INFO)' --version| sed 1q\ | fgrep -s -v -i debian'>/dev/null 2>&1; then\ - list='$(INFO_DEPS)';\ - for file in $$list; do\ - if test -f $(infodir)/$$file; then\ - echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\ - $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\ + for file in $(INFO_DEPS); do\ + if test -f "$(DESTDIR)$(infodir)/$$file"; then\ + echo "$(INSTALL_INFO) --info-dir=\"$(DESTDIR)$(infodir)\" \"$(DESTDIR)$(infodir)/$$file\"";\ + $(INSTALL_INFO) --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$file" || :;\ else : ; fi\ done;\ else : ; fi install-en: $(INFO_DEPS_EN) - $(MAKE) INFO_DEPS='$(INFO_DEPS_EN)' EMACS="$(EMACS)"\ + $(MAKE) INFO_DEPS='$(INFO_DEPS_EN)' $(XEMACSDEBUG)EMACS="$(EMACS)"\ infodir="$(infodir)" install install-ja: $(INFO_DEPS_JA) - $(MAKE) INFO_DEPS='$(INFO_DEPS_JA)' EMACS="$(EMACS)"\ + $(MAKE) INFO_DEPS='$(INFO_DEPS_JA)' $(XEMACSDEBUG)EMACS="$(EMACS)"\ infodir="$(infodir)" install dvi: dvi-en dvi-ja @@ -102,13 +113,34 @@ @texi=$<;\ case "$$texi" in \ *-ja.texi) \ - env TEX=$(PTEX) BIBTEX=$(JBIBTEX) $(TEXI2DVI) -l ja -o $@ $$texi ;;\ + env TEX=$(PTEX) BIBTEX=$(JBIBTEX) $(TEXI2DVI) -o $@ $$texi ;;\ *) \ $(TEXI2DVI) -o $@ $$texi ;;\ esac +pdf: pdf-en pdf-ja + +pdf-en: emacs-w3m.pdf + +pdf-ja: emacs-w3m-ja.pdf + +emacs-w3m.pdf: version.texi emacs-w3m.texi + +emacs-w3m-ja.pdf: version.texi emacs-w3m-ja.texi + +.texi.pdf: + @texi=$<;\ + case "$$texi" in\ + *-ja.texi)\ + i=`basename $@ .pdf`;\ + $(MAKE) $$i.dvi; $(DVIPDFMX) $$i;;\ + *) \ + $(TEXI2PDF) $$texi;;\ + esac + clean: - -rm -rf *~ *.info *.info-[0-9] *.info-[0-9][0-9] *.dvi *.ps missfont.log + -rm -rf *~ *.info version.texi *.dvi missfont.log *.pdf *.aux *.cp\ + *.cps *.fn *.fns *.ky *.kys *.log *.pg *.toc *.tp *.vr *.vrs distclean: clean -rm -f Makefile Only in work/emacs-w3m-1.4.4/doc: emacs-w3m.info diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/doc/ptexinfmt.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/ptexinfmt.el --- work/emacs-w3m-1.4.4/doc/ptexinfmt.el 2005-02-24 17:10:15.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/ptexinfmt.el 2012-04-12 12:08:08.000000000 +0900 @@ -1,4 +1,4 @@ -;;; ptexinfmt.el -- portable Texinfo formatter. +;;; ptexinfmt.el --- portable Texinfo formatter -*- lexical-binding: t -*- ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, ;; 1994, 1995, 1996, 1997 Free Software Foundation, Inc. @@ -24,8 +24,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -37,26 +37,35 @@ ;; Modified by Yamaoka not to use APEL functions. ;; Unimplemented command: -;; @abbr -;; @float, @caption, @shortcaption, @listoffloats +;; @abbr{ABBREVIATION} +;; @float ... @end float, @caption{TEXT}, @shortcaption{TEXT}, @listoffloats ;; @deftypecv[x] ;; @headitem -;; @comma{} ;; @quotation (optional arguments) -;; @acronym (optional argument) +;; @acronym{ACRONYM[, MEANING]} (optional argument) ;; @dofirstparagraphindent ;; @indent -;; @verbatiminclude +;; @verbatiminclude FILENAME ;; @\ -;; @definfoenclose -;; @deftypeivar -;; @deftypeop +;; @definfoenclose phoo,//,\\ +;; @deftypeivar CLASS DATA-TYPE VARIABLE-NAME +;; @deftypeop CATEGORY CLASS DATA-TYPE NAME ARGUMENTS... +;; @allowcodebreaks false +;; @thischapternum +;; @quotedblleft @quotedblright +;; @quoteleft @quoteright @quotedblbase @quotesinglbase +;; @guillemetleft @guillemetright @guilsinglleft @guilsinglright. +;; @clicksequence, @click, @clickstyle, @arrow ;;; Code: -(require 'backquote) (require 'texinfmt) +;; Work around a problem that double-quotes at bol disappear: +;; @dfn{FOO} => FOO", ``BAR'' => BAR", \BAZ/ => BAZ/ +(modify-syntax-entry ?\" "w" texinfo-format-syntax-table) +(modify-syntax-entry ?\\ "w" texinfo-format-syntax-table) + ;;; Broken (defvar ptexinfmt-disable-broken-notice-flag t "If non-nil disable notice, when call `ptexinfmt-broken-facility'. @@ -64,54 +73,54 @@ (put 'ptexinfmt-broken-facility 'lisp-indent-function 'defun) (defmacro ptexinfmt-broken-facility (facility docstring assertion - &optional dummy) + &optional _dummy) "Declare a symbol FACILITY is broken if ASSERTION is nil. DOCSTRING will be printed if ASSERTION is nil and `ptexinfmt-disable-broken-notice-flag' is nil." - (` (let ((facility '(, facility)) - (docstring (, docstring)) - (assertion (eval '(, assertion)))) - (put facility 'broken (not assertion)) - (if assertion + `(let ((facility ',facility) + (docstring ,docstring) + (assertion (eval ',assertion))) + (put facility 'broken (not assertion)) + (if assertion + nil + (put facility 'broken-docstring docstring) + (if ptexinfmt-disable-broken-notice-flag nil - (put facility 'broken-docstring docstring) - (if ptexinfmt-disable-broken-notice-flag - nil - (message "BROKEN FACILITY DETECTED: %s" docstring)))))) + (message "BROKEN FACILITY DETECTED: %s" docstring))))) (put 'ptexinfmt-defun-if-broken 'lisp-indent-function 'defun) (defmacro ptexinfmt-defun-if-broken (&rest args) "Redefine a function just like `defun' if it is considered broken." (let ((name (list 'quote (car args)))) (setq args (cdr args)) - (` (prog1 - (, name) - (if (get (, name) 'broken) - (defalias (, name) - (function (lambda (,@ args))))))))) + `(prog1 + ,name + (if (get ,name 'broken) + (defalias ,name + (function (lambda ,@args))))))) (put 'ptexinfmt-defun-if-void 'lisp-indent-function 'defun) (defmacro ptexinfmt-defun-if-void (&rest args) "Define a function just like `defun' unless it is already defined." (let ((name (list 'quote (car args)))) (setq args (cdr args)) - (` (prog1 - (, name) - (if (fboundp (, name)) - nil - (defalias (, name) - (function (lambda (,@ args))))))))) + `(prog1 + ,name + (if (fboundp ,name) + nil + (defalias ,name + (function (lambda ,@args))))))) (put 'ptexinfmt-defvar-if-void 'lisp-indent-function 'defun) (defmacro ptexinfmt-defvar-if-void (&rest args) "Define a variable just like `defvar' unless it is already defined." (let ((name (car args))) (setq args (cdr args)) - (` (prog1 - (defvar (, name)) - (if (boundp '(, name)) - nil - (defvar (, name) (,@ args))))))) + `(prog1 + (defvar ,name) + (if (boundp ',name) + nil + (defvar ,name ,@args))))) ;; sort -fd (ptexinfmt-broken-facility texinfo-format-printindex @@ -123,7 +132,9 @@ nil t)) -;; @var +;; @var{METASYNTACTIC-VARIABLE} +(defvar texinfo-enclosure-list) +(defvar texinfo-alias-list) (ptexinfmt-broken-facility texinfo-format-var "Don't perse @var argument." (condition-case nil @@ -135,7 +146,8 @@ t)) (error nil))) -;; @xref +;; @xref{NODE-NAME[, CROSS-REFERENCE-NAME, TITLE-OR-TOPIC, +;; INFO-FILE-NAME, PRINTED-MANUAL-TITLE]}. (ptexinfmt-broken-facility texinfo-format-xref "Can't format @xref, 1st argument is empty." (condition-case nil @@ -147,7 +159,7 @@ t)) (error nil))) -;; @uref +;; @uref{URL[, TEXT][, REPLACEMENT]} (ptexinfmt-broken-facility texinfo-format-uref "Parse twice @uref argument." (condition-case nil @@ -164,7 +176,10 @@ "`texinfo-multitable-widths' unsupport wide-char." (if (fboundp 'texinfo-multitable-widths) (with-temp-buffer - (let ((str "幅広文字")) + (let ((str (string (make-char 'japanese-jisx0208 73 125) + (make-char 'japanese-jisx0208 57 45) + (make-char 'japanese-jisx0208 74 56) + (make-char 'japanese-jisx0208 59 122)))) (texinfo-mode) (insert (format " {%s}\n" str)) (goto-char (point-min)) @@ -193,6 +208,7 @@ (put 'afourwide 'texinfo-format 'texinfo-discard-line) (put 'afivepaper 'texinfo-format 'texinfo-discard-line) (put 'pagesizes 'texinfo-format 'texinfo-discard-line-with-args) +(put 'fonttextsize 'texinfo-format 'texinfo-discard-line-with-args) ;; style (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args) @@ -202,6 +218,7 @@ (put 'setcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line) (put 'setshortcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line) (put 'novalidate 'texinfo-format 'texinfo-discard-line-with-args) +(put 'frenchspacing 'texinfo-format 'texinfo-discard-line-with-args) ;; head & foot (put 'headings 'texinfo-format 'texinfo-discard-line-with-args) @@ -216,9 +233,12 @@ (put 'page 'texinfo-format 'texinfo-discard-line) (put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg) -;; @slanted{} (makeinfo 4.8 or later) +;; @slanted{TEXT} (makeinfo 4.8 or later) (put 'slanted 'texinfo-format 'texinfo-format-noop) +;; @sansserif{TEXT} (makeinfo 4.8 or later) +(put 'sansserif 'texinfo-format 'texinfo-format-noop) + ;; @tie{} (makeinfo 4.3 or later) (put 'tie 'texinfo-format 'texinfo-format-tie) (ptexinfmt-defun-if-void texinfo-format-tie () @@ -227,7 +247,7 @@ ;;; Directory File -;; @direcategory +;; @direcategory DIRPART (put 'dircategory 'texinfo-format 'texinfo-format-dircategory) (ptexinfmt-defun-if-void texinfo-format-dircategory () (let ((str (texinfo-parse-arg-discard))) @@ -237,7 +257,7 @@ (point))) (insert "INFO-DIR-SECTION " str "\n"))) -;; @direntry +;; @direntry ... @end direntry (put 'direntry 'texinfo-format 'texinfo-format-direntry) (ptexinfmt-defun-if-void texinfo-format-direntry () (texinfo-push-stack 'direntry nil) @@ -330,22 +350,28 @@ ;;; Marking -;; @indicateurl, @url, @env, @command, +;; @env{ENVIRONMENT-VARIABLE} (put 'env 'texinfo-format 'texinfo-format-code) + +;; @command{COMMAND-NAME} (put 'command 'texinfo-format 'texinfo-format-code) +;; @indicateurl{INDICATEURL} (put 'indicateurl 'texinfo-format 'texinfo-format-code) + +;; @url{URL[, DISPLAYED-TEXT][, REPLACEMENT} (put 'url 'texinfo-format 'texinfo-format-uref) ; Texinfo 4.7 -;; @acronym +;; @acronym{ACRONYM} (put 'acronym 'texinfo-format 'texinfo-format-var) +;; @var{METASYNTACTIC-VARIABLE} (ptexinfmt-defun-if-broken texinfo-format-var () (let ((arg (texinfo-parse-expanded-arg))) (texinfo-discard-command) (insert (upcase arg)))) -;; @key +;; @key{KEY-NAME} (put 'key 'texinfo-format 'texinfo-format-key) (ptexinfmt-defun-if-void texinfo-format-key () (insert (texinfo-parse-arg-discard)) @@ -363,7 +389,7 @@ (insert (nth 1 args) " <" (nth 0 args) ">") (insert "<" (nth 0 args) ">")))) -;; @option +;; @option{OPTION-NAME} (put 'option 'texinfo-format 'texinfo-format-option) (ptexinfmt-defun-if-void texinfo-format-option () "Insert ` ... ' around arg unless inside a table; in that case, no quotes." @@ -392,24 +418,31 @@ (error "Not found: @verb start brace")) (delete-region texinfo-command-start (+ 2 texinfo-command-end)) (search-forward delimiter)) - (delete-backward-char 1) + (delete-char -1) (unless (looking-at "}") (error "Not found: @verb end brace")) (delete-char 1)) -;;; @LaTeX, @registeredsymbol{} +;; @LaTeX{} (put 'LaTeX 'texinfo-format 'texinfo-format-LaTeX) (ptexinfmt-defun-if-void texinfo-format-LaTeX () (texinfo-parse-arg-discard) (insert "LaTeX")) +;; @registeredsymbol{} (put 'registeredsymbol 'texinfo-format 'texinfo-format-registeredsymbol) (ptexinfmt-defun-if-void texinfo-format-registeredsymbol () (texinfo-parse-arg-discard) (insert "(R)")) ;;; Accents and Special characters +;; @euro{} ==> Euro +(put 'euro 'texinfo-format 'texinfo-format-euro) +(ptexinfmt-defun-if-void texinfo-format-euro () + (texinfo-parse-arg-discard) + (insert "Euro ")) + ;; @pounds{} ==> # Pounds Sterling (put 'pounds 'texinfo-format 'texinfo-format-pounds) (ptexinfmt-defun-if-void texinfo-format-pounds () @@ -420,7 +453,7 @@ (put 'ordf 'texinfo-format 'texinfo-format-ordf) (ptexinfmt-defun-if-void texinfo-format-ordf () (texinfo-parse-arg-discard) - (insert "o")) + (insert "a")) ;; @ordm{} ==> o Spanish masculine (put 'ordm 'texinfo-format 'texinfo-format-ordm) @@ -507,7 +540,7 @@ (goto-char texinfo-command-start)) ;; @,{c} ==> c, cedilla accent -(put ', 'texinfo-format 'texinfo-format-cedilla-accent) +(put '\, 'texinfo-format 'texinfo-format-cedilla-accent) (ptexinfmt-defun-if-void texinfo-format-cedilla-accent () (insert (texinfo-parse-arg-discard) ",") (goto-char texinfo-command-start)) @@ -588,9 +621,28 @@ (ptexinfmt-defun-if-void texinfo-format-\/ () (texinfo-discard-command)) +;; @textdegree{} +(put 'textdegree 'texinfo-format 'texinfo-format-textdegree) +(ptexinfmt-defun-if-void texinfo-format-textdegree () + (insert "o" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @geq{} +(put 'geq 'texinfo-format 'texinfo-format-geq) +(ptexinfmt-defun-if-void texinfo-format-geq () + (insert ">=" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + +;; @leq{} +(put 'leq 'texinfo-format 'texinfo-format-leq) +(ptexinfmt-defun-if-void texinfo-format-leq () + (insert "<=" (texinfo-parse-arg-discard)) + (goto-char texinfo-command-start)) + ;;; Cross References -;; @ref, @xref +;; @ref{NODE-NAME, ...} +;; @xref{NODE-NAME, ...} (put 'ref 'texinfo-format 'texinfo-format-xref) (ptexinfmt-defun-if-broken texinfo-format-xref () @@ -619,7 +671,7 @@ (insert (nth 1 args) " (" (nth 0 args) ")") (insert "`" (nth 0 args) "'")))) -;; @inforef +;; @inforef{NODE-NAME, CROSS-REFERENCE-NAME, INFO-FILE-NAME} (put 'inforef 'texinfo-format 'texinfo-format-inforef) (ptexinfmt-defun-if-void texinfo-format-inforef () (let ((args (texinfo-format-parse-args))) @@ -629,7 +681,7 @@ (insert "*Note " "(" (nth 2 args) ")" (car args) "::")))) -;; @anchor +;; @anchor{NAME} ;; don't emulation ;; If support @anchor for Mule 2.3, We must fix informat.el and info.el: ;; - Info-tagify suport @anthor-*-refill. @@ -947,6 +999,87 @@ (texinfo-sort-region opoint (point)) (shell-command-on-region opoint (point) "sort -fd" 1)))) + +;; @copying ... @end copying +;; that Emacs 21.4 and lesser and XEmacs don't support. +(if (fboundp 'texinfo-copying) + nil + (defvar texinfo-copying-text "" + "Text of the copyright notice and copying permissions.") + + (defun texinfo-copying () + "Copy the copyright notice and copying permissions from the Texinfo file, +as indicated by the @copying ... @end copying command; +insert the text with the @insertcopying command." + (let ((beg (progn (beginning-of-line) (point))) + (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) + (setq texinfo-copying-text + (buffer-substring-no-properties + (save-excursion (goto-char beg) (forward-line 1) (point)) + (save-excursion (goto-char end) (forward-line -1) (point)))) + (delete-region beg end))) + + (defun texinfo-insertcopying () + "Insert the copyright notice and copying permissions from the Texinfo file, +which are indicated by the @copying ... @end copying command." + (insert (concat "\n" texinfo-copying-text))) + + (defadvice texinfo-format-scan (before expand-@copying-section activate) + "Extract @copying and replace @insertcopying with it." + (goto-char (point-min)) + (when (search-forward "@copying" nil t) + (texinfo-copying)) + (while (search-forward "@insertcopying" nil t) + (delete-region (match-beginning 0) (match-end 0)) + (texinfo-insertcopying)))) + + +;; @comma +(if (fboundp 'texinfo-format-comma) + nil + (put 'comma 'texinfo-format 'texinfo-format-comma) + (defun texinfo-format-comma () + (texinfo-parse-arg-discard) + (insert ",") + (put-text-property (1- (point)) (point) 'ignore t)) + + ;; Redefine this function so as to work for @comma + (defun texinfo-format-parse-args () + (let ((start (1- (point))) + next beg end + args) + (search-forward "{") + (save-excursion + (texinfo-format-expand-region + (point) + (save-excursion (up-list 1) (1- (point))))) + ;; The following does not handle cross references of the form: + ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the + ;; re-search-forward finds the first right brace after the second + ;; comma. + (while (/= (preceding-char) ?\}) + (skip-chars-forward " \t\n") + (setq beg (point)) +;;; (re-search-forward "[},]") + ;; Ignore commas that are derived from @comma{}. + (while (and (re-search-forward "[},]" nil t) + (get-text-property (match-beginning 0) 'ignore))) +;;; + (setq next (point)) + (forward-char -1) + (skip-chars-backward " \t\n") + (setq end (point)) + (cond ((< beg end) + (goto-char beg) + (while (search-forward "\n" end t) + (replace-match " ")))) + (push (if (> end beg) (buffer-substring-no-properties beg end)) + args) + (goto-char next)) + ;;(if (eolp) (forward-char 1)) + (setq texinfo-command-end (point)) + (nreverse args)))) + (provide 'ptexinfmt) ;;; ptexinfmt.el ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/doc/txi-en.tex /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/txi-en.tex --- work/emacs-w3m-1.4.4/doc/txi-en.tex 2002-11-30 00:28:40.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/doc/txi-en.tex 2005-07-06 08:52:28.000000000 +0900 @@ -16,7 +16,8 @@ % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software -% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +% 02110-1301, USA. \gdef\putwordAppendix{Appendix} \gdef\putwordChapter{Chapter} Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: antenna-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: back-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: back-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: copy-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: db-history-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: forward-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: forward-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: history-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: home-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: image-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: open-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: parent-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: parent-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: reload-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: search-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: state-00.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: state-01.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: state-10.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: state-11.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons: weather-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: antenna-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: back-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: back-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: copy-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: db-history-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: forward-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: forward-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: history-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: home-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: image-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: open-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: parent-disabled.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: parent-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: reload-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: search-up.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: state-00.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: state-01.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: state-10.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: state-11.png Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/icons30: weather-up.png diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/mew-w3m.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mew-w3m.el --- work/emacs-w3m-1.4.4/mew-w3m.el 2005-03-24 17:01:11.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mew-w3m.el 2010-01-13 09:59:40.000000000 +0900 @@ -1,12 +1,12 @@ ;; mew-w3m.el --- View Text/Html content with w3m in Mew -;; Copyright (C) 2001, 2002, 2003, 2004 +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 ;; TSUCHIYA Masatoshi ;; Author: Shun-ichi GOTO , ;; Hideyuki SHIRAI ;; Created: Wed Feb 28 03:31:00 2001 -;; Version: $Revision: 1.53.2.2 $ +;; Version: $Revision: 1.69 $ ;; Keywords: Mew, mail, w3m, WWW, hypermedia ;; This file is a part of emacs-w3m. @@ -22,9 +22,9 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -107,6 +107,13 @@ :group 'mew-w3m :type 'hook) +(defcustom mew-w3m-region-cite-mark "> " + "*Method of converting `blockquote'." + :group 'mew-w3m + :type '(choice (const :tag "Use Indent" nil) + (const :tag "Use Cite Mark \"> \"" "> ") + (string :tag "Use Other Mark"))) + (defconst mew-w3m-safe-url-regexp "\\`cid:") ;; Avoid bytecompile error and warnings. @@ -119,6 +126,11 @@ (autoload 'mew-syntax-get-entry-by-cid "mew") (defun mew-cache-hit (&rest args) ()))) +(defmacro mew-w3m-add-text-properties (props) + `(add-text-properties (point-min) + (min (1+ (point-min)) (point-max)) + ,props)) + (defun mew-w3m-minor-mode-setter () "Check message buffer and activate w3m-minor-mode." (w3m-minor-mode (or (and (get-text-property (point-min) 'w3m) @@ -139,18 +151,67 @@ (mew-w3m-auto-insert-image t) (mew-w3m-use-safe-url-regexp nil)) (mew-summary-display 'force)) - (save-excursion - (set-buffer (mew-buffer-message)) + (with-current-buffer (mew-buffer-message) (let* ((image (get-text-property (point-min) 'w3m-images)) (w3m-display-inline-images image) (w3m-safe-url-regexp (when mew-w3m-use-safe-url-regexp mew-w3m-safe-url-regexp))) (w3m-toggle-inline-images) (mew-elet - (put-text-property (point-min) (1+ (point-min)) - 'w3m-images (not image)) + (mew-w3m-add-text-properties `(w3m-images ,(not image))) (set-buffer-modified-p nil))))))) +(defun mew-w3m-region (start end &optional url charset) + "w3m-region with inserting the cite mark." + (if (null mew-w3m-region-cite-mark) + (w3m-region start end url charset) + (save-restriction + (narrow-to-region start end) + (let ((case-fold-search t) + pos lines tagbeg0 tagend0 tagbeg1 tagend1) + (goto-char (point-min)) + (while (w3m-search-tag "blockquote") + (setq tagbeg0 (match-beginning 0)) + (setq tagend0 (match-end 0)) + (when (w3m-search-tag "/blockquote") + (setq tagbeg1 (match-beginning 0)) + (setq tagend1 (match-end 0)) + (setq lines (buffer-substring tagend0 tagbeg1)) + (delete-region tagbeg0 tagend1) + (insert (with-temp-buffer + (insert lines) + (goto-char (point-min)) + (if (and (w3m-search-tag "pre") + (setq tagbeg0 (match-beginning 0)) + (setq tagend0 (match-end 0)) + (w3m-search-tag "/pre") + (setq tagbeg1 (match-beginning 0)) + (setq tagend1 (match-end 0))) + (progn + (delete-region tagbeg1 tagend1) + (delete-region tagbeg0 tagend0)) + ;; delete
+ (goto-char (point-min)) + (while (w3m-search-tag "br") + (delete-region (match-beginning 0) (match-end 0)) + (unless (looking-at "[\n\r]") (insert "\n")))) + (goto-char (point-max)) + (skip-chars-backward " \t\n\f\r") + (delete-region (point) (point-max)) + (goto-char (point-min)) + (skip-chars-forward " \t\n\f\r") + (delete-region (point-min) (point)) + (goto-char (point-min)) + (while (not (eobp)) + (insert mew-w3m-region-cite-mark) + (forward-line 1)) + (goto-char (point-min)) + (insert "
\n")
+		      (goto-char (point-max))
+		      (insert "\n
\n") + (buffer-substring (point-min) (point-max))))))) + (w3m-region (point-min) (point-max) url charset)))) + ;; processing Text/Html contents with w3m. (defun mew-mime-text/html-w3m (&rest args) "View Text/Html contents with w3m rendering output." @@ -208,27 +269,23 @@ "-o" "ext_halfdump=1" "-o" "pre_conv=1" "-o" "strict_iso2022=0"))) - (w3m-region begin end xref))) + (mew-w3m-region begin end xref))) ((null cache) ;; Mew-2 + w3m, w3mmee - (w3m-region begin end xref (mew-charset-guess-region begin end))) + (mew-w3m-region begin end xref (mew-charset-guess-region begin end))) (t ;; Old Mew (setq charset (or (mew-syntax-get-param params "charset") - (save-excursion - (set-buffer cache) + (with-current-buffer cache (mew-charset-guess-region begin end)))) (if charset (setq wcs (mew-charset-to-cs charset)) (setq wcs mew-cs-text-for-write)) (mew-frwlet - mew-cs-dummy wcs - (w3m-region (point) - (progn (insert-buffer-substring cache begin end) - (point)) - xref)))) - (put-text-property (point-min) (1+ (point-min)) 'w3m t) - (put-text-property (point-min) (1+ (point-min)) - 'w3m-images mew-w3m-auto-insert-image))))) - + mew-cs-dummy wcs + (mew-w3m-region (point) + (progn (insert-buffer-substring cache begin end) + (point)) + xref)))) + (mew-w3m-add-text-properties `(w3m t w3m-images ,mew-w3m-auto-insert-image)))))) (defvar w3m-mew-support-cid (and (boundp 'mew-version-number) (fboundp 'mew-syntax-get-entry-by-cid))) @@ -239,25 +296,24 @@ (when (and w3m-mew-support-cid (string-match "^cid:\\(.+\\)" url)) (setq url (match-string 1 url)) - (let ((fld (mew-current-get-fld (mew-frame-id)))) - (set-buffer fld) - (let* ((msg (mew-current-get-msg (mew-frame-id))) - (cache (mew-cache-hit fld msg 'must-hit)) - (syntax (mew-cache-decode-syntax cache)) - cidstx beg end) - (if (string< "4.0.53" mew-version-number) - (setq cidstx (mew-syntax-get-entry-by-cid syntax (concat "<" url ">"))) - (setq cidstx (mew-syntax-get-entry-by-cid syntax url))) - (when cidstx - (setq beg (mew-syntax-get-begin cidstx)) - (setq end (mew-syntax-get-end cidstx)) - (prog1 - (with-current-buffer output-buffer - (set-buffer-multibyte t) - (insert-buffer-substring cache beg end) - (set-buffer-multibyte nil) - (downcase (car (mew-syntax-get-ct cidstx)))) - (run-hooks 'mew-w3m-cid-retrieve-hook))))))))) + (let* ((fld (mew-current-get-fld (mew-frame-id))) + (msg (mew-current-get-msg (mew-frame-id))) + (cache (mew-cache-hit fld msg 'must-hit)) + (syntax (mew-cache-decode-syntax cache)) + cidstx beg end) + (if (string< "4.0.53" mew-version-number) + (setq cidstx (mew-syntax-get-entry-by-cid syntax (concat "<" url ">"))) + (setq cidstx (mew-syntax-get-entry-by-cid syntax url))) + (when cidstx + (setq beg (mew-syntax-get-begin cidstx)) + (setq end (mew-syntax-get-end cidstx)) + (prog1 + (with-current-buffer output-buffer + (set-buffer-multibyte t) + (insert-buffer-substring cache beg end) + (set-buffer-multibyte nil) + (downcase (car (mew-syntax-get-ct cidstx)))) + (run-hooks 'mew-w3m-cid-retrieve-hook)))))))) (when w3m-mew-support-cid (push (cons 'mew-message-mode 'mew-w3m-cid-retrieve) @@ -280,6 +336,138 @@ (message "Download: %s...failed" name)) (sit-for 1)))) +(defun w3m-mail-compose-with-mew (source url charset content-type + to subject other-headers) + "Compose a mail using Mew." + (when (one-window-p) + (split-window)) + (select-window (next-window)) + (condition-case nil + (unless (and (boundp 'mew-init-p) mew-init-p + (progn + (mew-summary-jump-to-draft-buffer) + (and (eq major-mode 'mew-draft-mode) + (y-or-n-p "Attatch this draft? ")))) + (mew-user-agent-compose to subject other-headers)) + (quit + (if (y-or-n-p "Create new draft? ") + (mew-user-agent-compose to subject other-headers) + (delete-window) + (error "Abort mail composing")))) + (let* ((basename (file-name-nondirectory (w3m-url-strip-query url))) + (ct (downcase content-type)) + (mew-attach-move-next-after-copy nil) + (i 1) + (pos -1) + (csorig (mew-charset-to-cs (symbol-name charset))) + last filename cs) + (unless (mew-attach-p) + (mew-draft-prepare-attachments)) + ;; goto last attachment + (setq last (catch 'last + (while (not (= pos (point))) + (setq i (1+ i)) + (mew-attach-goto-number 'here `(,i)) + (when (mew-attach-line-lastp) + (throw 'last t))))) + (when (eq csorig mew-cs-unknown) + (setq csorig nil)) + (if (or (not last) (not (mew-attach-not-line012-1))) + (message "Can not attach from emacs-w3m here!") + ;; Application/.*xml is not inline view with Mew. + (cond + ((string= "application/xhtml+xml" ct) + (setq ct "text/html")) + ((string-match "^application/.*xml$" ct) + (setq ct "text/xml"))) + (setq filename (expand-file-name (cond + ((and (string-match "^[\t ]*$" basename) + (string= ct "text/html")) + "index.html") + ((and (string-match "^[\t ]*$" basename) + (string= ct "text/xml")) + "index.xml") + ((string-match "^[\t ]*$" basename) + "dummy") + (t + basename)) + mew-temp-dir)) + (with-temp-buffer + (cond + ((string= "text/html" ct) + (insert source) + (setq cs (w3m-static-if (fboundp 'mew-text/html-detect-cs) + (mew-text/html-detect-cs (point-min) (point-max)))) + (when (or (eq cs mew-cs-unknown) (not cs)) + (cond + (csorig + (setq cs csorig)) + (t + (setq cs mew-cs-autoconv))))) + ((string= "text/xml" ct) + (insert source) + (setq cs (w3m-static-if (fboundp 'mew-text/html-detect-cs) + (mew-text/html-detect-cs (point-min) (point-max)))) + (when (or (eq cs mew-cs-unknown) (not cs)) + (cond + (csorig + (setq cs csorig)) + ((mew-coding-system-p 'utf-8) + (setq cs 'utf-8)) + (t + (setq cs mew-cs-autoconv))))) + ((string-match "^text/" ct) + (insert source) + (setq cs mew-cs-autoconv)) + (t + (mew-set-buffer-multibyte nil) + (insert source) + (setq cs mew-cs-binary))) + (setq charset (cond + ((eq cs mew-cs-autoconv) + (mew-charset-guess-region (point-min) (point-max))) + ((eq cs mew-cs-binary) + nil) + (t + (mew-cs-to-charset cs)))) + (mew-frwlet + mew-cs-text-for-read cs + (write-region (point-min) (point-max) filename nil 'nomsg))) + (when ct + (setq ct (mew-capitalize ct))) + (mew-attach-copy filename (file-name-nondirectory filename)) + ;; content-type check & set + (let* ((nums (mew-syntax-nums)) + (syntax (mew-syntax-get-entry mew-encode-syntax nums)) + (file (mew-syntax-get-file syntax)) + (ctl (mew-syntax-get-ct syntax)) + (ct-orig (mew-syntax-get-value ctl 'cap)) + cte) + (unless (string= ct ct-orig) + (setq ctl (list ct)) + (mew-syntax-set-ct syntax ctl) + (setq cte (mew-ctdb-cte (mew-ctdb-by-ct ct))) + (mew-syntax-set-cte syntax cte) + (mew-syntax-set-cdp syntax (mew-syntax-cdp-format ct file)) + (mew-encode-syntax-print mew-encode-syntax))) + ;; charset set + (let* ((nums (mew-syntax-nums)) + (syntax (mew-syntax-get-entry mew-encode-syntax nums)) + (file (mew-syntax-get-file syntax)) + (ctl (mew-syntax-get-ct syntax)) + (ct (mew-syntax-get-value ctl 'cap)) + (params (mew-syntax-get-params ctl)) + (ocharset "charset")) + (when (and (string-match "^Text" ct) charset) + (setq params (mew-delete ocharset params)) + (setq ctl (cons ct (cons (list ocharset charset) params))) + (mew-syntax-set-ct syntax ctl)) + (mew-syntax-set-cd syntax url) + (mew-encode-syntax-print mew-encode-syntax)) + (message "Compose a mail using Mew with %s...done" url) + (when (and (file-exists-p filename) (file-writable-p filename)) + (delete-file filename))))) + ;;; (provide 'mew-w3m) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/mime-w3m.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mime-w3m.el --- work/emacs-w3m-1.4.4/mime-w3m.el 2005-02-16 17:21:02.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mime-w3m.el 2013-05-30 16:59:52.000000000 +0900 @@ -1,6 +1,6 @@ ;;; mime-w3m.el --- mime-view content filter for text -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 +;; Copyright (C) 2001-2005, 2009, 2010, 2012, 2013 ;; TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi , @@ -20,19 +20,16 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. +;;; Commentary: -;;; Install: - -;; (1) Install SEMI. -;; (2) Put this file to appropriate directory. -;; (3) Write these following code to your ~/.emacs or ~/.gnus. +;; To use this module along with a SEMI-based mail client (e.g. +;; Wanderlust), add this one to your ~/.emacs file or ~/.wl.el file: ;; -;; (require 'mime-w3m) - +;; (require 'mime-w3m) ;;; Code: @@ -104,16 +101,17 @@ (setq mime-setup-enable-inline-html nil) (let (flag) (when (boundp 'mime-preview-condition) - (labels ((overwrite (x) - (if (symbolp x) - (if (eq x 'mime-preview-text/html) - (setq flag 'mime-w3m-preview-text/html) - (when (eq x 'mime-w3m-preview-text/html) - (setq flag t)) - x) - (if (consp x) - (cons (overwrite (car x)) (overwrite (cdr x))) - x)))) + (w3m-labels + ((overwrite (x) + (if (symbolp x) + (if (eq x 'mime-preview-text/html) + (setq flag 'mime-w3m-preview-text/html) + (when (eq x 'mime-w3m-preview-text/html) + (setq flag t)) + x) + (if (consp x) + (cons (overwrite (car x)) (overwrite (cdr x))) + x)))) (setq mime-preview-condition (overwrite mime-preview-condition)))) (unless flag @@ -128,7 +126,7 @@ (set-alist 'mime-view-type-subtype-score-alist '(text . html) 3)))))) -(defsubst mime-w3m-setup () +(defun mime-w3m-setup () "Setup `mime-w3m' module." (require 'w3m) (when (eq mime-w3m-display-inline-images 'default) @@ -147,30 +145,6 @@ (font-set-face-background 'default color (current-buffer)))) (cons 'progn body))) -(unless (or (featurep 'xemacs) - (>= emacs-major-version 21)) - (defvar mime-w3m-mode-map nil - "Keymap for text/html part rendered by `mime-w3m-preview-text/html'. -This map is overwritten by `mime-w3m-local-map-property' based on the -value of `w3m-minor-mode-map'. Therefore, in order to add some -commands to this map, add them to `w3m-minor-mode-map' instead of this -map.")) - -(eval-when-compile - (defvar mime-w3m-mode-map)) - -(defsubst mime-w3m-local-map-property () - (if (or (featurep 'xemacs) - (>= emacs-major-version 21)) - (list 'keymap w3m-minor-mode-map) - (list 'local-map - (or mime-w3m-mode-map - (progn - (setq mime-w3m-mode-map (copy-keymap w3m-minor-mode-map)) - (set-keymap-parent mime-w3m-mode-map - mime-view-mode-default-map) - mime-w3m-mode-map))))) - ;;;###autoload (defun mime-w3m-preview-text/html (entity situation) (mime-w3m-setup) @@ -199,20 +173,20 @@ (mime-entity-content-type entity) "charset")) (add-text-properties p (point-max) - (nconc (mime-w3m-local-map-property) - '(text-rendered-by-mime-w3m t)))) + (list 'keymap w3m-minor-mode-map + 'text-rendered-by-mime-w3m t))) (error (message "%s" err))))))) (let (current-load-list) (defadvice mime-display-message - (after mime-w3m-add-local-hook activate compile) + (after add-emacs-w3m-functions-to-pre/post-command-hook activate compile) "Advised by emacs-w3m. -Set hooks run arround each command is executed." +Add some emacs-w3m utility functions to pre/post-command-hook." (when (featurep 'w3m) - (w3m-add-local-hook 'pre-command-hook - 'w3m-store-current-position) - (w3m-add-local-hook 'post-command-hook - 'mime-w3m-check-current-position)))) + (w3m-make-local-hook 'pre-command-hook) + (w3m-make-local-hook 'post-command-hook) + (add-hook 'pre-command-hook 'w3m-store-current-position nil t) + (add-hook 'post-command-hook 'mime-w3m-check-current-position nil t)))) (defun mime-w3m-check-current-position () "Run `mime-w3m-after-cursor-move-hook' if the cursor has been moved." @@ -234,7 +208,13 @@ (w3m-insert-string (mime-entity-content entity)) (mime-entity-type/subtype entity)))) -(let (current-load-list) +(eval + (quote + ;; Arglist varies according to Emacs version. + ;; Emacs 21.1~21.4, 23.3, 24, XEmacs, SXEmacs: + ;; (kill-new string &optional replace) + ;; Emacs 22.1~23.2: + ;; (kill-new string &optional replace yank-handler) (defadvice kill-new (before strip-keymap-properties-from-kill activate) "Advised by emacs-w3m. Strip `keymap' or `local-map' properties from a killed string." @@ -242,7 +222,7 @@ 'text-rendered-by-mime-w3m t (ad-get-arg 0)) (remove-text-properties 0 (length (ad-get-arg 0)) '(keymap nil local-map nil) - (ad-get-arg 0))))) + (ad-get-arg 0)))))) (mime-w3m-insinuate) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/mkinstalldirs /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mkinstalldirs --- work/emacs-w3m-1.4.4/mkinstalldirs 2002-11-15 14:10:43.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/mkinstalldirs 2008-02-06 11:24:18.000000000 +0900 @@ -1,38 +1,152 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi - pathcomp="$pathcomp/" - done + pathcomp=$pathcomp/ + done done exit $errstatus - -# mkinstalldirs ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/octet.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/octet.el --- work/emacs-w3m-1.4.4/octet.el 2005-02-15 20:04:44.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/octet.el 2010-08-18 14:23:21.000000000 +0900 @@ -1,6 +1,6 @@ ;;; octet.el --- An octet stream viewer. -;; Copyright (C) 2000, 2002, 2003, 2004, 2005 +;; Copyright (C) 2000, 2002, 2003, 2004, 2005, 2010 ;; Yuuichi Teranishi ;; Author: Yuuichi Teranishi @@ -19,8 +19,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; @@ -194,7 +194,8 @@ (funcall (symbol-function 'w3m-region) beg end (concat "about://octet-attachments/" (base64-encode-string - (buffer-name (current-buffer))) "/")) + (string-as-unibyte + (buffer-name (current-buffer))) "/"))) (setq octet-attachments nil)) 0) @@ -214,7 +215,7 @@ 0) 1)) 1)))) - ((>= emacs-major-version 21) + (t (defun octet-decode-image (ignore &rest args) (let (image) (if (image-type-available-p (car args)) @@ -224,9 +225,7 @@ (progn (erase-buffer) (insert-image image) 0) 1)) - 1)))) - (t - (defalias 'octet-decode-image 'ignore))) + 1))))) (defun octet-decode-u8-text (&rest args) (let ((string (buffer-string))) @@ -404,7 +403,7 @@ (with-current-buffer from (if (setq extent (extent-at (point-min) nil nil nil 'at)) (setq glyph (extent-end-glyph extent)))) - (insert-buffer from) + (insert-buffer-substring from) (if glyph (set-extent-end-glyph (make-extent (point) (point)) glyph)))) @@ -416,7 +415,7 @@ (interactive "fFilename: ") (as-binary-input-file (find-file file)) (unwind-protect - (let (buffer-read-only) + (let ((inhibit-read-only t)) (octet-buffer)) (goto-char (point-min)) (set-buffer-modified-p nil) Only in work/emacs-w3m-1.4.4/: octet.elc Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/patches: dot-domain.patch diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/patches/file-progress.patch /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/patches/file-progress.patch --- work/emacs-w3m-1.4.4/patches/file-progress.patch 2003-10-03 12:06:16.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/patches/file-progress.patch 2006-12-08 10:20:26.000000000 +0900 @@ -1,6 +1,6 @@ ---- file.c 26 Sep 2003 17:59:51 -0000 1.229 -+++ file.c 2 Oct 2003 01:09:08 -0000 -@@ -6582,6 +6582,8 @@ +--- w3m-0.5.1/file.c~ 2004-04-16 18:47:19 +0000 ++++ w3m-0.5.1/file.c 2006-12-08 01:04:52 +0000 +@@ -6602,6 +6602,8 @@ if (src) Strfputs(lineBuf2, src); linelen += lineBuf2->length; Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/patches: italic-text.patch Only in work/emacs-w3m-1.4.4/patches: mule-2.3@19.34.patch Only in work/emacs-w3m-1.4.4/patches: no-proxy.patch Only in work/emacs-w3m-1.4.4/patches: w3m-0.2.1-inu-1.5-solaris-xemacs.patch Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: .cvsignore diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/mew-shimbun.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/mew-shimbun.el --- work/emacs-w3m-1.4.4/shimbun/mew-shimbun.el 2005-03-16 06:49:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/mew-shimbun.el 2010-01-13 09:59:30.000000000 +0900 @@ -1,7 +1,7 @@ ;; -*- mode: emacs-lisp -*- ;; mew-shimbun.el --- View shimbun contents with Mew -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 ;; TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi @@ -21,9 +21,9 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; This package is `Shimbun' interface for Mew version 2.1 or later. @@ -296,6 +296,18 @@ (unless (mew-sinfo-get-summary-form) (mew-sinfo-set-summary-form (mew-get-summary-form fld))))) +(static-if (fboundp 'mew-expand-file) + ;; Mew 5 + (defalias 'mew-shimbun-folder-file 'mew-expand-file) + (defun mew-shimbun-folder-file (fld file) + (expand-file-name file (mew-expand-folder fld)))) + +(static-if (fboundp 'mew-expand-msg) + ;; Mew 5 + (defalias 'mew-shimbun-expand-msg 'mew-expand-msg) + (defun mew-shimbun-expand-msg (fld msg) + (expand-file-name msg (mew-expand-folder fld)))) + (if (featurep 'xemacs) nil (eval-and-compile @@ -356,7 +368,7 @@ (when (re-search-forward (or mew-shimbun-unseen-regex (mew-shimbun-unseen-regex)) nil t) (setq sbflds (cons fld sbflds)))) - (setq cfile (mew-expand-folder fld mew-summary-cache-file)) + (setq cfile (mew-shimbun-folder-file fld mew-summary-cache-file)) (when (file-readable-p cfile) (with-temp-buffer (mew-frwlet @@ -366,10 +378,10 @@ (when (re-search-forward (or mew-shimbun-unseen-regex (mew-shimbun-unseen-regex)) nil t) (setq sbflds (cons fld sbflds)))))))))))) - (mapcar (lambda (x) - (unless (member x removes) - (setq alst (cons (list x) alst)))) - sbflds) + (mapc (lambda (x) + (unless (member x removes) + (setq alst (cons (list x) alst)))) + sbflds) (let ((completion-ignore-case mew-complete-folder-ignore-case)) (setq fld (completing-read (if args @@ -390,7 +402,7 @@ (mew-summary-ls newfld newfld)))))) ;;;###autoload -(defun mew-shimbun-retrieve () +(defun mew-shimbun-retrieve (&optional newfld) "Retrieve articles via SHIMBUN on this folder." (interactive) (when (mew-summary-exclusive-p) @@ -414,7 +426,7 @@ (mew-shimbun-element-body sgr group server (setq count (+ (mew-shimbun-retrieve-article - mua server group range fld) + mua server group range fld newfld) count))))) (run-hooks 'mew-shimbun-retrieve-hook) (message "Getting %s %s in '%s' done" @@ -431,7 +443,7 @@ (mew-summary-only (let ((mua (luna-make-entity 'shimbun-mew-mua)) (cfld (mew-summary-folder-name 'ext)) - fld dir server group range) + fld dir server group range newfld) (run-hooks 'mew-shimbun-before-retrieve-hook) (mew-window-configure 'summary) (mew-current-set nil nil nil) @@ -442,17 +454,18 @@ (car fldgrp))) (setq dir (mew-expand-folder fld)) (unless (file-directory-p dir) - (mew-make-directory dir)) + (mew-make-directory dir) + (setq newfld t)) (mew-shimbun-visit-folder fld) (sit-for 0.5) (mew-rendezvous mew-summary-buffer-process) - (mew-shimbun-retrieve) + (mew-shimbun-retrieve newfld) (unless (eq (get-buffer cfld) (current-buffer)) (mew-kill-buffer (current-buffer))))) (mew-shimbun-visit-folder cfld) (message "Getting done")))) -(defun mew-shimbun-retrieve-article (mua server group range fld) +(defun mew-shimbun-retrieve-article (mua server group range fld &optional newfld) "Retrieve articles via SHIMBUN." (luna-define-method shimbun-mua-search-id ((mua shimbun-mew-mua) id) (let ((shimbun (shimbun-mua-shimbun mua))) @@ -468,7 +481,7 @@ mew-use-biff)) (count 0) (dispcount 0) - newfld msg file) + msg file) (if biff (mew-biff-clean-up)) (shimbun-open-group shimbun group) (unless (file-exists-p (mew-expand-folder fld)) @@ -501,7 +514,7 @@ (insert (format "X-Shimbun-Id: %s\n" id)) (mew-shimbun-sanity-convert) (setq msg (mew-folder-new-message fld 'numonly)) - (setq file (mew-expand-folder fld msg)) + (setq file (mew-shimbun-expand-msg fld msg)) (mew-frwlet mew-cs-dummy mew-cs-text-for-write (write-region (point-min) (point-max) file nil 'nomsg)) @@ -662,7 +675,7 @@ (setq newcount (1+ newcount)) (setq msg (mew-folder-new-message fld 'numonly)) (setq oldmd5 nil)) - (setq file (mew-expand-folder fld msg)) + (setq file (mew-shimbun-expand-msg fld msg)) (setq buf (get-buffer-create mew-shimbun-article-buffer-name)) (with-current-buffer buf (mew-erase-buffer) @@ -790,7 +803,7 @@ (mew-elet (delete-region (point) (progn (forward-line) (point))))) - (setq file (mew-expand-folder fld msg)) + (setq file (mew-shimbun-expand-msg fld msg)) (when (and (file-exists-p file) (file-readable-p file) (file-writable-p file)) @@ -1010,10 +1023,10 @@ (forward-line) (mew-header-goto-next) (delete-region beg (point))) - (mew-md5 - (string-as-unibyte - (mew-buffer-substring (point-min) - (min (point-max) (+ (point-min) 4096)))))))) + (md5 (string-as-unibyte + (mew-buffer-substring (point-min) + (min (point-max) (+ (point-min) 4096)))) + nil nil 'binary)))) (defvar mew-shimbun-touch-folder-p (static-if (boundp 'mew-touch-folder-p) @@ -1071,14 +1084,13 @@ (let* ((buf (or buf (current-buffer))) (fld (if (bufferp buf) (buffer-name buf) buf))) (when (and (get-buffer buf) (mew-shimbun-folder-p fld)) - (save-excursion - (set-buffer buf) + (with-current-buffer buf (unless (mew-summary-folder-dir-newp) (mew-summary-folder-cache-save)))))) ;; "Q" or exit Emacs (defadvice mew-mark-clean-up (before shimbun-cache-save activate) - (save-excursion + (save-current-buffer (dolist (fld mew-buffers) (when (and (get-buffer fld) (mew-shimbun-folder-p fld)) (set-buffer fld) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/nnshimbun.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/nnshimbun.el --- work/emacs-w3m-1.4.4/shimbun/nnshimbun.el 2005-03-23 12:56:11.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/nnshimbun.el 2012-02-16 08:15:55.000000000 +0900 @@ -1,10 +1,9 @@ ;;; nnshimbun.el --- interfacing with web newspapers -;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 -;; TSUCHIYA Masatoshi +;; Copyright (C) 2000-2012 TSUCHIYA Masatoshi ;; Authors: TSUCHIYA Masatoshi , -;; Akihiro Arisawa , +;; ARISAWA Akihiro , ;; Katsumi Yamaoka , ;; Yuuichi Teranishi ;; Keywords: news @@ -22,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -41,6 +40,7 @@ ;;; Code: (eval-when-compile (require 'cl)) +(eval-when-compile (require 'static)) (require 'nnoo) (require 'nnheader) @@ -65,14 +65,30 @@ (signal (car err) (cdr err)))))) (require 'shimbun) + (eval-and-compile (autoload 'gnus-declare-backend "gnus-start") + (autoload 'gnus-ephemeral-group-p "gnus") + (autoload 'gnus-group-change-level "gnus-start") + (autoload 'gnus-group-goto-group "gnus-group") + (autoload 'gnus-group-group-level "gnus-group") + (autoload 'gnus-group-insert-group-line-info "gnus-group") (autoload 'gnus-group-make-group "gnus-group") + (autoload 'gnus-group-prefixed-name "gnus") + (autoload 'gnus-group-read-ephemeral-group "gnus-group") + (autoload 'gnus-group-remove-mark "gnus-group") (autoload 'gnus-group-short-name "gnus") + (autoload 'gnus-group-update-group-line "gnus-group") + (autoload 'gnus-kill-ephemeral-group "gnus") (autoload 'gnus-summary-refer-article "gnus-sum") (autoload 'message-make-date "message") (autoload 'parse-time-string "parse-time")) +(eval-when-compile + (defvar gnus-level-default-subscribed) + (defvar gnus-level-killed) + (defvar gnus-level-subscribed)) + (defgroup nnshimbun nil "Reading web contents with Gnus." :group 'gnus) @@ -102,6 +118,13 @@ :group 'nnshimbun :type 'boolean) +(defcustom nnshimbun-default-group-level nil + "Integer specifies the default nnshimbun group level or nil. +It is applied when an nnshimbun group is newly created. If it is nil, +the value of `gnus-level-default-subscribed' will be used." + :group 'nnshimbun + :type '(radio (const :format "%v " nil) (integer :value 3))) + ;; The nnshimbun group parameter: @@ -248,7 +271,7 @@ (defvoo nnshimbun-directory (nnheader-concat gnus-directory "shimbun/") "*Directory where nnshimbun will store NOV files. -Actually, you can find the NOV file in the SERVER/GROUP/ subdirectory.") +Actually, you can find those files in the SERVER/GROUP/ subdirectory.") (defvoo nnshimbun-nov-is-evil nil "*If non-nil, nnshimbun won't use the NOV databases to retrieve headers.") @@ -267,7 +290,7 @@ You can use the `encapsulate-images' nnshimbun group parameter for each nnshimbun group.") -(defvoo nnshimbun-index-range nil +(defvoo nnshimbun-index-range 2 "*The number of indices that should be checked to detect new articles. `all' or nil is for all indices, `last' is for the last index, and an integer N is for the last N pages of indices. This simply provides a @@ -285,17 +308,17 @@ (defmacro nnshimbun-current-server () '(nnoo-current-server 'nnshimbun)) -(defmacro nnshimbun-server-directory (&optional server) - `(file-name-as-directory - (expand-file-name ,(or server '(nnshimbun-current-server)) - nnshimbun-directory))) - (defmacro nnshimbun-current-group () '(shimbun-current-group nnshimbun-shimbun)) -(defmacro nnshimbun-current-directory (&optional group) - `(nnmail-group-pathname ,(or group '(nnshimbun-current-group)) - (nnshimbun-server-directory))) +(defun nnshimbun-group-prefixed-name (group &optional server) + (gnus-group-prefixed-name (or group (nnshimbun-current-group)) + (list 'nnshimbun + (or server (nnshimbun-current-server))))) + +(defun nnshimbun-group-ephemeral-p (group) + (gnus-ephemeral-group-p (nnshimbun-group-prefixed-name + group (shimbun-server nnshimbun-shimbun)))) (defmacro nnshimbun-backlog (&rest form) `(let ((gnus-keep-backlog nnshimbun-keep-backlog) @@ -315,7 +338,7 @@ If FULL-NAME-P is non-nil, it assumes that GROUP is a full name." (let ((name (if full-name-p group - `(concat "nnshimbun+" (nnshimbun-current-server) ":" ,group)))) + `(nnshimbun-group-prefixed-name ,group)))) (cond ((eq 'index-range (eval symbol)) `(or (plist-get (nnshimbun-find-group-parameters ,name) 'index-range) @@ -351,6 +374,19 @@ (mm-decode-coding-string group 'utf-8) group)) +(defun nnshimbun-nov-buffer-name (&optional group) + (format " *nnshimbun overview %s %s*" + (nnshimbun-current-server) + (or group (nnshimbun-current-group)))) + +(defun nnshimbun-group-pathname (&optional group file) + "Return an absolute file name of FILE for GROUP." + (nnmail-group-pathname (or group (nnshimbun-current-group)) + (expand-file-name (nnshimbun-current-server) + nnshimbun-directory) + file)) + + ;; Interface functions: (nnoo-define-basics nnshimbun) @@ -360,69 +396,32 @@ (nnshimbun-open-server server) nnshimbun-shimbun) (or (not group) - (when (condition-case err - (shimbun-open-group nnshimbun-shimbun group) - (error - (nnheader-report 'nnshimbun "%s" (error-message-string err)))) - (let ((file-name-coding-system nnmail-pathname-coding-system) - (pathname-coding-system nnmail-pathname-coding-system) - (dir (nnshimbun-current-directory group))) - (or (file-directory-p dir) - (ignore-errors - (make-directory dir t) - (file-directory-p dir)) - (nnheader-report 'nnshimbun - (if (file-exists-p dir) - "Not a directory: %s" - "Couldn't create directory: %s") - dir))))))) + (condition-case err + (shimbun-open-group nnshimbun-shimbun group) + (error + (nnheader-report 'nnshimbun "%s" (error-message-string err))))))) (deffoo nnshimbun-open-server (server &optional defs) (or (nnshimbun-server-opened server) (let ((file-name-coding-system nnmail-pathname-coding-system) - (pathname-coding-system nnmail-pathname-coding-system) - (shimbun)) + shimbun) (when (condition-case err (setq shimbun - (shimbun-open server + (shimbun-open (or (cadr (assq 'nnshimbun-address defs)) + server) (luna-make-entity 'shimbun-gnus-mua))) (error (nnheader-report 'nnshimbun "%s" (error-message-string err)))) (nnoo-change-server 'nnshimbun server (cons (list 'nnshimbun-shimbun shimbun) defs)) - (when (or (file-directory-p nnshimbun-directory) - (ignore-errors - (make-directory nnshimbun-directory) - (file-directory-p nnshimbun-directory)) - (progn - (nnshimbun-close-server) - (nnheader-report 'nnshimbun - (if (file-exists-p nnshimbun-directory) - "Not a directory: %s" - "Couldn't create directory: %s") - nnshimbun-directory))) - (let ((dir (nnshimbun-server-directory server))) - (when (or (file-directory-p dir) - (ignore-errors - (make-directory dir) - (file-directory-p dir)) - (progn - (nnshimbun-close-server) - (nnheader-report 'nnshimbun - (if (file-exists-p dir) - "Not a directory: %s" - "Couldn't create directory: %s") - dir))) - (nnheader-report 'nnshimbun - "Opened server %s using directory %s" - server dir) - t))))))) + t)))) (deffoo nnshimbun-close-server (&optional server) (when (nnshimbun-server-opened server) (when nnshimbun-shimbun (dolist (group (shimbun-groups nnshimbun-shimbun)) - (nnshimbun-write-nov group t)) + (when (buffer-live-p (nnshimbun-nov-buffer-name group)) + (nnshimbun-write-nov group t))) (shimbun-close nnshimbun-shimbun))) (nnshimbun-backlog (gnus-backlog-shutdown)) (nnoo-close-server 'nnshimbun server) @@ -487,12 +486,15 @@ (nnheader-report 'nnshimbun "Couldn't retrieve article: %s" (prin1-to-string article))))) -(deffoo nnshimbun-request-group (group &optional server dont-check) +(deffoo nnshimbun-request-group (group &optional server dont-check info) (setq group (nnshimbun-decode-group-name group)) (if (not (nnshimbun-possibly-change-group group server)) - (nnheader-report 'nnshimbun "Invalid group (no such directory)") + (nnheader-report 'nnshimbun "Invalid group") (let (beg end lines) (with-current-buffer (nnshimbun-open-nov group) + (when (and (nnshimbun-group-ephemeral-p group) + (zerop (buffer-size))) + (nnshimbun-generate-nov-database group)) (goto-char (point-min)) (setq beg (ignore-errors (read (current-buffer)))) (goto-char (point-max)) @@ -504,17 +506,23 @@ lines (or beg 0) (or end 0) group)))) (deffoo nnshimbun-request-scan (&optional group server) - (setq group (nnshimbun-decode-group-name group)) + (when (and group + (progn + (setq group (nnshimbun-decode-group-name group)) + (nnshimbun-possibly-change-group nil server))) + (nnshimbun-generate-nov-database group))) + +(deffoo nnshimbun-retrieve-groups (groups &optional server) (when (nnshimbun-possibly-change-group nil server) - (if group - (nnshimbun-generate-nov-database group) - (dolist (group (shimbun-groups nnshimbun-shimbun)) - (nnshimbun-generate-nov-database group))))) + (dolist (group groups) + (nnshimbun-request-scan group server) + (nnshimbun-request-group group server)) + (nnshimbun-request-list server) + 'active)) (deffoo nnshimbun-close-group (group &optional server) (setq group (nnshimbun-decode-group-name group)) - (nnshimbun-write-nov group) - t) + (nnshimbun-write-nov group (nnshimbun-group-ephemeral-p group))) (deffoo nnshimbun-request-list (&optional server) (when (nnshimbun-possibly-change-group nil server) @@ -558,7 +566,7 @@ (unless (or gnus-nov-is-evil nnshimbun-nov-is-evil) (with-current-buffer nntp-server-buffer (erase-buffer) - (insert-buffer (nnshimbun-open-nov group)) + (insert-buffer-substring (nnshimbun-open-nov group)) (unless (and fetch-old (not (numberp fetch-old))) (nnheader-nov-delete-outside-range (if fetch-old @@ -597,7 +605,7 @@ (cdr strings)))) nnshimbun-tmp-string)))) -(defsubst nnshimbun-insert-nov (number header &optional id) +(defun nnshimbun-insert-nov (number header &optional id) (insert "\n") (backward-char 1) (let ((header-id (nnshimbun-string-or (shimbun-header-id header))) @@ -646,12 +654,16 @@ (goto-char (point-max)) (forward-line -1) (let* ((i (or (ignore-errors (read (current-buffer))) 0)) - (name (concat "nnshimbun+" (nnshimbun-current-server) ":" group)) - (pre-fetch (nnshimbun-find-parameter name 'prefetch-articles t))) + (name (unless (nnshimbun-group-ephemeral-p group) + (nnshimbun-group-prefixed-name group))) + (pre-fetch (when name + (nnshimbun-find-parameter name 'prefetch-articles t)))) (dolist (header (shimbun-headers nnshimbun-shimbun - (nnshimbun-find-parameter name - 'index-range t))) + (if name + (nnshimbun-find-parameter name + 'index-range t) + 'last))) (let ((article (nnshimbun-search-id group (shimbun-header-id header)))) (if article @@ -673,12 +685,12 @@ (defun nnshimbun-search-id (group id) (with-current-buffer (nnshimbun-open-nov group) (goto-char (point-min)) - (let (found) + (let (found case-fold-search) (while (and (not found) (search-forward id nil t)) ; We find the ID. ;; And the id is in the fourth field. (if (not (and (search-backward "\t" nil t 4) - (not (search-backward "\t" (shimbun-point-at-bol) t)))) + (not (search-backward "\t" (point-at-bol) t)))) (forward-line 1) (forward-line 0) (setq found t))) @@ -687,7 +699,7 @@ (setq id (concat "X-Nnshimbun-Id: " id)) (while (and (not found) (search-forward id nil t)) - (if (not (search-backward "\t" (shimbun-point-at-bol) t 8)) + (if (not (search-backward "\t" (point-at-bol) t 8)) (forward-line 1) (forward-line 0) (setq found t)))) @@ -697,7 +709,7 @@ ;; This function is defined as the alternative of `nnheader-parse-nov' ;; in order to keep the compatibility between T-gnus and Gnus. (defun nnshimbun-parse-nov () - (let ((eol (shimbun-point-at-eol))) + (let ((eol (point-at-eol))) (let ((number (nnheader-nov-read-integer)) (subject (nnheader-nov-field)) (from (nnheader-nov-field)) @@ -717,24 +729,13 @@ (or (cdr (assq 'X-Nnshimbun-Id extra)) id) refs chars lines xref extra)))) -(defsubst nnshimbun-nov-buffer-name (&optional group) - (format " *nnshimbun overview %s %s*" - (nnshimbun-current-server) - (or group (nnshimbun-current-group)))) - -(defsubst nnshimbun-nov-file-name (&optional group) - (nnmail-group-pathname (or group (nnshimbun-current-group)) - (nnshimbun-server-directory) - nnshimbun-nov-file-name)) - (defun nnshimbun-open-nov (group) (let ((buffer (nnshimbun-nov-buffer-name group))) (unless (gnus-buffer-live-p buffer) (with-current-buffer (gnus-get-buffer-create buffer) (erase-buffer) (let ((file-name-coding-system nnmail-pathname-coding-system) - (pathname-coding-system nnmail-pathname-coding-system) - (nov (nnshimbun-nov-file-name group))) + (nov (nnshimbun-group-pathname group nnshimbun-nov-file-name))) (when (file-exists-p nov) (nnheader-insert-file-contents nov))) (set-buffer-modified-p nil))) @@ -742,16 +743,23 @@ (defun nnshimbun-write-nov (group &optional close) (let ((buffer (nnshimbun-nov-buffer-name group))) - (when (gnus-buffer-live-p buffer) - (with-current-buffer buffer - (let ((file-name-coding-system nnmail-pathname-coding-system) - (pathname-coding-system nnmail-pathname-coding-system) - (nov (nnshimbun-nov-file-name group))) - (when (and (buffer-modified-p) - (or (> (buffer-size) 0) - (file-exists-p nov))) - (nnmail-write-region 1 (point-max) nov nil 'nomesg) - (set-buffer-modified-p nil)))) + (prog1 (or (nnshimbun-group-ephemeral-p group) + (not (gnus-buffer-live-p buffer)) + (let ((file-name-coding-system nnmail-pathname-coding-system)) + (when (let ((dir (nnshimbun-group-pathname group))) + (or (file-directory-p dir) + (ignore-errors + (make-directory dir t) + (file-directory-p dir)))) + (let ((nov (nnshimbun-group-pathname + group nnshimbun-nov-file-name))) + (with-current-buffer buffer + (when (and (buffer-modified-p) + (or (> (buffer-size) 0) + (file-exists-p nov))) + (nnmail-write-region 1 (point-max) nov nil 'nomesg) + (set-buffer-modified-p nil) + t)))))) (when close (kill-buffer buffer))))) @@ -764,7 +772,7 @@ (setq group (nnshimbun-decode-group-name group)) (when (nnshimbun-possibly-change-group group server) (let* ((expirable (copy-sequence articles)) - (name (concat "nnshimbun+" (nnshimbun-current-server) ":" group)) + (name (nnshimbun-group-prefixed-name group)) ;; If the group's `expiry-wait' parameter is non-nil, the value ;; of `nnmail-expiry-wait' will be bound to that value, and the ;; value of `nnmail-expiry-wait-function' will be bound to nil. @@ -784,7 +792,7 @@ (while expirable (setq article (pop expirable)) (when (and (nnheader-find-nov-line article) - (setq end (shimbun-point-at-eol)) + (setq end (point-at-eol)) (not (= (point-max) (1+ end)))) (setq time (and (search-forward "\t" end t) (search-forward "\t" end t) @@ -809,11 +817,11 @@ articles))) (deffoo nnshimbun-request-delete-group (group &optional force server) - "Delete the NOV file used for GROUP and the parent directories. + "Delete NOV file used for GROUP and the parent directories. Other files in the directory are also deleted." (setq group (nnshimbun-decode-group-name group)) (when (nnshimbun-possibly-change-group group server) - (let ((dir (nnmail-group-pathname group (nnshimbun-server-directory))) + (let ((dir (nnshimbun-group-pathname group)) (nov (nnshimbun-nov-buffer-name group)) files file subdir) (when (file-directory-p dir) @@ -829,8 +837,9 @@ (unless subdir (delete-directory dir))) (setq dir (expand-file-name ".." dir)) - (unless (directory-files - dir t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") + (when (and (file-directory-p dir) + (not (directory-files + dir t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) (delete-directory dir)) (when (gnus-buffer-live-p nov) (kill-buffer nov))) @@ -861,7 +870,7 @@ (while (and (not found) (search-forward url nil t) (looking-at "[?\t]")) - (if (not (search-backward "\t" (shimbun-point-at-bol) t 7)) + (if (not (search-backward "\t" (point-at-bol) t 7)) (forward-line 1) (forward-line 0) (setq found t)))) @@ -874,12 +883,13 @@ (interactive "sURL: ") (let ((method (gnus-find-method-for-group gnus-newsgroup-name)) (header)) - (and (eq 'nnshimbun (car method)) - (nnshimbun-possibly-change-group nil (nth 1 method)) - (setq header (nnshimbun-search-xref - (gnus-group-short-name gnus-newsgroup-name) url)) - (with-current-buffer gnus-summary-buffer - (gnus-summary-refer-article (shimbun-header-id header)))))) + (or (and (eq 'nnshimbun (car method)) + (nnshimbun-possibly-change-group nil (nth 1 method)) + (setq header (nnshimbun-search-xref + (gnus-group-short-name gnus-newsgroup-name) url)) + (with-current-buffer gnus-summary-buffer + (gnus-summary-refer-article (shimbun-header-id header)))) + 'w3m-goto-url))) (defun nnshimbun-setup-article-mode () (set (make-local-variable 'w3m-goto-article-function) @@ -891,9 +901,11 @@ (defvar nnshimbun-server-history nil) ;;;###autoload -(defun gnus-group-make-shimbun-group (server group) +(defun gnus-group-make-shimbun-group (server group &optional ephemeral) "Create a new nnshimbun group. -The user will be prompted for a SERVER name and a GROUP name." +The user will be prompted for a SERVER name and a GROUP name. When +this command is called with a prefix argument, it makes an ephemeral +shimbun group." (interactive (let ((minibuffer-setup-hook (append minibuffer-setup-hook '(beginning-of-line))) @@ -901,13 +913,13 @@ server groups group) (unless (eq major-mode 'gnus-group-mode) (error "Command invoked outside of a Gnus group buffer")) - (setq server - (let ((default-enable-multibyte-characters nil)) - (completing-read - "Shimbun server address [Hit TAB to see candidates]: " - alist nil t - (car (delete "" nnshimbun-server-history)) - 'nnshimbun-server-history))) + (setq server (completing-read + "Shimbun server address [Hit TAB to see candidates]: " + alist nil t + (car (delete "" nnshimbun-server-history)) + 'nnshimbun-server-history)) + (static-unless (featurep 'xemacs) + (setq server (string-as-unibyte server))) (if (assoc server alist) (let ((shimbun (shimbun-open server))) (setq group (completing-read @@ -920,19 +932,101 @@ (unless (shimbun-group-p shimbun group) (setq group nil))) (setq server nil)) - (list server group))) + (list server group current-prefix-arg))) (if (and server group) - (if (gnus-gethash (format "nnshimbun+%s:%s" server group) - gnus-newsrc-hashtb) - (error "Group nnshimbun+%s:%s already exists" server group) - (let (nnshimbun-pre-fetch-article) - (gnus-group-make-group - (if (mm-coding-system-p 'utf-8) - (mm-encode-coding-string group 'utf-8) - group) - (list 'nnshimbun server)))) + (let (nname) + (setq server (list 'nnshimbun server) + nname (gnus-group-prefixed-name + (if (mm-coding-system-p 'utf-8) + (mm-encode-coding-string group 'utf-8) + group) + server)) + (if ephemeral + (gnus-group-read-ephemeral-group nname server t + (cons (current-buffer) + (if (eq major-mode + 'gnus-summary-mode) + 'summary 'group))) + (when (gnus-ephemeral-group-p nname) + (gnus-kill-ephemeral-group nname)) + (let ((gnus-level-default-subscribed + (or nnshimbun-default-group-level + gnus-level-default-subscribed))) + (gnus-group-make-group group server)))) (error "Can't find group"))) +;;;###autoload +(defun gnus-group-make-shimbun-groups (server) + "Create all nnshimbun groups prepared for SERVER." + (interactive + (let ((minibuffer-setup-hook (append minibuffer-setup-hook + '(beginning-of-line)))) + (unless (eq major-mode 'gnus-group-mode) + (error "Command invoked outside of a Gnus group buffer")) + (list (completing-read + "Shimbun server address [Hit TAB to see candidates]: " + (shimbun-servers-alist) nil t)))) + (unless (string-equal server "") + (let ((gnus-level-default-subscribed (or nnshimbun-default-group-level + gnus-level-default-subscribed)) + (gnus-verbose 0) + (grps (reverse (shimbun-groups (shimbun-open server)))) + (inhibit-read-only t) + grp group) + (if grps + (when (or (= (length grps) 1) + (prog1 (yes-or-no-p (format "\ +Are you sure you want to make %d groups for nnshimbun+%s:? " + (length grps) server)) + (message ""))) + (while grps + (setq grp (pop grps) + group (format "nnshimbun+%s:%s" server grp)) + (if (gnus-group-entry group) + (progn + (save-excursion + (unless (gnus-group-goto-group group) + (gnus-group-update-group group) + (gnus-group-goto-group group)) + (gnus-group-remove-mark group) + (gnus-group-change-level + group + gnus-level-default-subscribed + (or (gnus-group-group-level) gnus-level-killed)) + (gnus-group-update-group-line) + (delete-region (point-at-bol) + (progn (forward-line 1) (point)))) + (gnus-group-insert-group-line-info group) + (forward-line -1)) + (gnus-group-make-group grp (list 'nnshimbun server))))) + (message "No group is found in nnshimbun+%s:" server))))) + +(defun nnshimbun-generate-download-script (&optional async) + "Generate download script for all subscribed schimbuns. +Output will be put in a new buffer. If called with a prefix, +puts a '&' after each w3m command." + (interactive "P") + (switch-to-buffer (get-buffer-create "*shimbun download script*")) + (erase-buffer) + (insert + (concat "#!/bin/sh\n# shimbun download script\n\n" + "W3M=" (if w3m-command w3m-command "/usr/bin/w3m") + "\nOPTS=\"-no-cookie -o accept_encoding=identity -dump_both\"\n\n")) + (let ((path (file-name-as-directory + (expand-file-name shimbun-local-path))) + url fname) + ;; get all subscribed shimbun groups + (dolist (cur gnus-newsrc-alist) + (when (and (eq (car-safe (nth 4 cur)) 'nnshimbun) + (<= (nth 1 cur) gnus-level-subscribed)) + (when (string-match "nnshimbun\\+\\(.+\\):\\(.+\\)" (car cur)) + (nnshimbun-possibly-change-group (match-string 2 (car cur)) + (match-string 1 (car cur))) + (when (setq url (shimbun-index-url nnshimbun-shimbun)) + (setq fname (concat path (substring (md5 url) 0 10) "_shimbun")) + (insert + (concat "$W3M $OPTS " (shell-quote-argument url) " > " fname + (if async " &\n" "\n"))))))))) (provide 'nnshimbun) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-2ch.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-2ch.el --- work/emacs-w3m-1.4.4/shimbun/sb-2ch.el 2005-02-15 20:04:45.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-2ch.el 2005-07-06 08:52:29.000000000 +0900 @@ -17,8 +17,8 @@ ;; 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. +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-airs.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-airs.el --- work/emacs-w3m-1.4.4/shimbun/sb-airs.el 2005-03-14 07:25:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-airs.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-airs.el --- shimbun backend for lists.airs.net -;; Copyright (C) 2001, 2002, 2003, 2005 Yuuichi Teranishi +;; Copyright (C) 2001, 2002, 2003, 2005, 2007 +;; Yuuichi Teranishi ;; Author: Yuuichi Teranishi ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -48,11 +49,11 @@ "\\([^<]+\\) \\([^<]+\\)") (defmacro shimbun-airs-concat-url (shimbun url) - (` (concat (shimbun-url-internal (, shimbun)) - (nth 1 (assoc (shimbun-current-group-internal (, shimbun)) - shimbun-airs-group-path-alist)) - "/" - (, url)))) + `(concat (shimbun-url-internal ,shimbun) + (nth 1 (assoc (shimbun-current-group-internal ,shimbun) + shimbun-airs-group-path-alist)) + "/" + ,url)) (luna-define-method shimbun-index-url ((shimbun shimbun-airs)) (shimbun-airs-concat-url shimbun "index.html")) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-aljazeera.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-arch-bluegate.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-asahi-html.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi-html.el --- work/emacs-w3m-1.4.4/shimbun/sb-asahi-html.el 2005-03-14 12:00:26.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi-html.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,32 +19,25 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: +;; This module is now semi-obsolete. You can use sb-asahi.el to read +;; html articles by putting the following line in your init file. +;; +;;(setq shimbun-asahi-prefer-text-plain nil) + ;;; Code: -(require 'shimbun) (require 'sb-asahi) (luna-define-class shimbun-asahi-html (shimbun-asahi) ()) -(defvar shimbun-asahi-html-content-start - "\ -\\|") - -(defvar shimbun-asahi-html-content-end - "\ -\\|\ -\\|") - -(luna-define-method shimbun-make-contents ((shimbun shimbun-asahi-html) - header) - (shimbun-asahi-prepare-article shimbun header) - (shimbun-make-html-contents shimbun header)) +(defconst shimbun-asahi-html-prefer-text-plain nil + "Non-nil means prefer text/plain articles rather than html articles.") (provide 'sb-asahi-html) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-asahi-mytown.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi-mytown.el --- work/emacs-w3m-1.4.4/shimbun/sb-asahi-mytown.el 2004-08-03 15:37:47.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi-mytown.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-asahi-mytown.el --- mytown.asahi.com -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004 Katsumi Yamaoka +;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Katsumi Yamaoka ;; Author: Katsumi Yamaoka ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -32,56 +32,55 @@ (shimbun-japanese-newspaper shimbun) ()) (defvar shimbun-asahi-mytown-group-table - '(("hokkaido" "北海道") - ("aomori" "青森") - ("iwate" "岩手") - ("miyagi" "宮城") - ("akita" "秋田") - ("yamagata" "山形") - ("fukushima" "福島") - ("ibaraki" "茨城") - ("tochigi" "栃木") - ("gunma" "群馬") - ("saitama" "埼玉") - ("chiba" "千葉") - ("tokyo" "東京") - ("tama" "多摩") - ("kanagawa" "神奈川") - ("niigata" "新潟") - ("toyama" "富山") - ("ishikawa" "石川") - ("fukui" "福井") - ("yamanashi" "山梨") - ("nagano" "長野") - ("gifu" "岐阜") - ("shizuoka" "静岡") - ("aichi" "愛知") - ("mie" "三重") - ("shiga" "滋賀") - ("kyoto" "京都") - ("osaka" "大阪") - ("hyogo" "兵庫") - ("nara" "奈良") - ("wakayama" "和歌山") - ("tottori" "鳥取") - ("shimane" "島根") - ("okayama" "岡山") - ("hiroshima" "広島") - ("yamaguchi" "山口") - ("tokushima" "徳島") - ("kagawa" "香川") - ("ehime" "愛媛") - ("kochi" "高知") - ("fukuoka" "福岡・北九州") - ("saga" "佐賀") - ("nagasaki" "長崎") - ("kumamoto" "熊本") - ("oita" "大分") - ("miyazaki" "宮崎") - ("kagoshima" "鹿児島") - ("okinawa" "沖縄") - ("usa" "USA")) - "Alist of group names and their Japanese translations.") + '(("hokkaido" "北海道" "0100000") + ("aomori" "青森" "0200000") + ("iwate" "岩手" "0300000") + ("miyagi" "宮城" "0400000") + ("akita" "秋田" "0500000") + ("yamagata" "山形" "0600000") + ("fukushima" "福島" "0700000") + ("ibaraki" "茨城" "0800000") + ("tochigi" "栃木" "0900000") + ("gunma" "群馬" "1000000") + ("saitama" "埼玉" "1100000") + ("chiba" "千葉" "1200000") + ("tokyo" "東京" "1300000") + ("tama" "多摩" "1400000") + ("kanagawa" "神奈川" "1500000") + ("niigata" "新潟" "1600000") + ("toyama" "富山" "1700000") + ("ishikawa" "石川" "1800000") + ("fukui" "福井" "1900000") + ("yamanashi" "山梨" "2000000") + ("nagano" "長野" "2100000") + ("gifu" "岐阜" "2200000") + ("shizuoka" "静岡" "2300000") + ("aichi" "愛知" "2400000") + ("mie" "三重" "2500000") + ("shiga" "滋賀" "2600000") + ("kyoto" "京都" "2700000") + ("osaka" "大阪" "2800000") + ("hyogo" "兵庫" "2900000") + ("nara" "奈良" "3000000") + ("wakayama" "和歌山" "3100000") + ("tottori" "鳥取" "3200000") + ("shimane" "島根" "3300000") + ("okayama" "岡山" "3400000") + ("hiroshima" "広島" "3500000") + ("yamaguchi" "山口" "3600000") + ("tokushima" "徳島" "3700000") + ("kagawa" "香川" "3800000") + ("ehime" "愛媛" "3900000") + ("kochi" "高知" "4000000") + ("fukuoka" "福岡・北九州" "4100000") + ("saga" "佐賀" "4200000") + ("nagasaki" "長崎" "4300000") + ("kumamoto" "熊本" "4400000") + ("oita" "大分" "4500000") + ("miyazaki" "宮崎" "4600000") + ("kagoshima" "鹿児島" "4700000") + ("okinawa" "沖縄" "4800000")) + "Alist of group names, their Japanese translations and ids.") (defvar shimbun-asahi-mytown-server-name "朝日新聞") @@ -92,16 +91,14 @@ (concat "http://" shimbun-asahi-mytown-top-level-domain "/") "Name of the parent url.") -(defvar shimbun-asahi-mytown-from-address - (concat "webmaster@" shimbun-asahi-mytown-top-level-domain)) - (defvar shimbun-asahi-mytown-expiration-days 6) (defvar shimbun-asahi-mytown-content-start - "") + "\\|\ +\\|\\|") (defvar shimbun-asahi-mytown-content-end - "") + "\\|") (defvar shimbun-asahi-mytown-x-face-alist '(("default" . "X-Face: +Oh!C!EFfmR$+Zw{dwWW]1e_>S0rnNCA*CX|\ @@ -112,39 +109,57 @@ (mapcar 'car shimbun-asahi-mytown-group-table)) (luna-define-method shimbun-current-group-name ((shimbun shimbun-asahi-mytown)) - (concat "マイタウン" + (concat "朝日マイタウン (" (nth 1 (assoc (shimbun-current-group-internal shimbun) - shimbun-asahi-mytown-group-table)))) + shimbun-asahi-mytown-group-table)) + ")")) (luna-define-method shimbun-index-url ((shimbun shimbun-asahi-mytown)) - (concat shimbun-asahi-mytown-url - (shimbun-current-group-internal shimbun) - "/news_itiran.asp")) + (let ((group (shimbun-current-group-internal shimbun))) + (concat shimbun-asahi-mytown-url + group + "/newslist.php?d_id=" + (nth 2 (assoc group shimbun-asahi-mytown-group-table))))) (defun shimbun-asahi-mytown-get-headers (shimbun) "Return a list of headers." (let ((group (shimbun-current-group-internal shimbun)) - (from (shimbun-from-address shimbun)) + (from (shimbun-current-group-name shimbun)) (case-fold-search t) - cyear cmonth start href artnum limit month day subject year headers) - (setq cyear (decode-time) + cyear cmonth url id subject month day year headers) + (setq cyear (shimbun-decode-time nil 32400) cmonth (nth 4 cyear) cyear (nth 5 cyear)) - (while (and (re-search-forward "<[\t\n\r ]*a[\t\n\r ]+href=\"\ -\\(news\\.asp\\?kiji=\\([0-9]+\\)\\)\"" nil t) - (setq start (match-end 0) - href (match-string 1) - artnum (match-string 2)) - (re-search-forward "<[\t\n\r ]*/a[\t\n\r ]*>[\t\n\r ]*(\ -\[\t\n\r ]*\\([0-9]+\\)[\t\n\r ]*/[\t\n\r ]*\\([0-9]+\\)" nil t) - (setq limit (match-beginning 0) - month (string-to-number (match-string 1)) - day (string-to-number (match-string 2))) - (goto-char start) - (re-search-forward ">\\([\t\n\r ]*<[^<>]+>\\)*[\t\n\r ]*\ -\\([^<>]+\\)[\t\n\r ]*= (- month cmonth) 2) + (while (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n  ]*") + (s1 "[\t\n ]+") + (no-nl "[^\n<>]+")) + (concat + "" s0 + ;; 3. subject + "\\(" no-nl "\\)" + s0 "" s0 "\\(?:<[^>]+>" s0 "\\)(" s0 + ;; 4. month + "\\([01][0-9]\\)" + s0 "/" s0 + ;; 5. day + "\\([0-3][0-9]\\)" + s0 ")"))) + nil t) + (setq url (shimbun-expand-url (concat group "/" (match-string 1)) + shimbun-asahi-mytown-url) + id (match-string 2) + subject (match-string 3) + month (string-to-number (match-string 4)) + day (string-to-number (match-string 5)) + year (cond ((>= (- month cmonth) 2) (1- cyear)) ((and (= 1 month) (= 12 cmonth)) (1+ cyear)) @@ -161,13 +176,12 @@ (shimbun-make-date-string year month day) ;; id (format "<%d%02d%02d.%s%%%s.%s>" - year month day artnum group + year month day id group shimbun-asahi-mytown-top-level-domain) ;; references, chars, lines "" 0 0 ;; xref - (shimbun-expand-url (concat group "/" href) - shimbun-asahi-mytown-url)) + url) headers)) headers)) @@ -176,18 +190,20 @@ (shimbun-asahi-mytown-get-headers shimbun)) (defun shimbun-asahi-mytown-prepare-article () - "Remove a subject line." + "Remove trailing empty lines." (let ((case-fold-search t) - start) - (when (and (re-search-forward "\ -" - nil t) - (setq start (point)) - (re-search-forward "\ -[\t\n\r ]*\ -]*>[\t\n\r ]*" - nil t)) - (delete-region start (point))))) + end start) + (when (and (re-search-forward shimbun-asahi-mytown-content-start nil t) + (re-search-forward shimbun-asahi-mytown-content-end nil t)) + (setq end (goto-char (match-beginning 0)) + start end) + (while (and (re-search-backward "[\t\n\r ]*\\(?:<[^>]+>[\t\n\r ]*\\)" + nil t) + (if (= (match-end 0) start) + (setq start (match-beginning 0)) + (delete-region (goto-char start) end) + (insert "\n") + nil)))))) (luna-define-method shimbun-make-contents :before ((shimbun shimbun-asahi-mytown) header) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-asahi.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi.el --- work/emacs-w3m-1.4.4/shimbun/sb-asahi.el 2005-03-17 12:59:58.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-asahi.el 2011-11-21 18:47:29.000000000 +0900 @@ -1,7 +1,6 @@ ;;; sb-asahi.el --- shimbun backend for asahi.com -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 -;; Yuuichi Teranishi +;; Copyright (C) 2001-2011 Yuuichi Teranishi ;; Author: TSUCHIYA Masatoshi , ;; Yuuichi Teranishi , @@ -22,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -33,11 +32,16 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (require 'shimbun) -(require 'sb-text) +(require 'sb-multi) + +(luna-define-class shimbun-asahi (shimbun-japanese-newspaper shimbun-multi + shimbun) ()) -(luna-define-class shimbun-asahi - (shimbun-japanese-newspaper shimbun-text) ()) +(defvar shimbun-asahi-prefer-text-plain t + "*Non-nil means prefer text/plain articles rather than html articles.") (defvar shimbun-asahi-top-level-domain "asahi.com" "Name of the top level domain for the Asahi shimbun.") @@ -47,11 +51,11 @@ "Name of the parent url.") (defun shimbun-asahi-make-regexp (name) - "Return a list of a regexp and numbers for the kansai.NAME group. + "Return a list of a regexp and numbers for the group NAME. Every `.' in NAME will be replaced with `/'." (list (let ((s0 "[\t\n  ]*") (s1 "[\t\n ]+") - (no-nl "[^\n]+")) + (no-nl "[^\n<>]+")) (concat "" s0 ;; 6. subject "\\(" no-nl "\\)" - s0 "")) + s0 "\\(?:]+>" s0 "\\)?")) 1 nil 2 6 3 4 5)) (defvar shimbun-asahi-group-table (let* ((s0 "[\t\n  ]*") (s1 "[\t\n ]+") - (no-nl "[^\n]+") + (no-nl "[^\n<>]+") (default (list (concat "" s0 ;; 5. subject "\\(" no-nl "\\)" - s0 "") + s0 "\\(?:]+>" s0 "\\)?") 1 4 nil 5 nil 2 3)) (default2 (shimbun-asahi-make-regexp "%s")) - (default3 (list - (concat - "" s0 - ;; 6. subject - "\\(" no-nl "\\)" - s0 "") - 1 nil 2 6 3 4 5)) + (book (list + (concat + "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?" s0 "") + 1 2 nil 6 3 4 5)) (edu (shimbun-asahi-make-regexp "edu.news")) - (health (shimbun-asahi-make-regexp "health.news"))) - `(("book" "出版ニュース" "book/news/" - ,@(shimbun-asahi-make-regexp "book.news")) + (international (list + (concat + "" s0 + ;; 5. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?") + 1 4 nil 5 nil 2 3)) + (rss (list + (concat + "" s0 "" s0 + ;; 5. subject + "\\([^<]+\\)" + s0 "\\(?:" + s0 "\\(?:<[^>]+/>" + "\\|<[^>]+>\\(?:<[^]]+\\]+>\\|[^<]+\\)]+>\\)\\)*" + s0 "" s0 + ;; 6. extra keyword (ja) + "\\([^<]+\\)" + s0 "" s0 "" s0 + ;; 7. year + "\\(20[0-9][0-9]\\)" + "-" + ;; 8. month + "\\([01][0-9]\\)" + "-" + ;; 9. day + "\\([0-3][0-9]\\)" + "T" + ;; 10. hour:min:sec + "\\([012][0-9]:[0-5][0-9]:[0-5][0-9]\\)") + 1 3 4 5 7 8 9 10 2 nil 6))) + `(("book" "RSS" "http://www3.asahi.com/rss/book.rdf" ,@rss) + ("book.column" "コラム") + ("book.news" "出版ニュース" nil ,@book) + ("book.paperback" "文庫・新書") + ("book.review" "書評" nil ,@book) + ("book.special" "特集" nil + ,(concat + "" s0 + ;; 6. subject + "\\(" no-nl "\\)") + 1 2 nil 6 3 4 5) ("business" "ビジネス" "%s/list.html" ,@default) - ;; The url should be ended with "index.html". - ("business.column" "経済気象台" "business/column/index.html" ,@default2) ("car" "愛車" "%s/news/" ,@(shimbun-asahi-make-regexp "car.news")) - ("car.italycolumn" "イタリア発アモーレ!モトーレ!" "car/italycolumn/" - ,@default2) - ("car.motorsports" "モータースポーツ" "car/motorsports/" ,@default2) - ("car.newcar" "新車情報" "car/newcar/" ,@default2) - ("car.newcarbywebcg" "新車発表会" "car/newcarbywebcg/" ,@default2) - ("culture" "文化・芸能" "%s/list.html" ,@default) - ("culture.column" "もやしのひげ" "culture/list_moyashi.html" - ,@(shimbun-asahi-make-regexp "culture.column.moyashi")) - ("digital" "デジタル機器" "digital/av/" - ,@(shimbun-asahi-make-regexp "digital.av")) - ("digital.apc" "雑誌「ASAHIパソコン」ニュース" "digital/apc/" ,@default2) - ("digital.bcnnews" "eビジネス情報 (提供:BCN)" "digital/bcnnews/" - ,@default2) - ("digital.column01" "デジタルコラム" "digital/column01/" - ,@default2) - ("digital.hotwired" "HotWired Japan" "digital/hotwired/" ,@default2) - ("digital.internet" "ネット・ウイルス" "digital/internet/" ,@default2) - ("digital.mobile" "携帯電話" "digital/mobile/" ,@default2) - ("digital.nikkanko" "日刊工業新聞ニュース" "digital/nikkanko/" - ,@default2) - ("digital.pc" "パソコン" "digital/pc/" ,@default2) - ("editorial" "社説" "paper/editorial.html" + ("culture" "文化・芸能" "%s/list.html" + ,(concat "" s0 + ;; 6. subject + "\\([^<]+\\)" + s0 "\\(?:]+>" s0 "\\)?" s0 + "<\\(?:/dt\\|span\\)") + 1 nil 2 6 3 4 5) + ("digital" "デジタル" "%s/list.html" + ,@(shimbun-asahi-make-regexp "digital/[^\"/]+")) + ("editorial" "社説" "include/editorial_bno4.xml" ,(concat "]+>\\)*" s0 "([01]?[0-9]/[0-3]?[0-9])") + (cons (concat + (car rest) + "\\(?:" s0 "<[^>]+>\\)*" s0 "([01]?[0-9]/[0-3]?[0-9])") (cdr rest)))) - ("health" "健康・生活" "%s/news/" ,@health) - ("health.aged" "福祉・高齢" "health/news/aged.html" ,@health) - ("health.alz" "認知症特集" "health/news/alz.html" ,@health) - ("health.medical" "医療・病気" "health/news/medical.html" ,@health) + ("food" "食" "%s/news/" ,@(shimbun-asahi-make-regexp "food.news")) + ("health" "健康" "%s/list.html" + ,@(shimbun-asahi-make-regexp "health.news")) ("housing" "住まい" "%s/news/" ,@(shimbun-asahi-make-regexp "housing.news")) - ("housing.amano" "天野彰のいい家いい家族" "housing/amano/" ,@default2) - ("housing.column" "住まいのお役立ちコラム" "housing/column/" ,@default2) - ("housing.diary" "小さな家の生活日記" "housing/diary/" ,@default2) - ("housing.world" "世界のウチ" "housing/world/" ,@default2) ("igo" "囲碁" "%s/news/" ,@(shimbun-asahi-make-regexp "igo.news")) ("international" "国際" "%s/list.html" ,@default) - ("international.jinmin" "人民日報" "international/jinmin/index.html" - ,@default2) + ("international.asia" "アジア" "international/asia.html" ,@international) + ("international.column" "コラム") + ("international.special" "特集") + ("international.world" "世界") ("job" "就職・転職" "%s/news/" ,@(shimbun-asahi-make-regexp "job.news")) - ("job.special" "週刊朝日・AERAから" "job/special/" - ,(concat - (car default2) - "\\(" s0 "<[^>]+>\\)*" s0 "(" s0 - ;; 8. extra - "\\(" no-nl "\\)" - ":") - ,@(cdr default2) nil 8) ("kansai" "関西" "%s/news/" ,@(shimbun-asahi-make-regexp "kansai.news")) - ("kansai.horiekenichi" "堀江謙一の世界一周ひとりぼっち" - "kansai/horiekenichi/" ,@default2) - ("kansai.umaimon" "うまいもん" "kansai/umaimon/" ,@default2) - ("kansai.fuukei" "風景を歩く" "kansai/fuukei/" ,@default2) - ("kansai.yotsuba" "よつ葉びより" "kansai/yotsuba/" ,@default2) - ("kansai.smile" "スマイルスタイル" "kansai/smile/" ,@default2) - ("kansai.keiki" "け〜きの“ええ話”" "kansai/keiki/" ,@default2) - ("kansai.okiniiri" "DJのお気に入り" "kansai/okiniiri/" ,@default2) - ("kansai.syun" "旬の顔" "kansai/syun/" ,@default2) - ("kansai.takara" "たから図鑑" "kansai/takara/" ,@default2) - ("kansai.kansaiisan" "勝手に関西世界遺産" "kansai/kansaiisan/" - ,@default2) - ("kansai.depa" "デパ地下NEWS" "kansai/depa/" ,@default2) - ("kansai.kaban" "かばんの中身" "kansai/kaban/" ,@default2) - ("kansai.kyosho" "巨匠に学べ" "kansai/kyosho/" ,@default2) - ("kansai.okan" "母さんの知恵袋" "kansai/okan/" ,@default2) - ("kansai.densetsu" "ほんま?関西伝説" "kansai/densetsu/" ,@default2) - ("kansai.onayami" "みうらじゅんのお悩み祭り" "kansai/onayami/" - ,@default2) - ("kansai.sanshi" "三枝の笑ウインドウ" "kansai/sanshi/" ,@default2) + ("kansai.entertainment" "楽しむ") + ("kansai.kokoro" "こころ") + ("kansai.sumai" "住まい") + ("kansai.taberu" "食べる") + ("komimi" "コミミ口コミ" "%s/list.html" ,@default2) ("life" "暮らし" "%s/list.html" ,@default) - ("life.column" "暮らしコラム" "life/column/" - ,(concat - "" s0 - ;; 6. subject - "\\(" no-nl "\\)" - s0 "") - 1 nil 2 6 3 4 5) - ("life.food" "食と料理" "life/food/" - ,(concat - "" s0 - ;; 6. subject - "\\(" no-nl "\\)" - s0 "") - 1 nil 2 6 3 4 5) - ("nankyoku" "南極プロジェクト" "%s/news/" - ,@(shimbun-asahi-make-regexp "nankyoku.news")) - ("nankyoku.borderless" "国境のない大陸から" "nankyoku/borderless/" - ,@default2) - ("nankyoku.people" "越冬隊の人びと" "nankyoku/people/" ,@default2) - ("nankyoku.whitemail" "WhiteMail@南極" "nankyoku/whitemail/" ,@default2) + ("life.column" "コラム") ("national" "社会" "%s/list.html" ,@default) - ("national.calamity" "災害・交通情報" "national/calamity.html" - ,@default3) - ("national.etc" "その他・話題" "national/etc.html" ,@default3) - ("national.trial" "裁判" "national/trial.html" ,@default3) - ("obituaries" "おくやみ" "obituaries" ,@default) ("politics" "政治" "%s/list.html" ,@default) - ("rss" "RSS" "http://www3.asahi.com/rss/index.rdf" - ,(concat - "" - ;; 1. subject - "\\([^<]+\\)" - "\n" - ;; 2. url - "\\(http://www\\.asahi\\.com/" - ;; 3. extra keyword (en) - "\\([^/]+\\)" - "/update/" - ;; 4 and 5. serial number - "\\([0-9]+\\)/\\([0-9]+\\)" - "\\.html\\?ref=rss\\)" - "\n\n" - ;; 6. extra keyword (ja) - "\\([^<]+\\)" - "\n20[0-9][0-9]-" - ;; 7. month - "\\([01][0-9]\\)" - "-" - ;; 8. day. - "\\([0-3][0-9]\\)" - "T" - ;; 9. hour:min:sec - "\\([012][0-9]:[0-5][0-9]:[0-5][0-9]\\)") - 2 4 5 1 nil 7 8 9 3 nil 6) - ("science" "サイエンス" "%s/list.html" - ,@(shimbun-asahi-make-regexp "science.news")) + ("rss" "RSS" "http://www3.asahi.com/rss/index.rdf" ,@rss) + ("science" "サイエンス" "%s/list.html" ,@default) ("shopping" "ショッピング" "%s/news/" ,@(shimbun-asahi-make-regexp "shopping.news")) - ("shopping.kishi" "岸朝子の気になるお取り寄せ12カ月" "shopping/kishi/" - ,@default2) - ("shopping.ryouhin" "くらしの良品探訪" "shopping/ryouhin/" - ,@default2) - ("shougi" "将棋" "%s/news/" ,@(shimbun-asahi-make-regexp "shougi.news")) + ("shopping.column" "コラム") + ("shopping.yakimono" "やきもの") + ("shougi" "将棋") ("sports" "スポーツ" "%s/list.html" ,@default) - ("sports.baseball" "野球" "sports/bb/" - ,@(shimbun-asahi-make-regexp "sports.bb")) - ("sports.column" "スポーツコラム" "sports/column/" ,@default2) - ("sports.football" "サッカー" "sports/fb/" - ,@(shimbun-asahi-make-regexp "sports.fb")) - ("sports.spo" "一般スポーツ" "sports/spo/" ,@default2) - ("tenjin" "天声人語" "paper/column.html" + ("sports.baseball" "野球") + ("sports.battle" "格闘技・相撲") + ("sports.etc" "その他") + ("sports.football" "サッカー") + ("sports.golf" "ゴルフ") + ("sports.rugby" "ラグビー") + ("sports.usa" "米プロスポーツ") + ("sports.winter" "ウインタースポーツ") + ("tenjin" "天声人語" "include/column_bno4.xml" ,(concat "" s0 + ;; 6. subject + "\\([^\n<>]+\\)" + s0 "\\(?:]+>" s0 "\\)*") + 1 nil 2 6 3 4 5))) "Alist of group names, their Japanese translations, index pages, regexps and numbers. Where index pages and regexps may contain the \"%s\" token which is replaced with group names, numbers point to the search result in order of [0]a url, [1,2]a serial number, [3]a subject, -\[4]a year, [5]a month, [6]a day, [7]an hour:minute and [8,9,10]an -extra keyword.") +\[4]a year, [5]a month, [6]a day, [7]an hour:minute, [8,9,10]an extra +keyword, [11]hour and [12]minute. If an index page is nil, a group +name in which \".\" is substituted with \"/\" is used instead.") + +(defvar shimbun-asahi-subgroups-alist + (let* ((s0 "[\t\n  ]*") + (s1 "[\t\n ]+") + (no-nl "[^\n<>]+") + (default (list + (concat + "" s0 + ;; 5. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?") + 1 4 nil 5 nil 2 3)) + (baseball (shimbun-asahi-make-regexp "sports.bb")) + (book1 (list + (concat + "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?" s0 "") + 1 2 nil 6 3 4 5)) + (book2 (list + (concat + "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?" s0 "") + 1 2 nil 6 3 4 5)) + (business (list + (concat + "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?" + "[\t\n ]*\\(?:\\|" s0 + ;; 6. subject + "\\(" no-nl "\\)" + s0 "\\(?:]+>" s0 "\\)?" s0 "") + 1 2 nil 6 3 4 5)) + (politics (cons (format (car default) "politics") (cdr default))) + (shopping (list + (concat + "]+/\\)+" + ;; 2. serial number + "\\([a-z]*" + ;; 3. year + "\\(20[0-9][0-9]\\)" + ;; 4. month + "\\([01][0-9]\\)" + ;; 5. day + "\\([0-3][0-9]\\)" + "[0-9]*\\)" + "\\.html\\)" + "\">" s0 + ;; 6. subject + "\\([^<]+\\)" + "\\(?:" s0 "<[^>]+>\\)*" s0 "([01]?[0-9]/[0-3]?[0-9])") + 1 nil 2 6 3 4 5)) + (shopping2 (list + (concat + "\\(?:" s0 + "[^<]+\\)?" s0 + ;; 6. subject + "\\(" no-nl "\\)" + "\\(?:" s0 "&#[0-9]+;\\|&#[0-9]+;" s0 "\\)*" + "\\(?:" s0 "<[^>]+>\\)*" s0 "([01]?[0-9]/[0-3]?[0-9])") + 1 nil 2 6 3 4 5)) + (sports (shimbun-asahi-make-regexp "sports.spo")) + (travel (list + (concat "" s0 + ;; 6. subject + "\\([^<]+\\)" + s0 "\\(?:]+>" s0 "\\)?") + 1 nil 2 6 3 4 5))) + `(("book.column" + ("著者に会いたい" "http://book.asahi.com/author/" + ,(format (car book1) "author") ,@(cdr book1)) + ("売れてる本" "http://book.asahi.com/bestseller/" + ,(format (car book1) "bestseller") ,@(cdr book1)) + ("愛でたい文庫" "http://book.asahi.com/bunko/" + ,(format (car book1) "bunko") ,@(cdr book1)) + ("ビジネス書" "http://book.asahi.com/business/" + ,(format (car book1) "business") ,@(cdr book1)) + ("コミックガイド" "http://book.asahi.com/comic/" + ,(format (car book1) "comic") ,@(cdr book1)) + ("話題の本棚" "http://book.asahi.com/hondana/" + ,(format (car book1) "hondana") ,@(cdr book1)) + ("暮らしのお役立ち" "http://book.asahi.com/life/" + ,(format (car book1) "life") ,@(cdr book1)) + ("たいせつな本" "http://book.asahi.com/mybook/" + ,(format (car book1) "mybook") ,@(cdr book1)) + ("ニュースな新刊" "http://book.asahi.com/newstar/" + ,(format (car book1) "newstar") ,@(cdr book1)) + ("新書の穴" "http://book.asahi.com/shinsho/" + ,(format (car book1) "shinsho") ,@(cdr book1)) + ("ニュースな本" "http://book.asahi.com/topics/" + ,(format (car book1) "topics") ,@(cdr book1)) + ("デジタル読書" "http://book.asahi.com/trendwatch/" + ,(format (car book1) "trendwatch") ,@(cdr book1))) + ("book.news" + ("朝日新聞社の新刊" "http://book.asahi.com/asahi/" + ,(format (car book1) "asahi") ,@(cdr book1)) + ("ひと・流行・話題" "http://book.asahi.com/clip/" + ,(format (car book1) "clip") ,@(cdr book1)) + ("オンラインブックフェア" "http://book.asahi.com/fair/" + ,(format (car book1) "fair") ,@(cdr book1))) + ("book.paperback" + ("文庫" "http://book.asahi.com/paperback/bunko.html" ,@paperback) + ("新書" "http://book.asahi.com/paperback/shinsho.html" ,@paperback)) + ("book.review" + ("ビジネス" "http://book.asahi.com/review/business.html" ,@book2) + ("デジタル" "http://book.asahi.com/review/digital.html" ,@book2) + ("教育 (児童書)" "http://book.asahi.com/review/edu.html" ,@book2) + ("国際" "http://book.asahi.com/review/international.html" ,@book2) + ("暮らし" "http://book.asahi.com/review/life.html" ,@book2)) + ("book.special" + ("BOOK TIMES" "http://book.asahi.com/booktimes/" + ,(format (car book1) "booktimes") ,@(cdr book1)) + ("売れ筋ランキング" "http://book.asahi.com/ranking/" + ,(format (car book1) "ranking") ,@(cdr book1))) + ("business" + ("AERA発マネー" "http://www.asahi.com/business/aera/" + ,(format (car business) "aera") ,@(cdr business)) + ("投資信託" "http://www.asahi.com/business/fund/" + ,(format (car business) "fund") ,@(cdr business)) + ("商品ファイル" "http://www.asahi.com/business/products/" + ,(format (car business) "products") ,@(cdr business)) + ("ロイターニュース" "http://www.asahi.com/business/list_reuters.html" + ,(format (car business) "reuters") ,@(cdr business)) + ("今日の視点" "http://www.asahi.com/business/today_eye/" + ,(format (car business) "today_eye") ,@(cdr business)) + ("今日の市況" "http://www.asahi.com/business/today_shikyo/" + ,(format (car business) "today_shikyo") ,@(cdr business)) + ("経済を読む" "http://www.asahi.com/business/topics/" + ,(format (car business) "topics") ,@(cdr business)) + ("東洋経済ニュース" "http://www.asahi.com/business/list_toyo.html" + ,(format (car business) "toyo") ,@(cdr business))) + ("car" + ("新車発表会" "http://www.asahi.com/car/cg/" + ,@(shimbun-asahi-make-regexp "car.cg")) + ("イタリア発アモーレ!モトーレ!" + "http://www.asahi.com/car/italycolumn/" + ,@(shimbun-asahi-make-regexp "car.italycolumn")) + ("モータースポーツ" "http://www.asahi.com/car/motorsports/" + ,@(shimbun-asahi-make-regexp "car.motorsports")) + ("新車情報" "http://www.asahi.com/car/newcar/" + ,@(shimbun-asahi-make-regexp "car.newcar"))) + ("culture" + ("文化" "http://www.asahi.com/culture/list_culture.html" ,@culture) + ("芸能" "http://www.asahi.com/culture/list_entertainment.html" + ,@culture) + ("藤沢周平の世界" "http://www.asahi.com/culture/fujisawa/" + ,@(shimbun-asahi-make-regexp "culture.fujisawa")) + ("人間国宝" "http://www.asahi.com/culture/kokuhou/" + ,@(shimbun-asahi-make-regexp "culture.kokuhou")) + ("いつかは名人会" "http://www.asahi.com/culture/column/rakugo/guide/" + ,@(shimbun-asahi-make-regexp "culture.column.rakugo.guide")) + ("落語って" "http://www.asahi.com/culture/column/rakugo/kyosu/" + ,@(shimbun-asahi-make-regexp "culture.column.rakugo.kyosu")) + ("ラクゴロク" "http://www.asahi.com/culture/column/rakugo/rakugoroku/" + ,@(shimbun-asahi-make-regexp "culture.column.rakugo.rakugoroku")) + ("連載記事" "http://www.asahi.com/culture/serial_backnumber.html" + ,@culture) + ("ゆるゆるフェミニン" "http://www.asahi.com/culture/column/yurufemi/" + ,@(shimbun-asahi-make-regexp "culture.column.yurufemi"))) + ("digital" + ("機器" "http://www.asahi.com/digital/av/" + ,@(shimbun-asahi-make-regexp "digital.av")) + ("e-ビジネス情報 (提供: BCN)" "http://www.asahi.com/digital/bcnnews/" + ,@(shimbun-asahi-make-regexp "digital.bcnnews")) + ("コラム" "http://www.asahi.com/digital/column01/" + ,@(shimbun-asahi-make-regexp "digital.column01")) + ("ネット・ウイルス" "http://www.asahi.com/digital/internet/" + ,@(shimbun-asahi-make-regexp "digital.internet")) + ("携帯電話" "http://www.asahi.com/digital/mobile/" + ,@(shimbun-asahi-make-regexp "digital.mobile")) + ("日刊工業新聞ニュース" "http://www.asahi.com/digital/nikkanko/" + ,@(shimbun-asahi-make-regexp "digital.nikkanko")) + ("PC・ゲーム" "http://www.asahi.com/digital/pc/" + ,@(shimbun-asahi-make-regexp "digital.pc"))) + ("edu" + ("入試" "http://www.asahi.com/edu/news/examination.html" ,@edu) + ("ゆき姐の子育て応援エッセー" "http://www.asahi.com/edu/column/ikuji/" + ,@(shimbun-asahi-make-regexp "edu.column.ikuji")) + ("教育問題" "http://www.asahi.com/edu/news/issue.html" ,@edu) + ("この記事を手がかりに" "http://www.asahi.com/edu/nie/kiji/" + ,@(shimbun-asahi-make-regexp "edu.nie.kiji.kiji")) + ("子育て" "http://www.asahi.com/edu/news/kosodate.html" ,@edu) + ("教育制度・話題" "http://www.asahi.com/edu/news/system.html" ,@edu) + ("ののちゃんのDO科学" "http://www.asahi.com/edu/nie/tamate/" + ,@(shimbun-asahi-make-regexp "edu.nie.tamate.kiji")) + ("大学" "http://www.asahi.com/edu/news/university.html" ,@edu)) + ("food" + ("季節のおいしいコラム" "http://www.asahi.com/food/cooking/" + ,@(shimbun-asahi-make-regexp "food.cooking")) + ("岸朝子「暮らしを楽しむお取り寄せ」" + "http://www.asahi.com/shopping/food/kishi/" + ,(concat "" s0 + ;; 6. subject + "\\(" no-nl "\\)" + "\\(?:" s0 "<[^>]+>\\)*[^<]*([01]?[0-9]/[0-3]?[0-9])") + 1 nil 2 6 3 4 5) + ("料理メモ" "http://www.asahi.com/food/memo/" + ,@(shimbun-asahi-make-regexp "food.memo")) + ("「神の雫」作者のノムリエ日記" + "http://www.asahi.com/food/column/nommelier/" + ,@(shimbun-asahi-make-regexp "food.column.nommelier")) + ("おいしさ発見" "http://www.asahi.com/food/column/oishisa/" + ,@(shimbun-asahi-make-regexp "food.column.oishisa")) + ("論より、おやつ" "http://www.asahi.com/food/column/oyatsu/" + ,@(shimbun-asahi-make-regexp "food.column.oyatsu")) + ("スイーツの心得" "http://www.asahi.com/food/column/sweets/" + ,@(shimbun-asahi-make-regexp "food.column.sweets")) + ("ワインの歳時記" "http://www.asahi.com/food/column/wine_saijiki/" + ,@(shimbun-asahi-make-regexp "food.column.wine_saijiki"))) + ("health" + ("健康・生活" "http://www.asahi.com/health/news/" ,@health) + ("福祉・高齢" "http://www.asahi.com/health/news/aged.html" ,@health) + ("認知症特集" "http://www.asahi.com/health/news/alz.html" ,@health) + ("医療・病気" "http://www.asahi.com/health/news/medical.html" ,@health)) + ("housing" + ("戸建て" "http://www.asahi.com/ad/clients/kodatenavi/news/" + ,@(shimbun-asahi-make-regexp "ad.clients.kodatenavi.news")) + ("マンション" "http://www.asahi.com/ad/clients/mansionnavi/news/" + ,@(shimbun-asahi-make-regexp "ad.clients.mansionnavi.news")) + ("天野彰のいい家いい家族" "http://www.asahi.com/housing/amano/" + ,@(shimbun-asahi-make-regexp "housing.amano")) + ("住まいのお役立ちコラム" "http://www.asahi.com/housing/column/" + ,@(shimbun-asahi-make-regexp "housing.column")) + ("小さな家の生活日記" "http://www.asahi.com/housing/diary/" + ,@(shimbun-asahi-make-regexp "housing.diary")) + ("住宅新報社ニュース" "http://www.asahi.com/housing/jutaku-s/" + ,@(shimbun-asahi-make-regexp "housing.jutaku-s")) + ("ここが知りたい" "http://www.asahi.com/housing/soudan/index_s.html" + ,@(shimbun-asahi-make-regexp "housing.soudan")) + ("世界のウチ" "http://www.asahi.com/housing/world/" + ,@(shimbun-asahi-make-regexp "housing.world"))) + ("igo" + ("トピックス" "http://www.asahi.com/igo/topics/" + ,@(shimbun-asahi-make-regexp "igo.topics"))) + ("international.asia" + ("アジアの街角" "http://www.asahi.com/international/asiamachi/" + ,@(shimbun-asahi-make-regexp "international.asiamachi")) + ("人民日報" "http://www.asahi.com/international/jinmin/" + ,@(shimbun-asahi-make-regexp "international.jinmin")) + ("コリアうめーや!!" "http://www.asahi.com/international/korea/" + ,@(shimbun-asahi-make-regexp "international.korea")) + ("スパイシー!ソウル" "http://www.asahi.com/international/seoul/" + ,@(shimbun-asahi-make-regexp "international.seoul")) + ("週刊アジア" "http://www.asahi.com/international/weekly-asia/" + ,@(shimbun-asahi-make-regexp "international.weekly-asia"))) + ("international.column" + ("船橋洋一の世界ブリーフィング" + "http://opendoors.asahi.com/syukan/briefing/index.shtml" + ,(concat + "No\\.[0-9]+ \\[ 週刊朝日" + ;; 3. year + "\\(20[0-9][0-9]\\)" + "年" + ;; 4. month + "\\([01]?[0-9]\\)" + "月" + ;; 5. day + "\\([0-3]?[0-9]\\)" + "[^]]+\\]
" + ;; 6. subject + "\\([^<]+\\)") + 1 2 nil 6 3 4 5) + ("姿月あさとの「独り言」" "http://www.asahi.com/international/shizuki/" + ,@(shimbun-asahi-make-regexp "international.shizuki"))) + ("international.special" + ("国際支援の現場から" "http://www.asahi.com/international/shien/" + ,(concat + "【@[^】]+】[\t\n -]*\\(?:" s0 "<[^>]+>\\)*" s0 + ;; 6. subject + "\\([^\n<>]+\\)") + 1 nil 2 6 3 4 5) + ("鳥インフルエンザ" "http://www.asahi.com/special/051102/" + ,@(shimbun-asahi-make-regexp "special.051102")) + ("日中関係" "http://www.asahi.com/special/050410/" + ,@(shimbun-asahi-make-regexp "special.050410")) + ("地球環境" "http://www.asahi.com/special/070110/" + ,@(shimbun-asahi-make-regexp "special.070110")) + ("北朝鮮拉致事件" "http://www.asahi.com/special/abductees/" + ,@(shimbun-asahi-make-regexp "special.abductees")) + ("BSE問題" "http://www.asahi.com/special/bse/" + ,@(shimbun-asahi-make-regexp "special.bse")) + ("イラク情勢" "http://www2.asahi.com/special/iraq/" + ,@(shimbun-asahi-make-regexp "special.iraq")) + ("中東和平" "http://www.asahi.com/special/MiddleEast/" + ,@(shimbun-asahi-make-regexp "special.MiddleEast")) + ("北朝鮮核問題" "http://www.asahi.com/special/nuclear/" + ,@(shimbun-asahi-make-regexp "special.nuclear")) + ("中国特集" "http://www.asahi.com/world/china/" + ,@(shimbun-asahi-make-regexp "world.china.news"))) + ("international.world" + ("アフリカ" "http://www.asahi.com/international/africa.html" + ,@international) + ("国連・その他" "http://www.asahi.com/international/etc.html" + ,@international) + ("ヨーロッパ" "http://www.asahi.com/international/europe.html" + ,@international) + ("中東" "http://www.asahi.com/international/middleeast.html" + ,@international) + ("北米" "http://www.asahi.com/international/namerica.html" + ,@international) + ("オセアニア" "http://www.asahi.com/international/oceania.html" + ,@international) + ("中南米" "http://www.asahi.com/international/samerica.html" + ,@international)) + ("job" + ("週刊朝日・AERAから" "http://www.asahi.com/job/special/" + ,@(let ((def (shimbun-asahi-make-regexp "job.special"))) + (cons (concat (car def) + "\\(?:" s0 "<[^>]+>\\)*" s0 "(" s0 + ;; 7. extra + "\\(" no-nl "\\)" + ":") + (append (cdr def) '(nil 7)))))) + ("kansai" + ("関西芸能ニュース" "http://www.asahi.com/kansai/entertainment/news/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.news")) + ("イベント" "http://www.asahi.com/kansai/event/" + ,@(shimbun-asahi-make-regexp "kansai.event"))) + ("kansai.entertainment" + ("米朝口まかせ" "http://www.asahi.com/kansai/entertainment/beichou/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.beichou")) + ("勝手に関西世界遺産" + "http://www.asahi.com/kansai/entertainment/kansaiisan/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.kansaiisan")) + ("教えて!関西っ子" + "http://www.asahi.com/kansai/entertainment/kansaikko/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.kansaikko")) + ("三枝の笑ウインドウ" + "http://www.asahi.com/kansai/entertainment/sanshi/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.sanshi")) + ("千客万歳!" "http://www.asahi.com/kansai/entertainment/senkyaku/" + ,@(shimbun-asahi-make-regexp "kansai.entertainment.senkyaku"))) + ("kansai.kokoro" + ("○○のひみつ" "http://www.asahi.com/kansai/kokoro/himitsu/" + ,@(shimbun-asahi-make-regexp "kansai.kokoro.himitsu")) + ("祈りの美" "http://www.asahi.com/kansai/kokoro/inori/" + ,@(shimbun-asahi-make-regexp "kansai.kokoro.inori")) + ("ピンホールの目" "http://www.asahi.com/kansai/kokoro/pinhole/" + ,@(shimbun-asahi-make-regexp "kansai.kokoro.pinhole")) + ("語りあう" "http://www.asahi.com/kansai/kokoro/taidan/" + ,@(shimbun-asahi-make-regexp "kansai.kokoro.taidan")) + ("とみこうみ" "http://www.asahi.com/kansai/kokoro/tomikoumi/" + ,@(shimbun-asahi-make-regexp "kansai.kokoro.tomikoumi"))) + ("kansai.sumai" + ("ぷらっと沿線紀行" "http://www.asahi.com/kansai/sumai/ensen/" + ,@(shimbun-asahi-make-regexp "kansai.sumai.ensen")) + ("街を恋う" "http://www.asahi.com/kansai/sumai/machi/" + ,@(shimbun-asahi-make-regexp "kansai.sumai.machi")) + ("関西の住まい" "http://www.asahi.com/kansai/sumai/news/" + ,@(shimbun-asahi-make-regexp "kansai.sumai.news"))) + ("kansai.taberu" + ("デパ地下NEWS" "http://www.asahi.com/kansai/taberu/depa/" + ,@(shimbun-asahi-make-regexp "kansai.taberu.depa")) + ("季語をいただく" "http://www.asahi.com/kansai/taberu/kigo/" + ,@(shimbun-asahi-make-regexp "kansai.taberu.kigo")) + ("まんぷく会のランチタイム" + "http://www.asahi.com/kansai/taberu/manpuku/" + ,@(shimbun-asahi-make-regexp "kansai.taberu.manpuku")) + ("パーンとスイーツ" "http://www.asahi.com/kansai/taberu/pan_sweets/" + ,@(shimbun-asahi-make-regexp "kansai.taberu.pan_sweets")) + ("やさしい肴" "http://www.asahi.com/kansai/taberu/sakana/" + ,@(shimbun-asahi-make-regexp "kansai.taberu.sakana"))) + ("life.column" + ("心地よい生活の知恵" "http://www.asahi.com/life/column/chie/" + ,@(shimbun-asahi-make-regexp "life.column.chie")) + ("私のミカタ" "http://www.asahi.com/life/column/mikata/" + ,@(shimbun-asahi-make-regexp "life.column.mikata\\(?:/sasaki\\)?")) + ("荻原博子の“がんばれ!家計”" + "http://www.asahi.com/life/column/ogiwara/" + ,@(shimbun-asahi-make-regexp "life.column.ogiwara"))) + ("national" + ("災害・交通情報" "http://www.asahi.com/national/calamity.html" + ,@national) + ("その他・話題" "http://www.asahi.com/national/etc.html" ,@national) + ("事件・事故" "http://www.asahi.com/national/incident.html" ,@national) + ("裁判" "http://www.asahi.com/national/trial.html" ,@national) + ("おくやみ" "http://www.asahi.com/obituaries/" + ,(format (car default) "obituaries") ,@(cdr default))) + ("politics" + ("国政" "http://www.asahi.com/politics/government.html" ,@politics) + ("地方政治" "http://www.asahi.com/politics/local.html" ,@politics)) + ("shopping.column" + ("楽天こだわり店長に聞く" "http://www.asahi.com/shopping/column/master/" + ,@shopping) + ("暮らしを楽しむ" "http://www.asahi.com/shopping/column/tatsujin/" + ,@shopping)) + ("shopping.yakimono" + ("小野公久「やきものガイド」" + "http://www.asahi.com/shopping/yakimono/ono/" ,@shopping2) + ("ロバート・イエリン「やきもの散歩道」" + "http://www.asahi.com/shopping/yakimono/yellin/" ,@shopping2)) + ("shougi" + ("本" "http://www.asahi.com/shougi/books/" + ,@(shimbun-asahi-make-regexp "shougi.books")) + ("ニュース" "http://www.asahi.com/shougi/news/" + ,@(shimbun-asahi-make-regexp "shougi.news")) + ("トピックス" "http://www.asahi.com/shougi/topics/" + ,@(shimbun-asahi-make-regexp "shougi.topics"))) + ("sports.baseball" + ("アマチュア野球" "http://www.asahi.com/sports/bb/ama.html" ,@baseball) + ("大リーグ" "http://www.asahi.com/sports/bb/mlb.html" ,@baseball) + ("プロ野球" "http://www.asahi.com/sports/bb/pro.html" ,@baseball)) + ("sports.battle" + ("格闘技" "http://www.asahi.com/sports/spo/battle.html" + ,@(shimbun-asahi-make-regexp "sports.\\(?:column\\|spo\\)")) + ("相撲" "http://www.asahi.com/sports/spo/sumo.html" ,@sports)) + ("sports.etc" + ("コラム" "http://www.asahi.com/sports/column/" + ,@(shimbun-asahi-make-regexp "sports.column")) + ("国外一般スポーツ" "http://www.asahi.com/sports/spo/kaigai.html" + ,@sports) + ("国内一般スポーツ" "http://www.asahi.com/sports/spo/kokunai.html" + ,@sports) + ("レーシング" "http://www.asahi.com/sports/spo/motor.html" ,@sports)) + ("sports.football" + ("日本代表" "http://www.asahi.com/sports/fb/japan/list.html" + ,@(shimbun-asahi-make-regexp "sports.fb.japan")) + ("Jリーグ・国内" "http://www.asahi.com/sports/fb/national.html" + ,@football) + ("海外" "http://www.asahi.com/sports/fb/world.html" ,@football)) + ("sports.golf" + ("男子ゴルフ" "http://www.asahi.com/sports/spo/golf_man.html" ,@sports) + ("女子ゴルフ" "http://www.asahi.com/sports/spo/golf_woman.html" + ,@sports)) + ("sports.rugby" + ("日本代表" "http://www.asahi.com/sports/spo/rugby_japan.html" ,@sports) + ("国内・その他" "http://www.asahi.com/sports/spo/rugby_national.html" + ,@sports)) + ("sports.usa" + ("NBA" "http://www.asahi.com/sports/spo/nba.html" ,@sports) + ("NFL" "http://www.asahi.com/sports/spo/nfl.html" ,@sports) + ("NHL" "http://www.asahi.com/sports/spo/nhl.html" ,@sports)) + ("sports.winter" + ("スケート・氷上競技" "http://www.asahi.com/sports/spo/skate.html" + ,@sports) + ("スキー・雪上競技" "http://www.asahi.com/sports/spo/ski.html" + ,@sports)) + ("travel" + ("旅する人のアペリティフ" "http://www.asahi.com/travel/aperitif/" + ,(format (car travel) "travel/aperitif") ,@(cdr travel)) + ("ぽれぽれサファリ" "http://www.asahi.com/travel/porepore/" + ,@(shimbun-asahi-make-regexp "travel.porepore")) + ("島旅たび" "http://www.asahi.com/travel/shima/" + ,(format (car travel) "travel/shima") ,@(cdr travel)) + ("週刊シルクロード紀行" "http://www.asahi.com/travel/silkroad/" + ,@(shimbun-asahi-make-regexp "travel.silkroad")) + ("愛の旅人" "http://www.asahi.com/travel/traveler/" + ,(format (car travel) "travel/traveler") ,@(cdr travel))))) + "Alist of parent groups and lists of tables for subgroups. +Each table is the same as the `cdr' of the element of +`shimbun-asahi-group-table'.") (defvar shimbun-asahi-content-start - "\ + "\ +\\|\ +\\(?:[\t\n ]*[\t\n ]*\ +\\|[\t\n ]*[\t\n ]*\\)?\ +\\|\ \\|") (defvar shimbun-asahi-content-end - "\ + "\ +\\|\ +\\|\ +\\|\ +\\|") + +(defvar shimbun-asahi-text-content-start + "\ +\\|\ +\\(?:[\t\n ]*[\t\n ]*\ +\\|[\t\n ]*[\t\n ]*\\)?\ +\\|\ +\\|") + +(defvar shimbun-asahi-text-content-end + "\ +\\|\ +\\|\ \\|") (defvar shimbun-asahi-x-face-alist - '(("default" . "X-Face: +Oh!C!EFfmR$+Zw{dwWW]1e_>S0rnNCA*CX|\ -bIy3rr^gW5)Q]N{Mmn\n L]suPpL|gFjV{S|]a-:)\\FR\ -7GRf9uL:ue5_=;h{V%@()={uTd@l?eXBppF%`6W%;h`#]2q+f*81n$B\n h|t"))) + '(("default" . "\ +Face: iVBORw0KGgoAAAANSUhEUgAAAEIAAAAQBAMAAABQPLQnAAAAElBMVEX8rKjd3Nj+7utdXFr + ////oOTn0UMNfAAAA90lEQVQoz21SQWoDMQwUprlXWA8IZvsAd/yA2KsHLKX+/1c6cklI2EgGeTW + jwYxW/F2Uq0zGIcWHPAO5ut+SF7nMeyQ/Mb6OqwhnGSOE0gtjb9Q4JG33xqCYeM/mvVqUXOtY+Lp + 37XqbIp4BB9p/wef8IAF1BxQRRoaiIzcWQ4Vdfp2f0aiItKXRSWUxjhk1OjqR3NDYMomBkEVIdYy + 56Q6SbOEKlz0kQy5jZ95mYVvrQpWN0ADB9axMje/5QzAeXvsSbbQvqavxKA3QIpt655XHmOphcHo + YJJJOO5Kw7QiXSrh9JnAv47GmJ7tfGD7Wqrnp7e2f8AfqrGxn9j9f+QAAAABJRU5ErkJggg=="))) +;; '(("default" . "X-Face: +Oh!C!EFfmR$+Zw{dwWW]1e_>S0rnNCA*CX|\ +;;bIy3rr^gW5)Q]N{Mmn\n L]suPpL|gFjV{S|]a-:)\\FR\ +;;7GRf9uL:ue5_=;h{V%@()={uTd@l?eXBppF%`6W%;h`#]2q+f*81n$B\n h|t"))) (defvar shimbun-asahi-expiration-days 6) @@ -365,6 +989,8 @@ ;; successor `shimbun-asahi-html'. (shimbun-set-x-face-alist-internal shimbun shimbun-asahi-x-face-alist) (shimbun-set-expiration-days-internal shimbun shimbun-asahi-expiration-days) + (shimbun-set-content-start-internal shimbun shimbun-asahi-content-start) + (shimbun-set-content-end-internal shimbun shimbun-asahi-content-end) shimbun) (luna-define-method shimbun-groups ((shimbun shimbun-asahi)) @@ -376,10 +1002,16 @@ (luna-define-method shimbun-index-url ((shimbun shimbun-asahi)) (let* ((group (shimbun-current-group-internal shimbun)) - (index (nth 2 (assoc group shimbun-asahi-group-table)))) - (if (string-match "\\`http:" index) - index - (concat shimbun-asahi-url (format index group))))) + (index (or (nth 2 (assoc group shimbun-asahi-group-table)) + (concat (shimbun-subst-char-in-string ?. ?/ group) "/")))) + (cond ((not index) + "about:blank") + ((string-match "\\`http:" index) + index) + ((string-match "\\`book\\." group) + (shimbun-expand-url (substring index 5) "http://book.asahi.com/")) + (t + (shimbun-expand-url (format index group) shimbun-asahi-url))))) (defun shimbun-asahi-get-headers (shimbun) "Return a list of headers." @@ -387,157 +1019,180 @@ (from (concat (shimbun-server-name shimbun) " (" (shimbun-current-group-name shimbun) ")")) (case-fold-search t) - regexp jname numbers cyear cmonth rss-p paper-p en-category + regexp jname numbers book-p cyear cmonth rss-p paper-p en-category hour-min month year day serial num extra rgroup id headers - backnumbers) + travel-p subgroups iraq-p) (setq regexp (assoc group shimbun-asahi-group-table) jname (nth 1 regexp) numbers (nthcdr 4 regexp) - regexp (format (nth 3 regexp) - (regexp-quote (shimbun-subst-char-in-string - ?. ?/ group))) - cyear (decode-time) + book-p (string-match "\\`book\\." group)) + (when (setq regexp (nth 3 regexp)) + (setq regexp (format regexp + (regexp-quote (shimbun-subst-char-in-string + ?. ?/ (if book-p + (substring group 5) + group)))))) + (setq cyear (shimbun-decode-time nil 32400) cmonth (nth 4 cyear) cyear (nth 5 cyear) - rss-p (string-equal group "rss") - paper-p (member group '("editorial" "tenjin"))) + rss-p (member group '("book" "rss")) + paper-p (member group '("editorial" "tenjin")) + travel-p (string-equal group "travel") + subgroups (cdr (assoc group shimbun-asahi-subgroups-alist))) + (shimbun-strip-cr) + (goto-char (point-min)) (catch 'stop - ;; The loop for fetching all the articles in the whitemail group. + ;; The loop for fetching all the articles in the subgroups. (while t - (while (re-search-forward regexp nil t) - (cond ((string-equal group "english") - (setq en-category - (save-excursion - (save-match-data - (if (re-search-backward "\ -]+\\)?>[\t\n ]*\\([^&]+\\)[\t\n ]*&#[0-9]+" - nil t) - (downcase (match-string 2))))))) - (t - (setq hour-min - (save-excursion - (save-match-data - (if (re-search-forward "\ -]+>[\t\n ]*(\\([01]?[0-9]/[0-3]?[0-9][\t\n ]+\\)? + (when regexp + (while (re-search-forward regexp nil t) + (cond ((string-equal group "english") + (setq en-category + (save-excursion + (save-match-data + (if (re-search-backward "\ +]+\\)?>[\t\n ]*\\([^&]+\\)[\t\n ]*&#[0-9]+" + nil t) + (downcase (match-string 1))))))) + (t + (setq hour-min + (save-excursion + (save-match-data + (if (re-search-forward "\ +]+>[\t\n ]*(\\(?:[01]?[0-9]/[0-3]?[0-9][\t\n ]+\\)? \\([012]?[0-9]:[0-5][0-9]\\))[\t\n ]*
" - nil t) - (match-string 2))))))) - (setq month (string-to-number (match-string (nth 5 numbers))) - year (if (setq num (nth 4 numbers)) - (string-to-number (match-string num)) - (cond ((>= (- month cmonth) 2) - (1- cyear)) - ((and (= 1 month) (= 12 cmonth)) - (1+ cyear)) - (t - cyear))) - day (string-to-number (match-string (nth 6 numbers))) - serial (cond (rss-p - (format "%d%s.%s" - year - (match-string (nth 1 numbers)) - (match-string (nth 2 numbers)))) - (paper-p - (format "%d%02d%02d" year month day)) - ((and (setq num (nth 1 numbers)) - (match-beginning num)) - (format "%d%02d%02d.%s" - year month day (match-string num))) - (t - (shimbun-subst-char-in-string - ?/ ?. - (downcase (match-string (nth 2 numbers)))))) - extra (or (and (setq num (nth 8 numbers)) - (match-beginning num) - (match-string num)) - (and (setq num (nth 9 numbers)) - (match-beginning num) - (match-string num))) - rgroup (mapconcat 'identity - (nreverse (save-match-data - (split-string group "\\."))) - ".") - id (if (and extra - (not (member group '("job.special")))) - (concat "<" serial "%" extra "." rgroup "." - shimbun-asahi-top-level-domain ">") - (concat "<" serial "%" rgroup "." - shimbun-asahi-top-level-domain ">"))) - (unless (and (shimbun-search-id shimbun id) - (if backnumbers - (throw 'stop nil) - ;; Don't stop it since there might be more new - ;; articles even if the same links are repeated. - t)) - (push (shimbun-create-header - ;; number - 0 - ;; subject - (cond (rss-p - (match-string (nth 3 numbers))) - (en-category - (concat "[" en-category "] " - (match-string (nth 3 numbers)))) - ((and (setq num (nth 8 numbers)) - (match-beginning num)) - (concat "[" (match-string num) "] " - (match-string (nth 3 numbers)))) - ((and (setq num (nth 9 numbers)) - (match-beginning num)) - (concat "[" (match-string num) "] " - (match-string (nth 3 numbers)))) - (paper-p - (concat jname (format " (%d/%d)" month day))) - (t - (match-string (nth 3 numbers)))) - ;; from - (if (and rss-p - (setq num (nth 10 numbers)) - (setq num (match-string num))) - (save-match-data - (shimbun-replace-in-string - from "(RSS" (concat "\\&:" num))) - from) - ;; date - (shimbun-make-date-string - year month day (cond ((and (setq num (nth 7 numbers)) - (match-beginning num)) - (match-string num)) - (paper-p - "07:00") - (t - hour-min))) - ;; id - id - ;; references, chars, lines - "" 0 0 - ;; xref - (shimbun-expand-url - (match-string (nth 0 numbers)) - (if paper-p - (concat shimbun-asahi-url "paper/") - shimbun-asahi-url))) - headers))) - (if (string-equal group "nankyoku.whitemail") + nil t) + (match-string 1))))))) + (setq month (string-to-number (match-string (nth 5 numbers))) + year (if (setq num (nth 4 numbers)) + (string-to-number (match-string num)) + (cond ((>= (- month cmonth) 2) + (1- cyear)) + ((and (= 1 month) (= 12 cmonth)) + (1+ cyear)) + (t + cyear))) + day (string-to-number (match-string (nth 6 numbers))) + serial (cond (rss-p + (if (match-beginning (nth 1 numbers)) + (format "%d%s.%s" + year + (match-string (nth 1 numbers)) + (match-string (nth 2 numbers))) + (match-string (nth 2 numbers)))) + (paper-p + (format "%d%02d%02d" year month day)) + ((and (setq num (nth 1 numbers)) + (match-beginning num)) + (format "%d%02d%02d.%s" + year month day (match-string num))) + (t + (shimbun-subst-char-in-string + ?/ ?. + (downcase (match-string (nth 2 numbers)))))) + extra (or (and (setq num (nth 8 numbers)) + (match-beginning num) + (match-string num)) + (and (setq num (nth 9 numbers)) + (match-beginning num) + (match-string num))) + rgroup (mapconcat 'identity + (nreverse (save-match-data + (split-string group "\\."))) + ".") + id (if (and extra + (not (save-match-data + (string-match "週刊朝日・AERAから" + from)))) + (concat "<" serial "%" extra "." rgroup "." + shimbun-asahi-top-level-domain ">") + (concat "<" serial "%" rgroup "." + shimbun-asahi-top-level-domain ">"))) + (unless (shimbun-search-id shimbun id) + (push (shimbun-create-header + ;; number + 0 + ;; subject + (cond (rss-p + (match-string (nth 3 numbers))) + (en-category + (concat "[" en-category "] " + (match-string (nth 3 numbers)))) + ((and (setq num (nth 8 numbers)) + (match-beginning num)) + (concat "[" (match-string num) "] " + (match-string (nth 3 numbers)))) + ((and (setq num (nth 9 numbers)) + (match-beginning num)) + (concat "[" (match-string num) "] " + (match-string (nth 3 numbers)))) + (paper-p + (concat jname (format " (%d/%d)" month day))) + (travel-p + (save-match-data + (shimbun-replace-in-string + (match-string (nth 3 numbers)) + "\\(?:[\t\n  ]*&#[0-9]+;\\)*[\t\n  ]*" ""))) + (t + (match-string (nth 3 numbers)))) + ;; from + (if (and rss-p + (setq num (nth 10 numbers)) + (setq num (match-string num))) + (save-match-data + (when (and book-p + (string-match + "\\`書評 \\[評者\\]\\(その他\\)?" num)) + (setq num (if (match-beginning 1) + "書評" + (substring num (match-end 0))))) + (shimbun-replace-in-string + from "(RSS" (concat "(" num))) + from) + ;; date + (shimbun-make-date-string + year month day + (cond ((and (setq num (nth 11 numbers)) + (match-beginning num)) + (concat (match-string num) ":" + (match-string (nth 12 numbers)))) + ((and (setq num (nth 7 numbers)) + (match-beginning num)) + (match-string num)) + (paper-p + "07:00") + (t + hour-min))) + ;; id + id + ;; references, chars, lines + "" 0 0 + ;; xref + (shimbun-expand-url + (match-string (nth 0 numbers)) + (cond (paper-p + (concat shimbun-asahi-url "paper/")) + (book-p + "http://book.asahi.com/") + ((string-match "船橋洋一の世界ブリーフィング" from) + "http://opendoors.asahi.com/syukan/briefing/") + (iraq-p + "http://www2.asahi.com/") + (t + shimbun-asahi-url)))) + headers))) + (when (string-match "私のミカタ" from) + (setq headers (nreverse headers)))) + (if subgroups (progn - (cond ((eq backnumbers 'stop) - (throw 'stop nil)) - ((null backnumbers) - (while (re-search-forward "" - nil t) - (unless (member (setq id (match-string 1)) backnumbers) - (push id backnumbers))))) - (if backnumbers - (progn - (shimbun-retrieve-url - (prog1 - (car backnumbers) - (erase-buffer) - (unless (setq backnumbers (cdr backnumbers)) - (setq backnumbers 'stop))))) - (throw 'stop nil))) + (erase-buffer) + (setq from (concat (shimbun-server-name shimbun) + " (" (caar subgroups) ")") + iraq-p (string-equal (caar subgroups) "イラク情勢")) + (shimbun-retrieve-url (cadar subgroups)) + (setq regexp (caddar subgroups) + numbers (cdddar subgroups) + subgroups (cdr subgroups))) (throw 'stop nil)))) (append (shimbun-sort-headers headers) (shimbun-asahi-get-headers-for-today group jname from)))) @@ -552,22 +1207,27 @@ (goto-char (point-min)) (let ((basename (cdr (assoc group '(("editorial" . "editorial") ("tenjin" . "column"))))) - year month day url) + year cmonth month day url) (when (and basename (re-search-forward - (concat - ;; 1. year - "\\(20[0-9][0-9]\\)" "年" - ;; 2. month - "\\([01]?[0-9]\\)" "月" - ;; 3. day - "\\([0-3]?[0-9]\\)" "日" - "(.曜日)付") + (eval-when-compile + (concat + "/\\(?:editorial\\|column\\)\\.html\"[^\n0-9]+" + ;; 1. month + "\\([01]?[0-9]\\)" "月" + ;; 2. day + "\\([0-3]?[0-9]\\)" "日付")) nil t)) - (setq year (string-to-number (match-string 1)) - month (string-to-number (match-string 2)) - day (string-to-number (match-string 3)) - url (format "paper/%s%d%02d%02d.html" basename year month day)) + (setq year (shimbun-decode-time nil 32400) + cmonth (nth 4 year) + year (nth 5 year) + month (string-to-number (match-string 1)) + day (string-to-number (match-string 2))) + (cond ((and (= cmonth 1) (= month 12)) + (decf year)) + ((and (= cmonth 12) (= month 1)) + (incf year))) + (setq url (format "paper/%s%d%02d%02d.html" basename year month day)) (list (shimbun-make-header ;; number @@ -587,100 +1247,363 @@ ;; xref (shimbun-expand-url url shimbun-asahi-url)))))) +(defun shimbun-asahi-multi-next-url (shimbun header url) + (goto-char (point-min)) + (when (and (re-search-forward "\ +]+[\t\n ]+\\)*class=\"SeqNav forSplit\"" + nil t) + (shimbun-end-of-tag "div" t)) + (let ((end (match-beginning 0))) + (prog1 + (when (re-search-backward "\ +]*>[\t\n ]*次ページ[\t\n ]*" + end 'move) + (goto-char end) + (shimbun-expand-url (match-string 1) url)) + (if (and (re-search-backward "[^\t\n >]\\([\t\n ]*<\\)" nil t) + (re-search-forward "[\t\n ]*<[\t\n ]*[^/]" end t)) + (delete-region (match-beginning 0) end) + (goto-char end)) + (insert "\n"))))) + +(luna-define-method shimbun-multi-next-url ((shimbun shimbun-asahi) + header url) + (shimbun-asahi-multi-next-url shimbun header url)) + (defun shimbun-asahi-prepare-article (shimbun header) "Prepare an article. -Extract the article core on some groups or adjust a date header if -there is a correct information available. For the groups editorial -and tenjin, it tries to fetch the article for that day if it failed." +For the groups editorial and tenjin, it tries to fetch the article for +that day if it failed." (let ((case-fold-search t) - (group (shimbun-current-group-internal shimbun))) + (group (shimbun-current-group-internal shimbun)) + (from (shimbun-header-from-internal header))) (cond + ((string-equal group "car") + (shimbun-remove-tags "\ +\[\t\n ]*" + "\ +\ +\[\t\n ]*") + (goto-char (point-min)) + (when (and (re-search-forward (shimbun-content-start shimbun) nil t) + (re-search-forward "\ +\[\t\n ]*\n"))) + ((string-equal group "digital") + (shimbun-remove-tags "\ +\[\t\n ]*" + "\ +\ +\[\t\n ]*") + (cond ((string-match "コラム" from) + (unless (re-search-forward (shimbun-content-end shimbun) nil t) + (when (re-search-forward "\\(?:[\t\b ]*<[^>]+>\\)*[\t\n ]*\ +\\(?:]*[\t\n ]*alt=\"プロフィール\"\ +\\|プロフィール\\)" + nil t) + (goto-char (match-beginning 0)) + (insert "\n\n")))))) ((string-equal group "editorial") - (let ((regexp "\ -]+\\)?>[\t\n ]*") + (let ((url (shimbun-header-xref header)) (retry 0) - index) - (while (<= retry 1) - (if (re-search-forward regexp nil t) + start) + (while retry + (if (progn + (while (and (re-search-forward "\ +<\\(h[0-9]+\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*class=\"bdr_btm_2px" + nil t) + (shimbun-end-of-tag (match-string 1) t) + (if start + (progn + (delete-region + (goto-char (match-beginning 0)) + (match-beginning 1)) + (insert "\n \n") + (forward-char 1)) + (setq start (match-beginning 1))))) + (and start + (re-search-forward "[\t\n ]*\ +\\(?:]+[\t\n ]+\\)*class=\"FollowLnk\ +\\|]+[\t\n ]+\\)*class=\"TopLnk\"\ +\\|]+[\t\n ]+\\)*class=\"PrInfo\"\\)" + nil t))) (progn (goto-char (match-beginning 0)) + (setq retry nil) + (insert "\n") + (goto-char start) (insert "") - (when index + (when (string-match "/editorial\\.html\\'" url) (insert "\ -\n

(指定された url が まだ/すでに 無いので、\ -トップページ から記事を取得しました)

\n")) - (search-forward "" nil t) - (while (re-search-forward regexp nil t)) - (when (re-search-forward "[\n\t ]*

" nil t) - (insert "\n")) - (setq retry 255)) +\n

(指定された url が まだ/すでに 無いので、\ +トップページ から記事を取得しました)

\n"))) (erase-buffer) - (if (zerop retry) - (progn - (shimbun-retrieve-url (setq index - (shimbun-index-url shimbun))) - (goto-char (point-min))) - (insert "Couldn't retrieve the page.\n"))) - (setq retry (1+ retry))))) + (if (= retry 1) + (setq retry nil) + (setq url "http://www.asahi.com/paper/editorial.html" + retry 1 + start nil) + (shimbun-header-set-xref header url) + (shimbun-fetch-url shimbun url) + (goto-char (point-min))))))) + ((string-equal group "food") + (when (and (re-search-forward (shimbun-content-start shimbun) nil t) + (re-search-forward "[\t\n ]*\n"))) + ((string-equal group "housing") + (shimbun-remove-tags + "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*" + "[\t\n ]*\\(?:<[^>]+>[\t\n ]*\\)*") + (when (string-match "マンション\\|戸建て" from) + (goto-char (point-min)) + (re-search-forward "[\t\n ]*\ +\\(?:<[^>]+>[\t\n ]*\\)*" + nil t) + (insert "") + (when (re-search-forward "[\t\n ]*\\(?:<[^>]+>[\t\n ]*\\)*" + nil 'move) + (goto-char (match-beginning 0)) + (insert "")))) + ((string-equal group "rss")) ((string-equal group "tenjin") - (let ((retry 0) - index) - (while (<= retry 1) - (if (and (search-forward "【天声人語】" nil t) - (re-search-forward "]+>[\t\n ]*" nil t)) - (progn - (insert "") - (when index + (let ((url (shimbun-header-xref header)) + (retry 0) + start) + (while retry + (if (and (re-search-forward "\ +

20[0-9][0-9]年[01]?[0-9]月[0-3]?[0-9]日([日月火水木金土])付

\ +\\(\\(?:[\t\n ]*印刷\\)?[\t\n ]*<[^>]+>\\)+[\t\n ]*" + nil t) + (progn + (setq start (match-end 0)) + (re-search-forward "[\t\n ]*

" nil t))) + (save-restriction + (narrow-to-region start (goto-char (match-beginning 0))) + (setq retry nil) + (insert "

\n") + (goto-char start) + (insert "

") + (when (string-match "/column\\.html\\'" url) (insert "\ -\n

(指定された url が まだ/すでに 無いので、\ -トップページ から記事を取得しました)

\n")) - (while (re-search-forward "[\t\n ]*]+>[\t\n ]*" - nil t) - (delete-region (match-beginning 0) (match-end 0))) - (when (re-search-forward "[\t\n ]*" nil t) - (goto-char (match-beginning 0)) - (insert "\n")) - (setq retry 255)) +\n

(指定された url が まだ/すでに 無いので、\ +トップページ から記事を取得しました)

\n")) + (while (re-search-forward + (eval-when-compile + (concat "[▼" + (condition-case nil + (list (make-char 'mule-unicode-2500-33ff + 33 124)) + (error nil)) + "]")) + nil t) + (replace-match "。

\n

 "))) (erase-buffer) - (if (zerop retry) - (progn - (shimbun-retrieve-url (setq index - (shimbun-index-url shimbun))) - (goto-char (point-min))) - (insert "Couldn't retrieve the page.\n"))) - (setq retry (1+ retry))))) - (t - (when (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 1. year - "\\(20[0-9][0-9]\\)年" - ;; 2. month - "\\([01]?[0-9]\\)月" - ;; 3. day - "\\([0-3]?[0-9]\\)日" - ;; 4. hour - "\\([012]?[0-9]\\)時" - ;; 5. minute - "\\([0-5]?[0-9]\\)分" - s0 "

"))) - nil t) - (shimbun-header-set-date - header - (shimbun-make-date-string - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3)) - (concat (match-string 4) ":" (match-string 5)) - "+0900")))))) - (goto-char (point-min))) + (if (= retry 1) + (setq retry nil) + (setq url "http://www.asahi.com/paper/column.html" + retry 1 + start nil) + (shimbun-header-set-xref header url) + (shimbun-fetch-url shimbun url) + (goto-char (point-min))))))) + ((string-match "\\`book\\(?:\\.\\|\\'\\)" group) + (while (re-search-forward "\\(]+>\\)\ +\[\t\n ]*]+>[\t\n ]*" + nil t) + (when (save-match-data + (search-backward "alt=\"No image\"" (match-beginning 0) t)) + (replace-match "\\1No image")))) + ((string-match "\\`shopping\\." group) + (when (re-search-forward "\ +[\t\n ]*\ +]+>[\t\n ]*\\([^<]+\\)

[\t\n ]*\ +[\t\n ]*20[0-9][0-9]年[01]?[0-9]月[0-3]*[0-9]日[\t\n ]*\ +

[\t\n ]*" + nil t) + (replace-match "\\1
\n"))) + ((string-match "ののちゃんのDO科学" from) + ;; Remove furigana. + (while (re-search-forward "\\(\\cj\\)(\\cH+)" nil t) + (replace-match "\\1"))) + ((string-match "ゆるゆるフェミニン" from) + (let (comics) + (while (re-search-forward + "]+alt=\"マンガ\"[^>]*>" + nil t) + (push (match-string 0) comics)) + (erase-buffer) + (when comics + (insert "\n" + (mapconcat 'identity comics "
\n") + "\n\n")))) + ((string-match "船橋洋一の世界ブリーフィング" from) + (when (re-search-forward "\ +]+[\t\n ]+alt=\"船橋洋一顔写真\">" + nil t) + (goto-char (match-beginning 0)) + (insert "") + (when (re-search-forward "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +\\(?:\ +\\|\\)" + nil t) + (goto-char (match-beginning 0)) + (insert "\n")))) + ((string-match "中国特集" from) + (let (start) + (when (and (re-search-forward "\ +

中国最新ニュース

[\t\n ]*

[^>]+

[\t\n ]*" + nil t) + (progn + (setq start (match-end 0)) + (re-search-forward "\ +]*>[\t\n ]*([01][0-9]/[0-3][0-9])[\t\n ]*

" + nil t))) + (delete-region (match-end 0) (point-max)) + (insert "\n") + (delete-region (point-min) (goto-char start)) + (insert "\n")))) + ((string-match "東洋経済ニュース" from) + ;; Insert newlines. + (shimbun-with-narrowed-article + shimbun + (while (re-search-forward "。 ?\\(\\cj\\)" nil t) + (replace-match "。

 \\1")))) + ((string-match "藤沢周平の世界\\|人間国宝" from) + (when (re-search-forward "\ +[\t\n ]*" + nil t) + (insert "\n\n") + (when (re-search-forward "\ +\\(?:[\t\n ]*<[^>]+>\\)?\\(?:[\t\n ]*20[0-9][0-9]年[01]?[0-9]月[0-3]?[0-9]日\ +\\(?:[\t\n ]*<[^>]+>\\)*\\)?[\t\n ]*\n"))))) + (shimbun-with-narrowed-article + shimbun + ;; Remove sitesearch area. + (when (re-search-forward "[\t\n ]*\\(?:]+>[\t\n ]*\\)+\ +この記事の関連情報をアサヒ・コム内で検索する" + nil t) + (goto-char (match-beginning 0)) + (insert "\n")) + ;; Remove ads. + (goto-char (point-min)) + (when (re-search-forward "[\t\n ]*[\t\n ]\ +*ここから広告です[\t\n ]*

" + nil t) + (let ((start (match-beginning 0))) + (when (re-search-forward "[\t\n ]*\ +広告終わり\\(?:[\t\n ]*

[\t\n ]*\\|\\'\\)" + nil t) + (delete-region start (match-end 0))))) + ;; Remove trailing garbage. + (goto-char (point-min)) + (when (and (not (string-match "ゆるゆるフェミニン" from)) + (re-search-forward + "\\(?:

\\)?\\(\\(?:[\t\n  ]*<[^>]+>\\)+[\t\n  ]*\\'\\)" + nil t)) + (goto-char (match-beginning 0)) + (while (or (and (looking-at "[\t\n  ]*\\(]+>\\)[\t\n  ]*") + ;; Don't remove close tags. + (progn (replace-match "\\1") t)) + (and (looking-at "[\t\n  ]*<[^>]+>[\t\n  ]*\\|[\t\n  ]+") + (progn (replace-match "") t)))) + (goto-char (point-max)) + (unless (bolp) (insert "\n")))))) (luna-define-method shimbun-make-contents :before ((shimbun shimbun-asahi) header) (shimbun-asahi-prepare-article shimbun header)) +(defun shimbun-asahi-clear-contents (shimbun header) + (when (luna-call-next-method) + ;; Remove garbage after an article. + (goto-char (point-min)) + (when (re-search-forward + "[\t\n ]*" + nil t) + (delete-region (match-beginning 0) (point-max)) + (goto-char (point-min))) + ;; Remove forms and links. + (while (re-search-forward "[\t\n ]*\\(?:<\\(form\\)[\t\n ]\ +\\|<\\(div\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*class=\"Box2\"\\)" nil t) + (if (shimbun-end-of-tag (or (match-string 1) (match-string 2)) t) + (delete-region (match-beginning 0) (match-end 0)) + (delete-region (match-beginning 0) (point-max))) + (insert "\n")) + ;; Extract images in tables. + (let (imgs) + (while (re-search-forward "]+>[\t\n ]*\\)+

[\t ]*") + (delete-region (match-beginning 0) (match-end 0)))))) + ;; Remove zoom buttons. + (goto-char (point-min)) + (while (re-search-forward "[\t\n ]*]+\\)*\ +\[\t\n ]+class=\"ThmbZoomBtn\"[^>]*>[\t\n ]*" + nil t) + (replace-match "\n")) + ;; Add line breaks after images that captions or images follow. + (goto-char (point-min)) + (while (re-search-forward + "\\(]+>\\(?:[\t\n ]*]+>\\)*\\)[\t\n ]*" + nil t) + (when (or (save-match-data + (looking-at "\\(?:<[^\t\n >]+>[\t\n ]*\\)*[^<]+")) + (not (eq (char-after) ?<))) + (replace-match "\\1
\n"))) + ;; Remove related topics. + (goto-char (point-min)) + (while (re-search-forward "\ +<\\(div\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*class=\"LnkRelated\\(?:AsaD\\)?\"\ +\\|<\\(p\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*class=\"AsaDLnk\"" nil t) + (when (shimbun-end-of-tag (or (match-string 1) (match-string 2)) t) + (delete-region (match-beginning 0) (match-end 0)) + (insert "\n"))) + (unless (shimbun-prefer-text-plain-internal shimbun) + (shimbun-break-long-japanese-lines)) + t)) + +(luna-define-method shimbun-clear-contents :around ((shimbun shimbun-asahi) + header) + (shimbun-asahi-clear-contents shimbun header)) + +(defun shimbun-asahi-multi-clear-contents (shimbun header + has-previous-page + has-next-page) + (when (luna-call-next-method) + (when has-previous-page + (goto-char (point-min)) + (insert " \n") + (when (looking-at "[\t\n ]*

[\t\n ]*") + (delete-region (match-beginning 0) (match-end 0)))) + t)) + +(luna-define-method shimbun-multi-clear-contents :around ((shimbun + shimbun-asahi) + header + has-previous-page + has-next-page) + (shimbun-asahi-multi-clear-contents shimbun header + has-previous-page has-next-page)) + (provide 'sb-asahi) ;;; sb-asahi.el ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-atmarkit.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-atmarkit.el --- work/emacs-w3m-1.4.4/shimbun/sb-atmarkit.el 2005-03-10 06:51:09.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-atmarkit.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-atmarkit.el --- shimbun backend for atmarkit -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004, 2005 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 +;; NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news @@ -19,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -29,10 +30,10 @@ (require 'shimbun) (require 'sb-rss) +(require 'sb-multi) -(luna-define-class shimbun-atmarkit (shimbun-rss) ()) +(luna-define-class shimbun-atmarkit (shimbun-multi shimbun-rss) ()) -(defvar shimbun-atmarkit-from-address "info@atmarkit.co.jp") (defvar shimbun-atmarkit-coding-system 'euc-japan) (defvar shimbun-atmarkit-content-start "]*>") (defvar shimbun-atmarkit-content-end "]*>") @@ -41,7 +42,6 @@ '( ;; ニュース系 ;; NewsInsight ("news". "http://www.atmarkit.co.jp/rss/news/rss2dc.xml") - ;; フォーラム系 ;; Windows Server Insiderフォーラム ("fwin2k" . "http://www.atmarkit.co.jp/rss/fwin2k/rss2dc.xml") @@ -80,36 +80,51 @@ (cdr (assoc (shimbun-current-group-internal shimbun) shimbun-atmarkit-group-path-alist))) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-atmarkit) url date) - (unless (string-match "http://[^\/]+/\\(.+\\)\\.html" url) - (error "Cannot find message-id base")) - (format "<%s%%%s@atmarkit.co.jp>" (match-string-no-properties 1 url) - (shimbun-current-group-internal shimbun))) - -(defvar shimbun-atmarkit-use-base-url nil - "Non-nil means make `shimbun-article-url' return a base url.") - -(luna-define-method shimbun-article-url :around ((shimbun shimbun-atmarkit) - header) - ;; Switch the return value to the base url and the printing url - ;; according to `shimbun-atmarkit-use-base-url'. - (if shimbun-atmarkit-use-base-url - (luna-call-next-method) - "http://www.atmarkit.co.jp/club/print/print.php")) - -(luna-define-method shimbun-make-contents :around ((shimbun shimbun-atmarkit) - header) - ;; Make `shimbun-article-url' return the base url rather than the - ;; printing url because links in the print page are relative to it. - (let ((shimbun-atmarkit-use-base-url t)) - (luna-call-next-method))) +(luna-define-method shimbun-article-url ((shimbun shimbun-atmarkit) + header) + "http://www.atmarkit.co.jp/club/print/print.php") + +(luna-define-method shimbun-get-headers :around ((shimbun shimbun-atmarkit) + &optional range) + (mapcar + (lambda (header) + (shimbun-header-set-xref header + (shimbun-real-url (shimbun-header-xref header))) + header) + (luna-call-next-method))) + +(luna-define-method shimbun-multi-next-url ((shimbun shimbun-atmarkit) + header url) + (goto-char (point-max)) + (when (re-search-backward + ""))) + t)) (luna-define-method shimbun-clear-contents :before ((shimbun shimbun-atmarkit) header) - (shimbun-remove-tags "") - (shimbun-remove-tags "") - (shimbun-remove-tags "")) + (shimbun-remove-tags "script\\|noscript\\|form" t)) + +(luna-define-method shimbun-article :before ((shimbun shimbun-atmarkit) + header &optional outbuf) + (let ((xref (shimbun-header-xref header)) + end) + (when (setq end (string-match "\\?" xref)) + (setq xref (substring xref 0 end))) + (shimbun-header-set-xref header xref))) (provide 'sb-atmarkit) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-atom-hash.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-atom.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-bbc.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-bbc.el --- work/emacs-w3m-1.4.4/shimbun/sb-bbc.el 2005-03-16 13:27:21.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-bbc.el 2007-11-02 20:11:24.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-bbc.el --- shimbun backend for BBC UK -;; Copyright (C) 2003, 2004, 2005 Koichiro Ohba +;; Copyright (C) 2003, 2004, 2005, 2006, 2007 +;; Koichiro Ohba ;; Author: Koichiro Ohba ;; Keywords: news @@ -19,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -33,25 +34,50 @@ (luna-define-class shimbun-bbc (shimbun-rss) ()) (defvar shimbun-bbc-url - "http://news.bbc.co.uk/rss/newsonline_uk_edition/world/rss091.xml") -(defvar shimbun-bbc-groups '("news")) + "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition") (defvar shimbun-bbc-from-address "newsonline@bbc.co.uk") (defvar shimbun-bbc-content-start - "\\(\\)") + (concat "")) (defvar shimbun-bbc-content-end "") -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-bbc) url date) -;;; -;; (shimbun-bbc-build-message-id url)) -;; -;;(defun shimbun-bbc-build-message-id (url) -;;; - (if (string-match "/hi/\\(.+\\)\\.stm" url) - (let ((elems (nreverse (split-string (match-string 1 url) "/")))) - (concat "<" (car elems) "@" (mapconcat 'identity (cdr elems) ".") - ".bbc.co.uk>")) - (error "Cannot find message-id base"))) +(defvar shimbun-bbc-path-alist + '(("front_page" . "/front_page/rss.xml") + ;; use the name "news" here to be backward compatible + ;; ("world" . "/world/rss.xml") + ("news" . "/world/rss.xml") + ("uk" . "/uk/rss.xml") + ("england" . "/england/rss.xml") + ("northern_ireland" . "/northern_ireland/rss.xml") + ("scotland" . "/scotland/rss.xml") + ("wales" . "/wales/rss.xml") + ("business" . "/business/rss.xml") + ("politics" . "/uk_politics/rss.xml") + ("health" . "/health/rss.xml") + ("education" . "/education/rss.xml") + ("science" . "/sci/tech/rss.xml") + ("technology" . "/technology/rss.xml") + ("entertainment" . "/entertainment/rss.xml") + ("talking_point" . "/talking_point/rss.xml") + ("magazine" . "/magazine/rss.xml") + ("week_at-a-glance" . "/week_at-a-glance/rss.xml") + ("programmes" . "programmes/rss.xml") + ("latest_stories" . "/latest_published_stories/rss.xml"))) + +(defvar shimbun-bbc-x-face-alist + '(("default" . "\ +Face: iVBORw0KGgoAAAANSUhEUgAAACoAAAAOAgMAAAAkkGboAAAADFBMVEW7uLJ/e2z////09PP + b5J9PAAAAjElEQVQI12OYGhqaGRoaBqQSGLJWrZq2atVKIDWBIev/qmnrf63M2v8KyBatmrYwfGW + WaByQLeM1beGRlRn+h4BsqahpC5euzNUCqRcEqhFfmfgKxBaIm7aQ9SWELXVp2sK1molgNfJC0xZ + +1IToFfWbtjDkZbZoEJB9/tW0Nf9WZm34NQHFDaEItwEAmSVN3A2XO9kAAAAASUVORK5CYII="))) + +(defvar shimbun-bbc-groups (mapcar 'car shimbun-bbc-path-alist)) + +(luna-define-method shimbun-index-url ((shimbun shimbun-bbc)) + (concat shimbun-bbc-url + (cdr (assoc (shimbun-current-group-internal shimbun) + shimbun-bbc-path-alist)))) (provide 'sb-bbc) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-bbdb-ml.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-bbdb-ml.el --- work/emacs-w3m-1.4.4/shimbun/sb-bbdb-ml.el 2005-03-08 10:29:12.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-bbdb-ml.el 2007-10-17 20:15:58.000000000 +0900 @@ -20,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-cgi-board.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cgi-board.el --- work/emacs-w3m-1.4.4/shimbun/sb-cgi-board.el 2004-08-05 12:16:23.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cgi-board.el 2009-09-18 08:39:40.000000000 +0900 @@ -16,9 +16,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -29,7 +29,13 @@ (require 'shimbun) (eval-when-compile - (require 'cl)) + (require 'cl) + ;; `multiple-value-bind' requires the 2nd argument to be multiple-value, + ;; not a list, in particular for XEmacs 21.5. `values-list' does it, + ;; but is a run-time cl function in XEmacs 21.4 and Emacs 21. + (when (eq 'identity (symbol-function 'values-list)) + (define-compiler-macro values-list (arg) + arg))) (defcustom shimbun-cgi-board-group-alist '(("support" . @@ -149,7 +155,7 @@ (string-to-number (match-string 3 string)) (match-string 4 string)) (multiple-value-bind (sec min hour day month year dow dst zone) - (decode-time (shimbun-time-parse-string string)) + (values-list (decode-time (shimbun-time-parse-string string))) (setq zone (/ zone 60)) (shimbun-make-date-string year month day (format "%02d:%02d" hour min) @@ -182,7 +188,7 @@ (string-match "\\`[^:/#?]+://\\([^/#?]+\\)/" url) (match-string 1 url))))) -(luna-define-method shimbun-make-contents ((shimbun shimbun-cgi-board) header) +(luna-define-method shimbun-clear-contents ((shimbun shimbun-cgi-board) header) (let ((id (shimbun-header-id header))) (when (string-match "\\`<\\([^@]+\\)@" id) (goto-char (point-min)) @@ -196,15 +202,7 @@ (goto-char (point-min)) (when (looking-at "]*>") (delete-region (match-beginning 0) (match-end 0))) - (goto-char (point-min)) - (insert "\n\n\n\n\n") - (goto-char (point-max)) - (insert (shimbun-footer shimbun header t) - "\n\n\n") - (shimbun-make-mime-article shimbun header) - (buffer-string)))))) + t))))) (provide 'sb-cgi-board) Only in work/emacs-w3m-1.4.4/shimbun: sb-chalow.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-chise.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-cnet-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnet-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-cnet-jp.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnet-jp.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,11 +1,12 @@ ;;; sb-cnet-jp.el --- shimbun backend for CNET Japan -*- coding: iso-2022-7bit -*- -;; Copyright (C) 2003, 2004, 2005 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 +;; NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio , ;; TSUCHIYA Masatoshi , ;; Katsumi Yamaoka , -;; Tsuyoshi CHO +;; Tsuyoshi CHO ;; Keywords: news ;; Created: Jun 14, 2003 @@ -22,38 +23,53 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) +(require 'sb-multi) (require 'sb-rss) -(luna-define-class shimbun-cnet-jp (shimbun-japanese-newspaper shimbun-rss) ()) +(luna-define-class shimbun-cnet-jp (shimbun-multi shimbun-rss) ()) (defvar shimbun-cnet-jp-group-alist - '(("news" . "http://japan.cnet.com/rss/index.rdf") - ("blog.kenn" . "http://blog.japan.cnet.com/kenn/index.rdf") - ("blog.lessig" . "http://blog.japan.cnet.com/lessig/index.rdf") - ("blog.watanabe" . "http://blog.japan.cnet.com/watanabe/index.rdf") - ("blog.editors" . "http://blog.japan.cnet.com/editors/index.rdf"))) + '(("general" . "http://feed.japan.cnet.com/rss/index.rdf") + ("news" . "http://feed.japan.cnet.com/rss/news/index.rdf") + ;;("release" . "http://release.japan.cnet.com/rss/index.rdf") + ("special" . "http://feed.japan.cnet.com/rss/sp/index.rdf") + ("opinion" . "http://feed.japan.cnet.com/rss/opinion/index.rdf") + ;;("whitepaper" . "http://paper.japan.cnet.com/rss/index.rdf") + ;;("review" . "http://review.japan.cnet.com/rss/index.rdf") + ("blog.geetstate" . "http://blog.japan.cnet.com/geetstate/index.rdf") + ("blog.kenn" . "http://blog.japan.cnet.com/kenn/index.rdf") + ("blog.lessig" . "http://blog.japan.cnet.com/lessig/index.rdf") + ("blog.matsumura" . "http://blog.japan.cnet.com/matsumura/index.rdf") + ("blog.nakajima" . "http://blog.japan.cnet.com/nakajima/index.rdf") + ("blog.saeki" . "http://blog.japan.cnet.com/saeki/index.rdf") + ("blog.sakamoto" . "http://blog.japan.cnet.com/sakamoto/index.rdf") + ("blog.sasaki" . "http://blog.japan.cnet.com/sasaki/index.rdf") + ("blog.sentan" . "http://blog.japan.cnet.com/sentan/index.rdf") + ("blog.staff" . "http://blog.japan.cnet.com/staff/index.rdf") + ("blog.takawata" . "http://blog.japan.cnet.com/takawata/index.rdf") + ("blog.watanabe" . "http://blog.japan.cnet.com/watanabe/index.rdf"))) (defvar shimbun-cnet-jp-orphaned-group-list '("blog.inoue" "blog.mori" - "blog.umeda")) + "blog.umeda" + "blog.editors")) -(defvar shimbun-cnet-jp-server-name "CNET Japan") -(defvar shimbun-cnet-jp-from-address "webmaster@japan.cnet.com") -(defvar shimbun-cnet-jp-content-start "

") -(defvar shimbun-cnet-jp-content-end "") +(defvar shimbun-cnet-jp-server-name "CNET Networks,Inc.") +(defvar shimbun-cnet-jp-content-start + "
") +(defvar shimbun-cnet-jp-content-end + "\\(
\\|\ +\\)") (defvar shimbun-cnet-jp-x-face-alist '(("default" . "X-Face: 0p7.+XId>z%:!$ahe?x%+AEm37Abvn]n\ *GGh+>v=;[3`a{1lqO[$,~3C3xU_ri>[JwJ!9l0\n ~Y`b*eXAQ:*q=bBI\ @@ -72,119 +88,48 @@ (luna-define-method shimbun-index-url ((shimbun shimbun-cnet-jp)) (cdr (assoc (shimbun-current-group shimbun) shimbun-cnet-jp-group-alist))) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-cnet-jp) url date) - (if (or - ;; For news group - (string-match "http://japan\\.cnet\\.com/\ -\\(.+\\)/\\([,0-9]+\\)\\.htm\\?ref=rss" url) - ;; For blog group - (string-match "http://blog\\.japan\\.cnet\\.com/\ -\\([^/]+\\)/archives/\\([0-9]+\\)\\.html" url)) - (concat "<" - (shimbun-replace-in-string - (match-string-no-properties 2 url) "," ".") - "%" (shimbun-current-group shimbun) "@japan.cnet.com>") - (error "Cannot find message-id base"))) - -(defun shimbun-cnet-jp-clean-text-page () - (let ((case-fold-search t) (start)) - (goto-char (point-min)) - (when (and (search-forward shimbun-cnet-jp-content-start nil t) - (setq start (match-end 0)) - (re-search-forward shimbun-cnet-jp-content-end nil t)) - (delete-region (match-beginning 0) (point-max)) - (delete-region (point-min) start) - (goto-char (point-min)) - ))) - -(defun shimbun-cnet-jp-retrieve-next-pages (shimbun header base-cid url - &optional images) - (let ((case-fold-search t) (next)) - (goto-char (point-min)) - (when (re-search-forward - "]*>次のページ" nil t) - (setq next (shimbun-expand-url (match-string 1) url))) - (shimbun-cnet-jp-clean-text-page) - (goto-char (point-min)) - ;; remove page footer (last page is ignored) - (when (re-search-forward "| [0-9]+ / [0-9]+ |" nil t) - (if next - ;; isn't last - (progn - (goto-char (match-end 0)) - ;; "前の..." or "| 1 " - (re-search-backward "\\(前の..." - (delete-region (match-beginning 0) end)))) - (goto-char (point-min)) - (insert "\n\n\n\n\n") - (goto-char (point-max)) - (unless next - (insert (shimbun-footer shimbun header t))) - (insert "\n\n\n") - (when shimbun-encapsulate-images - (setq images (shimbun-mime-replace-image-tags base-cid url images))) - (let ((body (shimbun-make-text-entity "text/html" (buffer-string))) - (result (when next - (with-temp-buffer - (shimbun-fetch-url shimbun next) - (shimbun-clear-contents shimbun header) - (shimbun-cnet-jp-retrieve-next-pages - shimbun header base-cid next images))))) - (list (cons body (car result)) - (or (nth 1 result) images))))) - -(luna-define-method shimbun-make-contents ((shimbun shimbun-cnet-jp) header) - (let ((case-fold-search t)) - (shimbun-clear-contents shimbun header) - (let ((base-cid (shimbun-header-id header))) - (when (string-match "\\`<\\([^>]+\\)>\\'" base-cid) - (setq base-cid (match-string 1 base-cid))) - (let (body) - (multiple-value-bind (texts images) - (shimbun-cnet-jp-retrieve-next-pages shimbun header base-cid - (shimbun-header-xref header)) - (erase-buffer) - (if (= (length texts) 1) - (setq body (car texts)) - (setq body (shimbun-make-multipart-entity)) - (let ((i 0)) - (dolist (text texts) - (setf (shimbun-entity-cid text) - (format "shimbun.%d.%s" (incf i) base-cid)))) - (apply 'shimbun-entity-add-child body texts)) - (when images - (setf (shimbun-entity-cid body) (concat "shimbun.0." base-cid)) - (let ((new (shimbun-make-multipart-entity))) - (shimbun-entity-add-child new body) - (apply 'shimbun-entity-add-child new - (mapcar 'cdr (nreverse images))) - (setq body new)))) - (shimbun-header-insert shimbun header) - (insert "MIME-Version: 1.0\n") - (shimbun-entity-insert body))) - (buffer-string))) +(luna-define-method shimbun-multi-next-url ((shimbun shimbun-cnet-jp) + header url) + (goto-char (point-min)) + (when (re-search-forward "
  • -
  • - (shimbun-remove-tags "
    ") - ;; remove column
    -
    - (shimbun-remove-tags "
    ") - (shimbun-remove-tags "") - (shimbun-remove-tags "")) - -(luna-define-method shimbun-footer :around ((shimbun shimbun-cnet-jp) header - &optional html) - (if (string= "news" (shimbun-current-group shimbun)) - (luna-call-next-method) - "")) + (shimbun-remove-tags "script\\|noscript" t) + (shimbun-remove-tags + "\\(div\\) class=\"\\(?:photor_thumb_wrap\\|block_infocnet_stb\\)\"" t) + (shimbun-remove-tags "
    " + "") + (shimbun-remove-tags "" "")) + +(luna-define-method shimbun-multi-clear-contents ((shimbun shimbun-cnet-jp) + header + has-previous-page + has-next-page) + (when (shimbun-clear-contents shimbun header) + (cond + (has-next-page + (goto-char (point-max)) + (when (search-backward "
    " nil t) + (delete-region (point) (point-max)))) + (has-previous-page + (shimbun-remove-tags "
    " + ""))) + t)) + +(luna-define-method shimbun-make-contents :before ((shimbun shimbun-cnet-jp) + header) + (goto-char (point-min)) + (when (re-search-forward "\\(s.prop2=\"\\([^\"]+\\)\"\\|\ +
    \\([^\n]+\\)
    \\)" nil t) + (let ((from (or (match-string 2) (match-string 3)))) + (setq from (shimbun-replace-in-string from "文:" "")) + (setq from (shimbun-replace-in-string from "翻訳校正:*" "")) + (setq from (shimbun-replace-in-string from " *
    *" ", ")) + (setq from (shimbun-replace-in-string from "、" ", ")) + (shimbun-header-set-from header from)))) (provide 'sb-cnet-jp) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-cnet.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnet.el --- work/emacs-w3m-1.4.4/shimbun/sb-cnet.el 2004-01-12 22:47:30.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnet.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-cnet.el --- shimbun backend for CNET -;; Copyright (C) 2004 TSUCHIYA Masatoshi +;; Copyright (C) 2004, 2006, 2009, 2010 +;; TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi , ;; Yuuichi Teranishi , @@ -20,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -40,7 +41,13 @@ (require 'shimbun) (require 'sb-rss) (eval-when-compile - (require 'cl)) + (require 'cl) + ;; `multiple-value-bind' requires the 2nd argument to be multiple-value, + ;; not a list, in particular for XEmacs 21.5. `values-list' does it, + ;; but is a run-time cl function in XEmacs 21.4 and Emacs 21. + (when (eq 'identity (symbol-function 'values-list)) + (define-compiler-macro values-list (arg) + arg))) (luna-define-class shimbun-cnet (shimbun-rss shimbun) ()) @@ -72,7 +79,7 @@ (luna-define-method shimbun-rss-process-date ((shimbun shimbun-cnet) string) "Convert a slightly corrupted date string to a date string in right format." (multiple-value-bind (sec min hour day month year dow dst zone) - (decode-time (shimbun-time-parse-string string)) + (values-list (decode-time (shimbun-time-parse-string string))) (setq zone (/ zone 60)) (shimbun-make-date-string year month day (format "%02d:%02d" hour min) @@ -81,13 +88,6 @@ (/ zone 60) (% zone 60))))) -(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-cnet) - url date) - (if (string-match "\\`http://news\\.com\\.com/\\([-_0-9]+\\)\\.html" url) - (concat "<" (match-string 1 url) "%" - (shimbun-current-group shimbun) "@news.com.com>") - (error "Cannot find message-id base"))) - (defun shimbun-cnet-extract-body () "Extract a body of an article. In CNET site, bodies are surrounded by either
    or @@ -125,13 +125,12 @@ (insert "
    \n")))) (defun shimbun-cnet-remove-useless-tags () - (shimbun-remove-tags "") - (shimbun-remove-tags "") - (shimbun-remove-tags "
    " "") - (shimbun-remove-tags "" "") - (shimbun-remove-tags "") - (shimbun-remove-tags "") - (shimbun-remove-tags "" "")) + (shimbun-remove-tags "script\\|noscript" t) + (shimbun-remove-tags "\\(a\\) \\(?:\ +\\(?:href=\"\\(?:[^\"]+\\?tag=st_util_print\"\\|[^\"]+\\?tag=st_util_email\"\ +javascript\\)\\)\ +\\|onclick\\)" t) + (shimbun-remove-tags "\\(newselement\\) type=\"table\"" t)) (luna-define-method shimbun-clear-contents ((shimbun shimbun-cnet) header) (shimbun-strip-cr) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-cnn-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnn-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-cnn-jp.el 2005-03-14 07:25:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-cnn-jp.el 2008-03-28 14:24:31.000000000 +0900 @@ -1,8 +1,8 @@ -;;; sb-cnn-jp.el --- shimbun backend for CNN Japan -*- coding: iso-2022-7bit; -*- +;;; sb-cnn-jp.el --- shimbun backend for CNN Japan -;; Copyright (C) 2003, 2004, 2005 Tsuyoshi CHO +;; Copyright (C) 2003, 2004, 2005, 2008 Tsuyoshi CHO -;; Author: Tsuyoshi CHO +;; Author: Tsuyoshi CHO ;; Keywords: news ;; Created: May 22, 2004 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -40,8 +40,11 @@ (defvar shimbun-cnn-jp-server-name "CNN Japan") (defvar shimbun-cnn-jp-from-address "webmaster@cnn.co.jp") (defvar shimbun-cnn-jp-content-start - "Web\\(\\s \\| \\)+posted\\(\\s \\| \\)+at:[^<]*
    ") -(defvar shimbun-cnn-jp-content-end "
    ") + "[\t\n ]*\ +\\|[\t\n ]*\ +\\|Web\\(?:\\s \\| \\)+posted\\(?:\\s \\| \\)+at:[^<]*
    ") +(defvar shimbun-cnn-jp-content-end + "[\t\n ]*
    ") (defvar shimbun-cnn-jp-expiration-days 14) (defvar shimbun-cnn-jp-group-alist @@ -56,14 +59,11 @@ (defvar shimbun-cnn-jp-x-face-alist '(("default" . "\ -Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAWAgMAAAD7mfc/AAAABGdBTUEAALGPC/xhBQAAAAx - QTFRFtgEB4mlp9bGx/vT0/VCoMAAAAC90RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYStGTG1 - hc2sgIFJldjogMTIvMjkvOTQbx6p8AAAA9ElEQVR42j3OMU7DQBAF0L8TxRviIg1IhCYUES0cYbM - FNRROJFwQSioq6oxzAgspkTgCziHiI2xD78Y9RZBAsjwZS4hmvl7z/0Da+7RO5XchoYQEpJu51Em - HFme7JJHPZBUYP1TsFvVq832tqMaI568v2/eRolwijp4ftw9WwXyxj8bp2y0pvBOJrF/PWEEkQiZ - bu/xOYRXIyV1CEXe4Me78H6fGnXTodRgYR/gr6JPxxjEy3gtZmnlm/SDvJ2Q582HJCFNoffnkqyn - ja+gQ2erKHwYlGlMUH/FhSE3EEAdg1KDXakqlZ9LCii6J5DB7CROp4iPbnmrk8JWgOgAAAAd0SU1 - FB9QGBAQGEAm9iVAAAAAASUVORK5CYII="))) +Face: iVBORw0KGgoAAAANSUhEUgAAACMAAAAQAgMAAADhWS7JAAAADFBMVEW2AQHojY3xxsb//// + LZAepAAAAmUlEQVQI12P4P0F86v6v8R8aGH4ySIXmXw3/4MDwQDQqKnraJCCrwYFNLHxqAJDlyBg + pGjZVoMCBgYX/r0hAI4sCkKX/l0WAkZEByKr/y8ICYdn/ZWEAMiCyQBZQzJX7L0uAI4uAA0MjAwN + LgSMviwPDhQAGlhJRPiDrg2howB4WeUcHhr8MDAz/GOQPMDD8X8LA9r+h/gEHAHPyLQOjNU7WAAA + AAElFTkSuQmCC"))) (luna-define-method shimbun-groups ((shimbun shimbun-cnn-jp)) (mapcar 'car shimbun-cnn-jp-group-alist)) @@ -75,62 +75,64 @@ (luna-define-method shimbun-get-headers ((shimbun shimbun-cnn-jp) &optional range) (let ((case-fold-search t) - (beg (point-min)) (end (point-max)) - headers) - (goto-char (point-min)) - (when (re-search-forward - "FULL STORY" nil t) - (setq beg (match-end 0))) - (when (re-search-forward - "" - nil t) - (setq end (match-beginning 0))) - (save-excursion - (narrow-to-region beg end) - (goto-char (point-min)) - (let (title url date id str) - (while (re-search-forward - "\\([^<]*\\)" - nil t) - (setq title (match-string-no-properties 2)) - (setq str (substring (match-string-no-properties 1) 1)) - (setq url (shimbun-expand-url (concat shimbun-cnn-jp-url str))) - (let ((year 0) (month 0) (day 0)) - (when (string-match - "\\([^/]*\\)/\\([^0-9]*\\)\\([0-9][0-9][0-9][0-9]\\)\ -\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9]*\\)" - str) - (setq year (match-string-no-properties 3 str) - month (match-string-no-properties 4 str) - day (match-string-no-properties 5 str))) - (setq id (format "<%s%s%s%s%s%%%s@%s>" - (match-string-no-properties 2 str) ; news provider - year month day ; date - (match-string-no-properties 6 str) ; number - (match-string-no-properties 1 str) ; category - shimbun-cnn-jp-top-level-domain)) ; domain - (setq date (shimbun-make-date-string - (string-to-int year) - (string-to-int month) - (string-to-int day))) - (push (shimbun-create-header - 0 - title - (shimbun-from-address shimbun) - date - id "" 0 0 url) - headers))))) + (from (shimbun-from-address shimbun)) + year month day id ids headers) + (while (re-search-forward + (eval-when-compile + (concat "" + ;; 8. title + "\\([^>]+\\)" + "")) + nil t) + (setq year (string-to-number (match-string 4)) + month (string-to-number (match-string 5)) + day (string-to-number (match-string 6)) + id (format "<%s%d%02d%02d%s%%%s@%s>" + (match-string 3) + year month day + (match-string 7) + (match-string 2) + shimbun-cnn-jp-top-level-domain)) + (unless (or (member id ids) ;; Avoid duplications. + (shimbun-search-id shimbun id)) + (push id ids) + (push (shimbun-create-header + 0 + (match-string 8) + from + (shimbun-make-date-string year month day) + id "" 0 0 + (shimbun-expand-url (match-string 1) shimbun-cnn-jp-url)) + headers))) headers)) -;; date normalize (defun shimbun-cnn-jp-prepare-article (shimbun header) - "Prepare an article: adjusting a date header if there is a correct -information available." - (let ((case-fold-search t)) + "Prepare an article: + adjusting a date header if there is a correct information available; + move a photograph to the top." + (let ((case-fold-search t) + photo) (when (re-search-forward ">\\(20[0-9][0-9]\\).\\([01][0-9]\\).\\([0-3][0-9]\\)
    \n\ -Web\\(\\s \\| \\)+posted\\(\\s \\| \\)+at:[^0-9]*\ -\\([0-9][0-9]:[0-9][0-9]\\)\\(\\s \\| \\)*\\([A-Z]+\\)
    " +Web\\(?:\\s \\| \\)+posted\\(?:\\s \\| \\)+at:[^0-9]*\ +\\([0-9][0-9]:[0-9][0-9]\\)\\(?:\\s \\| \\)*\\([A-Z]+\\)
    " ;;

    2005.02.10
    ;; Web posted at:  ;; 10:23 @@ -142,8 +144,29 @@ (string-to-number (match-string-no-properties 1)) (string-to-number (match-string-no-properties 2)) (string-to-number (match-string-no-properties 3)) - (match-string-no-properties 6) - (match-string-no-properties 8))) + (match-string-no-properties 4) + (match-string-no-properties 5))) + (goto-char (point-min))) + + (when (and (not (shimbun-prefer-text-plain-internal shimbun)) + (re-search-forward "[\t\n ]*\ +\\(]+>\\)[\t\n ]*

    \ +\\(?:[\t\n ]*[\t\n ]*\ +

    \\([^<]+\\)

    [\t\n ]*
    \\)?" + nil t) + (progn + (setq photo (if (match-beginning 2) + (concat (match-string 1) "
    \n" + (match-string 2) "
    \n") + (concat (match-string 1) "
    \n"))) + (goto-char (point-min)) + (re-search-forward (shimbun-content-start shimbun) nil t))) + (if (looking-at "[\t\n ]*\\(-[\t\n ]+[A-Z]+\\(?:/[A-Z]+\\)*\\)\ +\[\t\n ]*

    [\t\n ]*

    ") + (replace-match (concat "\\1
    \n" photo "

    ")) + (when (looking-at "[\t\n ]+") + (delete-region (match-beginning 0) (match-end 0))) + (insert photo)) (goto-char (point-min))))) (luna-define-method shimbun-make-contents :before ((shimbun shimbun-cnn-jp) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-coldsync.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-coldsync.el --- work/emacs-w3m-1.4.4/shimbun/sb-coldsync.el 2005-03-14 07:25:37.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-coldsync.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-debian-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-debian-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-debian-jp.el 2003-12-24 11:58:57.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-debian-jp.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-debian.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-debian.el --- work/emacs-w3m-1.4.4/shimbun/sb-debian.el 2003-11-18 10:57:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-debian.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-debian.el --- shimbun backend for debian.org -;; Copyright (C) 2001, 2002, 2003 OHASHI Akira +;; Copyright (C) 2001, 2002, 2003, 2005, 2007 OHASHI Akira ;; Author: OHASHI Akira ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -104,32 +104,32 @@ (concat (shimbun-current-group-internal shimbun) "@debian.org")) (defmacro shimbun-debian-get-headers (shimbun url headers &optional aux) - (` (let ((case-fold-search t) - (regexp (or (shimbun-mhonarc-litemplate-regexp-internal (, shimbun)) - shimbun-mhonarc-litemplate-regexp)) - (year (and (string-match (concat (regexp-quote (shimbun-index-url shimbun)) - "\\([0-9]+\\)") - url) - (match-string 1 url))) - month day date-start date-end) - (goto-char (point-max)) - (while (and (setq date-end (re-search-backward "^" nil t)) - (setq date-start (re-search-backward "^

      " nil t))) - (forward-line -1) - (looking-at "^\\(\\w+\\) \\([0-9]+\\)") - (setq month (match-string 1) - day (match-string 2)) - (goto-char date-end) - (while (re-search-backward regexp date-start t) - (shimbun-mhonarc-extract-header-values (, shimbun) (, url) - (, headers) (, aux)) - (shimbun-header-set-date (car (, headers)) - (format "%s %s %s 00:00 +0000" - day month year)) - (if (> (length (, headers)) shimbun-debian-fetch-headers-max) - (throw 'stop (, headers))) - (forward-line 0))) - (, headers)))) + `(let ((case-fold-search t) + (regexp (or (shimbun-mhonarc-litemplate-regexp-internal ,shimbun) + shimbun-mhonarc-litemplate-regexp)) + (year (and (string-match (concat (regexp-quote (shimbun-index-url + shimbun)) + "\\([0-9]+\\)") + url) + (match-string 1 url))) + month day date-start date-end) + (goto-char (point-max)) + (while (and (setq date-end (re-search-backward "^
    " nil t)) + (setq date-start (re-search-backward "^
      " nil t))) + (forward-line -1) + (looking-at "^\\(\\w+\\) \\([0-9]+\\)") + (setq month (match-string 1) + day (match-string 2)) + (goto-char date-end) + (while (re-search-backward regexp date-start t) + (shimbun-mhonarc-extract-header-values ,shimbun ,url ,headers ,aux) + (shimbun-header-set-date (car ,headers) + (format "%s %s %s 00:00 +0000" + day month year)) + (if (> (length ,headers) shimbun-debian-fetch-headers-max) + (throw 'stop ,headers)) + (forward-line 0))) + ,headers)) (luna-define-method shimbun-get-headers ((shimbun shimbun-debian) &optional range) @@ -151,7 +151,7 @@ (shimbun-retrieve-url (format base-url "list") t) (re-search-forward "Page [0-9]+ of \\([0-9]+\\)\\(
      \\)?") - (let* ((page-max (string-to-int (match-string 2))) + (let* ((page-max (string-to-number (match-string 2))) (i page-max)) (while (> i 1) (setq url (format base-url i)) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-debugmagazin-de.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-dennou.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-dennou.el --- work/emacs-w3m-1.4.4/shimbun/sb-dennou.el 2005-03-14 07:25:37.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-dennou.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'shimbun) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-digiko.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-digiko.el --- work/emacs-w3m-1.4.4/shimbun/sb-digiko.el 2005-03-14 07:25:36.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-digiko.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-digiko.el --- shimbun backend for digiko-ML. -;; Copyright (C) 2001, 2002, 2003, 2004 Akihiro Arisawa +;; Copyright (C) 2001, 2002, 2003, 2004, 2007 +;; Akihiro Arisawa ;; Author: Akihiro Arisawa ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: @@ -39,26 +40,26 @@ "\\([^<]+\\)\n
      • From: \\(.+\\) \\(\\(Sun\\|Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\), [ 0-9]+ [A-Z][a-z][a-z] [0-9]+ [0-2][0-9]:[0-5][0-9]:[0-5][0-9] .*\\)
      • ") (defmacro shimbun-digiko-get-headers (shimbun url headers) - (` (let ((case-fold-search t)) - (goto-char (point-min)) - (while (re-search-forward - (shimbun-mhonarc-litemplate-regexp-internal (, shimbun)) - nil t) - (let ((id (format "<%s%%%s>" (match-string 1) - (shimbun-current-group-internal (, shimbun)))) - (xref (shimbun-expand-url (match-string 2) (, url))) - (subject (shimbun-mhonarc-replace-newline-to-space - (match-string 3))) - (from (shimbun-mhonarc-replace-newline-to-space - (match-string 4))) - (date (match-string 5))) - (if (shimbun-search-id (, shimbun) id) - (throw 'stop (, headers)) - (push (shimbun-make-header 0 - (shimbun-mime-encode-string subject) - (shimbun-mime-encode-string from) - date id "" 0 0 xref) - (, headers)))))))) + `(let ((case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward + (shimbun-mhonarc-litemplate-regexp-internal ,shimbun) + nil t) + (let ((id (format "<%s%%%s>" (match-string 1) + (shimbun-current-group-internal ,shimbun))) + (xref (shimbun-expand-url (match-string 2) ,url)) + (subject (shimbun-mhonarc-replace-newline-to-space + (match-string 3))) + (from (shimbun-mhonarc-replace-newline-to-space + (match-string 4))) + (date (match-string 5))) + (if (shimbun-search-id ,shimbun id) + (throw 'stop ,headers) + (push (shimbun-make-header 0 + (shimbun-mime-encode-string subject) + (shimbun-mime-encode-string from) + date id "" 0 0 xref) + ,headers)))))) (luna-define-method shimbun-get-headers ((shimbun shimbun-digiko) &optional range) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-elips.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-elips.el --- work/emacs-w3m-1.4.4/shimbun/sb-elips.el 2003-03-07 08:09:39.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-elips.el 2008-03-27 20:44:01.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-elips.el --- shimbun backend for the Elips mailing list -;; Copyright(C) 2003 Katsumi Yamaoka +;; Copyright(C) 2003, 2008 Katsumi Yamaoka ;; Author: Katsumi Yamaoka ;; Keywords: news @@ -18,20 +18,20 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: (require 'shimbun) -(require 'sb-fml) +(require 'sb-mailman) -(luna-define-class shimbun-elips (shimbun-fml) ()) +(luna-define-class shimbun-elips (shimbun-mailman-ja) ()) -(defvar shimbun-elips-url "http://heimat.jp/~nakaji/elips/") +(defvar shimbun-elips-url "http://www.heimat.gr.jp/pipermail/elips/") (defvar shimbun-elips-groups '("elips")) (defvar shimbun-elips-x-face-alist '(("default" . "X-Face: 4(*_4GGM'.9>v7]}eY@L8:2Zn7:&ANIR4778Vg*'(f\ diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-emacs-w3m.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-emacs-w3m.el --- work/emacs-w3m-1.4.4/shimbun/sb-emacs-w3m.el 2004-06-25 12:41:06.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-emacs-w3m.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-emacswiki.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-emacswiki.el --- work/emacs-w3m-1.4.4/shimbun/sb-emacswiki.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-emacswiki.el 2005-12-22 14:42:27.000000000 +0900 @@ -19,16 +19,13 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-rss) @@ -76,8 +73,8 @@ (setq url (and (listp item) (eq (intern (concat rss-ns "item")) (car item)) (if (string= (shimbun-current-group shimbun) "changes") - (shimbun-rss-node-text rss-ns 'link (cddr item)) - (shimbun-rss-node-text wiki-ns 'diff (cddr item))))) + (shimbun-rss-node-text rss-ns 'link item) + (shimbun-rss-node-text wiki-ns 'diff item)))) (when url (let* ((date (or (shimbun-rss-node-text dc-ns 'date item) (shimbun-rss-node-text rss-ns 'pubDate item))) @@ -85,8 +82,12 @@ (unless (shimbun-search-id shimbun id) (push (shimbun-create-header 0 - (shimbun-rss-node-text rss-ns 'title item) - (or (shimbun-rss-node-text dc-ns 'contributor item) + (let ((desc (shimbun-rss-node-text rss-ns 'description + item))) + (concat (shimbun-rss-node-text rss-ns 'title item) + (if desc + (concat " - " desc)))) + (or (shimbun-rss-node-text wiki-ns 'username item) (shimbun-from-address shimbun)) (shimbun-rss-process-date shimbun date) id "" 0 0 url) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-engadget-ja.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-excite.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-excite.el --- work/emacs-w3m-1.4.4/shimbun/sb-excite.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-excite.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,8 +1,8 @@ ;;; sb-excite.el --- shimbun backend for excite -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2004, 2005 Tsuyoshi CHO +;; Copyright (C) 2004, 2005, 2006, 2010 Tsuyoshi CHO -;; Author: Tsuyoshi CHO +;; Author: Tsuyoshi CHO ;; Keywords: news ;; Created: Dec 24, 2004 @@ -19,17 +19,14 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-rss) @@ -49,9 +46,9 @@ (defvar shimbun-excite-from-address (concat "nobody@" shimbun-excite-top-level-domain)) (defvar shimbun-excite-content-start - "\\[ +[0-9]*年[0-9]*月[0-9]*日 *[0-9]*時[0-9]*分 +\\]") + "]*>\\[ *[0-9]*年[0-9]*月[0-9]*日 *[0-9]*時[0-9]*分 *\\]") (defvar shimbun-excite-content-end - "ニューストップ") + "")) +(luna-define-method shimbun-rss-build-message-id :around + ((shimbun shimbun-excite) url date) + (if (string-match + (concat (regexp-quote shimbun-excite-url) + "\\([^/]\\)*/\\([0-9]+\\)\.html?") + url) + (luna-call-next-method) + nil)) (luna-define-method shimbun-get-headers :around ((shimbun shimbun-excite) &optional range) @@ -96,11 +90,10 @@ (shimbun-header-set-from header (shimbun-from-address shimbun))) headers)) -(luna-define-method shimbun-clear-contents :before - ((shimbun shimbun-excite) header) +(luna-define-method shimbun-clear-contents :before ((shimbun shimbun-excite) + header) (shimbun-strip-cr) - (shimbun-remove-tags "") - (shimbun-remove-tags "")) + (shimbun-remove-tags "script\\|noscript" t)) (provide 'sb-excite) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-exconn.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-exconn.el --- work/emacs-w3m-1.4.4/shimbun/sb-exconn.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-exconn.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-exconn.el --- shimbun backend for eXperts Connection -;; Copyright (C) 2004, 2005 Yoichi NAKAYAMA +;; Copyright (C) 2004, 2005, 2006 Yoichi NAKAYAMA ;; Author: Yoichi NAKAYAMA ;; Keywords: news @@ -19,17 +19,14 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-rss) @@ -44,13 +41,6 @@ (defvar shimbun-exconn-content-end "") -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-exconn) url date) - (unless (string-match "\ -http://support.microsoft.com/default.aspx\\?scid=kb;ja;\\([0-9]+\\)" url) - (error "Cannot find message-id base")) - (concat "<" (match-string-no-properties 1 url) "@support.microsoft.com>")) - (luna-define-method shimbun-rss-process-date ((shimbun shimbun-exconn) date) (cond ((null date) "") diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-f1fan.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-f1fan.el --- work/emacs-w3m-1.4.4/shimbun/sb-f1fan.el 2005-03-14 07:14:43.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-f1fan.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,21 +19,23 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: +;; This back end generates text/plain articles unless failing to +;; extract contents. + ;; Original code was nnshimbun.el written by ;; TSUCHIYA Masatoshi . ;;; Code: (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-f1fan (shimbun shimbun-text) ()) +(luna-define-class shimbun-f1fan (shimbun) ()) (defvar shimbun-f1fan-url "http://www.ksky.ne.jp/~tahara/f1/") (defvar shimbun-f1fan-server-name "F1ファン") diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-fau.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-fau.el --- work/emacs-w3m-1.4.4/shimbun/sb-fau.el 2005-03-22 20:42:04.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-fau.el 2007-02-22 18:35:47.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-fau.el --- Freie ArbeiterInnen Union shimbun backend -;; Copyright (C) 2005 David Hansen +;; Copyright (C) 2005, 2006, 2007 David Hansen ;; Author: David Hansen ;; Keywords: news @@ -19,8 +19,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -38,13 +38,12 @@ (defvar shimbun-fau-x-face-alist '(("default" . "X-Face: 5Nxj%|<|TGh94(OzpKK*3XE{c=jFM9F7Mngs2BJva%Cs2jH>DThKw\ -[h'n|GAMyNEJ~*y%59xj5d31q4(xg_=>O+w}\ +\[h'n|GAMyNEJ~*y%59xj5d31q4(xg_=>O+w}\ ") (defvar shimbun-fau-content-end "\\s-* -

        \\s-* -..*?\\s-*") (defvar shimbun-fau-coding-system (or (shimbun-find-coding-system 'windows-1252) @@ -63,12 +62,6 @@ header) (luna-call-next-method))) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-fau) url date) - (unless (string-match "/[^/]*$" url) - (error "Cannot find message-id base")) - (concat "<" (match-string 0 url) "@fau.de>")) - (luna-define-method shimbun-article ((shimbun shimbun-fau) header &optional outbuf) (when (shimbun-current-group-internal shimbun) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-ffii.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-ffii.el --- work/emacs-w3m-1.4.4/shimbun/sb-ffii.el 2005-02-24 13:16:16.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-ffii.el 2007-10-17 20:15:58.000000000 +0900 @@ -22,9 +22,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-fml.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-fml.el --- work/emacs-w3m-1.4.4/shimbun/sb-fml.el 2005-03-14 07:25:39.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-fml.el 2010-01-13 09:59:30.000000000 +0900 @@ -1,8 +1,8 @@ ;;; sb-fml.el --- shimbun backend class for fml archiver. -;; Copyright (C) 2001, 2002, 2003, 2004 +;; Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 ;; Akihiro Arisawa -;; Copyright (C) 2001, 2002, 2003, 2004 +;; Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 ;; Yuuichi Teranishi ;; Author: TSUCHIYA Masatoshi , @@ -23,9 +23,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -41,7 +41,7 @@ (luna-define-class shimbun-fml (shimbun) ()) -(defsubst shimbun-fml-parse-time (str) +(defun shimbun-fml-parse-time (str) (save-match-data (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\) \\([0-9]+:[0-9]+:[0-9]+\\)" @@ -97,14 +97,10 @@ (delete-region (point-min) (point)) (throw 'stop nil)) (if (search-forward "" nil t) - (progn - (beginning-of-line) - (delete-region (point) (point-max))) + (delete-region (point-at-bol) (point-max)) (throw 'stop nil)) (if (search-backward "" nil t) - (progn - (beginning-of-line) - (delete-region (point) (save-excursion (end-of-line) (point)))) + (delete-region (point-at-bol) (point-at-eol)) (throw 'stop nil)) (save-restriction (narrow-to-region (point-min) (point)) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-gendai-net.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-geocrawler.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-geocrawler.el --- work/emacs-w3m-1.4.4/shimbun/sb-geocrawler.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-geocrawler.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -29,9 +29,6 @@ ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (luna-define-class shimbun-geocrawler (shimbun) ()) @@ -117,7 +114,7 @@ "http://www.geocrawler.com/mail/msg_raw.php3?msg_id=" (match-string 1))) (id (concat "<" (match-string 1) "@geocrawler.com>")) - (eol (line-end-position))) + (eol (point-at-eol))) (when (shimbun-search-id shimbun id) (throw 'stop nil)) (push (shimbun-make-header diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-glimpse.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-glimpse.el --- work/emacs-w3m-1.4.4/shimbun/sb-glimpse.el 2003-11-18 10:57:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-glimpse.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-gnome.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-gnome.el --- work/emacs-w3m-1.4.4/shimbun/sb-gnome.el 2005-03-14 07:31:26.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-gnome.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-haiku-os.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-haiku-os.el --- work/emacs-w3m-1.4.4/shimbun/sb-haiku-os.el 2004-08-03 13:03:08.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-haiku-os.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-haiku-os.el --- shimbun backend for haiku-os.org -;; Copyright (C) 2004 Yoichi NAKAYAMA +;; Copyright (C) 2004, 2006 Yoichi NAKAYAMA ;; Author: Yoichi NAKAYAMA ;; Keywords: news @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -50,12 +50,6 @@ (luna-define-method shimbun-rss-process-date ((shimbun shimbun-haiku-os) date) date) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-haiku-os) url date) - (unless (string-match "=\\([0-9]+\\)\\>" url) - (error "Cannot find message-id base")) - (concat "<" (match-string-no-properties 1 url) "%" (shimbun-current-group shimbun) "@haiku-os.org>")) - (luna-define-method shimbun-make-contents :around ((shimbun shimbun-haiku-os) &optional header) (let ((entry (assoc (shimbun-current-group shimbun) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-hash.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-heise.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-heise.el --- work/emacs-w3m-1.4.4/shimbun/sb-heise.el 2005-03-22 06:50:43.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-heise.el 2009-10-06 07:17:32.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-heise.el --- heise online shimbun backend -;; Copyright (C) 2004, 2005 David Hansen +;; Copyright (C) 2004, 2005, 2008, 2009 David Hansen ;; Author: David Hansen ;; Keywords: news @@ -19,8 +19,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -38,9 +38,10 @@ (defvar shimbun-heise-content-start - "\\(\\|\\|\\)") + "\\(\\|\\|<[^>]*HEISETEXT[^>]*>\\)") (defvar shimbun-heise-content-end - "\\(\\|\\|\\)") + "\\(\\|\ +\\|<[^>]*/HEISETEXT[^>]*>\\)") (defvar shimbun-heise-x-face-alist '(("default" . "X-Face: #RVD(kjrS;RY\"2yH]w.1U,ZC_DbR,9{tQnhyYe|,\\J)\"\ @@ -59,13 +60,15 @@ (defun shimbun-heise-get-newsticker-headers (shimbun) - (let ((regexp "\\([^<]+\\)") + (let ((regexp + "]*>\\([^<]+\\)") (from "Heise Online News ") - (date "") (id) (url) (subject) (headers)) + (date "") (longurl) (id) (url) (subject) (headers)) (catch 'stop (while (re-search-forward regexp nil t nil) - (setq id (match-string 1)) - (setq url (shimbun-expand-url (concat "meldung/" id) + (setq longurl (match-string 1)) + (setq id (md5 longurl)) + (setq url (shimbun-expand-url longurl (shimbun-index-url shimbun))) (setq subject (match-string 2)) (setq id (concat "")) @@ -92,33 +95,33 @@ (let (headers (limit (re-search-forward shimbun-heise-date-re nil t))) (catch 'stop (while limit - (goto-char limit) - (let ((day (match-string 1)) - (month (match-string 2)) - (year (match-string 3))) - (setq limit (save-excursion - (re-search-forward shimbun-heise-date-re nil t))) - (save-match-data - (while (re-search-forward shimbun-heise-url-re limit t) - (let ((url (match-string 1)) - (mid (concat "<" (match-string 2) "x" - (match-string 3) "@heise.de>")) - (subj (match-string 4))) - (when (shimbun-search-id shimbun mid) - (throw 'stop nil)) - (when (re-search-forward shimbun-heise-author-re limit t) - (let ((author (match-string 1))) - (push (shimbun-create-header - 0 subj author - (shimbun-make-date-string - (string-to-number year) - (string-to-number month) - (string-to-number day) - "00:00" - ;; FIXME: timezone is always wrong, slightly better than - ;; the default "+0900" - "+0000") - mid "" 0 0 url) headers))))))))) + (goto-char limit) + (let ((day (match-string 1)) + (month (match-string 2)) + (year (match-string 3))) + (setq limit (save-excursion + (re-search-forward shimbun-heise-date-re nil t))) + (save-match-data + (while (re-search-forward shimbun-heise-url-re limit t) + (let ((url (match-string 1)) + (mid (concat "<" (match-string 2) "x" + (match-string 3) "@heise.de>")) + (subj (match-string 4))) + (when (shimbun-search-id shimbun mid) + (throw 'stop nil)) + (when (re-search-forward shimbun-heise-author-re limit t) + (let ((author (match-string 1))) + (push (shimbun-create-header + 0 subj author + (shimbun-make-date-string + (string-to-number year) + (string-to-number month) + (string-to-number day) + "00:00" + ;; FIXME: timezone is always wrong, slightly better + ;; than the default "+0900" + "+0000") + mid "" 0 0 url) headers))))))))) headers)) (luna-define-method shimbun-get-headers @@ -132,8 +135,8 @@ (save-excursion ;; get the real date - (let ((regexp-date-begin "") - (regexp-date-end "") + (let ((regexp-date-begin "

        ") + (regexp-date-end "
        ") (regexp-date (concat "\\([0-9]+\\)\\.\\([0-9]+\\)\\." "\\([0-9]+\\)[ \t]+\\([0-9]+\\:[0-9]+\\)")) (tmp-point) (bound-point)) @@ -147,16 +150,15 @@ (string-to-number (match-string 3)) ; year (string-to-number (match-string 2)) ; month (string-to-number (match-string 1)) ; day - (match-string 4) ; time + (match-string 4) ; time ;; FIXME: timezone is always wrong, slightly better than the ;; default "+0900" "+0000")))))) ;; get the real from - (let ((regexp-from-begin "\\|") - (regexp-from-end "") - (regexp-from (concat "(]*>\\([^<]+\\)")) + (let ((regexp-from-begin "") + (regexp-from-end "
        "))))))) + (shimbun-remove-tags "" "
        ") + (shimbun-remove-tags "" ""))) - ;; strip ads - (goto-char (point-min)) - (let ((regexp-ad-begin "\\|") - (regexp-ad-end "") - (regexp-ad "") - (tmp-point) (bound-min) (bound-max)) - (when (setq bound-min (re-search-forward regexp-ad-begin nil t nil)) - (when (setq bound-max (re-search-forward regexp-ad-end nil t nil)) - (goto-char bound-min) - (while (re-search-forward regexp-ad bound-max t nil) - (let ((begin-region (re-search-backward "" bound-max t nil))) - (when (and begin-region end-region) - (delete-region begin-region end-region))))))))) (defun shimbun-heise-wash-telepolis-article (header) (save-excursion ;; strip nasty "download" images (goto-char (point-min)) - (while (re-search-forward "" nil t nil) - (delete-region (point) (re-search-forward "" nil t nil))))) + (while (re-search-forward "" nil t nil) + (delete-region (point) (re-search-forward "" + nil t nil))) + (goto-char (point-min)) + (while (re-search-forward "") -(defvar shimbun-ibm-dev-content-end - "") +(defvar shimbun-ibm-dev-content-start "") +(defvar shimbun-ibm-dev-content-end "") + +(luna-define-method shimbun-index-url ((shimbun shimbun-ibm-dev)) + (shimbun-expand-url (concat (shimbun-current-group shimbun) "/library.html") + (shimbun-url-internal shimbun))) + +(luna-define-method shimbun-from-address ((shimbun shimbun-ibm-dev)) + (concat "IBM developerWorks (" (shimbun-current-group shimbun) ")")) (luna-define-method shimbun-get-headers ((shimbun shimbun-ibm-dev) &optional range) - (with-temp-buffer - (let* ((case-fold-search t) - (from (shimbun-from-address shimbun)) - (pages (shimbun-header-index-pages range)) - (group (shimbun-current-group-internal shimbun)) - (baseurl (concat (shimbun-url-internal shimbun) group "/")) - (count 0) - aux headers id url subject date datelist indexes index) - (setq index (shimbun-expand-url "library.html" baseurl)) - (shimbun-retrieve-url index 'reload) - (subst-char-in-region (point-min) (point-max) ?\t ?\ t) - (goto-char (point-min)) - (push index indexes) ;; push latest - ;; check old lib - (while (re-search-forward "[0-9]+年" nil t)) + (push (shimbun-expand-url (match-string 1) base) indexes))) + (let ((pattern (format "/jp/developerworks/%s/" + (regexp-quote (shimbun-current-group shimbun))))) + (dolist (index (nreverse indexes)) + (unless (string= index base) + (erase-buffer) + (shimbun-fetch-url shimbun index)) (goto-char (point-min)) (while (re-search-forward - ;; getting URL, SUBJECT and DATE - "]+\\)?>\\(.*\\) (\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)) *
        " - nil t) - (setq url (match-string 1) - subject (match-string 3) - datelist (list (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - date (apply 'shimbun-make-date-string datelist)) - ;; remove ...(bold tag) if exist in subject - (let ((start 0)) - (while (string-match "" subject start) - (setq subject (replace-match "" nil nil subject) - start (match-beginning 0)))) - ;; adjusting URL - (setq url (shimbun-expand-url url baseurl)) - ;; building ID - (setq aux (if (string-match "\\([^/]+\\)\\.html" url) - (match-string 1 url) - url)) - (setq id (format "<%s%%%02d%02d%02d%%%s@www-6.ibm.com>" aux - (car datelist) (car (cdr datelist)) - (car (cdr (cdr datelist))) - group)) - (when (shimbun-search-id shimbun id) - (throw 'stop nil)) - (push (shimbun-make-header - 0 (shimbun-mime-encode-string subject) - from date id "" 0 0 url) - headers) - (forward-line 1)))) + "\\([^<>]+\\)" nil t) + (let ((url (shimbun-expand-url (match-string 1) index)) + (subject (match-string 2))) + (when (string-match pattern url) + (let ((id (concat "<" (md5 url) + "%" (shimbun-current-group shimbun) + "@" (shimbun-server shimbun) + ".shimbun.namazu.org>"))) + (when (shimbun-search-id shimbun id) + (throw 'stop headers)) + (push (shimbun-create-header nil subject + (shimbun-from-address shimbun) + nil id "" 0 0 url) + headers))))))) headers))) -(luna-define-method shimbun-article-url ((shimbun shimbun-ibm-dev) header) - (with-temp-buffer - (let ((url (shimbun-article-base-url shimbun header))) - (shimbun-fetch-url shimbun url) - (if (re-search-forward "\ -" nil t) - (match-string 1) - url)))) - (luna-define-method shimbun-clear-contents :around ((shimbun shimbun-ibm-dev) header) + (goto-char (point-min)) + (when (re-search-forward "" nil t) + (shimbun-header-set-date header + (shimbun-make-date-string + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (string-to-number (match-string 3))))) + (when (re-search-forward "\\([^<>]+\\)" nil t) + (let ((name (match-string 1))) + (shimbun-header-set-from header + (if (looking-at + "[^\n]*") + (concat name " <" (match-string 1) ">") + name)))) (when (luna-call-next-method) - (goto-char (point-min)) - (when (re-search-forward "

        " nil t) - (search-backward "

        " nil t) - (delete-region (point-min) (match-beginning 0))) + (shimbun-remove-tags "" "") + (shimbun-remove-tags "script" t) t)) (provide 'sb-ibm-dev) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-impress.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-impress.el --- work/emacs-w3m-1.4.4/shimbun/sb-impress.el 2005-03-08 15:41:56.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-impress.el 2009-09-18 17:41:26.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-impress.el --- shimbun backend for www.watch.impress.co.jp -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 ;; Yuuichi Teranishi ;; Author: Yuuichi Teranishi @@ -19,55 +19,64 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: + (require 'shimbun) -(require 'md5) -(eval-when-compile - (require 'cl)) +(require 'sb-rss) -(luna-define-class shimbun-impress (shimbun) ()) +(luna-define-class shimbun-impress (shimbun-rss) ()) (defvar shimbun-impress-url "http://www.watch.impress.co.jp/") (defvar shimbun-impress-groups-alist - '( ;; group link-regexp start end address? - ("enterprise" "]*\\)\\)\">" - "" "" "http://enterprise.watch.impress.co.jp/") - ("pc" "]*\\)\\)\">" - "" "" "http://pc.watch.impress.co.jp/") - ("dc" "]*\\)\\)\">" - "" "" "http://dc.watch.impress.co.jp/") + '( ;; group (rss | link-regexp) start end address? + ("enterprise" rss + "" "" + "http://enterprise.watch.impress.co.jp/cda/rss/enterprise.rdf") + ("pc" rss + "" "" + "http://pc.watch.impress.co.jp/sublink/pc.rdf") + ("dc" rss + "" "" + "http://dc.watch.impress.co.jp/cda/rss/digicame.rdf") ("akiba" "]*\\)\\)\">" "" -"\\(\\|\\)") - ("av" "]*\\)\\)\">" - "\\(\\|
        \\)" "\\(\\|\\)") - ("game" "
        ]*\\)\\)\">" - "\\(\n\\|\\)" "") - ("k-tai" "\"]*\\)\">" - "" "" "http://k-tai.impress.co.jp/") - ("internet" "]*\\)\\)\">" - "" "" "http://internet.watch.impress.co.jp/") - ("bb" "\"]*\\)\">" - "" "" "http://bb.watch.impress.co.jp/") - ("forest" - "]*\\)\\)\">" + "" + "\\(\\|\\)") + ("av" rss + "\\(\\|
        \\)" "\\(\\|\\)" + "http://www.watch.impress.co.jp/av/sublink/av.rdf") + ("game" rss + "" "\\(\\|\\)" + "http://www.watch.impress.co.jp/game/sublink/game.rdf") + ("k-tai" rss + "" "" + "http://k-tai.impress.co.jp/cda/rss/ktai.rdf") + ("internet" rss + "" "" + "http://internet.watch.impress.co.jp/cda/rss/internet.rdf") + ("bb" rss + "" "" + "http://bb.watch.impress.co.jp/cda/rss/broadband.rdf") + ("forest" rss "" "" - "http://www.forest.impress.co.jp/") + "http://www.forest.impress.co.jp/rss.xml") + ("robot" rss + "" "" + "http://robot.watch.impress.co.jp/cda/rss/robot.rdf") + ("kaden" rss + "" "" + "http://kaden.watch.impress.co.jp/cda/rss/kaden.rdf") + ("car" rss + "" "" + "http://car.watch.impress.co.jp/docs/car.rdf") )) (defvar shimbun-impress-groups (mapcar 'car shimbun-impress-groups-alist)) @@ -78,6 +87,7 @@ JzTbXTM!V{ecn<+l,RDM&H3CKdu8tWENJlbRm)a|Hk+limu}hMtR\\E!%r\ 9wC\"6\n ebr5rj1[UJ5zDEDsfo`N7~s%;P`\\JK'#y.w^>K]E~{`wZru"))) ;;(defvar shimbun-impress-expiration-days 7) +(defvar shimbun-impress-ignored-subject "^\\(AD\\|PR\\):") (luna-define-method shimbun-index-url ((shimbun shimbun-impress)) (or (nth 4 (assoc (shimbun-current-group-internal shimbun) @@ -85,8 +95,13 @@ (concat (shimbun-url-internal shimbun) (shimbun-current-group-internal shimbun) "/"))) -(defsubst shimbun-impress-get-headers-date (shimbun &optional range) - "get headers for url is date.target is all groups \"k-tai\" and \"bb\"is not included." +(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-impress) + url &optional date) + (concat "<" (md5 url) "%" (shimbun-current-group shimbun) + "@www.watch.impress.co.jp>")) + +(defun shimbun-impress-get-headers (shimbun &optional range) + "Get headers without RSS." (let ((case-fold-search t) (regexp (nth 1 (assoc (shimbun-current-group-internal shimbun) shimbun-impress-groups-alist))) @@ -130,61 +145,19 @@ headers)))) headers)) -(defsubst shimbun-impress-get-headers-sequence (shimbun &optional range) - "get headers for url is sequence number.target is \"k-tai\" and \"bb\"." - (let ((case-fold-search t) - (regexp (nth 1 (assoc (shimbun-current-group-internal shimbun) - shimbun-impress-groups-alist))) - ids - headers) - (goto-char (point-min)) - (while (re-search-forward regexp nil t) - (let* ((apath (match-string 1)) - (number (string-to-number (match-string 2))) - (url (shimbun-expand-url apath (shimbun-index-url shimbun))) - (pos (point)) - subject - id) - (when (re-search-forward "" nil t) - (setq subject (buffer-substring pos (match-beginning 0)) - subject (with-temp-buffer - (insert subject) - (goto-char (point-min)) - (when (re-search-forward "
        \\(−\\|〜\\).*" nil t) - (replace-match "") - (goto-char (point-min))) - (while (re-search-forward "[\r\n]" nil t) - (replace-match "")) - (shimbun-remove-markup) - (buffer-string)))) - (setq id (concat "<" (md5 url) "%" (shimbun-current-group shimbun) - "www.watch.impress.co.jp>")) - (unless (member id ids) - (setq ids (cons id ids)) - (push (shimbun-create-header - number - (or subject "") - (shimbun-from-address shimbun) - "" - id - "" 0 0 - url) - headers)))) - headers)) +(luna-define-method shimbun-headers :around ((shimbun shimbun-impress) + &optional range) + (if (eq (nth 1 (assoc (shimbun-current-group-internal shimbun) + shimbun-impress-groups-alist)) + 'rss) + (luna-call-next-method) + (with-temp-buffer + (shimbun-fetch-url shimbun (shimbun-index-url shimbun) t) + (shimbun-remove-tags "") ;; clear comment-outed html source + (shimbun-impress-get-headers shimbun range)))) -(luna-define-method shimbun-get-headers ((shimbun shimbun-impress) - &optional range) - (shimbun-remove-tags "") ;; clear comment-outed html source - (cond - ;; k-tai and bb - ((or (equal "k-tai" (shimbun-current-group-internal shimbun)) - (equal "bb" (shimbun-current-group-internal shimbun))) - (shimbun-impress-get-headers-sequence shimbun range)) - ;; all others - (t - (shimbun-impress-get-headers-date shimbun range) - ) - )) +(luna-define-method shimbun-article-url :around ((shimbun shimbun-impress) header) + (shimbun-real-url (luna-call-next-method))) (luna-define-method shimbun-make-contents :around ((shimbun shimbun-impress) &optional header) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-infoshop.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-itmedia.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-itmedia.el --- work/emacs-w3m-1.4.4/shimbun/sb-itmedia.el 2005-03-14 07:25:40.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-itmedia.el 2011-10-11 11:02:14.000000000 +0900 @@ -1,9 +1,11 @@ ;;; sb-itmedia.el --- shimbun backend for ITmedia -*- coding: iso-2022-7bit -*- -;; Copyright (C) 2004, 2005 Yuuichi Teranishi +;; Copyright (C) 2004-2011 Yuuichi Teranishi ;; Author: TSUCHIYA Masatoshi , -;; Yuuichi Teranishi +;; Yuuichi Teranishi , +;; ARISAWA Akihiro , +;; Katsumi Yamaoka ;; Keywords: news ;; This file is a part of shimbun. @@ -19,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -34,218 +36,279 @@ (require 'cl)) (require 'shimbun) +(require 'sb-rss) +(require 'sb-multi) -(luna-define-class shimbun-itmedia (shimbun) ()) - -(defvar shimbun-itmedia-url "http://www.itmedia.co.jp/") +(luna-define-class shimbun-itmedia (shimbun-multi shimbun-rss) ()) (defvar shimbun-itmedia-group-alist - (let ((template (concat "
        ]+\\)\\.html\\)[^>]*>"))) - `(("anchordesk" "anchordesk" - ,(format template "anchordesk/articles") - "[[^ ]* \\([0-9]+:[0-9]+\\)]") - ("bursts" "news/bursts" - ,(format template "enterprise/articles\\|news/articles") - "[[^ ]* \\([0-9]+:[0-9]+\\)]") - ("business" "news/business" - ,(format template "news/articles") - nil) - ("enterprise" "enterprise" - ,(format template "enterprise/articles") - "[[^ ]* \\([0-9]+:[0-9]+\\)]") - ("games" "games/news" - ,(format template "games/articles") - nil) - ("lifestyle" "lifestyle" - ,(format template "lifestyle/articles") - nil) - ("mobile" "mobile/news" - ,(format template "mobile/articles") - nil) - ("news" "news/past" - ,(format template "news/articles") - "(\\([0-9]+:[0-9]+\\))") - ("pcupdate" "pcupdate/news" - ,(format template "pcupdate/articles") - nil) - ("technology" "news/technology" - ,(format template "news/articles") - nil)))) + `(,@(mapcar + (lambda (group) + (list (concat "news." group) (concat "news_" group))) + '("bursts" "domestic" "foreign" "products" "technology" "web20" + "nettopics" "society" "security" "industry" "research" "sp_amd")) + ("anchordesk" "anchordesk") + ("bizid" "bizid") + ("enterprise" "enterprise") + ,@(mapcar + (lambda (group) + (list (concat "+D." group) group)) + '("plusd" "mobile" "pcupdate" "lifestyle" "games" "docomo" "au_kddi" + "vodafone" "shopping")) + ,@(mapcar + (lambda (def) + (nconc (list (concat "+D.lifestyle.column." (car def)) nil) def)) + '(("asakura" "麻倉怜士" + "http://www.itmedia.co.jp/keywords/emma.html") + ("honda" "本田雅一") + ("kobayashi" "こばやしゆたか") + ("kodera" "小寺信良" + "http://www.itmedia.co.jp/keywords/kodera_nobuyoshi.html") + ("nishi" "西正") + ("ogikubo" "荻窪圭" + "http://plusd.itmedia.co.jp/lifestyle/features/satuei/") + ("tachibana" "橘十徳" + "http://plusd.itmedia.co.jp/lifestyle/features/jibara/") + ("takemura" "竹村譲") + ("unakami" "海上忍" + "http://plusd.itmedia.co.jp/lifestyle/features/keyword/"))))) -(defvar shimbun-itmedia-server-name "ITmedia") -(defvar shimbun-itmedia-from-address "webmaster@itmedia.co.jp") (defvar shimbun-itmedia-x-face-alist - '(("default" . "X-Face: %JzFW&0lP]xKGl{Bk3\\`yC0zZp|!;\\KT9'rqE2AIk\ + '(("\\+D" . "X-Face: #Ur~tK`JhZFFHPEVGKEi`MS{55^~&^0KUuZ;]-@WQ[8\ +@,Ex'EeAAE}6xF\\|
        ") +(defvar shimbun-itmedia-content-end "
        ") + +(defvar shimbun-itmedia-retry-fetching 1) +(defvar shimbun-itmedia-ignored-subject "^PR:") + +(luna-define-method initialize-instance :after ((shimbun shimbun-itmedia) + &rest init-args) + (shimbun-rss-initialize-ignored-subject shimbun)) + (luna-define-method shimbun-groups ((shimbun shimbun-itmedia)) (mapcar 'car shimbun-itmedia-group-alist)) +(luna-define-method shimbun-from-address ((shimbun shimbun-itmedia)) + (let ((group (shimbun-current-group-internal shimbun))) + (format "ITmedia (%s)" + (or (nth 3 (assoc group shimbun-itmedia-group-alist)) group)))) + (luna-define-method shimbun-index-url ((shimbun shimbun-itmedia)) - (concat - (shimbun-url-internal shimbun) - (nth 1 (assoc (shimbun-current-group-internal shimbun) - shimbun-itmedia-group-alist)) - "/")) - -(luna-define-method shimbun-get-headers ((shimbun shimbun-itmedia) - &optional range) -;;; -;; (shimbun-itmedia-get-headers shimbun)) -;; -;;(defun shimbun-itmedia-get-headers (shimbun) -;;; - (let* ((case-fold-search t) - (group (shimbun-current-group-internal shimbun)) - (url-regexp (nth 2 (assoc group shimbun-itmedia-group-alist))) - (time-regexp (nth 3 (assoc group shimbun-itmedia-group-alist))) - (table '((":" ":") ("[" "[") ("]" "]"))) - next headers) - (while (search-forward "\r" nil t) - (replace-match "\n")) - (goto-char (point-min)) - (while (if next + (let ((def (assoc (shimbun-current-group-internal shimbun) + shimbun-itmedia-group-alist))) + (or (nth 4 def) + (if (nth 1 def) + (format "http://rss.itmedia.co.jp/rss/2.0/%s.xml" (nth 1 def)) + (format "http://plusd.itmedia.co.jp/lifestyle/column/%s.html" + (nth 2 def)))))) + +(luna-define-method shimbun-headers :around ((shimbun shimbun-itmedia) + &optional range) + (if (string-match "\\.xml\\'" (shimbun-index-url shimbun)) + ;; Use the function defined in sb-rss.el. + (luna-call-next-method) + ;; Use the default function defined in shimbun.el. + (funcall (intern "shimbun-headers" + (luna-class-obarray (luna-find-class 'shimbun))) + shimbun range))) + +(luna-define-method shimbun-get-headers :around ((shimbun shimbun-itmedia) + &optional range) + (if (string-match "\\.xml\\'" (shimbun-index-url shimbun)) + (luna-call-next-method) + (let ((case-fold-search t) + (group (nth 2 (assoc (shimbun-current-group-internal shimbun) + shimbun-itmedia-group-alist))) + (from (shimbun-from-address shimbun)) + headers) + (goto-char (point-min)) + (let ((regexp "\ +-]+\\)?[\t\n ]*-+>[\t\n ]*")) + (when (re-search-forward regexp nil t) + (delete-region (point-min) (match-end 0))) + (goto-char (point-max)) + (when (re-search-backward regexp nil t) + (delete-region (match-beginning 0) (point-max))) + (goto-char (point-min)) + (setq regexp (if (string-equal group "kodera") + "\\(?:[\t\n ]*\\|[\t\n ]*[\t\n ]*\\)\\([^<]+\\)" + "\\(?:[\t\n ]*\\|[\t\n ]*[\t\n ]*\\)\\([^<]+\\)")) + (while (re-search-forward regexp nil t) + (push (shimbun-create-header + 0 (match-string 6) from + (shimbun-make-date-string + (+ (string-to-number (match-string 2)) 2000) + (string-to-number (match-string 3)) + (string-to-number (match-string 4))) + (concat + "<20" (match-string 2) (match-string 3) (match-string 4) + "." (match-string 5) "." group + ".column.lifestyle@itmedia.shimbun.namazu.org>") + "" 0 0 + (match-string 1)) + headers))) + headers))) + +(luna-define-method shimbun-multi-next-url ((shimbun shimbun-itmedia) + header url) + (goto-char (point-min)) + (when (re-search-forward + "次のページ\ +\\|次のページへ" nil t) + (let ((next (or (match-string 1) (match-string 2)))) + (prog1 + (shimbun-expand-url next url) + ;; Remove navigation button. + (goto-char (point-min)) + (when (and (re-search-forward "\ +]+[\t\n ]+\\)*id=\"notice\"" + nil t) + (shimbun-end-of-tag "div" t) + (save-match-data + (re-search-backward (concat "[\t\n ]href=\"" + (regexp-quote next) + "\"") + (match-beginning 0) t))) + (replace-match "\n")))))) + +(luna-define-method shimbun-multi-clear-contents ((shimbun shimbun-itmedia) + header + has-previous-page + has-next-page) + (let (credit) + (when (and (not has-previous-page) (progn - (set-match-data next) - (setq next nil) - (goto-char (match-end 0))) - (re-search-forward url-regexp nil t)) - (unless (string= "index" (match-string 7)) - (let ((url (match-string 2)) - (year (+ 2000 (string-to-number (match-string 4)))) - (month (string-to-number (match-string 5))) - (day (string-to-number (match-string 6))) - (id (format "<%s%s%s%s%%%s>" - (match-string 4) - (match-string 5) - (match-string 6) - (match-string 7) - group)) - (subject (mapconcat - (lambda (s) - (dolist (e table s) - (setq s (apply 'shimbun-replace-in-string s e)))) - (delete - "" - (split-string - (buffer-substring (match-end 0) - (progn - (search-forward "" nil t) - (point))) - "[\t\n ]*<[^>]+>[\t\n ]*\\|[\t\n  ]+")) - " ")) - time) - (unless (zerop (length subject)) - (setq subject (shimbun-replace-in-string - subject " ?\\([“”()「」]\\) ?" "\\1")) - (when time-regexp - (setq next (point) - next (when (re-search-forward url-regexp nil t) - (goto-char next) - (match-data)) - time (when (re-search-forward time-regexp (car next) t) - (match-string 1)))) - (push (shimbun-create-header - 0 subject - (shimbun-from-address shimbun) - (shimbun-make-date-string year month day time) - id "" 0 0 - (concat shimbun-itmedia-url url)) - headers))))) - (shimbun-sort-headers headers))) - -(defun shimbun-itmedia-clean-text-page () - (let ((case-fold-search t) (start)) - (goto-char (point-min)) - (when (and (search-forward "" nil t) - (setq start (match-end 0)) - (re-search-forward "" nil t)) - (delete-region (match-beginning 0) (point-max)) - (delete-region (point-min) start) - ;; Remove anchors to both the next page and the previous page. - ;; These anchors are inserted into the head and the tail of the - ;; article body. - (skip-chars-backward " \t\r\f\n") - (forward-line 0) - (when (looking-at "

        <[AB]") - (delete-region (point) (point-max))) + (goto-char (point-min)) + (re-search-forward "[\t\n ]*" nil t)) + (looking-at "]+>[^\n]+")) + (setq credit (match-string 1)) + (when (string-match "\\[ITmedia\\]" credit) + (setq credit nil))) + (when (shimbun-clear-contents shimbun header) + (goto-char (point-min)) + (when credit + (insert "\n")) + ;; Remove navigation buttons. + (while (and (re-search-forward "\ +]+[\t\n ]+\\)*class=\"ctrl\"" + nil t) + (shimbun-end-of-tag "div" t) + (save-match-data + (re-search-backward "[次前]のページへ" + (match-beginning 0) t))) + (replace-match "\n")) (goto-char (point-min)) - (skip-chars-forward " \t\r\f\n") - (when (looking-at "

        <[AB]") - (delete-region (point-min) (line-end-position)))) - (shimbun-remove-tags "" "") - (shimbun-remove-tags "\ + (when has-previous-page + (insert " ") ;; ^L + ;; Remove tags that likely cause a newline preceding a page. + (when (and (looking-at "[\t\n ]*<\\(h[0-9]+\\|p\\)[\t\n >]") + (shimbun-end-of-tag (match-string 1) t)) + (replace-match "\n\\3\n"))) + t))) + +(luna-define-method shimbun-clear-contents :around ((shimbun shimbun-itmedia) + header) + (or (luna-call-next-method) + ;; Extract the article body and return t if successful. + (let ((case-fold-search t) + start end md) + (goto-char (point-min)) + (when (and (re-search-forward "]+[\t\n ]+\\)*\ +id=\"cms\\(?:Abstract\\|Byline\\|\\(Body\\)\\)\"" nil t) + (progn + (setq start (match-beginning 0)) + (or (match-beginning 1) + (re-search-forward "\ +]+[\t\n ]+\\)*id=\"cmsBody\"" nil t))) + (shimbun-end-of-tag "div" t)) + (setq end (match-end 1)) + (goto-char start) + (delete-region (if (re-search-forward "[\t\n ]*[\t\n ]*関連" + end t) + (match-beginning 0) + end) + (point-max)) + (delete-region (point-min) start) + (goto-char (point-max)) + (insert "\n") + (shimbun-remove-tags "" "") + (shimbun-remove-tags "" "") + (shimbun-remove-tags "\ ]*SRC=\"http:/[^\"]*/\\(ad\\.itmedia\\.co\\.jp\\|\ a1100\\.g\\.akamai\\.net\\)/[^>]+>") - (shimbun-remove-tags "\ + (shimbun-remove-tags "\ ]*HREF=\"http:/[^\"]*/\\(ad\\.itmedia\\.co\\.jp\\|\ -a1100\\.g\\.akamai\\.net\\)/[^>]+>[^<]*"))) +a1100\\.g\\.akamai\\.net\\)/[^>]+>[^<]*") -(defun shimbun-itmedia-retrieve-next-pages (shimbun base-cid url - &optional images) - (let ((case-fold-search t) (next)) - (goto-char (point-min)) - (when (re-search-forward - "次のページ" nil t) - (setq next (shimbun-expand-url (match-string 1) url))) - (shimbun-itmedia-clean-text-page) - (goto-char (point-min)) - (insert "\n\n\n\n\n") - (goto-char (point-max)) - (insert "\n\n\n") - (when shimbun-encapsulate-images - (setq images (shimbun-mime-replace-image-tags base-cid url images))) - (let ((body (shimbun-make-text-entity "text/html" (buffer-string))) - (result (when next - (with-temp-buffer - (shimbun-fetch-url shimbun next) - (shimbun-itmedia-retrieve-next-pages shimbun base-cid - next images))))) - (list (cons body (car result)) - (or (nth 1 result) images))))) - -(luna-define-method shimbun-make-contents ((shimbun shimbun-itmedia) header) - (let ((case-fold-search t)) - (when (re-search-forward "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\) \ -\\([0-9]+:[0-9]+\\) 更新" nil t) - (shimbun-header-set-date - header - (shimbun-make-date-string - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3)) - (match-string 4)))) - (let ((base-cid (shimbun-header-id header))) - (when (string-match "\\`<\\([^>]+\\)>\\'" base-cid) - (setq base-cid (match-string 1 base-cid))) - (let (body) - (multiple-value-bind (texts images) - (shimbun-itmedia-retrieve-next-pages shimbun base-cid - (shimbun-header-xref header)) - (erase-buffer) - (if (= (length texts) 1) - (setq body (car texts)) - (setq body (shimbun-make-multipart-entity)) - (let ((i 0)) - (dolist (text texts) - (setf (shimbun-entity-cid text) - (format "shimbun.%d.%s" (incf i) base-cid)))) - (apply 'shimbun-entity-add-child body texts)) - (when images - (setf (shimbun-entity-cid body) (concat "shimbun.0." base-cid)) - (let ((new (shimbun-make-multipart-entity))) - (shimbun-entity-add-child new body) - (apply 'shimbun-entity-add-child new - (mapcar 'cdr (nreverse images))) - (setq body new)))) - (shimbun-header-insert shimbun header) - (insert "MIME-Version: 1.0\n") - (shimbun-entity-insert body))) - (buffer-string))) + ;; Insert line-break after images. + (goto-char (point-min)) + (while (re-search-forward + "\\(]+>\\(?:[\t\n ]*<[^>]+>\\)*\\)[\t\n ]*" + nil t) + (when (or + ;; Look forward for . + (progn + (setq start (point) + md (match-data)) + (and (re-search-forward "\\)[\t\n ]*" + nil t) + (or (match-beginning 1) + (progn + (goto-char start) + (set-match-data md) + nil)))) + ;; Look backward for . + (re-search-backward "\\(]+>\\)[\t\n ]*" + (match-beginning 1) t)) + (goto-char (match-end 0))) + (unless + ;; Check if there's a tag that is likely to cause + ;; the line-break. + (looking-at "\\(?:]+>[\t\n ]*\\)*\ +<\\(?:br\\|div\\|h[0-9]+\\|p\\)\\(?:[\t\n ]*>\\|[\t\n ]\\)") + (replace-match "\\1
        \n"))) + (let ((hankaku (shimbun-japanese-hankaku shimbun))) + (when (and hankaku (not (memq hankaku '(header subject)))) + (shimbun-japanese-hankaku-buffer t))) + t)))) + +(luna-define-method shimbun-make-contents :before ((shimbun shimbun-itmedia) + header) + (when (re-search-forward "\\([0-9]+\\)年\\([0-9]+\\)月\\([0-9]+\\)日 \ +\\([0-9]+\\)時\\([0-9]+\\)分 更新" nil t) + (shimbun-header-set-date + header + (shimbun-make-date-string + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (string-to-number (match-string 3)) + (concat (match-string 4) ":" (match-string 5)))))) + +(luna-define-method shimbun-footer :around ((shimbun shimbun-itmedia) + header &optional html) + (if html + (concat "

        \n-- 
        \n\ +この記事の諸権利は ITmedia または情報の提供元に帰属します。
        +原物はここで公開されています。\n
        \n") + (concat "-- \n\ +この記事の諸権利は ITmedia または情報の提供元に帰属します。\n\ +原物は以下の場所で公開されています:\n" + (shimbun-article-base-url shimbun header) "\n"))) (provide 'sb-itmedia) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-japantimes.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-japantimes.el --- work/emacs-w3m-1.4.4/shimbun/sb-japantimes.el 2005-01-08 21:50:24.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-japantimes.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-japantimes.el --- shimbun backend for www.japantimes.co.jp -;; Author: Hidetaka Iwai +;; Author: Hidetaka Iwai , +;; KASUGA Toru ;; Keywords: news @@ -17,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -29,86 +30,87 @@ ;;; Code: (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-japantimes (shimbun shimbun-text) ()) +(luna-define-class shimbun-japantimes (shimbun) ()) -(defvar shimbun-japantimes-url "http://www.japantimes.co.jp/") +(defvar shimbun-japantimes-url + "http://www.japantimes.co.jp/") (defvar shimbun-japantimes-groups '("general" "business")) -(defvar shimbun-japantimes-from-address "webmaster@japantimes.co.jp") -(defvar shimbun-japantimes-content-start "

        \n") -(defvar shimbun-japantimes-content-end "\n\n") - -(defvar shimbun-japantimes-group-path-alist - '(("general" . "news.htm") - ("business" . "business.htm"))) +(defvar shimbun-japantimes-from-address + "webmaster@japantimes.co.jp") +(defvar shimbun-japantimes-content-start + "
        \\|
        ") +(defvar shimbun-japantimes-content-end + "^
        ") + +(defvar shimbun-japantimes-group-table + '(("general" "news.htm" "nn") + ("business" "news.htm" "nb"))) (defvar shimbun-japantimes-expiration-days 7) (luna-define-method shimbun-index-url ((shimbun shimbun-japantimes)) (concat (shimbun-url-internal shimbun) - (cdr (assoc (shimbun-current-group-internal shimbun) - shimbun-japantimes-group-path-alist)))) + (nth 1 (assoc (shimbun-current-group-internal shimbun) + shimbun-japantimes-group-table)))) (luna-define-method shimbun-get-headers ((shimbun shimbun-japantimes) &optional range) - (let ((case-fold-search t) headers) + (let ((regexp + (format + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat "" + ;; 7. subject + s0 "\\([^[<>]+\\)" + s0 ""))) + (nth 2 (assoc (shimbun-current-group-internal shimbun) + shimbun-japantimes-group-table)))) + (case-fold-search t) + url serial year month day tag subject id date headers) (goto-char (point-min)) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 7 - s0 "" s1 - "" s0 - ;; 9. subject - "\\([^[<>]+\\)" - "
        "))) - nil t) - (let* ((url (match-string 1)) - (serial (match-string 2)) - (year (match-string 3)) - (month (match-string 4)) - (day (match-string 5)) - (tag (match-string 6)) - (subject (match-string 9)) - id date) - (setq id (format "<%s%s%s%s%s%%%s.japantimes.co.jp>" - serial year month day tag - (shimbun-current-group-internal shimbun))) - (setq date (shimbun-make-date-string - (string-to-number year) - (string-to-number month) - (string-to-number day))) - (push (shimbun-make-header - 0 - (shimbun-mime-encode-string subject) - (shimbun-from-address shimbun) - date id "" 0 0 (concat - (shimbun-url-internal shimbun) - url)) - headers))) + (while (re-search-forward regexp nil t) + (setq url (match-string 1) + serial (match-string 2) + year (match-string 3) + month (match-string 4) + day (match-string 5) + tag (match-string 6) + subject (match-string 7) + id (format "<%s%s%s%s%s%%%s.japantimes.co.jp>" + serial + year + month + day + tag + (shimbun-current-group-internal shimbun)) + date (shimbun-make-date-string + (string-to-number year) + (string-to-number month) + (string-to-number day))) + (push (shimbun-make-header + 0 + (shimbun-mime-encode-string subject) + (shimbun-from-address shimbun) + date id "" 0 0 url) + headers)) headers)) (provide 'sb-japantimes) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-javaconf.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-javaconf.el --- work/emacs-w3m-1.4.4/shimbun/sb-javaconf.el 2005-03-14 07:25:36.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-javaconf.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-javaconf.el --- shimbun backend class for java-conference archive. -;; Copyright (C) 2001, 2002, 2003, 2004 ABE Yasushi +;; Copyright (C) 2001, 2002, 2003, 2004, 2007 ABE Yasushi ;; Author: ABE Yasushi ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -43,10 +43,10 @@ "\\([^<]+\\)\n \\([^<]+\\)\n") (defmacro shimbun-javaconf-concat-url (shimbun url) - (` (concat (shimbun-url-internal (, shimbun)) - (shimbun-current-group-internal shimbun) - "/" - (, url)))) + `(concat (shimbun-url-internal ,shimbun) + (shimbun-current-group-internal ,shimbun) + "/" + ,url)) (luna-define-method shimbun-get-headers ((shimbun shimbun-javaconf) &optional range) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-jpilot.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-jpilot.el --- work/emacs-w3m-1.4.4/shimbun/sb-jpilot.el 2005-03-14 07:25:42.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-jpilot.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-jpo.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-jpo.el --- work/emacs-w3m-1.4.4/shimbun/sb-jpo.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-jpo.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; @@ -54,9 +54,6 @@ ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (luna-define-class shimbun-jpo (shimbun) ()) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-kantei.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-kantei.el --- work/emacs-w3m-1.4.4/shimbun/sb-kantei.el 2004-10-05 08:42:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-kantei.el 2012-04-12 16:45:16.000000000 +0900 @@ -1,6 +1,6 @@ -;;; sb-kantei.el --- shimbun backend for kantei mail magazine backnumber -*- coding: iso-2022-7bit; -*- +;;; sb-kantei.el --- shimbun backend for kantei blog backnumber -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2003, 2003, 2004 Yuuichi Teranishi +;; Copyright (C) 2001-2012 Yuuichi Teranishi ;; Author: Yuuichi Teranishi ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -31,94 +31,527 @@ (luna-define-class shimbun-kantei (shimbun) ()) (defvar shimbun-kantei-url "http://www.kantei.go.jp/") -(defvar shimbun-kantei-from-address "koizumi@mmz.kantei.go.jp") -(defvar shimbun-kantei-groups '("m-magazine-en" "m-magazine-ja" "m-magazine") - "List of groups of the Koizumi cabinet email magazine. -Note that the `m-magazine-ja' is the same as `m-magazine' which is for -the backward compatibility.") - -(defvar shimbun-kantei-content-start - "\\|
        ")
        -(defvar shimbun-kantei-content-end
        -  "\\(\\)\\|\\(
        \\)\n\n") +(defvar shimbun-kantei-groups '("blog-en" + "blog-ja" + "blog-en.kan" + "blog-ja.kan" + "m-magazine-cn.hatoyama" + "m-magazine-kr.hatoyama" + "m-magazine-en.hatoyama" + "m-magazine-ja.hatoyama" + "m-magazine-en.aso" + "m-magazine-ja.aso" + "m-magazine-en.fukuda" + "m-magazine-ja.fukuda" + "m-magazine-en.abe" + "m-magazine-ja.abe" + "m-magazine-en.koizumi" + "m-magazine-ja.koizumi" + ;; Backward compatibility. + "m-magazine") + "List of the groups subscribing to the blog of Japan's Cabinet. +Old e-mail magazines' archive are also supported. +Note that the `m-magazine-ja.koizumi' is the same as `m-magazine' +which is for the backward compatibility.") + (defvar shimbun-kantei-x-face-alist - '(("default" . "X-Face: .bsmj'!8A`wI\\o+KF!)#0.a0,f1MA~PH/5T0\ -fu$Mg+)_5G~NSk4.0t]&|f@^c3l8-Fuz8'|\n kr;td_Jn7|GwREbDs'H9$Iy#y\ -M#*J2c'L},(m8K:8?$vTPC%D}YJ[bV#7xw|{\"DJ:_?`V1m_4^+;7+\n JOf6v&\ -x6?mU-q=0}mTK5@\"-bFGuD}2Y/(lR/V#'?HRc2Jh2UrR,oIR~NL!})|^%kw"))) + ;; Don't change the order of the faces. See the method function that + ;; is applied to `shimbun-make-contents'. + '(("default" . "X-Face: )y>~@`/54G8A3vhuan6E%su\\r]&ACV[`\"4|_2e\"!\ +KcK5c8:G'\"C6<;7ovb1YWG4B%BY?:^r\n p[nt=j!$4c:Buz#]][;-i&P66^9aC\ +\\CtF^uD20*Y9SqW'lFN,mTLp[\"0`9Z?bS,BJ-CaA@a||]\n Oe]\";W)D3whpcUo(?a\ +&S|i=u\"r>{N9/GRtw'OC2W9M%5t_>") + ("\\.kan\\'" . "X-Face: #Mk`n~UfLBs/5u+Pl'tnaO~4.\";)nt-Ip-+H&X}D\ +u!TN~u*]-#PJ(Xo'uKzpq-l]6pac=~T\n hm-vH$Bh88Kq<[!1tY7\\wVW{fV=9ad4!`|\ +xnRw$tl:?a{01+wd:6ysB*[Mms:Gv%\\Dj-a<{MY{vKJK\n /*t91Ighysyc8}Z2NG#X]\ +W9fUoRI<7zrQw") + ("\\.hatoyama\\'" . "X-Face: Bhu:2dJ9#&[pX@hMRh=$pF|O>-,*d\"V+@u\"gB5\n ]}Yxh$n#S1BM\ +o,8|XYsIrL4grl\\|6JV6fq3!B`28KP2,M/.Tsh") + ("\\.aso\\'" . "X-Face: #(b'i|jCr9M1k*o`B1YbD.C*%\\T3~.mUK@q?}o4.\ +TC*~*~fPaHg\\]V+Q2$3wu$=:[HZ'C/&9e15i*4e>OV4`\n pdAVvpz`w<$QCu9'~:}|\ +h`SEZv\\U]f']V(QbE5'%u$InJltT4~|Ru\\vs~g!;y;1uY#8v<8|eGbb*i=\n a/RMY:'\"^)0:;L!2x8j|br~q/E=j.s!FBI-6xr") + ("\\.fukuda\\'" . "X-Face: R![ems6?kedF&(},`\";7nbUIT6Uyt2A9jSQ'\\\ +$=;,n.9vM+PFYQB}O\n x=IKEqN%\n 3EL93@D{*BW-{GE88b7{d^m-%v9}=-7=^M\ +#$?zJm$]Yy07J^}:#V?9t_<{fhavZVZQ1^1=SLQf3X=<\n z|Af_njD},U!m}4V}$]L_7\ +a!b>X!RW$['xZs$r=G?o|=M^O)IJoOurt|UKUu[UuQFT/r&vygySYUmf\n Jm;kjj") + ("\\.koizumi\\'\\|\\`m-magazine\\'" . "X-Face: .bsmj'!8A`wI\\o+KF\ +!)#0.a0,f1MA~PH/5T0fu$Mg+)_5G~NSk4.0t]&|f@^c3l8-Fuz8'|\n kr;td_Jn7|Gw\ +REbDs'H9$Iy#yM#*J2c'L},(m8K:8?$vTPC%D}YJ[bV#7xw|{\"DJ:_?`V1m_4^+;7+\n\ + JOf6v&x6?mU-q=0}mTK5@\"-bFGuD}2Y/(lR/V#'?HRc2Jh2UrR,oIR~NL!})|^%kw"))) (luna-define-method shimbun-index-url ((shimbun shimbun-kantei)) - (let ((group (shimbun-current-group-internal shimbun))) - (concat (shimbun-url-internal shimbun) - (cond ((string-equal group "m-magazine-en") - "foreign/m-magazine") - ((string-equal group "m-magazine") ;; Backward compatibility. - "jp/m-magazine") - (t - "jp/m-magazine")) - "/backnumber/"))) + (let* ((group (shimbun-current-group-internal shimbun)) + (url (cond ((string-equal group "blog-en") + "http://nodasblog.kantei.go.jp/") + ((string-equal group "blog-ja") + "http://kawaraban.kantei.go.jp/") + ((string-equal group "blog-en.kan") + "http://kansblog.kantei.go.jp/archives.html") + ((string-equal group "blog-ja.kan") + "http://kanfullblog.kantei.go.jp/archives.html") + ((string-equal group "m-magazine-cn.hatoyama") + "http://www.mmz.kantei.go.jp/\ +foreign/m-magazine/backnumber_ch/hatoyama_index.html") + ((string-equal group "m-magazine-kr.hatoyama") + "http://www.mmz.kantei.go.jp/\ +foreign/m-magazine/backnumber_ko/hatoyama_index.html") + ((string-equal group "m-magazine-en.hatoyama") + "http://www.mmz.kantei.go.jp/\ +foreign/m-magazine/backnumber/hatoyama.html") + ((string-equal group "m-magazine-ja.hatoyama") + "http://www.mmz.kantei.go.jp/\ +jp/m-magazine/backnumber/hatoyama.html") + ((string-equal group "m-magazine-en.aso") + "http://www.mmz.kantei.go.jp/\ +foreign/m-magazine/backnumber/aso.html") + ((string-equal group "m-magazine-ja.aso") + "http://www.mmz.kantei.go.jp/\ +jp/m-magazine/backnumber/aso.html") + ((string-equal group "m-magazine-en.fukuda") + "http://www.mmz.kantei.go.jp/\ +foreign/m-magazine/backnumber/fukuda.html") + ((string-equal group "m-magazine-ja.fukuda") + "http://www.mmz.kantei.go.jp/\ +jp/m-magazine/backnumber/hukuda.html") + ((string-equal group "m-magazine-en.abe") + "foreign/m-magazine/backnumber/abe.html") + ((string-equal group "m-magazine-ja.abe") + "jp/m-magazine/backnumber/abe.html") + ((string-equal group "m-magazine-en.koizumi") + "foreign/m-magazine/backnumber/koizumi.html") + ((string-equal group "m-magazine-ja.koizumi") + "jp/m-magazine/backnumber/koizumi.html") + ;; Backward compatibility. + ((string-equal group "m-magazine") + "jp/m-magazine/backnumber/koizumi.html") + ;; Default. + (t + "jp/m-magazine/backnumber/")))) + (cond ((string-match "\\`blog-\\(?:en\\|ja\\)\\'" group) + (concat url (format-time-string "%Y/%02m/"))) + ((string-match "\\`http:" url) + url) + (t + (concat (shimbun-url-internal shimbun) url))))) (luna-define-method shimbun-from-address ((shimbun shimbun-kantei)) - (format "%s <%s>" - (shimbun-mime-encode-string - (if (string-equal (shimbun-current-group-internal shimbun) - "m-magazine-en") - "Official Residence" - "首相官邸")) - (shimbun-from-address-internal shimbun))) + (let ((group (shimbun-current-group-internal shimbun))) + (cond ((string-equal group "blog-en") + "Yoshihiko Noda") + ((string-equal group "blog-ja") + "野田佳彦") + ((string-equal group "blog-en.kan") + "Naoto Kan") + ((string-equal group "blog-ja.kan") + "菅直人") + ((string-equal group "m-magazine-cn.hatoyama") + "p/山由射夫") + ((string-equal group "m-magazine-kr.hatoyama") + "GOEd>_86 @/E0?@") + ((string-equal group "m-magazine-en.hatoyama") + "Yukio Hatoyama") + ((string-equal group "m-magazine-ja.hatoyama") + "鳩山由紀夫") + ((string-equal group "m-magazine-en.aso") + "Taro Aso") + ((string-equal group "m-magazine-ja.aso") + "麻生太郎") + ((string-equal group "m-magazine-en.fukuda") + "Yasuo Fukuda") + ((string-equal group "m-magazine-ja.fukuda") + "福田康夫") + ((string-equal group "m-magazine-en.abe") + "Shinzo Abe") + ((string-equal group "m-magazine-ja.abe") + "安倍晋三") + ((string-equal group "m-magazine-en.koizumi") + "Junichiro Koizumi") + ((string-equal group "m-magazine-ja.koizumi") + "小泉純一郎") + ((string-equal group "m-magazine") ;; Backward compatibility. + "小泉純一郎") + (t + "野田佳彦")))) (luna-define-method shimbun-get-headers ((shimbun shimbun-kantei) &optional range) - (let (year month mday id url subject headers) - (while (re-search-forward - ;; 1. url - ;; 3. year (ja) - ;; 4. month (ja) - ;; 5. mday (ja) - ;; 6. month (en) - ;; 7. mday (en) - ;; 8. year (en) - ;; 9. subject - "\ -]+\\)\">\ -\\(\ -【\\(20[0-9][0-9]\\)/\\([01][0-9]\\)/\\([0-3][0-9]\\)】\ -\\|\ -\\[\\([01][0-9]\\)/\\([0-3][0-9]\\)/\\(20[0-9][0-9]\\)\\]\ -\\)\ -\[\t ]*\\([^<]+\\)" - nil t) - (setq year (string-to-number (or (match-string 3) (match-string 8))) - month (string-to-number (or (match-string 4) (match-string 6))) - mday (string-to-number (or (match-string 5) (match-string 7))) - url (match-string 1) - id (format "<%d%02d%02d%s@www.kantei.or.jp>" - year month mday - (shimbun-current-group-internal shimbun)) - subject (match-string 9)) - (push (shimbun-create-header - 0 - (or subject "") - (shimbun-from-address shimbun) - (shimbun-make-date-string year month mday) - id "" 0 0 - (if (string-match "\\`http:" url) - url - (concat (shimbun-index-url shimbun) url))) - headers)) - headers)) - -(luna-define-method shimbun-clear-contents ((shimbun shimbun-kantei) header) - (let ((case-fold-search t) start) - (when (and (re-search-forward (shimbun-content-start-internal shimbun) - nil t) + (let* ((group (shimbun-current-group-internal shimbun)) + (enp (string-match "\\`m-magazine-en" group)) + (cnp (string-match "\\`m-magazine-cn" group)) + (krp (string-match "\\`m-magazine-kr" group)) + (regexp + (cond + ((string-equal group "blog-en") + (eval-when-compile + (concat "]*>[\t\n ]*" + ;; 6. subject + "\\(\\(?:\\(?:[^<]*\\)+[^<]*\\)\\|[^<]+\\)"))) + ((string-equal group "blog-ja") + (eval-when-compile + (concat "]*>[\t\n ]*" + ;; 6. subject + "\\([^<]+\\)"))) + (enp + (eval-when-compile + (concat "]*>[\t\n ]*" + ;; 5. subject + "\\(\\(?:[^\t\n <]+[\t\n ]+\\)*[^\t\n <]+\\)" + "[\t\n ]*[\t\n ]*[\t\n ]*"))) + (cnp + (eval-when-compile + (concat "]*>[\t\n ]*" + ;; 5. subject + "\\(\\(?:[^\t\n <]+[\t\n ]+\\)*[^\t\n <]+\\)" + "[\t\n ]*[\t\n ]*[\t\n ]*"))) + (krp + (eval-when-compile + (concat "]*>[\t\n ]*" + ;; 5. subject + "\\(\\(?:[^\t\n <]+[\t\n ]+\\)*[^\t\n <]+\\)" + "[\t\n ]*[\t\n ]*[\t\n ]*"))) + (t + (eval-when-compile + (concat "]*>[\t\n ]*【[^】]+】[\t\n ]*" + ;; 6. subject + "\\([^<]+\\)"))))) + (parent (shimbun-index-url shimbun)) + (murl parent) + (from (shimbun-from-address shimbun)) + unreads time year month mday url subject rev id prev headers) + (catch 'stop + (while t + ;; Remove commented areas. + (while (re-search-forward "" + year month mday group)) + (setq year (string-to-number (match-string 2)) + month (string-to-number (match-string 3)) + mday (string-to-number (match-string 4)) + url (match-string 1) + subject (shimbun-replace-in-string (match-string 6) + "[\t\n  ]+" " ") + rev (match-string 5)) + (if (and (member group '("blog-en" "blog-ja")) + (prog2 + (setq prev (match-end 0)) + (re-search-forward "\ +]+[\t\n ]+\\)?class=\"time\"[^>]*>\ +\\(\\([012]?[0-9]\\):\\([0-5]?[0-9]\\)\\)" nil t) + (goto-char prev))) + (setq time (match-string 1) + id (format "<%d%02d%02d%02d%02d%s.%s%%kantei.go.jp>" + year month mday + (string-to-number (match-string 2)) + (string-to-number (match-string 3)) + (if rev (concat "-" rev) "") + group)) + (setq id (format "<%d%02d%02d%s.%s%%kantei.go.jp>" + year month mday (or rev "") group)))) + (unless (and (string-match "\\`blog-\\(?:en\\|ja\\)\\'" group) + (shimbun-search-id shimbun id)) + (push (shimbun-create-header + 0 subject from + (shimbun-make-date-string year month mday time) + id "" 0 0 + (if (string-match "\\`http:" url) + url + (shimbun-expand-url url parent))) + unreads))) + (if unreads + (setq headers (nconc unreads headers) + unreads nil) + (throw 'stop nil)) + (if (string-match "\\`blog-\\(?:en\\|ja\\)\\'" group) + (if (string-match "/\\(20[1-9][0-9]\\)/\\([01][0-9]\\)/\\'" murl) + (progn + (setq year (string-to-number (match-string 1 murl)) + month (1- (string-to-number (match-string 2 murl)))) + (when (<= month 0) + (setq month 12 + year (1- year))) + (if (and (= year 2011) (< month 9)) + (throw 'stop nil) + (setq murl (format "%s/%d/%02d/" + (substring murl 0 (match-beginning 0)) + year month)) + (erase-buffer) + (shimbun-retrieve-url murl))) + (throw 'stop nil)) + (throw 'stop nil)))) + (shimbun-sort-headers headers))) + +(luna-define-method shimbun-clear-contents :around ((shimbun shimbun-kantei) + header) + (let ((case-fold-search t) + (group (shimbun-current-group-internal shimbun)) + start end section) + (if (and (search-forward "
        " nil t)
        +	     (progn
         	       (setq start (match-beginning 0))
        -	       (re-search-forward (shimbun-content-end-internal shimbun)
        -				  nil t))
        -      (delete-region (or (match-end 1) (match-end 2)) (point-max))
        -      (delete-region (point-min) start)
        -      t)))
        +	       (goto-char (point-max))
        +	       (search-backward "
        " nil t))) + (progn + (delete-region (match-end 0) (point-max)) + (insert "\n") + (delete-region (point-min) start) + t) + (if (re-search-forward "[\t\n ]*\ +\\(?:<[^>]+>[\t\n ]*\\)*" + nil t) + (progn + (setq start (match-end 0)) + (re-search-forward "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +\\(?:]+>[\t\n ]*\ +go[\t\n ]+to[\t\n ]+top[\t\n ]+of[\t\n ]+the[\t\n ]+page[\t\n ]*\ +\\|]+>[\t\n ]*subscription[\t\n ]*\ +\\|\\)" + nil t) + (delete-region (match-beginning 0) (point-max)) + (insert "\n") + (delete-region (point-min) start))) + (goto-char (point-min)) + (if (and (re-search-forward "[\t\n ]*" nil t) + (progn + (setq section (regexp-quote (match-string 1)) + start (match-end 0)) + (re-search-forward (concat "\[\t\n ]*") + nil t))) + (progn + (setq end (match-beginning 0)) + (while (when (re-search-forward "[\t\n ]*" nil t) + (setq section (regexp-quote (match-string 1))) + (delete-region end (match-end 0)) + (insert "\n \n") + (and (re-search-forward (concat "\[\t\n ]*") + nil t) + (setq end (match-beginning 0))))) + (if (and (re-search-forward "\ +]+[\t\n ]+\\)*align=\"center\"" nil t) + (shimbun-end-of-tag "div" t)) + (progn + (delete-region (match-end 1) (point-max)) + (insert "\n") + (goto-char end) + (delete-region end (match-beginning 3)) + (insert "\n
        \n-- 
        \n")) + (delete-region end (point-max)) + (insert "\n")) + (delete-region (point-min) start)) + ;; Remove style sheet. + (shimbun-remove-tags "style" t) + ;; Remove navigation button. + (shimbun-remove-tags "\\(td\\|span\\)\ +\\(?:[\t\n ]+[^\t\n >]+\\)*[\t\n ]+class=\"breadcrumbs\"" t)) + ;; Remove useless tags. + (goto-char (point-min)) + (while (re-search-forward "[\t\n ]*[\t\n ]*" nil t) + (replace-match "
        \n")) + (goto-char (point-min)) + (while (re-search-forward "\ +\[\t\n ]*]+\\)?>[\t\n ]*" + nil t) + (replace-match "\n")) + (goto-char (point-min)) + (while (re-search-forward "[\t\n ]*]+>[\t\n ]*" nil t) + (replace-match "\n

        ")) + (goto-char (point-min)) + (while (re-search-forward "[\t\n ]*]+>[\t\n ]*" nil t) + (replace-match "\n")) + (goto-char (point-min)) + (while (re-search-forward "^[\t  ]+\n" nil t) + (delete-region (match-beginning 0) (match-end 0))) + (goto-char (point-min)) + (while (re-search-forward "\\([\t\n ]*]*\\)?>\\)\ +\\(?:[\t\n ]*]*\\)?>\\)+[\t\n ]*\\(]\\)" nil t) + (replace-match "\\1\\2")) + (goto-char (point-min)) + (skip-chars-forward "\t\n ") + (delete-region (point-min) (point)) + (while (re-search-forward "[\t\n ]+\n" nil t) + (replace-match "\n")) + ;; Insert newlines around images. + (goto-char (point-min)) + (while (re-search-forward "[\t\n ]*\\(\\(?:<[^/][>]+>[\t\n ]*\\)*\ +]+>\\(?:[\t\n ]*<[^/][>]+>\\)*\\)[\t\n ]*" nil t) + (replace-match "
        \n\\1
        \n")) + ;; Shrink boundary lines. + (let ((limit (w3m-static-if (featurep 'xemacs) + (when (device-on-window-system-p) + (font-width (face-font 'default))) + (when window-system + (frame-char-width))))) + (when limit + (setq limit (* limit (1- (window-width)))) + (goto-char (point-min)) + (while (re-search-forward + "]+\\)*[\t\n ]+height=\"1\"" + nil t) + (when (shimbun-end-of-tag) + (goto-char (match-beginning 0)) + (if (re-search-forward "width=\"\\([0-9]+\\)\"" (match-end 0) t) + (when (> (string-to-number (match-string 1)) limit) + (replace-match (concat "width=\"" (number-to-string limit) + "\""))) + (goto-char (match-end 0))))))) + (cond ((string-match "\\`blog-\\(?:en\\|ja\\)\\'" group) + (goto-char (point-min)) + (when (and (or (re-search-forward "\ +]+[\t\n ]+\\)*class=\"block article\"" nil t) + (re-search-forward "\ +]+[\t\n ]+\\)*class=\"block header\"" nil t)) + (shimbun-end-of-tag "div")) + (goto-char (setq start (match-beginning 2))) + (when (re-search-forward "[\t\n ]*\ +]+[\t\n ]+\\)*class=\"footer\"" nil t) + (delete-region (match-beginning 0) (point-max)) + (insert "\n") + (delete-region (point-min) start)))) + ((string-match "\\`blog-" group) + (goto-char (point-min)) + (when (and (re-search-forward "\ +]+[\t\n ]+\\)*class=\"entry-body\"" nil t) + (shimbun-end-of-tag "div" t)) + (delete-region (match-end 2) (point-max)) + (insert "\n") + (delete-region (point-min) (match-beginning 2)) + (goto-char (point-min)) + (while (re-search-forward "\ +\[\t\n  ]*

        \\(?:[\t\n  ]*\\|[\t\n ]* [\t\n ]*\\)

        [\t\n  ]*" + nil t) + (replace-match ""))))) + ;; Zenkaku ASCII -> Hankaku + (unless (memq (shimbun-japanese-hankaku shimbun) '(header subject nil)) + (shimbun-japanese-hankaku-buffer t))))) + +(luna-define-method shimbun-make-contents :around ((shimbun shimbun-kantei) + header) + (if (string-match "\\`m-magazine-\\(?:cn\\|en\\|ja\\|kr\\)\\'" + (shimbun-current-group-internal shimbun)) + ;; Choose a face according to the author. + (let ((shimbun-x-face-database-function + (or shimbun-x-face-database-function + (let ((from (shimbun-header-from header t))) + `(lambda (ignore) + ,(cdr (nth + (cond ((member from '("Naoto Kan" + "菅直人")) + 1) + ((member from '("Yukio Hatoyama" + "鳩山由紀夫" + "p/山由射夫" + "GOEd>_86 @/E0?@")) + 2) + ((member from '("Taro Aso" + "麻生太郎")) + 3) + ((member from '("Yasuo Fukuda" + "福田康夫")) + 4) + ((member from '("Shinzo Abe" + "安倍晋三")) + 5) + ((member from '("Junichiro Koizumi" + "小泉純一郎")) + 6) + (t + 0)) + shimbun-kantei-x-face-alist))))))) + (luna-call-next-method)) + (luna-call-next-method))) (provide 'sb-kantei) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-kde.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-kde.el --- work/emacs-w3m-1.4.4/shimbun/sb-kde.el 2003-12-24 11:58:57.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-kde.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-laut-de.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-laut-de.el --- work/emacs-w3m-1.4.4/shimbun/sb-laut-de.el 2004-10-11 08:14:32.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-laut-de.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-laut-de.el --- shimbun backend for -;; Copyright (C) 2004 Andreas Seltenreich +;; Copyright (C) 2004, 2005, 2006, 2010 +;; Andreas Seltenreich ;; Author: Andreas Seltenreich ;; Keywords: news @@ -17,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: @@ -29,19 +30,22 @@ (luna-define-class shimbun-laut-de (shimbun-rss) ()) (defvar shimbun-laut-de-groups - '("platten" - "news" - "platten_rock" - "platten_pop" + '("news" + "platten" "platten_alternative" - "platten_metal" - "platten_rnb" "platten_dance" + "platten_hiphop" "platten_jazz" - "platten_hiphop")) + "platten_metal" + "platten_pop" + "platten_rnb" + "platten_rock")) (defvar shimbun-laut-de-content-start - "\\|]*>") + (concat + "\\|" + "]*>\\|" + "")) (defvar shimbun-laut-de-content-end (concat "\\|" @@ -50,26 +54,23 @@ (defvar shimbun-laut-de-from-address "redaktion@laut.de") -(luna-define-method shimbun-headers :before ((shimbun shimbun-laut-de) - &rest range) - shimbun) - (luna-define-method shimbun-groups ((shimbun shimbun-laut-de)) shimbun-laut-de-groups) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-laut-de) url date) - (unless (string-match "laut.de/\\(.*\\)/" url) - (error "Cannot find message-id base")) - (format "<%s@sb-laut-de.invalid>" - (shimbun-replace-in-string - (match-string-no-properties 1 url) - "[^a-zA-Z0-9]" "%"))) - (luna-define-method shimbun-index-url ((shimbun shimbun-laut-de)) (concat "http://www.laut.de/partner/allgemein/" (shimbun-current-group-internal shimbun) ".rdf")) +(luna-define-method shimbun-clear-contents :after ((shimbun shimbun-laut-de) + header) + (shimbun-remove-tags "script" t) + (shimbun-remove-tags + "") + (shimbun-remove-tags + "]+\\(?:width=\"1\"\\|height=\"1\"\\)[^>]*>") + (shimbun-remove-tags + "\\(a\\) href=\"[^\"]+lautshop_preisvergleich_detail.php" t)) + (provide 'sb-laut-de) ;;; sb-laut-de.el ends here Only in work/emacs-w3m-1.4.4/shimbun: sb-linux-ja.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-linuxce-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-linuxce-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-linuxce-jp.el 2001-11-20 13:51:23.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-linuxce-jp.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-lotusex.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-lotusex.el --- work/emacs-w3m-1.4.4/shimbun/sb-lotusex.el 2005-03-14 07:31:26.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-lotusex.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-lump.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-lump.el --- work/emacs-w3m-1.4.4/shimbun/sb-lump.el 2005-03-14 07:31:23.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-lump.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-m17n.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-m17n.el --- work/emacs-w3m-1.4.4/shimbun/sb-m17n.el 2003-11-18 10:57:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-m17n.el 2009-05-11 10:17:59.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-m17n.el --- shimbun backend for m17n.org -;; Copyright (C) 2001, 2002, 2003 Akihiro Arisawa +;; Copyright (C) 2001, 2002, 2003, 2006, 2009 +;; Akihiro Arisawa ;; Author: Akihiro Arisawa ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: @@ -32,13 +33,20 @@ (luna-define-class shimbun-m17n (shimbun-mhonarc) ()) +(defvar shimbun-m17n-url "http://www.m17n.org/mlarchive/") + (defconst shimbun-m17n-group-path-alist - '(("mule-ja" "mule-ja-archive/" "mule-ja@m17n.org") - ("mule" "mule-archive/" "mule@m17n.org"))) + '(("mule-ja" "mule-ja/" "mule-ja@m17n.org") + ("mule" "mule/" "mule@m17n.org"))) -(defvar shimbun-m17n-url "http://www.m17n.org/") (defvar shimbun-m17n-groups (mapcar 'car shimbun-m17n-group-path-alist)) +(defvar shimbun-m17n-x-face-alist + '(("default" . "X-Face: '>=krMO{M-21~VC2Y-{q4s}ckFG89D`j^w\ +:FI[z%_o+'mV,NKiQlN5v9i+<6EuQs\\I!3UB_\n ZY>/Nhd6A?6:B'+zCXV\ +tcW.jD{Y&/'K6$ls7r8!M%HnBCV[j;?Vr!3l|dWt%.%Wx8nvzk1+w5Uw6Zb\n\ + |?bUC;wOQxjd46p\\MP[x{+0i|lA\\fZ)@4_|!uG;=M\\Y}I&D3dP00O"))) + (luna-define-method shimbun-index-url ((shimbun shimbun-m17n)) (shimbun-expand-url (nth 1 (assoc (shimbun-current-group-internal shimbun) shimbun-m17n-group-path-alist)) @@ -58,32 +66,34 @@ (catch 'stop (while (and (if pages (<= (incf count) pages) t) (re-search-forward - "\\[Date Index\\]" + "" nil t) (push (match-string 1) months))) (setq months (nreverse months)) (dolist (month months) - (let ((url (shimbun-expand-url (concat month "/") + (let ((url (shimbun-expand-url (concat month "/maillist.html") (shimbun-index-url shimbun)))) + (erase-buffer) (shimbun-retrieve-url url t) (goto-char (point-max)) - (while (re-search-backward - "\\([^<]+\\)
        \nFrom: \\([^<]+\\)Date: \\(.*\\)" - nil t) + (while (re-search-backward "\ +\ +\\([^<]+\\)
        \n\ +
        • From: \\([^<]+\\)" + nil t) (let ((id (format "<%s%s%%%s>" month (match-string 1) (shimbun-current-group-internal shimbun))) (xref (shimbun-expand-url (match-string 2) url)) (subject (shimbun-mhonarc-replace-newline-to-space (match-string 3))) (from (shimbun-mhonarc-replace-newline-to-space - (match-string 4))) - (date (match-string 5))) + (match-string 4)))) (if (shimbun-search-id shimbun id) (throw 'stop headers) (push (shimbun-make-header 0 (shimbun-mime-encode-string subject) (shimbun-mime-encode-string from) - date id "" 0 0 xref) + nil id "" 0 0 xref) headers))))))) headers)) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-macosx-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-macosx-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-macosx-jp.el 2002-08-21 05:56:05.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-macosx-jp.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-mailarc.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mailarc.el --- work/emacs-w3m-1.4.4/shimbun/sb-mailarc.el 2005-03-14 07:31:24.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mailarc.el 2005-07-06 08:52:29.000000000 +0900 @@ -17,8 +17,8 @@ ;; 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. +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-mailman.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mailman.el --- work/emacs-w3m-1.4.4/shimbun/sb-mailman.el 2005-02-14 07:25:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mailman.el 2012-05-01 15:10:07.000000000 +0900 @@ -1,12 +1,12 @@ ;;; sb-mailman.el --- shimbun backend class for mailman archiver -*- coding: iso-2022-7bit; -*- ;; Copyright (C) 2002, 2003 NAKAJIMA Mikio -;; Copyright (C) 2002 Katsumi Yamaoka -;; Copyright (C) 2005 Tsuyoshi CHO +;; Copyright (C) 2002, 2008 Katsumi Yamaoka +;; Copyright (C) 2005 Tsuyoshi CHO ;; Authors: NAKAJIMA Mikio , ;; Katsumi Yamaoka , -;; Tsuyoshi CHO +;; Tsuyoshi CHO ;; Keywords: news ;; This file is a part of shimbun. @@ -22,9 +22,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -42,9 +42,9 @@ (defun shimbun-mailman-make-contents (shimbun header) (subst-char-in-region (point-min) (point-max) ?\t ?\ t) - (shimbun-decode-entities) (goto-char (point-min)) - (let ((end (search-forward ""))) + (let ((end (search-forward "")) + name address) (goto-char (point-min)) (search-forward "") (when (re-search-forward "

          \\([^\n]+\\)\\(\n +\\)?

          " end t nil) @@ -54,14 +54,35 @@ (when (re-search-forward "\\([^\n]+\\)\\(\n +\\)? *\n +\ \\([^\n]+\\)" end t nil) + (setq name (match-string 1) + address (match-string 3)) + (when (string-match " at " name) + (setq name (concat (substring name 0 (match-beginning 0)) + "@" + (substring name (match-end 0))))) + (when (string-match " at " address) + (setq address (concat (substring address 0 (match-beginning 0)) + "@" + (substring address (match-end 0))))) (shimbun-header-set-from header - (shimbun-mime-encode-string (concat (match-string 1) - " <" (match-string 3) ">"))) - (when (re-search-forward "\\([^\n]+\\)" end t nil) - (shimbun-header-set-date header (match-string 1))) + (shimbun-mime-encode-string (concat name " <" address ">"))) + (when (re-search-forward "\ +\\(?:\\(Sun\\|Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\) \\)?\ +\\([^\n]+\\)" end t nil) + (if (match-beginning 1) + (shimbun-header-set-date + header (concat (match-string 1) ", " (match-string 2))) + (shimbun-header-set-date header (match-string 2)))) (delete-region (point-min) end) (delete-region (search-forward "") (point-max)) + ;; Remove useless hrefs being added to things looking like mail + ;; addresses, and restore them to the original. + (let ((case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward + "]+>\\([^<]+\\) at \\([^<]+\\)" nil t) + (replace-match "\\1@\\2"))) (shimbun-header-insert-and-buffer-string shimbun header nil t)))) (luna-define-method shimbun-make-contents ((shimbun shimbun-mailman) header) @@ -81,8 +102,9 @@ (let ((pages (shimbun-header-index-pages range)) (count 0)) (while (and (if pages (<= (incf count) pages) t) - (re-search-forward "" nil t)) @@ -112,8 +134,8 @@ from (match-string 4)) (setq subject (with-temp-buffer (insert subject) - (shimbun-decode-entities) (shimbun-remove-markup) + (shimbun-decode-entities) (buffer-string))) (push (shimbun-make-header 0 (shimbun-mime-encode-string subject) @@ -133,7 +155,6 @@ (defun shimbun-mailman-ja-make-contents (shimbun header) (subst-char-in-region (point-min) (point-max) ?\t ?\ t) - (shimbun-decode-entities) (goto-char (point-min)) (let ((end (search-forward "")) name address date) @@ -179,6 +200,13 @@ (shimbun-header-set-date header date)) (delete-region (point-min) end) (delete-region (search-forward "") (point-max)) + ;; Remove useless hrefs being added to things looking like mail + ;; addresses, and restore them to the original. + (let ((case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward "\ +]+>\\([^<]+\\) \\(?:@\\|at\\) \\([^<]+\\)" nil t) + (replace-match "\\1@\\2"))) (shimbun-header-insert-and-buffer-string shimbun header nil t)))) (luna-define-method shimbun-make-contents ((shimbun shimbun-mailman-ja) header) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-mainichi.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mainichi.el --- work/emacs-w3m-1.4.4/shimbun/sb-mainichi.el 2004-12-25 01:07:37.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-mainichi.el 2012-04-16 11:19:40.000000000 +0900 @@ -1,6 +1,6 @@ -;;; sb-mainichi.el --- shimbun backend for MSN-Mainichi -*- coding: iso-2022-7bit; -*- +;;; sb-mainichi.el --- shimbun backend for Mainichi jp -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004 Koichiro Ohba +;; Copyright (C) 2001-2009, 2011, 2012 Koichiro Ohba ;; Author: Koichiro Ohba ;; Katsumi Yamaoka @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -31,39 +31,67 @@ ;;; Code: -(require 'shimbun) +(require 'sb-rss) +(require 'sb-multi) -(luna-define-class shimbun-mainichi (shimbun-japanese-newspaper shimbun) ()) +(luna-define-class shimbun-mainichi (shimbun-japanese-newspaper + shimbun-multi shimbun-rss) ()) -(defvar shimbun-mainichi-top-level-domain "mainichi-msn.co.jp" - "Name of the top level domain for the MSN-Mainichi INTERACTIVE.") +(defvar shimbun-mainichi-url "http://mainichi.jp/") -(defvar shimbun-mainichi-url - (concat "http://www." shimbun-mainichi-top-level-domain "/") - "Name of the parent url.") - -(defvar shimbun-mainichi-group-table - '(("shakai" "社会") - ("shakai.edu" "教育") - ("sports" "スポーツ") - ("geinou" "芸能") - ("kurashi" "暮らし") - ("it" "IT") - ("kagaku.science" "科学") - ("kagaku.env" "環境") - ("kagaku.medical" "医学") - ("seiji" "政治") - ("keizai" "経済") - ("kokusai" "国際")) - "List of supported groups and Japanese translations.") +(defvar shimbun-mainichi-top-level-domain "mainichi.jp") (defvar shimbun-mainichi-server-name "毎日新聞") -(defvar shimbun-mainichi-from-address - (concat "webmaster@" shimbun-mainichi-top-level-domain)) -(defvar shimbun-mainichi-content-start - "[\t\n ]*") -(defvar shimbun-mainichi-content-end - "\\([\t\n ]*<[^>]+>\\)*[\t\n ]*") + +(defvar shimbun-mainichi-prefer-text-plain nil + "*Non-nil means prefer text/plain articles rather than html articles.") + +(defvar shimbun-mainichi-ignored-subject "\\`PR: ") + +(luna-define-method initialize-instance :after ((shimbun shimbun-mainichi) + &rest init-args) + (shimbun-rss-initialize-ignored-subject shimbun)) + +(defvar shimbun-mainichi-group-table + '(("flash" "ニュース速報" + "http://mainichi.jp/rss/etc/flash.rss") + ("sports" "スポーツ" + "http://mainichi.jp/rss/etc/sports.rss") + ("entertainment" "エンターテインメント" + "http://mainichi.jp/rss/etc/enta.rss") + ("mantan" "アニメ・マンガ・ゲーム" + "http://mainichi.jp/rss/etc/mantan.rss") + ("electronics" "IT・家電" + "http://mainichi.jp/rss/etc/electronics.rss") + ("weekly" "英語を学ぶ" + "http://mainichi.jp/rss/etc/weekly.rss") + ;; Non-RSS groups. + ("opinion.editorial" "社説" + "http://mainichi.jp/select/opinion/editorial/archive/") + ("opinion.yoroku" "余録" + "http://mainichi.jp/select/opinion/yoroku/archive/") + ("opinion.hasshinbako" "発信箱" + "http://mainichi.jp/select/opinion/hasshinbako/archive/") + ("opinion.eye" "記者の目" + "http://mainichi.jp/select/opinion/eye/archive/") + ("opinion.hito" "ひと" + "http://mainichi.jp/select/opinion/hito/archive/") + ("opinion.kinji" "近事片々" + "http://mainichi.jp/select/opinion/kinji/archive/") + ("opinion.yuraku" "憂楽帳" + "http://mainichi.jp/select/opinion/yuraku/archive/") + ("opinion.closeup" "クローズアップ" + "http://mainichi.jp/select/opinion/closeup/archive/") + ("opinion.kaisetsu" "土曜解説" + "http://mainichi.jp/select/opinion/kaisetsu/") + ("opinion.newsup" "ニュースUP" + "http://mainichi.jp/select/opinion/newsup/") + ("opinion.jidainokaze" "時代の風" + "http://mainichi.jp/select/opinion/jidainokaze/") + ("entertainment.art" "芸術・文化" + "http://mainichi.jp/enta/art/archive/") + ("fuchisou" "風知草" + "http://mainichi.jp/select/seiji/fuchisou/"))) (defvar shimbun-mainichi-x-face-alist '(("default" . "\ @@ -86,188 +114,239 @@ shimbun-mainichi-group-table))) (luna-define-method shimbun-index-url ((shimbun shimbun-mainichi)) - (concat (shimbun-url-internal shimbun) - (shimbun-subst-char-in-string - ?. ?/ (shimbun-current-group-internal shimbun)) - "/")) - -(defun shimbun-mainichi-make-date-string (&rest args) - "Run `shimbun-make-date-string' with ARGS and fix a day if needed. - -\(shimbun-mainichi-make-date-string YEAR MONTH DAY &optional TIME TIMEZONE)" - (save-match-data - (let* ((ctime (current-time)) - (date (apply 'shimbun-make-date-string args)) - (time (shimbun-time-parse-string date)) - (ms (car time)) - (ls (cadr time)) - (system-time-locale "C")) - (if (or (> ms (car ctime)) - (and (= ms (car ctime)) - (> ls (cadr ctime)))) - ;; It should be yesterday's same time. - (progn - (setq ms (1- ms)) - (when (< (setq ls (- ls (eval-when-compile (- (* 60 60 24) 65536)))) - 0) - (setq ms (1- ms) - ls (+ ls 65536))) - (format-time-string "%a, %d %b %Y %R +0900" (list ms ls))) - date)))) - -(defun shimbun-mainichi-get-headers (shimbun) - (let* ((group (shimbun-current-group-internal shimbun)) - (hierarchy (when (string-match "\\." group) - (mapconcat 'identity - (nreverse (split-string group "\\.")) - "."))) - (from (shimbun-from-address shimbun)) - (case-fold-search t) - url urls subgroup header topnews headers date) - (while (search-forward "\r" nil t) - (delete-backward-char 1)) - (goto-char (point-min)) - (while (re-search-forward "\ -") (luna-define-method shimbun-groups ((shimbun shimbun-msports-nifty)) (mapcar 'car shimbun-msports-nifty-group-alist)) @@ -62,16 +63,14 @@ (let ((case-fold-search t) headers) (goto-char (point-min)) (while (re-search-forward - "]*>☆ \\([^<]+\\)
          " nil t) + "
          ]*>☆ \\([^<]+\\)<" nil t) (let ((url (match-string 1)) (year (match-string 2)) (month (match-string 3)) - (id (match-string 4)) - (subject (match-string 5)) - (day 1) date) - (save-excursion - (when (re-search-backward "[0-9]+/[0-9][0-9]/\\([0-9][0-9]\\)" nil t) - (setq day (match-string 1)))) + (day (match-string 4)) + (id (match-string 5)) + (subject (match-string 6)) + date) (setq id (format "<%s%s%s%s%%%s%%msports@nifty.com>" year month day id (shimbun-current-group-internal shimbun))) @@ -89,15 +88,14 @@ (luna-define-method shimbun-make-contents ((shimbun shimbun-msports-nifty) header) - (let ((id (shimbun-header-id header)) - start) + (let ((id (shimbun-header-id header))) (setq id (substring id 9 20)) ; extract anchor (re-search-forward (format "" id) nil t) (delete-region (point-min) (point)) (shimbun-header-insert-and-buffer-string shimbun header "UTF-8" (if (shimbun-clear-contents shimbun header) - (shimbun-shallow-rendering) + (progn (shimbun-shallow-rendering) nil) t)))) (provide 'sb-msports-nifty) Only in work/emacs-w3m-1.4.4/shimbun: sb-muchy.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-multi.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-n24-de.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-n24-de.el --- work/emacs-w3m-1.4.4/shimbun/sb-n24-de.el 2004-06-07 07:36:18.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-n24-de.el 2007-10-17 20:15:58.000000000 +0900 @@ -17,9 +17,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-namazu.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-namazu.el --- work/emacs-w3m-1.4.4/shimbun/sb-namazu.el 2004-06-26 00:27:55.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-namazu.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-netbsd.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-netbsd.el --- work/emacs-w3m-1.4.4/shimbun/sb-netbsd.el 2003-11-18 10:57:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-netbsd.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-nikkansports.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-nikkansports.el --- work/emacs-w3m-1.4.4/shimbun/sb-nikkansports.el 2005-03-14 07:14:43.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-nikkansports.el 2008-04-02 17:51:33.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-nikkansports.el --- shimbun backend for www.nikkansports.com -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 ;; MIYOSHI Masanori ;; Author: MIYOSHI Masanori @@ -20,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -37,30 +37,55 @@ (shimbun-japanese-newspaper shimbun) ()) (defvar shimbun-nikkansports-url "http://www.nikkansports.com/") + (defvar shimbun-nikkansports-server-name "日刊スポーツ") + (defvar shimbun-nikkansports-group-table - '(("baseball" "野球" "ns/baseball/top-bb.html") - ("mlb" "大リーグ" "ns/baseball/mlb/top-tp2-bb.html") - ("soccer" "サッカー" "ns/soccer/top-sc.html") - ("sports" "スポーツ" "ns/sports/top-sp.html") - ("battle" "バトル" "ns/battle/top-bt.html") - ("horseracing" "競馬" "ns/horseracing/top-hr.html") - ("entertainment" "芸能" "ns/entertainment/top-et.html") - ("society" "社会" "ns/general/top-so.html") - ("leisure" "釣り" "ns/leisure/top-ls.html"))) + '(("flash" "最新ニュース" "flash/flash-news.html") + ("baseball" "野球" "baseball/news/backnumber-baseball.html") + ("baseball.highschool" "高校野球" + "baseball/highschool/news/backnumber-highschool.html") + ("baseball.amateur" "大学・社会人野球" + "baseball/amateur/news/backnumber-amateur.html") + ("baseball.mlb" "MLB" "baseball/mlb/news/backnumber-mlb.html") + ("soccer" "サッカー" "soccer/news/backnumber-soccer.html") + ("soccer.japan" "サッカー日本代表" + "soccer/japan/news/backnumber-japan.html") + ("soccer.world" "海外サッカー" "soccer/world/news/backnumber-world.html") + ("sports" "スポーツ" "sports/news/backnumber-sports.html") + ("sumo" "大相撲" "sports/sumo/news/backnumber-sumo.html") + ("nba" "NBA" "sports/nba/news/backnumber-nba.html") + ("nfl" "NFL" "sports/nfl/news/backnumber-nfl.html") + ("nhl" "NHL" "sports/nhl/news/backnumber-nhl.html") + ("rugby" "ラグビー" "sports/rugby/news/backnumber-rugby.html") + ("golf" "ゴルフ" "sports/golf/news/backnumber-golf.html") + ("motor" "モータースポーツ" "sports/motor/news/backnumber-motor.html") + ("battle" "格闘技" "battle/news/backnumber-battle.html") + ("race" "競馬" "race/news/backnumber-race.html") + ("race.kka" "競輪・競艇・オート" "race/kka/news/backnumber-kka.html") + ("entertainment" "芸能" "entertainment/news/backnumber-entertainment.html") + ("cinema" "シネマ" "entertainment/cinema/news/backnumber-cinema.html") + ("general" "社会" "general/news/backnumber-general.html"))) + (defvar shimbun-nikkansports-content-start - "") + "<[\t\n ]*![\t\n ]*-+[\t\n ]*\\++[\t\n ]*\ +ニュース本文[\t\n ]*\\++[\t\n ]*-+[\t\n ]*>[\t\n ]*\ +\\(?:\\(?:<[\t\n ]*/?[\t\n ]*[ads][^>]+>\ +\\|<[\t\n ]*h[0-9]+[\t\n ]*>[^<]+<[\t\n ]*/[\t\n ]*h[0-9]+[\t\n ]*>\\)\ +\[\t\n ]*\\)*") + (defvar shimbun-nikkansports-content-end - "") + "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +<[\t\n ]*![\t\n ]*-+[\t\n ]*/[\t\n ]*\\++[\t\n ]*\ +ニュース本文[\t\n ]*\\++[\t\n ]*-+[\t\n ]*>") + (defvar shimbun-nikkansports-expiration-days 17) -(defvar shimbun-nikkansports-end-of-header-regexp - (concat "\n\n") - "*Regexp used to look for the end of the header in a html contents.") +(defvar shimbun-nikkansports-x-face-alist + '(("default" . "\ +Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUDKpy11PIeeNv///+ + PA1z5AAAAP0lEQVQI12NgAAMOJgYG/n/2Fxj4a+0+MPDH2i4AEvYPgAQ3iLvvB5DYCyL0LzCsAgI + kYm3u+yqGte9Td4G5AJiKHahMk6/LAAAAAElFTkSuQmCC"))) (luna-define-method shimbun-groups ((shimbun shimbun-nikkansports)) (mapcar 'car shimbun-nikkansports-group-table)) @@ -70,95 +95,71 @@ shimbun-nikkansports-group-table))) (luna-define-method shimbun-index-url ((shimbun shimbun-nikkansports)) - (concat (shimbun-url-internal shimbun) - (nth 2 (assoc (shimbun-current-group-internal shimbun) - shimbun-nikkansports-group-table)))) + (shimbun-expand-url (nth 2 (assoc (shimbun-current-group-internal shimbun) + shimbun-nikkansports-group-table)) + shimbun-nikkansports-url)) (luna-define-method shimbun-get-headers ((shimbun shimbun-nikkansports) &optional range) -;;; -;; (shimbun-nikkansports-get-headers shimbun)) -;; -;;(defun shimbun-nikkansports-get-headers (shimbun) -;;; - (when (re-search-forward shimbun-nikkansports-end-of-header-regexp nil t) - (delete-region (point-min) (point)) - (when (re-search-forward - "\n\n" nil t) - (forward-line -1) - (delete-region (point) (point-max)) - (goto-char (point-min)) - (let* ((case-fold-search t) - (group (shimbun-current-group-internal shimbun)) - (from (concat shimbun-nikkansports-server-name " (" - (nth 1 (assoc group - shimbun-nikkansports-group-table)) - ")")) - year month day headers) - (while (re-search-forward - (eval-when-compile - (concat - "
        • ]+" - ;; 2. year - "\\([0-9][0-9]\\)" - ;; 3. month - "\\([0-9][0-9]\\)" - ;; 4. day - "\\([0-9][0-9]\\)" - "-" - ;; 5. serial number - "\\([0-9]+\\)" - "\\.html\\)" - "\">" - ;; 6. subject - "\\([^<]+\\)" - "\\([^<]+[[0-3]?[0-9]日" - ;; 8. hour:minute - "\\([012]?[0-9]:[0-5]?[0-9]\\)" - "]\\)?")) - nil t) - (setq year (string-to-number (match-string 2)) - month (string-to-number (match-string 3)) - day (string-to-number (match-string 4))) - (push (shimbun-create-header - 0 - (match-string 6) - from - (shimbun-make-date-string year month day (match-string 8)) - (format "<20%02d%02d%02d%s.%s%%nikkansports.com>" - year month day (match-string 5) group) - "" 0 0 - (concat (shimbun-url-internal shimbun) - (match-string 1))) - headers)) - (shimbun-sort-headers headers))))) - -(luna-define-method shimbun-make-contents - :before ((shimbun shimbun-nikkansports) header) -;;; -;; (shimbun-nikkansports-prepare-article shimbun header)) -;; -;;(defun shimbun-nikkansports-prepare-article (shimbun header) -;;; - (let ((case-fold-search t) - start) - (when (or (re-search-forward "]*class=\"photo\"" nil t) - (re-search-forward "" nil t)) - (setq start (match-beginning 0)) - (goto-char (point-max)) - (when (and (re-search-backward "" nil t) - (search-forward "

          " nil t)) - (save-restriction - (narrow-to-region start (point)) - (shimbun-break-long-japanese-lines) - (goto-char (point-min)) - (insert shimbun-nikkansports-content-start) - (goto-char (point-max)) - (insert shimbun-nikkansports-content-end))) - (goto-char (point-min))))) + (shimbun-nikkansports-get-headers shimbun range)) + +(defun shimbun-nikkansports-get-headers (shimbun range) + (let ((regexp + (eval-when-compile + (concat + "[\t ]*" + ;; 6. subject + "\\([^<]+\\)" + "[\t ]*[^\n]+\\[[\t ]*[0-9]+日[\t ]*" + ;; 7. time + "\\([012][0-9]:[0-5][0-9]\\)" + "[\t ]*\\]"))) + (group (shimbun-current-group-internal shimbun)) + (from (concat shimbun-nikkansports-server-name " (" + (shimbun-current-group-name shimbun) ")")) + (case-fold-search t) + headers) + (setq group (mapconcat 'identity + (nreverse (split-string group "\\.")) + ".")) + (while (re-search-forward regexp nil t) + (push (shimbun-create-header + 0 (match-string 6) from + (shimbun-make-date-string + (string-to-number (match-string 3)) + (string-to-number (match-string 4)) + (string-to-number (match-string 5)) + (match-string 7)) + (concat "<" + (mapconcat 'identity + (save-match-data + (split-string (match-string 2) "-")) + ".") + "%" group ".nikkansports.com>") + "" 0 0 (match-string 1)) + headers)) + (shimbun-sort-headers headers))) + +(luna-define-method shimbun-clear-contents :around ((shimbun + shimbun-nikkansports) + header) + (shimbun-strip-cr) + (goto-char (point-min)) + (when (luna-call-next-method) + (unless (shimbun-prefer-text-plain-internal shimbun) + (shimbun-break-long-japanese-lines)) + t)) (provide 'sb-nikkansports) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-nikkei.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-nikkei.el --- work/emacs-w3m-1.4.4/shimbun/sb-nikkei.el 2005-03-10 20:21:08.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-nikkei.el 2011-10-13 19:25:41.000000000 +0900 @@ -1,9 +1,9 @@ ;;; sb-nikkei.el --- shimbun backend for nikkei.co.jp -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 -;; Kazuyoshi KOREEDA +;; Copyright (C) 2001-2007, 2009-2011 +;; Kazuyoshi KOREEDA -;; Author: Kazuyoshi KOREEDA , +;; Author: Kazuyoshi KOREEDA , ;; Katsumi Yamaoka , ;; NOMIYA Masaru ;; Keywords: news @@ -21,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -33,9 +33,6 @@ ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (luna-define-class shimbun-nikkei (shimbun-japanese-newspaper shimbun) ()) @@ -63,64 +60,151 @@ ("tento" "ベンチャー" ,(concat shimbun-nikkei-url "news/tento/") shimbun-nikkei-get-headers-default2 shimbun-nikkei-prepare-article-default2) - ("zinzi" "トップ人事" ,(concat shimbun-nikkei-url "news/zinzi/") - shimbun-nikkei-get-headers-default2 - shimbun-nikkei-prepare-article-default2) - ("report" "日経の調査" ,(concat shimbun-nikkei-url "report/") - shimbun-nikkei-get-headers-report - shimbun-nikkei-prepare-article-report) ("kansai" "関西" ,(concat shimbun-nikkei-url "kansai/") shimbun-nikkei-get-headers-kansai shimbun-nikkei-prepare-article-kansai) - ("it" "IT" "http://it.nikkei.co.jp/it/news/" - shimbun-nikkei-get-headers-it + ("it.business" "ITビジネス" + "http://it.nikkei.co.jp/business/news/index.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.busi_gyoukai" "業界動向(ITビジネス)" + "http://it.nikkei.co.jp/business/news/busi_gyoukai.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.biz-system" "企業情報システム" + "http://it.nikkei.co.jp/business/news/busi_system.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.sox" "盛り上がるSOX法ビジネス" + "http://it.nikkei.co.jp/business/special/sox.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.data" "データで読むIT市場" + "http://it.nikkei.co.jp/business/column/data.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.taidan" "トップ対談" + "http://it.nikkei.co.jp/business/column/taidan.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.internet" "インターネット" + "http://it.nikkei.co.jp/internet/news/index.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.broad" "ブロードバンド" + "http://it.nikkei.co.jp/internet/news/broadband.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.net_gyoukai" "業界動向(インターネット)" + "http://it.nikkei.co.jp/internet/news/net_gyoukai.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.iptel" "多機能化するIP電話" + "http://it.nikkei.co.jp/internet/special/iptel.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.tele" "放送・ネット融合" + "http://it.nikkei.co.jp/internet/special/tele.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.broadcast" "地上デジタル放送" + "http://it.nikkei.co.jp/internet/special/d_broadcast.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.internet-column" "インターネット:コラム" + "http://it.nikkei.co.jp/internet/column/koike.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.contents" "コンテンツビジネス" + "http://it.nikkei.co.jp/internet/column/contents.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.ec" "EC" + "http://it.nikkei.co.jp/internet/news/ec.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.policy" "政策・統計" + "http://it.nikkei.co.jp/internet/news/seisaku.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.e-gov" "行政のIT化" + "http://it.nikkei.co.jp/business/special/e-gov.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.mobile" "モバイル" + "http://it.nikkei.co.jp/mobile/news/index.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.mob_gyoukai" "業界動向(モバイル)" + "http://it.nikkei.co.jp/mobile/news/gyoukai.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.mobsoft" "サービス" + "http://it.nikkei.co.jp/mobile/news/soft.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.mobcon" "コンテンツ" + "http://it.nikkei.co.jp/mobile/news/contents.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.money" "携帯キャリアの金融ビジネス" + "http://it.nikkei.co.jp/mobile/special/money.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.one" "ワンセグはテレビを変えるか" + "http://it.nikkei.co.jp/mobile/special/one.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.security" "セキュリティ" + "http://it.nikkei.co.jp/security/news/index.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.net_crime" "ネット犯罪" + "http://it.nikkei.co.jp/security/news/net_crime.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.digital" "デジタル家電&エンタメ" + "http://it.nikkei.co.jp/digital/news/index.aspx" + shimbun-nikkei-get-headers-it-default + shimbun-nikkei-prepare-article-default) + ("it.pc" "PC&デジタルカメラ" + "http://it.nikkei.co.jp/pc/news/index.aspx" + shimbun-nikkei-get-headers-it-pc shimbun-nikkei-prepare-article-default2) - ("it.zensen" "IT最前線" - "http://it.nikkei.co.jp/it/column/zensen.cfm?ichiran=true" - shimbun-nikkei-get-headers-it-zensen - shimbun-nikkei-prepare-article-default) - ("it.manage" "ITニュースの焦点" - "http://it.nikkei.co.jp/it/manage/foc.cfm?ichiran=true" - shimbun-nikkei-get-headers-it-manage - shimbun-nikkei-prepare-article-default) - ("it.seisaku" "IT政策" "http://it.nikkei.co.jp/it/news/seisaku.cfm" - shimbun-nikkei-get-headers-it-seisaku - shimbun-nikkei-prepare-article-default) - ("it.digicore" "デジタルコア・レポート" - "http://it.nikkei.co.jp/it/column/digicore.cfm?ichiran=true" - shimbun-nikkei-get-headers-it-digicore - shimbun-nikkei-prepare-article-default) - ("kokunai" "市場概況" "http://markets.nikkei.co.jp/kokunai/summary.cfm" - shimbun-nikkei-get-headers-kawase - shimbun-nikkei-prepare-article-default3) - ("markets" "海外株概況" "http://markets.nikkei.co.jp/kaigai/summary.cfm" - shimbun-nikkei-get-headers-markets - shimbun-nikkei-prepare-article-default3) - ("kawase" "為替概況" "http://markets.nikkei.co.jp/kawase/summary.cfm" - shimbun-nikkei-get-headers-kawase - shimbun-nikkei-prepare-article-default3) + ("kokunai" "市場概況" "http://markets.nikkei.co.jp/kokunai/summary.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) + ("markets" "海外株概況" "http://markets.nikkei.co.jp/kaigai/summary.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) + ("kawase" "為替概況" "http://markets.nikkei.co.jp/kawase/summary.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) ("kinri" "短期金利・債権・CB概況" - "http://markets.nikkei.co.jp/kawase/kinri.cfm" - shimbun-nikkei-get-headers-kinri - shimbun-nikkei-prepare-article-default3) + "http://markets.nikkei.co.jp/kawase/kinri.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) ("ft" "英フィナンシャル・タイムズ" - "http://markets.nikkei.co.jp/kaigai/ft.cfm" + "http://markets.nikkei.co.jp/kaigai/ft.aspx" shimbun-nikkei-get-headers-ft - shimbun-nikkei-prepare-article-default3) - ("dj" "米ダウ・ジョーンズ" "http://markets.nikkei.co.jp/kaigai/dj.cfm" + shimbun-nikkei-prepare-article-default4) + ("dj" "米ダウ・ジョーンズ" "http://markets.nikkei.co.jp/kaigai/dj.aspx" shimbun-nikkei-get-headers-dj - shimbun-nikkei-prepare-article-default3) + shimbun-nikkei-prepare-article-default4) ("ngyoseki" "企業業績ニュース" - "http://markets.nikkei.co.jp/kokunai/gyoseki.cfm" - shimbun-nikkei-get-headers-gyoseki - shimbun-nikkei-prepare-article-default3) + "http://markets.nikkei.co.jp/kokunai/gyoseki.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) ("gyosuuchi" "業績数値" - "http://markets.nikkei.co.jp/kokunai/bunkatsu3.cfm?genre=m4" - shimbun-nikkei-get-headers-bunkatsu2 - shimbun-nikkei-prepare-article-bunkatsu2) - ("gyoseki" "海外企業業績" "http://markets.nikkei.co.jp/kaigai/gyoseki.cfm" - shimbun-nikkei-get-headers-gyoseki - shimbun-nikkei-prepare-article-default3) + "http://markets.nikkei.co.jp/kokunai/bunkatsu2.aspx?genre=m4" + shimbun-nikkei-get-headers-gyosuuchi + shimbun-nikkei-prepare-article-default4) + ("gyoseki" "海外企業業績" "http://markets.nikkei.co.jp/kaigai/gyoseki.aspx" + shimbun-nikkei-get-headers-stock + shimbun-nikkei-prepare-article-default4) + ("china" "中国ビジネス事情" ,(concat shimbun-nikkei-url "china/news/") + shimbun-nikkei-get-headers-china + shimbun-nikkei-prepare-article-default4) ("market" "株・為替" ,(concat shimbun-nikkei-url "news/market/") shimbun-nikkei-get-headers-market shimbun-nikkei-prepare-article-market) @@ -135,7 +219,7 @@ shimbun-nikkei-prepare-article-default) ("retto" "地域経済" ,(concat shimbun-nikkei-url "news/retto/") shimbun-nikkei-get-headers-retto - shimbun-nikkei-prepare-article-default2) + shimbun-nikkei-prepare-article-default4) ("sports" "スポーツ" "http://sports.nikkei.co.jp/" shimbun-nikkei-get-headers-sports shimbun-nikkei-prepare-article-sports) @@ -145,24 +229,236 @@ ("release" "プレスリリース" "http://release.nikkei.co.jp/" shimbun-nikkei-get-headers-release shimbun-nikkei-prepare-article-release) - ("shasetsu" "社説・春秋" ,(concat shimbun-nikkei-url "news/shasetsu/") + ("release.it.comp" "プレスリリース(IT;コンピューター)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=1" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.peri" "プレスリリース(IT;周辺機器)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=2" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.sys" "プレスリリース(IT;システム・ソフト開発)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=3" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.cont" "プレスリリース(IT;情報・コンテンツ)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=4" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.net" "プレスリリース(IT;通信・インターネット)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=5" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.lsi" "プレスリリース(IT;半導体)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=6" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.game" "プレスリリース(IT;ゲーム・娯楽)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=7" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.it.etc" "プレスリリース(IT;その他IT関連)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=1&sindID=8" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.depart" "プレスリリース(流通;百貨店・スーパー)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=9" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.ryohan" "プレスリリース(流通;量販店)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=10" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.zakka" "プレスリリース(流通;生活雑貨)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=11" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.cosme" "プレスリリース(流通;医薬品・化粧品)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=12" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.car" "プレスリリース(流通;自動車)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=13" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.book" "プレスリリース(流通;書籍)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=14" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.record" "プレスリリース(流通;レコード・ゲーム)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=15" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.food" "プレスリリース(流通;食品・飲料)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=16" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.mercha" "プレスリリース(流通;商社・卸売業)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=17" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.mail" "プレスリリース(流通;通信・訪問販売)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=18" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.netshop" "プレスリリース(流通;ネットショッピング)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=19" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.dist.etc" "プレスリリース(流通;その他商業)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=2&sindID=20" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.money.bank" "プレスリリース(金融;銀行・信金)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=3&sindID=57" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.money.sec" "プレスリリース(金融;証券会社)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=3&sindID=58" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.money.am" "プレスリリース(金融;投資信託運用会社)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=3&sindID=59" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.money.insu" "プレスリリース(金融;保険会社)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=3&sindID=60" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.money.etc" "プレスリリース(金融;その他金融)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=3&sindID=61" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.chemi" "プレスリリース(メーカー;化学・医薬品)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=31" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.mecha" "プレスリリース(メーカー;機械・金属)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=32" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.car" "プレスリリース(メーカー;自動車・自動車部品)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=33" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.elec" "プレスリリース(メーカー;家電・電機)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=34" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.food" "プレスリリース(メーカー;食品・飲料)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=35" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.sports" "プレスリリース(メーカー;スポーツ・娯楽用品)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=36" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.apparel" "プレスリリース(メーカー;アパレル・生活用品)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=37" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.commu" "プレスリリース(メーカー;通信機器・精密機械)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=38" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.maker.etc" "プレスリリース(メーカー;その他メーカー)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=4&sindID=39" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.medic" "プレスリリース(サービス;医療・福祉)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=40" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.rest" "プレスリリース(サービス;飲食)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=41" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.trans" "プレスリリース(サービス;運輸・運送)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=42" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.energy" "プレスリリース(サービス;エネルギー)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=43" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.enter" "プレスリリース(サービス;エンターテインメント)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=44" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.env" "プレスリリース(サービス;環境)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=45" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.consul" "プレスリリース(サービス;コンサルティング)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=46" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.edu" "プレスリリース(サービス;教育・研修)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=47" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.haken" "プレスリリース(サービス;人材派遣)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=48" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.life" "プレスリリース(サービス;生活関連)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=49" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.media" "プレスリリース(サービス;メディア)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=50" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.lease" "プレスリリース(サービス;リース)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=51" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.travel" "プレスリリース(サービス;旅行・ホテル)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=52" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.service.etc" "プレスリリース(サービス;その他サービス業)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=53" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.const.const" "プレスリリース(サービス;建設・土木)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=6&sindID=54" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.const.house" "プレスリリース(サービス;住宅)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=6&sindID=56" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("release.const.etc" "プレスリリース(サービス;その他建設関連)" + "http://release.nikkei.co.jp/isclassList.cfm?lindID=5&sindID=53" + shimbun-nikkei-get-headers-release2 + shimbun-nikkei-prepare-article-release2) + ("shasetsu" "社説・春秋" + "http://www.nikkei.co.jp/news/shasetsu/childKijiIchiran.js" + ;; The contents of IndexKijiIchiran.js will be appended afterward. shimbun-nikkei-get-headers-shasetsu - shimbun-nikkei-prepare-article-default) - ("okuyami" "おくやみ" ,(concat shimbun-nikkei-url "news/okuyami/") - shimbun-nikkei-get-headers-okuyami - shimbun-nikkei-prepare-article-okuyami)) + shimbun-nikkei-prepare-article-default)) "Alist of group names and parameters. Each parameters include a Japanese group name, an index page, a function used to get headers and a function used to prepare an article.") (defvar shimbun-nikkei-server-name "日本経済新聞") -(defvar shimbun-nikkei-from-address "webmaster@nikkei.co.jp") +(defvar shimbun-nikkei-from-address "nobody@example.com") (defvar shimbun-nikkei-content-start "") (defvar shimbun-nikkei-content-end "") (defvar shimbun-nikkei-x-face-alist '(("default" . "\ +Face: iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAABGdBTUEAALGPC/xhBQAAAA9 + QTFRF////AY8ACZYCg8p7////e1VqQQAAAAlwSFlzAAAOnAAADsQBdfaEgQAAACh0RVh0U29mdHd + hcmUAWFYgVmVyc2lvbiAzLjEwYSAgUmV2OiAxMi8yOS85NFhtieMAAADcSURBVCjPXZHhkcUgCIS + 9vAouaUDRAqKPCnT7r+lYTGLm+LffsLADIXh9RM7wKvH6p/MiG3XSdhNqExi7xMcw5ADuMfSjFqC + KxstR0BXoB87LUTAIFH2CZIoABNsCXwNxhrCJDcg3SL+2s6rNRIvBIuVv08GkjBIYgoZU6oHmwLR + tHWptOwEbfAOjEhQHTMoGCVUn2IHkV/qZYKTS2RAfIKWLg+2yJL1AmENb0jkzhLlW5AHuMWFjZB4 + 1q+24bhrXl7IHXW8RP3Jcj+HRurxfycnn67m+/PX+j976D3rKSsvKwOwqAAAAB3RJTUUH1wgDChM + rIe5fHAAAAABJRU5ErkJggg==") + ("\\`release" . "\ Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAWAgMAAAD7mfc/AAAABGdBTUEAALGPC/xhBQAAAAx QTFRFBjKeZ4rcxdHp+/z7lhoK9wAAAC90RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYStGTG1 hc2sgIFJldjogMTIvMjkvOTQbx6p8AAABBUlEQVR4nD3MIU/DQBwF8D8d62W9wGqalYRSREUV9xX @@ -170,19 +466,7 @@ uZOiZYHJoUMb5y3twhhSFnZHR2NjZz7hHIGkyiJFMP8FCILhpIiqKp+EthkqMLMQ3TUD2Y8jEyQi LuLFJ6wMVrjsWRgvOPYFEBqEvjSuAcwJK55uVuv7Qs7n6xzYlSWrYoNHn6YV1cJ06Gh2LvCOs5Eo jZ9Gph5VYg57fTN0Q/I1Gx+bDw9BZcP22ZQ8WPBKVadTs6xiKlaIaOdv70SssB7/oy7JbxPXlcqJ - +AFOYhEr5ENrbAAAAB3RJTUUH1AQGFzot7I86fAAAAABJRU5ErkJggg==") - ("release" . "\ -Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAATBAMAAAAkFJMsAAAABGdBTUEAALGPC/xhBQAAABJ - QTFRFAAAAZI9jnMGYtNiv1+3U////kl1YDAAAAC90RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjE - wYStGTG1hc2sgIFJldjogMTIvMjkvOTQbx6p8AAABM0lEQVR4nDVRQZKEIAwMg97DoHddnTsI3NG - BOwj5/1c2WzvTKZJ0NZWiA/hVCsewf5mPAUAAEOAOoVFrZ7V6OrdZ+IcANVFRtNEP2UChP3LNRHW - ugDPVB000cJzhngnoVJgLqEBtanMbe26Qb4oP4klkQJHvcwllblQEdVpGSkmzKEhSiDnmMveJkLi - 4Y+wAsgtijmRGmknkxuNhrAJelQXJAZKoPQLRfWAoAvYI/hwu+QZIKWqfGIvH578d9bW1HZ/uyf7 - F+pcQEBfl3MrXmD7h1fXBnVqEzNemmxWoEEHDPOxpX/3xxsFUb6sz0mqrN3jl4eq1uYZDKr3WkPS - VbK8QYMBqXNxxWMpti1fTpettwLPgTcIEEs/dxClO5xQ970ogfMGv+TL+D/UVhFBKreuH/QJ8OEG - oiorzBAAAAAd0SU1FB9QECQYoFI75G7YAAABodEVYdENvbW1lbnQAQ1JFQVRPUjogWFYgVmVyc2l - vbiAzLjEwYStGTG1hc2sgIFJldjogMTIvMjkvOTQKQ1JFQVRPUjogWFYgVmVyc2lvbiAzLjEwYSt - GTG1hc2sgIFJldjogMTIvMjkvOTQKYD1XBQAAAABJRU5ErkJggg=="))) + +AFOYhEr5ENrbAAAAB3RJTUUH1AQGFzot7I86fAAAAABJRU5ErkJggg=="))) (defvar shimbun-nikkei-expiration-days 7) @@ -199,147 +483,170 @@ (luna-define-method shimbun-get-headers ((shimbun shimbun-nikkei) &optional range) - (let* ((group (shimbun-current-group-internal shimbun)) + (let* ((case-fold-search t) + (group (shimbun-current-group-internal shimbun)) (fn (nth 3 (assoc group shimbun-nikkei-group-table))) - (shimbun-nikkei-from-address (shimbun-from-address shimbun)) - (case-fold-search t)) + (shimbun-nikkei-from-address + (concat (shimbun-server-name shimbun) + " (" (shimbun-current-group-name shimbun) ")")) + (folder (nth 2 (assoc group shimbun-nikkei-group-table)))) + (when (and (not (string-match "\\`http://markets\\.nikkei\\.co\\.jp/" + folder)) + (or (member group '("kaigai" "seiji")) + (not (eq (aref folder (1- (length folder))) ?/))) + (string-match "[^/]/[^/]\\|[^/]/\\'" folder)) + (setq folder (substring folder 0 (+ (match-beginning 0) 2)))) (while (search-forward "\r" nil t) - (delete-backward-char 1)) + (delete-char -1)) (goto-char (point-min)) (when (fboundp fn) - (funcall fn group (nth 2 (assoc group shimbun-nikkei-group-table)))))) + (shimbun-sort-headers (funcall fn group folder shimbun range))))) (defun shimbun-nikkei-expand-url (url folder) "Make a fullname of URL relative to FOLDER. If URL begins with `http://', FOLDER is ignored." (save-match-data - (cond ((string-match "\\`http://" url) + (cond ((string-match "=http://" url) + (substring url (1+ (match-beginning 0)))) + ((string-match "\\`http://" url) url) ((string-match "\\`/" url) - (concat folder (substring url 1))) + (shimbun-expand-url url shimbun-nikkei-url)) (t (concat folder url))))) -(defun shimbun-nikkei-make-date-string (&rest args) - "Run `shimbun-make-date-string' with ARGS and fix a day if needed. - -\(shimbun-nikkei-make-date-string YEAR MONTH DAY &optional TIME TIMEZONE)" +(defun shimbun-nikkei-make-date-string (year month day + &optional time timezone adj) + "Run `shimbun-make-date-string' and fix a day if needed. +Optional ADJ is the number of days that adjust the day of month." (save-match-data - (let* ((ctime (current-time)) - (date (apply 'shimbun-make-date-string args)) - (time (shimbun-time-parse-string date)) - (ms (car time)) - (ls (cadr time)) - (system-time-locale "C")) - (if (or (> ms (car ctime)) - (and (= ms (car ctime)) - (> ls (cadr ctime)))) - ;; It should be yesterday's same time. - (progn - (setq ms (1- ms)) - (when (< (setq ls (- ls (eval-when-compile - (- (* 60 60 24) 65536)))) - 0) - (setq ms (1- ms) - ls (+ ls 65536))) - (format-time-string "%a, %d %b %Y %R +0900" (list ms ls))) - date)))) + (let ((ctime (current-time)) + (date (shimbun-make-date-string year month day time timezone)) + (system-time-locale "C") + ms ls) + (setq time (shimbun-time-parse-string date) + ms (car time) + ls (cadr time)) + (when adj + (setq ls (+ ls (* adj (eval-when-compile (* 60 60 24)))) + ms (+ (/ ls 65536) ms) + ls (mod ls 65536))) + (cond ((or (> ms (car ctime)) + (and (= ms (car ctime)) + (> ls (cadr ctime)))) + ;; It should be the same time yesterday. + (setq ms (1- ms)) + (when (< (setq ls (- ls (eval-when-compile + (- (* 60 60 24) 65536)))) + 0) + (setq ms (1- ms) + ls (+ ls 65536))) + (format-time-string "%a, %d %b %Y %R +0900" (list ms ls))) + (adj + (format-time-string "%a, %d %b %Y %R +0900" (list ms ls))) + (t + date))))) -(defun shimbun-nikkei-get-headers-default (group folder &optional headers) +(defvar shimbun-nikkei-tmp-ids nil) +(defvar shimbun-nikkei-tmp-subjects nil) + +(defun shimbun-nikkei-get-headers-default (group folder shimbun range + &optional headers) "Default function used to fetch headers. GROUP is a group name. FOLDER is a parent url. If HEADERS is non-nil, it is appended to newly fetched headers." - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "]+/\\)?" - ;; 3. serial number - "\\(" - ;; 4. year - "\\(20[0-9][0-9]\\)" - ;; 5. month - "\\([01][0-9]\\)" - ;; 6. day - "\\([0-3][0-9]\\)" - "[0-9a-z]+\\)" - "\\.html\\)\"" s0 ">\\(" s0 "<[^<>]+>" s0 "\\)*" s0 - ;; 8. subject - "\\([^<>]+\\)" - "\\(" s0 "<[^<>]+>" s0 "\\)*" - "(" - ;; 10. hour:minute - "\\([012][0-9]:[0-5][0-9]\\)" - ")"))) - nil t) - (push (shimbun-create-header - 0 - (match-string 8) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6)) - (match-string 10)) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 1) folder)) - headers)) - (shimbun-sort-headers headers)) + (unless headers + (setq shimbun-nikkei-tmp-ids nil + shimbun-nikkei-tmp-subjects nil)) + (let (next time url subject serial day month year category id) + (goto-char (point-min)) + (while (re-search-forward "]+\\)?>\ +\[\t\n ]*(\\([012][0-9]:[0-5][0-9]\\))[\t\n ]*" + nil t) + (setq next (match-end 0) + time (match-string 1)) + (when (and (re-search-backward "]*>\ +\[\t\n ]*\\(?:]+>[\t\n ]*\\)*\\([^\n<]+\\)\\(?:[\t\n ]*]+>\\)*\ +\[\t\n ]*" + nil t) + (progn + (setq url (match-string 1) + subject (match-string 2)) + (when (string-match "[\t\n ]+\\'" url) + (setq url (substring url 0 (match-beginning 0)))) + (or (and (string-match "\ +\\(?:/20[0-9][0-9][01][0-9][0-3][0-9]\\|/index\\.aspx\\?n=\\)\ +\\(.+\\)\\([0-3][0-9]\\)\\([01][0-9]\\)\\(20[0-9][0-9]\\)" url) + (prog1 t + (setq serial (downcase (match-string 1 url)) + day (match-string 2 url) + month (match-string 3 url) + year (match-string 4 url)))) + (and (string-match "\ +\\(20[0-9][0-9]\\)\\([01][0-9]\\)\\([0-3][0-9]\\)\\([^\n\t ./=]+\\)" url) + (prog1 t + (setq year (match-string 1 url) + month (match-string 2 url) + day (match-string 3 url) + serial (downcase (match-string 4 url))))))) + (and (string-match "\ +\\`http://\\([^\t\n ./]+\\)\\.nikkei\\.co\\.jp/\\(?:\\([^\t\n /]+\\)/news/\\)?\ +\\|\\`/news/\\([^\t\n /]+\\)/" url) + (prog1 t + (setq category (if (match-beginning 2) + (concat (match-string 2 url) "." + (match-string 1 url)) + (or (match-string 1 url) + (match-string 3 url)))))) + (progn + (setq id (concat "<" year month day "." + (shimbun-subst-char-in-string ? ?_ serial) + "%" category "." group "." + shimbun-nikkei-top-level-domain ">")) + (not (or (member id shimbun-nikkei-tmp-ids) + (and (>= (length subject) 16) + (member subject + shimbun-nikkei-tmp-subjects)))))) + (push id shimbun-nikkei-tmp-ids) + (push subject shimbun-nikkei-tmp-subjects) + (push (shimbun-create-header + 0 subject shimbun-nikkei-from-address + (shimbun-nikkei-make-date-string + (string-to-number year) + (string-to-number month) + (string-to-number day) + time) + id "" 0 0 + (shimbun-nikkei-expand-url url folder)) + headers)) + (goto-char next)) + headers)) -(defun shimbun-nikkei-get-headers-top (group folder) +(defun shimbun-nikkei-get-headers-top (group folder shimbun range) "Function used to fetch headers for the `top' group." + (setq shimbun-nikkei-tmp-ids nil) + (setq shimbun-nikkei-tmp-subjects nil) (let (headers) - (when (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - "" s0 - ;; 6. subject - "\\([^<]+\\)" - s0 - "\\(" s0 "<[^!]+>\\)*" s0 - "[^<]+(" - ;; 8. hour:minute - "\\([0-2][0-9]:[0-5][0-9]\\)"))) - nil t) + ;; Get headers for the retto group. + (while (re-search-forward "[\t\n ]*\\([^<]+\\):[\n\t  ]*\\([^<]+\\)" nil t) (push (shimbun-create-header 0 - (match-string 6) + (concat "[" (match-string 7) "] " (match-string 8)) ;; subject shimbun-nikkei-from-address (shimbun-nikkei-make-date-string (string-to-number (match-string 3)) (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (match-string 8)) - (concat "<" (match-string 2) "%" group "." - shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 5))) + (concat "<" (match-string 2) "." (downcase (match-string 6)) + "%retto.top." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) - (shimbun-nikkei-get-headers-default group folder headers))) + (shimbun-nikkei-get-headers-default group folder shimbun range headers))) -(defun shimbun-nikkei-get-headers-default2 (group folder) +(defun shimbun-nikkei-get-headers-default2 (group folder shimbun range) "Function used to fetch headers for the tento and the zinzi groups." (let (headers) (while (re-search-forward @@ -348,111 +655,43 @@ (s1 "[\t\n ]+")) (concat "]+/\\)?" - ;; 3. serial number + "\\(\\(?:[^\"<>]+/\\)?" + ;; 2. serial number "\\(" - ;; 4. year + ;; 3. year "\\(20[0-9][0-9]\\)" - ;; 5. month + ;; 4. month "\\([01][0-9]\\)" - ;; 6. day + ;; 5. day "\\([0-3][0-9]\\)" "[0-9a-z]+\\)" - "\\.html\\)\"" s0 "\\(>\\)" s0 - ;; 8. subject + "\\.html\\)" + s0 "\"" s0 ">" s0 + ;; 6. subject "\\([^<>]+\\)"))) nil t) (push (shimbun-create-header 0 - (match-string 8) + (match-string 6) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string + (string-to-number (match-string 3)) (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 1) folder)) - headers)) - (shimbun-sort-headers headers))) - -(defun shimbun-nikkei-get-headers-report (group folder) - "Function used to fetch headers for the report group." - (let ((date (if (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" - s0 "更新" s0 "[::]" s0 - ;; 1. year - "\\(20[0-9][0-9]\\)" - "/" - ;; 2. month - "\\([01]?[0-9]\\)" - "/" - ;; 3. day - "\\([0-3]?[0-9]\\)" - s0 "

          "))) - nil t) - (prog1 - (shimbun-make-date-string - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3))) - (goto-char (point-min))) - (let ((cts (current-time-string))) - (format "%s, %02d %s %s 00:00 +0900" - (substring cts 0 3) - (string-to-number (substring cts 8 10)) - (substring cts 4 7) - (substring cts 20))))) - headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 3. subject - "\\([^<]+\\)" - s0 "<"))) - nil t) - (push (shimbun-create-header - 0 - (match-string 3) - shimbun-nikkei-from-address - date - (concat "<" (match-string 2) "%" group "." + (string-to-number (match-string 5))) + (concat "<" (downcase (match-string 2)) "%" group "." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) headers)) -(defun shimbun-nikkei-get-headers-kansai (group folder) +(defun shimbun-nikkei-get-headers-kansai (group folder shimbun range) "Function used to fetch headers for the kansai group." - (let ((date (if (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "class=\"date\">" s0 - ;; 1. year - "\\(20[0-9][0-9]\\)" - "年" - ;; 2. month - "\\([01]?[0-9]\\)" - "月" - ;; 3. day - "\\([0-3]?[0-9]\\)" - "日" s0 "(" "\\([^<]+\\)" ")" - s0 ""))) - nil t) + (let ((date (if (re-search-forward "\ +]+[\t\n ]+\\)*class=\"topicpath[\t\n ]+updatetime\"\ +\[^>]*>[\t\n ]*\\(20[0-9][0-9]\\)/\\([01]?[0-9]\\)/\\([0-3]?[0-9]\\)\ +\[\t\n  ]+更新[\t\n ]*
        " + nil t) (prog1 (shimbun-make-date-string (string-to-number (match-string 1)) @@ -466,606 +705,344 @@ (substring cts 4 7) (substring cts 20))))) headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "]+/\\)" - ;; 3. serial number - "\\([^\t\n ]+\\)\\)" - s0 "-frame" s0 "\\.html" - s0 "\">" s0 - ;; 4. subject - "\\([^<]+\\)" - s0 "<"))) - nil t) + (while (re-search-forward "[\t\n ]*\\([^<]+\\)[\t\n ]*" + nil t) (push (shimbun-create-header 0 - (match-string 4) + (match-string 3) shimbun-nikkei-from-address date - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (concat (match-string 1) ".html") - folder)) - headers)) - headers)) - -(defun shimbun-nikkei-get-headers-it (group folder) - "Function used to fetch headers for the it group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 7. subject - "\\([^<]+\\)" ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 7) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 3)) - (string-to-number (match-string 4)) - (string-to-number (match-string 5))) - (concat "<" (match-string 2) "%" group "." + (concat "<" (shimbun-subst-char-in-string + ?/ ?. (downcase (match-string 2))) + "%" group "." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) headers)) -(defun shimbun-nikkei-get-headers-it-zensen (group folder) - "Function used to fetch headers for the it.zensen group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 "\\(([01]?[0-9]/[0-3]?[0-9])\\)?" s0 - ;; 9. subject - "\\([^<]+\\)" ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 9) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url - (concat "http://it.nikkei.co.jp/it/column/zensen.cfm" - (match-string 2)) folder)) - headers)) - headers)) - -(defun shimbun-nikkei-get-headers-it-manage (group folder) - "Function used to fetch headers for the it.manage group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 8. subject - "\\([^<]+\\)" ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 8) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url - (concat "http://it.nikkei.co.jp/it/manage/foc.cfm" - (match-string 2)) folder)) - headers)) +(defun shimbun-nikkei-get-headers-it-default (group folder shimbun range) + "Function used to fetch headers for the it groups." + (let ((pages (shimbun-header-index-pages range)) + (count 0) + sub-end id headers) + (catch 'stop + (while t + (while (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat "" + "\\(?:" s0 "([01]?[0-9]/[0-3]?[0-9])\\)?" s0 + ;; 7. subject + "\\([^<]+\\)" + s0 ""))) + nil t) + (setq sub-end (point) + id (concat "<" (shimbun-subst-char-in-string + ? ?_ (downcase (match-string 2))) + "%" group "." + shimbun-nikkei-top-level-domain ">")) + (if (shimbun-search-id shimbun id) + (unless (zerop count) + (throw 'stop nil)) + (push (shimbun-create-header + 0 + (match-string 7) + shimbun-nikkei-from-address + (shimbun-nikkei-make-date-string + (string-to-number (match-string 5)) + (string-to-number (match-string 4)) + (string-to-number (match-string 3))) + id "" 0 0 + (shimbun-nikkei-expand-url (match-string 1) folder)) + headers)) + (goto-char sub-end)) + (if (and (or (not pages) + (< (setq count (1+ count)) pages)) + (re-search-forward "\ +>> 過去記事一覧\ +\\|次へ>" + nil t)) + (progn + (shimbun-retrieve-url (prog1 + (concat "\ +http://it.nikkei.co.jp/" (or (match-string 1) (match-string 2))) + (erase-buffer)) + t) + (goto-char (point-min))) + (throw 'stop nil)))) headers)) -(defun shimbun-nikkei-get-headers-it-seisaku (group folder) - "Function used to fetch headers for the it.seisaku group." +(defun shimbun-nikkei-get-headers-it-pc (group folder shimbun range) + "Function used to fetch headers for the it.pc group." (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 8. subject - "\\([^<]+\\)" ""))) - nil t) + (while (and (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat "" s0 + ;; 6. subject + "\\([^<]+\\)" + s0 ""))) + nil t) + (not (string-match "\\`[\t\n  ]*\\'" (match-string 6)))) (push (shimbun-create-header 0 - (match-string 8) + (match-string 6) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) - headers)) - headers)) - -(defun shimbun-nikkei-get-headers-it-digicore (group folder) - "Function used to fetch headers for the it.digicore group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 "\\(([01]?[0-9]/[0-3]?[0-9])\\)?" s0 - ;; 9. subject - "\\([^<]+\\)" ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 9) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." - shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 3))) + (concat "<" (shimbun-subst-char-in-string + ? ?_ (downcase (match-string 2))) + "%" group "." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url - (concat "http://it.nikkei.co.jp/it/column/digicore.cfm" - (match-string 2)) folder)) + (concat "http://it.nikkei.co.jp/" (match-string 1)) + folder)) headers)) headers)) -(defun shimbun-nikkei-get-headers-markets (group folder) - "Function used to fetch headers for the markets group." +(defun shimbun-nikkei-get-headers-stock (group folder shimbun range) + "Function used to fetch headers for stock groups." (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)" s0 "(" - ;; 7. month - "\\([01]?[0-9]\\)" - "/" - ;; 8. day - "\\([0-3]?[0-9]\\)" - s1 - ;; 9. hour - "\\([0-2]?[0-9]\\)" - ":" - ;; 10. minute - "\\([0-5]?[0-9]\\)" - ")" s0 ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 6) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 7)) - (string-to-number (match-string 8)) - (format "%02d:%02d" - (string-to-number (match-string 9)) - (string-to-number (match-string 10)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) - headers)) - (shimbun-sort-headers headers))) - -(defun shimbun-nikkei-get-headers-kawase (group folder) - "Function used to fetch headers for the kawase group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)" s0 "(" - ;; 7. month - "\\([01]?[0-9]\\)" - "/" - ;; 8. day - "\\([0-3]?[0-9]\\)" - s1 - ;; 9. hour - "\\([0-2]?[0-9]\\)" - ":" - ;; 10. minute - "\\([0-5]?[0-9]\\)" - ")" s0 ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 6) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 7)) - (string-to-number (match-string 8)) - (format "%02d:%02d" - (string-to-number (match-string 9)) - (string-to-number (match-string 10)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) - headers)) - (shimbun-sort-headers headers))) - -(defun shimbun-nikkei-get-headers-bunkatsu2 (group folder) - "Function used to fetch headers for the kawase group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 7. subject - "\\([^<]+\\)" s0 "(" - ;; 8. month - "\\([01]?[0-9]\\)" - "/" - ;; 9. day - "\\([0-3]?[0-9]\\)" - s1 - ;; 10. hour - "\\([0-2]?[0-9]\\)" - ":" - ;; 11. minute - "\\([0-5]?[0-9]\\)" - ")" s0 ""))) - nil t) - (push (shimbun-create-header - 0 - (match-string 7) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 8)) - (string-to-number (match-string 9)) - (format "%02d:%02d" - (string-to-number (match-string 10)) - (string-to-number (match-string 11)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) - headers)) - (shimbun-sort-headers headers))) - -(defun shimbun-nikkei-get-headers-kinri (group folder) - "Function used to fetch headers for the kinri group." - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)" s0 "(" - ;; 7. month + ;; 5. subject + "\\([^<]+\\)" + "" "\\(?:\n\\)?" "\\(?:\n\\)?" "[\t\n ]+(" + ;; 6. month "\\([01]?[0-9]\\)" "/" - ;; 8. day + ;; 7. day "\\([0-3]?[0-9]\\)" s1 - ;; 9. hour + ;; 8. hour "\\([0-2]?[0-9]\\)" ":" - ;; 10. minute + ;; 9. minute "\\([0-5]?[0-9]\\)" - ")" s0 ""))) + ")" s0 "\\(?:[\t\n ]+\\)?" ""))) nil t) (push (shimbun-create-header 0 - (match-string 6) + (match-string 5) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string (string-to-number (match-string 4)) + (string-to-number (match-string 6)) (string-to-number (match-string 7)) - (string-to-number (match-string 8)) (format "%02d:%02d" - (string-to-number (match-string 9)) - (string-to-number (match-string 10)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 8)) + (string-to-number (match-string 9)))) + (concat "<" (downcase (match-string 2)) "." + (downcase (save-match-data + (shimbun-replace-in-string (match-string 3) + "[\t\n ]+" "."))) + "%" group "." + shimbun-nikkei-top-level-domain ">") "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) + (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) (shimbun-sort-headers headers))) -(defun shimbun-nikkei-get-headers-ft (group folder) +(defun shimbun-nikkei-get-headers-ft (group folder shimbun range) "Function used to fetch headers for the ft group." (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject + ;; 4. subject "\\([^<]+\\)" - s0 "\\([(|(]\\)" - ;; 8. month + s0 "[((]" + ;; 5. month "\\([01]?[0-9]\\)" "/" - ;; 9. day + ;; 6. day "\\([0-3]?[0-9]\\)" - "\\([)|)]\\)" s0 "※" s0 ""))) + "[))]"))) nil t) (push (shimbun-create-header 0 - (match-string 6) + (match-string 4) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 8)) - (string-to-number (match-string 9))) -;; (match-string 9)) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 3)) + (string-to-number (match-string 5)) + (string-to-number (match-string 6)) + nil nil 1) + (concat "") "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) + (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) headers)) -(defun shimbun-nikkei-get-headers-dj (group folder) +(defun shimbun-nikkei-get-headers-dj (group folder shimbun range) "Function used to fetch headers for the dj group." (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)" s0 "(" - ;; 7. month + "\\)" + "\\)" + "\"" s0 ">\\(?:\\)?" s0 + ;; 4. subject + "\\([^<]+\\)" + s0 "[((]" + ;; 5. month "\\([01]?[0-9]\\)" "/" - ;; 8. day + ;; 6. day "\\([0-3]?[0-9]\\)" - s1 - ;; 9. hour - "\\([0-2]?[0-9]\\)" - ":" - ;; 10. minute - "\\([0-5]?[0-9]\\)" - ")" s0 ""))) + "[))]" s0 ""))) nil t) (push (shimbun-create-header 0 - (match-string 6) + (match-string 4) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string - (string-to-number (match-string 4)) - (string-to-number (match-string 7)) - (string-to-number (match-string 8)) - (format "%02d:%02d" - (string-to-number (match-string 9)) - (string-to-number (match-string 10)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 3)) + (string-to-number (match-string 5)) + (string-to-number (match-string 6))) + (concat "") "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) + (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) (shimbun-sort-headers headers))) -(defun shimbun-nikkei-get-headers-gyoseki (group folder) - "Function used to fetch headers for the gyoseki group." +(defun shimbun-nikkei-get-headers-gyosuuchi (group folder shimbun range) + "Function used to fetch headers for the gyosuuchi group." (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)" s0 "(" - ;; 7. month + ;; 5. subject + "\\([^<]+\\)" + "" "\\(?:\n\\)?" "\\(?:\n\\)?" "[\t\n ]+(" + ;; 6. month "\\([01]?[0-9]\\)" "/" - ;; 8. day + ;; 7. day "\\([0-3]?[0-9]\\)" s1 - ;; 9. hour + ;; 8. hour "\\([0-2]?[0-9]\\)" ":" - ;; 10. minute + ;; 9. minute "\\([0-5]?[0-9]\\)" - ")" s0 ""))) + ")" s0 "\\(?:[\t\n ]+\\)?" ""))) nil t) (push (shimbun-create-header 0 - (match-string 6) + (match-string 5) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string (string-to-number (match-string 4)) + (string-to-number (match-string 6)) (string-to-number (match-string 7)) - (string-to-number (match-string 8)) (format "%02d:%02d" - (string-to-number (match-string 9)) - (string-to-number (match-string 10)))) - (concat "<" (match-string 3) (match-string 4) (match-string 5) - "%" group "." shimbun-nikkei-top-level-domain ">") + (string-to-number (match-string 8)) + (string-to-number (match-string 9)))) + (concat "<" (downcase (match-string 2)) "." + (downcase (save-match-data + (shimbun-replace-in-string (match-string 3) + "[\t\n ]+" "."))) + "%" group "." + shimbun-nikkei-top-level-domain ">") "" 0 0 - (shimbun-nikkei-expand-url (match-string 2) folder)) + (shimbun-nikkei-expand-url + (concat "\ +http://markets.nikkei.co.jp/kokunai/bunkatsu3.aspx" (match-string 1)) folder)) headers)) (shimbun-sort-headers headers))) -(defun shimbun-nikkei-get-headers-market (group folder) +(defun shimbun-nikkei-get-headers-market (group folder shimbun range) "Function used to fetch headers for the market group." (let ((subregexp (eval-when-compile @@ -1081,8 +1058,8 @@ "月" ;; 3. day "\\([0-3]?[0-9]\\)" - "日\\(" s1 - ;; 5. hour:minute + "日\\(?:" s1 + ;; 4. hour:minute "\\([012]?[0-9]:[0-5]?[0-9]\\)" "\\)?")))) subdata start end subtitle month day time from year headers) @@ -1102,7 +1079,7 @@ (setq subtitle (match-string 1) month (string-to-number (match-string 2)) day (string-to-number (match-string 3)) - time (match-string 5)) + time (match-string 4)) (setq from (shimbun-replace-in-string shimbun-nikkei-from-address ")" (concat "/" @@ -1120,124 +1097,201 @@ "\\(" ;; 3. year "\\(20[0-9][0-9]\\)" - "\\([^.]+\\)" + "[^.]+" "\\)" - "\\.html\\)\"" - s0 ">\\(" s0 "<[^>]+>\\)*" s0 - ;; 6. subject - + "\\.html\\)" + s0 "\"" s0 ">\\(?:" s0 "<[^>]+>\\)*" s0 + ;; 4. subject "\\([^<]+\\)" s0))) end t) (setq year (string-to-number (match-string 3))) (push (shimbun-create-header 0 - (match-string 6) + (match-string 4) from (shimbun-nikkei-make-date-string year month day time) (format "<%s%%%s.%s>" - (match-string 2) group + (downcase (match-string 2)) group shimbun-nikkei-top-level-domain) "" 0 0 (shimbun-nikkei-expand-url (match-string 1) shimbun-nikkei-url)) headers)) (setq start end)) - (shimbun-sort-headers headers)))) + headers))) -(defun shimbun-nikkei-get-headers-retto (group folder) - "Function used to fetch headers for the retto group." - (let ((region "") - headers) +(defun shimbun-nikkei-get-headers-china (group folder shimbun range) + "Function used to fetch headers for the china group." + (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "]*>" s0 "【" - ;; 1. region - "\\([^\t\n ]+\\)" - "】" s0 "

        " - "\\|" - "" + s0 "\\(?:([01]?[0-9]/[0-3]?[0-9])\\)?" s0 + ;; 7. subject + "\\([^<]+\\)" + ""))) nil t) - (if (match-beginning 1) - (setq region (match-string 1)) - (push (shimbun-create-header - 0 - (concat "[" region "] " (match-string 2)) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 5)) - (string-to-number (match-string 6)) - (string-to-number (match-string 7)) - (match-string 8)) - (concat "<" (match-string 4) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 3) folder)) - headers))) - (shimbun-sort-headers headers))) + (push (shimbun-create-header + 0 + (match-string 6) + shimbun-nikkei-from-address + (shimbun-nikkei-make-date-string + (string-to-number (match-string 3)) + (string-to-number (match-string 4)) + (string-to-number (match-string 5))) + (concat "<" (downcase (match-string 2)) "%" group "." + shimbun-nikkei-top-level-domain ">") + "" 0 0 + (shimbun-nikkei-expand-url (match-string 1) folder)) + headers)) + headers)) + +(defun shimbun-nikkei-get-headers-retto (group folder shimbun range) + "Function used to fetch headers for the retto group." + (when (re-search-forward "\ +]+>\\([^\t\n ]+\\)" + nil t) + (let ((start (match-end 0)) + (region (match-string 1)) + end next subject url serial year month day time headers) + (while start + (if (re-search-forward "\ +]+>\\([^\t\n ]+\\)" + nil t) + (setq end (match-end 0) + next (match-string 1)) + (setq end nil)) + (while (progn + (goto-char start) + (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat "" s0 "" s0 "" s0))) + (regexp-quote subject)) + end t) + (setq url (match-string 1))) + (push (shimbun-create-header + 0 + (concat "[" region "] " subject) + shimbun-nikkei-from-address + (shimbun-nikkei-make-date-string year month day time) + (concat "<" serial "%" group "." + shimbun-nikkei-top-level-domain ">") + "" 0 0 + (shimbun-nikkei-expand-url url folder)) + headers)) + (setq start end + region next)) + headers))) -(defun shimbun-nikkei-get-headers-sports (group folder) +(defun shimbun-nikkei-get-headers-sports (group folder shimbun range) "Function used to fetch headers for the sports group." - (let (headers) + ;; Skip headlinenews. + (re-search-forward "\ +[\t\n ]*更新:[01]?[0-9]月[0-3]?[0-9]日" + nil t) + (let (category headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) (concat "]+>" "\\(" s0 "<[^>]+>\\)*" s0 "(" s0 + "[^&]+\\)" + "&t=" + ;; 4. category + "\\([^\"]+\\)" + "\\)" + s0 "\">" s0 "(" ;; 5. month - "\\([0-9]+\\)" - s0 "/" s0 + "\\([01]?[0-9]\\)" + "/" ;; 6. day - "\\([0-9]+\\)" - s0 ")" s0 + "\\([0-3]?[0-9]\\)" + ")" s0 ;; 7. subject "\\([^<]+\\)"))) nil t) + (setq category (match-string 4)) (push (shimbun-create-header 0 - (match-string 7) + (concat "[" category "] " (match-string 7)) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string (string-to-number (match-string 3)) (string-to-number (match-string 5)) (string-to-number (match-string 6))) - (concat "<" (match-string 2) "%" group "." + (concat "<" (downcase (match-string 2)) "%" category "." group "." shimbun-nikkei-top-level-domain ">") "" 0 0 - (shimbun-nikkei-expand-url (match-string 1) folder)) + (match-string 1)) headers)) headers)) -(defun shimbun-nikkei-get-headers-newpro (group folder) +(defun shimbun-nikkei-get-headers-newpro (group folder shimbun range) "Function used to fetch headers for the newpro group." - (when (re-search-forward ">[\t\n ]*● 新製品記事一覧[\t\n ]*<" nil t) + (when (re-search-forward ">[\t\n ]*最新新製品ニュース[\t\n ]*<" nil t) (narrow-to-region (point) (or (search-forward "

      " nil t) (point-max))) (goto-char (point-min)) @@ -1248,30 +1302,30 @@ (s1 "[\t\n ]+")) (concat "" s0 - ;; 7. subject + s0 "\"" s0 ">" s0 + ;; 6. subject "\\([^<]+\\)"))) nil t) (push (shimbun-create-header 0 - (match-string 7) + (match-string 6) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string + (string-to-number (match-string 3)) (string-to-number (match-string 4)) - (string-to-number (match-string 5)) - (string-to-number (match-string 6))) - (concat "<" (match-string 3) "%" group "." + (string-to-number (match-string 5))) + (concat "<" (downcase (match-string 2)) "%" group "." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url (match-string 1) folder)) @@ -1279,7 +1333,7 @@ (widen) headers))) -(defun shimbun-nikkei-get-headers-release (group folder) +(defun shimbun-nikkei-get-headers-release (group folder shimbun range) "Function used to fetch headers for the release group." (let (url id subject sub-end year month day headers) (while (re-search-forward @@ -1291,12 +1345,13 @@ "\\(detail\\.cfm\\?relID=" ;; 2. serial number "\\([^\"]+\\)" - "\\)\"" s0 ">" s0 + "\\)" + s0 "\"" s0 ">" s0 ;; 3. subject "\\([^<]+\\)"))) nil t) (setq url (match-string 1) - id (match-string 2) + id (downcase (match-string 2)) subject (match-string 3) sub-end (point)) (when (re-search-backward "\ @@ -1318,98 +1373,180 @@ (goto-char sub-end))) headers)) -(defun shimbun-nikkei-get-headers-shasetsu (group folder) +(defun shimbun-nikkei-get-headers-release2 (group folder shimbun range) + "Function used to fetch headers for the release-in-detail groups." + (let ((pages (shimbun-header-index-pages range)) + (count 0) + url id subject sub-end year month day headers) + (catch 'stop + (while t + (while (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat "" s0 + ;; 3. subject + "\\([^<]+\\)"))) + nil t) + (setq url (match-string 1) + id (downcase (match-string 2)) + subject (match-string 3) + sub-end (point)) + (when (re-search-backward "\ +>[\t\n ]*\\(20[0-9][0-9]\\)/\\([01][0-9]\\)/\\([0-3][0-9]\\)[^0-9]" + nil t) + (setq year (string-to-number (match-string 1)) + month (string-to-number (match-string 2)) + day (string-to-number (match-string 3)) + id (format "<%d%02d%02d.%s%%%s.%s>" + year month day id group + shimbun-nikkei-top-level-domain)) + (if (shimbun-search-id shimbun id) + (unless (zerop count) + (throw 'stop nil)) + (push (shimbun-create-header + 0 subject shimbun-nikkei-from-address + (shimbun-nikkei-make-date-string year month day) + id "" 0 0 + (shimbun-nikkei-expand-url + (concat "http://release.nikkei.co.jp/" url) folder)) + headers)) + (goto-char sub-end))) + (if (and (or (not pages) + (< (setq count (1+ count)) pages)) + (progn + (goto-char (point-min)) + (re-search-forward "[\t\n ]*次へ[\t\n ]*>[\t\n ]*" + nil t))) + (progn + (shimbun-retrieve-url (prog1 + (concat "http://release.nikkei.co.jp/" + (match-string 1)) + (erase-buffer)) + t) + (goto-char (point-min))) + (throw 'stop nil)))) + headers)) + +(defun shimbun-nikkei-get-headers-shasetsu (group folder shimbun range) "Function used to fetch headers for the shasetsu group." + (goto-char (point-max)) + (insert (with-temp-buffer + (shimbun-retrieve-url + "http://www.nikkei.co.jp/news/shasetsu/IndexKijiIchiran.js" + t) + (buffer-string))) + (goto-char (point-min)) (let (headers) (while (re-search-forward (eval-when-compile (let ((s0 "[\t\n ]*") (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\(\\(社説\\|春秋\\)[^<]+\\)"))) + "\\\\\"[^>]*>" s0 + ;; 4. subject + "\\(\\(?:社説\\|春秋\\)[^<]*[((]" s0 + ;; 5. month + "\\([01]?[0-9]\\)" + s0 "/" s0 + ;; 6. day + "\\([0-3]?[0-9]\\)" + s0 "[))]\\)" + s0 ""))) nil t) (push (shimbun-create-header 0 - (match-string 6) + (shimbun-subst-char-in-string + ?\) ?\) + (shimbun-subst-char-in-string ?\( ?\( (match-string 4))) shimbun-nikkei-from-address (shimbun-nikkei-make-date-string (string-to-number (match-string 3)) - (string-to-number (match-string 4)) - (string-to-number (match-string 5))) - (concat "<" (match-string 2) "%" group "." + (string-to-number (match-string 5)) + (string-to-number (match-string 6))) + (concat "<" (downcase (match-string 2)) "%" group "." shimbun-nikkei-top-level-domain ">") "" 0 0 (shimbun-nikkei-expand-url (match-string 1) folder)) headers)) (nreverse headers))) -(defun shimbun-nikkei-get-headers-okuyami (group folder) - "Function used to fetch headers for the okuyami group." - (when (re-search-forward ">[\t\n ]*▼おくやみ[\t\n ]*<" nil t) - (let (headers) - (while (re-search-forward - (eval-when-compile - (let ((s0 "[\t\n ]*") - (s1 "[\t\n ]+")) - (concat "" s0 - ;; 6. subject - "\\([^<]+\\)"))) - nil t) - (push (shimbun-create-header - 0 - (match-string 6) - shimbun-nikkei-from-address - (shimbun-nikkei-make-date-string - (string-to-number (match-string 3)) - (string-to-number (match-string 4)) - (string-to-number (match-string 5))) - (concat "<" (match-string 2) "%" group "." - shimbun-nikkei-top-level-domain ">") - "" 0 0 - (shimbun-nikkei-expand-url (match-string 1) folder)) - headers)) - headers))) - (luna-define-method shimbun-make-contents :before ((shimbun shimbun-nikkei) header) (let ((fn (nth 4 (assoc (shimbun-current-group-internal shimbun) shimbun-nikkei-group-table))) (case-fold-search t)) (while (search-forward "\r" nil t) - (delete-backward-char 1)) + (delete-char -1)) (goto-char (point-min)) - (when (fboundp fn) - (funcall fn header) - (goto-char (point-min))))) + (while (re-search-forward "[\t\n ]*\\(?:\ +]+\\)?>\ +\\|
    \ +\\|]+>[\t\n ]*<拡大\\(?:画像\\)?>[\t\n ]*\ +\\|\\(?:]+>[\t\n ]*\\)?]+>\\(?:[\t\n ]*
    \\)?\ +\\)[\t\n ]*" + nil t) + (delete-region (match-beginning 0) (match-end 0))) + (goto-char (point-min)) + (if (and (fboundp fn) + (funcall fn header)) + (shimbun-with-narrowed-article + shimbun + ;; Remove
    tags surrounding images. + (while (and (search-forward "
    " nil t) + (progn + (backward-char 1) + (shimbun-end-of-tag "center" t)) + (save-match-data + (re-search-backward "]+\\)\ +\\|![^>]+\\)>[\t\n ]*\\)+\ +\\(]+>\\)[\t\n ]*\ +\\(?:<\\(?:\\(?:/?div\\|/?p\\|/?td\\|/?tr\\)\\(?:[\t\n ]*\\|[\t\n ]+[^>]+\\)\ +\\|![^>]+\\)>[\t\n ]*\\)+" + nil t) + (replace-match "\n\\1
    \n")) + ;; Remove trailing garbage. + (goto-char (point-min)) + (when (re-search-forward "[\t\n ]*\ +\\(?:<\\(?:\\(?:/?div\\|/?p\\)\\(?:[\t\n ]*\\|[\t\n ]+[^>]+\\)\\|![^>]+\\)>\ +\[\t\n ]*\\)+\\'" + nil t) + (replace-match "\n")) + ;; Break long lines. + (shimbun-break-long-japanese-lines)) + (erase-buffer) + (insert "\ +Couldn't extract the body for this article.
    \ +Please visit the original page.\ +\n")) + (goto-char (point-min)))) -(defun shimbun-nikkei-prepare-article-default (&rest args) +(defun shimbun-nikkei-prepare-article-default-0 (&rest args) "Default function used to prepare contents of an article." (let (photo-end body) (when (re-search-forward "" nil t) (setq photo-end (point)))) (when (or (and (re-search-forward "\ -[\t\n ]*" +[\t\n ]*" nil t) - (setq body (point)) - (re-search-forward "\ -\[\t\n ]*" - nil t) - (insert shimbun-nikkei-content-start) - (when (re-search-forward "\ -" - nil t) - (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) +(defun shimbun-nikkei-prepare-article-default (header) + "Default function used to prepare contents of an article." + (let (start end) + (if (or + (when (re-search-forward + "[\t\n ]*" + nil t) + (setq start (match-end 0)) + (or (re-search-forward "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +[\t\n ]*" + nil t) + (prog1 nil (goto-char (point-min))))) + (when (re-search-forward + "[\t\n ]*" + nil t) + (setq start (match-end 0)) + (or (re-search-forward "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +[\t\n ]*" + nil t) + (prog1 nil (goto-char (point-min))))) + (when (re-search-forward "[\t\n ]*" nil t) + (setq start (match-end 0)) + (or (re-search-forward "\ +\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\\[[01]?[0-9]月[0-3]?[0-9]日[//][^]]+\\]" + nil t) + (prog1 nil (goto-char (point-min))))) + (when (re-search-forward "\ +\\([\t\n ]*\\)\ +\\|<\\([^\t\n >]+\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*\ +\\(?:class=\"photo\"\\|summary=\"写真ニュース\"\\)[^>]*>[\t\n ]*\ +\\|[\t\n ]*" + nil t) + (let (st nd) + (if (and (or (and (match-beginning 1) + (progn + (setq st (match-end 1)) + (re-search-forward "\ +\[\t\n ]*" + nil t) + (setq nd (match-beginning 0)))) + (and (match-beginning 2) + (shimbun-end-of-tag (match-string 2) t) + (setq st (match-beginning 3) + nd (match-end 3)))) + (re-search-forward "\ +[\t\n ]*" + nil t)) + (progn + (setq start st) + (delete-region nd (match-end 0)) + (insert "\n")) + (setq start (match-end 0)))) + (or (re-search-forward "\\(?:[\t\n ]*<[^/][^>]*>\\)*[\t\n ]*\ +" + nil t) + (prog1 nil (goto-char (point-min))))) + (when (or (re-search-forward + "[\t\n ]*" + nil t) + (re-search-forward "[\t\n ]*" + nil t)) + (setq start (match-end 0)) + (or (re-search-forward "\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +" + nil t) + (prog1 nil (goto-char (point-min))))) + (setq end (shimbun-nikkei-prepare-article-default-0 header)) + (prog1 nil (goto-char (point-min))) + + ;; Filters having a potential to mistakenly extract the body follow. + (when (or (re-search-forward "\ +[\t\n ]*トップ[\t\n ]*[\t\n ]*" + nil t) + (re-search-forward "\ +\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*" + nil t) + (re-search-forward "\ +\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*\ +\\(?:[\t\n ]*<[^>]+>\\)*[\t\n ]*" + nil t)) + (setq start (match-end 0)) + (or (re-search-forward "\ +\[\t\n ]*\\(?:<[^>]+>[\t\n ]*\\)*]+\\)*[\t\n ]align=" + nil t) + (prog1 nil (goto-char (point-min))))) + (when (or (re-search-forward "\ +\\(?:[\t\n ]*<[^i][^>]*>\\)*[\t\n ]*" + nil t) + (re-search-forward "" nil t) + (re-search-forward "]+>[\t\n ]*" + nil t)) + (setq start (match-end 0)) + (set-match-data nil) + (while (re-search-forward "[\t\n ]*\\(?:<[^>]+>[\t\n ]*\\)*\ +" + nil t)) + (or (match-beginning 0) + (prog1 nil (goto-char (point-min)))))) + (progn + (unless end + (goto-char (match-beginning 0)) + (insert shimbun-nikkei-content-end) + (goto-char start) + (insert shimbun-nikkei-content-start)) + t) + (when (and (re-search-forward "\ +]+>[\t\n ]*>>記事を読む[\t\n ]*" + nil t) + (re-search-backward "href=\"\\([^\"]+\\)" + (match-beginning 0) t)) + (let ((new (match-string 1)) + (old (shimbun-header-xref header))) + (when (string-match "[^/]/[^/]" old) + (setq new (shimbun-nikkei-expand-url + new (substring old 0 (1- (match-end 0))))) + (shimbun-header-set-xref header new) + (erase-buffer) + (shimbun-retrieve-url new t) + (goto-char (point-min)) + (shimbun-nikkei-prepare-article-default header))))))) -(defun shimbun-nikkei-prepare-article-kansai (&rest args) +(defun shimbun-nikkei-prepare-article-default2 (&rest args) "Function used to prepare contents of an article for some groups." + ;; Remove unwanted images. + (let (start end) + (while (re-search-forward "[\t\n ]*]+>[\t\n ]*]+>[\t\n ]*
    [\t\n ]*" + nil t) + (setq start (match-beginning 0) + end (match-end 0)) + (goto-char start) + (if (re-search-forward + "src=\"http://parts\\.nikkei\\.co\\.jp/parts/s\\.gif\"" + end t) + (delete-region start end) + (goto-char end)))) + (goto-char (point-min)) (when (re-search-forward "\ -" +" nil t) (insert shimbun-nikkei-content-start) (when (re-search-forward "\ -" +\\(?:[\t\n  ]*<\\(?:p\\|p[\t\n  ]+[^>]+\\|/p\\|/p[\t\n  ]+[^>]+\\)>\\)*\ +\[\t\n  ]*\ +\\|\n" nil t) (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) - -(defun shimbun-nikkei-prepare-article-default3 (&rest args) - "Function used to prepare contents of an article for some groups." - (when (re-search-forward "\ -\[\t\n ]" - nil t) - (insert shimbun-nikkei-content-start) - (when (re-search-forward "[\t\n ]" nil t) - (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) + (insert shimbun-nikkei-content-end) + t))) -(defun shimbun-nikkei-prepare-article-bunkatsu2 (&rest args) - "Function used to prepare contents of an article for some groups." - (when (re-search-forward "[\t\n ]" nil t) - (insert shimbun-nikkei-content-start) - (when (re-search-forward "[\t\n ]" nil t) - (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) +(defun shimbun-nikkei-prepare-article-kansai (header) + "Function used to prepare contents of an article for the kansai group." + (let ((date (when (re-search-forward "[\t\n ]*\ +\\(20[0-9][0-9]\\)/\\([01]?[0-9]\\)/\\([0-3][0-9]\\)[\t\n ]*配信[\t\n ]*<" + nil t) + (prog1 + (shimbun-nikkei-make-date-string + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (string-to-number (match-string 3))) + (goto-char (point-min)))))) + (when (and (re-search-forward "\ +]+[\t\n ]+\\)*class=\"detailframe\\(?: clearfix\"\\)?" + nil t) + (shimbun-end-of-tag "div" t)) + (goto-char (match-end 3)) + (insert "\n" shimbun-nikkei-content-end) + (goto-char (match-beginning 3)) + (insert shimbun-nikkei-content-start) + (when date + (shimbun-header-set-date header date)) + t))) (defun shimbun-nikkei-prepare-article-sports (&rest args) "Function used to prepare contents of an article for the sports group." (when (re-search-forward "\ -" +<\\([^\t\n >]+\\)[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*\ +\\(?:class=\"photo\"\\|summary=\"写真ニュース\"\\)[^>]*>[\t\n ]*\ +\\|[\t\n ]*" nil t) + (let ((start (match-end 0)) + st nd) + (if (and (match-beginning 1) + (progn + (goto-char (match-beginning 1)) + (shimbun-end-of-tag (match-string 1) t)) + (progn + (setq st (match-beginning 3) + nd (match-end 3)) + (re-search-forward "\ +[\t\n ]*" + nil t))) + (progn + (delete-region nd (match-end 0)) + (insert "\n") + (goto-char st)) + (goto-char start))) (insert shimbun-nikkei-content-start) (when (re-search-forward "\ -" +" nil t) (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) + (insert shimbun-nikkei-content-end) + t))) (defun shimbun-nikkei-prepare-article-newpro (&rest args) "Function used to prepare contents of an article for the newpro group." @@ -1507,11 +1812,11 @@ (when (search-forward "" nil t) (setq photo-end (point)))) (when (and (re-search-forward "\ -[\t\n ]*" +[\t\n ]*" nil t) (setq body (point)) (re-search-forward "\ -\[\t\n ]*" +" nil t) (insert shimbun-nikkei-content-start) - (when (re-search-forward "\\((\\([012]?[0-9]:[0-5]?[0-9]\\))[\t\n ]*\\)?\ -" + (when (re-search-forward "\\(?:(\\([012]?[0-9]:[0-5]?[0-9]\\))[\t\n ]*\\)?\ +" nil t) - (if (match-beginning 2) + (if (match-beginning 1) (progn - (goto-char (1+ (match-end 2))) - (let ((new (match-string 2)) + (goto-char (1+ (match-end 1))) + (let ((new (match-string 1)) (date (shimbun-header-date header))) (when (string-match "[012]?[0-9]:[0-5]?[0-9]" date) (shimbun-header-set-date header (replace-match new nil nil date))))) (goto-char (match-beginning 0))) - (insert shimbun-nikkei-content-end)))) + (insert shimbun-nikkei-content-end) + t))) -(defun shimbun-nikkei-prepare-article-okuyami (&rest args) - "Function used to prepare contents of an article for the okuyami group." +(defun shimbun-nikkei-prepare-article-default4 (&rest args) + "Function used to prepare contents of an article for some groups." (when (re-search-forward "\ -" +\ +\\|\n[\t\n ]+

    " nil t) (insert shimbun-nikkei-content-start) (when (re-search-forward "\ -" +\ +\\|" nil t) (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end)))) - -(eval-and-compile - (autoload 'japanese-hankaku "japan-util")) - -(defun shimbun-nikkei-prepare-article-report (header) - "Function used to prepare contents of an article for the report group." - (when (re-search-forward "\ -" - nil t) - (insert shimbun-nikkei-content-start) - (let ((start (point))) - (when (re-search-forward "\ -" - nil t) - (goto-char (match-beginning 0)) - (insert shimbun-nikkei-content-end) - (when (and (re-search-backward "\ -\\([22][00][0-90-9][0-90-9]\\)年\ -\\([0101]?[0-90-9]\\)月\ -\\([0-30-3]?[0-90-9]\\)日" - start t) - (or (memq (char-before (match-beginning 0)) - '(?\[ ?\〔 ?\[)) - (eq (char-after (match-end 0)) ?\〕))) - ;; Note: `japanese-hankaku' breaks `match-data'. - (let ((year (match-string 1)) - (month (match-string 2)) - (day (match-string 3))) - (shimbun-header-set-date - header - (shimbun-make-date-string - (string-to-number (japanese-hankaku year)) - (string-to-number (japanese-hankaku month)) - (string-to-number (japanese-hankaku day)))))))))) + (insert shimbun-nikkei-content-end) + t))) (provide 'sb-nikkei) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-nytimes.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-opentechpress-jp.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-orca.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-orca.el --- work/emacs-w3m-1.4.4/shimbun/sb-orca.el 2005-03-14 07:14:43.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-orca.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-palmfan.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-palmfan.el --- work/emacs-w3m-1.4.4/shimbun/sb-palmfan.el 2005-03-10 17:54:27.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-palmfan.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'shimbun) @@ -57,6 +57,12 @@ (defvar shimbun-palmfan-expiration-days 6) +(defvar shimbun-palmfan-x-face-alist + '(("default" . "X-Face: \"dU62umIQL4j!$\ +eGluPC0(*l4^GB8v\n diqCIs\\6@p\\TN#{@;s*NMI'@\\[8Z8M*:5g}\ +`c9yC}F6e\\}DqeZo!LB>(hEF|P+U.b|#\n >$@]5@PdGIwuU4=`imfei\ +i$PdWyuHC8!1=KH'r,R=fV])N6uQS"))) + (luna-define-method initialize-instance :after ((shimbun shimbun-palmfan) &rest init-args) (shimbun-palmfan-set-content-hash-internal diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-pcweb-column.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pcweb-column.el --- work/emacs-w3m-1.4.4/shimbun/sb-pcweb-column.el 2005-03-14 07:31:25.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pcweb-column.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,8 +1,10 @@ ;;; sb-pcweb-column.el --- shimbun backend for PC WEB COLUMN Square -;; Copyright (C) 2002, 2003, 2004 OHASHI Akira +;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +;; OHASHI Akira ;; Author: OHASHI Akira +;; Tsuyoshi CHO ;; Keywords: news ;; This file is a part of shimbun. @@ -18,28 +20,35 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-pcweb-column (shimbun shimbun-text) ()) +(luna-define-class shimbun-pcweb-column (shimbun) ()) + +(defvar shimbun-pcweb-column-url "http://journal.mycom.co.jp/column/") -(defvar shimbun-pcweb-column-url "http://pcweb.mycom.co.jp/column/") (defvar shimbun-pcweb-column-groups '(;; Under a series - "itshihonron" "osx" "yetanother" "svalley" "winxp" "sopinion" - "toolexp" "rikei" + "jsr" "yume" "hreceipe" "kita" "shonanlife" "kaden" "nemurenai" "komono" + "js" "en" "motherboard" "svalley" "architecture" "motorlife" "nihongoprog" + "objc" "ide" "music" "itsecurity" "soundvisual" "osx" "sopinion" "ebook" + "orerobo" "zsh" "rikei" "lifehack" "world" "guutara" "volt" "textclean" + "person" "web20" "system" ;; Series end - "game" "asia" "scramble" "hitech" "bytes" "benri")) + "itshihonron" "yetanother" "asia" "benri" "bytes" "game" "hitech" "java" + "jisakuparts" "scramble" "toolexp" "winvista" "winxp" "interview" "ityougo" + "kimeuchi" "stratesys" "toyagain")) + (defvar shimbun-pcweb-column-from-address "pcmail@pc.mycom.co.jp") -(defvar shimbun-pcweb-column-content-start "") +(defvar shimbun-pcweb-column-content-start + "") (defvar shimbun-pcweb-column-content-end "") (defvar shimbun-pcweb-column-coding-system 'shift_jis) @@ -53,14 +62,16 @@ (headers) (pattern (format - "\\([^<]+\\)" + "\\([^<]+\\)" (regexp-quote (shimbun-current-group shimbun))))) (goto-char (point-min)) (while (re-search-forward pattern nil t) (let ((url (match-string 1)) (num (match-string 2)) - (subject (match-string 3)) + (subject (match-string 4)) id) + ;; do not modify for compatibility. (setq id (format "<%s.%s.column@pcweb.mycom.co.jp>" num (shimbun-current-group-internal shimbun))) (push (shimbun-make-header @@ -87,16 +98,17 @@ (let (case-fold-search) (goto-char (point-min)) (when (re-search-forward "\ -\\([^<]+\\)" nil t) - (shimbun-header-set-from header (match-string 1))) +\\(]*>\\)?\\([^<]+\\)\\(

    \\)?" nil t) + (shimbun-header-set-from header (match-string 2))) (goto-char (point-min)) - (when (re-search-forward "\ -\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)" nil t) + (when (re-search-forward "\ +\\(]*>\\)?\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)\\(

    \\)?\ +" nil t) (shimbun-header-set-date header (shimbun-make-date-string - (string-to-number (match-string 1)) (string-to-number (match-string 2)) - (string-to-number (match-string 3))))))) + (string-to-number (match-string 3)) + (string-to-number (match-string 4))))))) (provide 'sb-pcweb-column) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-perlentaucher-de.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-pilot-link.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pilot-link.el --- work/emacs-w3m-1.4.4/shimbun/sb-pilot-link.el 2005-03-14 07:14:42.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pilot-link.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-pilot-mailsync.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pilot-mailsync.el --- work/emacs-w3m-1.4.4/shimbun/sb-pilot-mailsync.el 2005-03-14 07:14:42.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pilot-mailsync.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-plucker.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-plucker.el --- work/emacs-w3m-1.4.4/shimbun/sb-plucker.el 2005-03-14 07:14:42.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-plucker.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-pocketgames.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pocketgames.el --- work/emacs-w3m-1.4.4/shimbun/sb-pocketgames.el 2005-03-24 17:01:14.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-pocketgames.el 2008-01-18 08:38:36.000000000 +0900 @@ -1,11 +1,11 @@ ;;; sb-pocketgames.el --- shimbun backend class for www.pocketgames.jp. -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004, 2005 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2005, 2008 NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news -;; Version: $Id: sb-pocketgames.el,v 1.10.2.3 2005/03/24 08:01:14 yamaoka Exp $ -;; Last Modified: $Date: 2005/03/24 08:01:14 $ +;; Version: $Id: sb-pocketgames.el,v 1.18 2008-01-17 23:38:36 yamaoka Exp $ +;; Last Modified: $Date: 2008-01-17 23:38:36 $ ;; This file is a part of shimbun. @@ -20,15 +20,12 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (eval-and-compile @@ -86,7 +83,7 @@ (shimbun-remove-markup) (setq subject (buffer-string))) (setq url (shimbun-expand-url - (w3m-decode-anchor-string url) + (shimbun-decode-anchor-string url) (concat (shimbun-index-url shimbun) "/"))) (push (shimbun-make-header 0 (shimbun-mime-encode-string subject) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-rakuten.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rakuten.el --- work/emacs-w3m-1.4.4/shimbun/sb-rakuten.el 2005-03-14 07:25:38.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rakuten.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-rakuten.el --- shimbun backend for rakuten diary -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2006 NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -58,19 +58,6 @@ (format "http://api.plaza.rakuten.ne.jp/%s/rss/" (shimbun-current-group-internal shimbun))) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-rakuten) url date) - (unless (string-match - "http://\\([^\/]+\\)/[^\/]+/[^\/]+/\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\)" - url) - (error "Cannot find a message-id base")) - (format "%s%s%s%%%s@%s" - (match-string-no-properties 2 url) - (match-string-no-properties 3 url) - (match-string-no-properties 4 url) - (shimbun-current-group-internal shimbun) - (match-string-no-properties 1 url))) - (luna-define-method shimbun-rss-get-date ((shimbun shimbun-rakuten) url) (unless (string-match diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-redhat.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-redhat.el --- work/emacs-w3m-1.4.4/shimbun/sb-redhat.el 2003-11-18 10:57:35.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-redhat.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-rediff.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rediff.el --- work/emacs-w3m-1.4.4/shimbun/sb-rediff.el 2005-03-10 17:54:25.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rediff.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-rediff.el --- shimbun backend for rediff.com -;; Copyright (C) 2004, 2005 S V N Vishwanathan +;; Copyright (C) 2004, 2005, 2006, 2010 S V N Vishwanathan ;; Author: S V N Vishwanathan ;; Keywords: news @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -34,9 +34,10 @@ (defvar shimbun-rediff-url "http://www.rediff.com/rss/newsrss.xml") (defvar shimbun-rediff-groups '("news")) -(defvar shimbun-rediff-from-address "news@rediff.com") +(defvar shimbun-rediff-from-address "news@rediff.com") (defvar shimbun-rediff-content-start "
    ") -(defvar shimbun-rediff-content-end "

    ") +(defvar shimbun-rediff-content-end + "\\(

    \\)?\\(\\)?") (defconst shimbun-rediff-month-alist '(("January" . 1) ("February" . 2) ("March" . 3) ("April" . 4) @@ -45,50 +46,50 @@ ;; Print version has less ads -(luna-define-method shimbun-article-url ((shimbun shimbun-rediff) header) - (let ((url (shimbun-article-base-url shimbun header))) - (if (string-match "http://www.rediff.com/rss/redirect.php\\?url=\ -http://www.rediff.com/\\(.+\\.htm\\)" url) - (concat "http://in.rediff.com/cms/print.jsp?docpath=" - (match-string-no-properties 1 url)) - url))) - -;; Three kinds of tags to strip from the print version - -;; Type 1: -;;

    -;; blah blah -;;

    - -;; Type 2: -;; -;; blah blah! -;;
    - -;; Type 3: -;;

    +(luna-define-method shimbun-article :before + ((shimbun shimbun-rediff) header &optional outbuf) + (let ((url (shimbun-article-url shimbun header))) + (unless + (string-match + "http://www.rediff.com/rss/redirect.php\\?url=\ +http://www.rediff.com/\\(.+\\.htm\\)" + url) + (error "Malformed URL? %s" url)) + (shimbun-header-set-xref + header + (concat + "http://in.rediff.com/cms/print.jsp?docpath=" + (match-string-no-properties 1 url))))) + +;; Tags to strip from the print version (luna-define-method shimbun-clear-contents :before ((shimbun shimbun-rediff) header) (when (luna-call-next-method) - (shimbun-remove-tags "

    ]+>" "\\(

    \\| \\)") + (shimbun-remove-tags "\\(A\\) \\(?:class=\"\"\\|target=new\\)" t) + (shimbun-remove-tags "

    " "") + (shimbun-remove-tags "

    Also read:" "\\(

    \\)?") + (shimbun-remove-tags "]*>]*>" "") (shimbun-remove-tags "" - "
    " ) - (shimbun-remove-tags "]*>]*>" ""))) + ""))) ;; The default header has no date string ;; We need to parse it from the contents and set the header (luna-define-method shimbun-make-contents :before ((shimbun shimbun-rediff) header) +;;; +;; (shimbun-rediff-make-contents shimbun header)) +;; +;;(defun shimbun-rediff-make-contents (shimbun header) +;;; (setq case-fold-search nil) (when (re-search-forward "\\(January\\|February\\|March\\|April\\|May\\|June\ -\\|July\\|August\\|September\\|October\\|November\\|December\\) \ -\\([0-3][0-9]\\), \\(20[0-9][0-9]\\) | \\([0-1][0-9]:[0-6][0-9]\\) IST" nil t) +\\|July\\|August\\|September\\|October\\|November\\|December\\)[ ]+\ +\\([0-3][0-9]\\),[ ]+\\(20[0-9][0-9]\\) | \\([0-2][0-9]:[0-6][0-9]\\) IST" + nil t) (shimbun-header-set-date header (shimbun-make-date-string @@ -99,20 +100,6 @@ "+05:30")) (goto-char (point-min)))) -;; Build unique ID for the message - -(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-rediff) - url date) - (unless (string-match "http://www.rediff.com/rss/redirect.php\\?url=\ -http://www.rediff.com/\\([A-Za-z]+\\)/\\([0-9]+\\)/\\([^/]+\\)/\\(.+\\)\\.htm" - url) - (error (concat "Cannot find a message-id base for " url) )) - (format "<%s%s%s%s@rediff.com>" - (match-string-no-properties 1 url) - (match-string-no-properties 2 url) - (match-string-no-properties 3 url) - (match-string-no-properties 4 url))) - (provide 'sb-rediff) ;;; sb-rediff.el ends here Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-rss-blogs.el Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-rss-hash.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-rss.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rss.el --- work/emacs-w3m-1.4.4/shimbun/sb-rss.el 2005-02-22 10:59:05.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-rss.el 2013-05-09 08:55:13.000000000 +0900 @@ -1,7 +1,7 @@ ;;; sb-rss.el --- shimbun backend for RSS (Rich Site Summary). -;; Copyright (C) 2003, 2004, 2005 Koichiro Ohba -;; Copyright (C) 2003, 2004, 2005 NAKAJIMA Mikio +;; Copyright (C) 2003-2011, 2013 Koichiro Ohba +;; Copyright (C) 2003-2011, 2013 NAKAJIMA Mikio ;; Author: Koichiro Ohba ;; NAKAJIMA Mikio @@ -21,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -39,7 +39,19 @@ (require 'xml))) (eval '(require 'xml)) -(luna-define-class shimbun-rss (shimbun) ()) +(eval-and-compile + (luna-define-class shimbun-rss (shimbun) (ignored-subject))) + +(luna-define-method initialize-instance :after ((shimbun shimbun-rss) + &rest init-args) + (shimbun-rss-initialize-ignored-subject shimbun)) + +(defun shimbun-rss-initialize-ignored-subject (shimbun) + (luna-set-slot-value shimbun 'ignored-subject + (symbol-value + (intern-soft (format "shimbun-%s-ignored-subject" + (shimbun-server shimbun))))) + shimbun) (luna-define-generic shimbun-rss-process-date (shimbun-rss date) "Process DATE string and return proper Date string to show it in MUA.") @@ -129,17 +141,29 @@ (luna-define-method shimbun-rss-get-date ((shimbun shimbun-rss) url) nil) -(luna-define-generic shimbun-rss-build-message-id (shimbun-rss url date) - "Build unique message-id from URL and DATE and return it.") +(luna-define-generic shimbun-rss-build-message-id (shimbun-rss + url &optional date) + "Build unique message-id from URL and (optionally) DATE, and return it.") + +(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-rss) + url &optional date) + (when (string-match "[?#]" url) + (setq url (substring url 0 (match-beginning 0)))) + (concat "<" (md5 url) "%" (shimbun-current-group shimbun) + "@" (shimbun-server shimbun) ".shimbun.namazu.org>")) (luna-define-method shimbun-headers ((shimbun shimbun-rss) &optional range) (with-temp-buffer (let ((case-fold-search t)) (shimbun-retrieve-url (shimbun-index-url shimbun) 'no-cache 'no-decode) - (goto-char (point-min)) - (decode-coding-region (point-min) (point-max) (shimbun-rss-get-encoding)) - (set-buffer-multibyte t) + ;; In some rss feeds, LFs might be used mixed with CRLFs. + (shimbun-strip-cr) + (insert + (prog1 + (decode-coding-string (buffer-string) (shimbun-rss-get-encoding)) + (erase-buffer) + (set-buffer-multibyte t))) (shimbun-get-headers shimbun range)))) (luna-define-method shimbun-get-headers ((shimbun shimbun-rss) @@ -148,24 +172,70 @@ (defun shimbun-rss-get-headers (shimbun &optional range need-descriptions need-all-items) - (static-when (featurep 'xemacs) - ;; It's one of many bugs in XEmacs that the coding systems *-dos - ;; provided by Mule-UCS don't convert CRLF to LF when decoding. - (shimbun-strip-cr)) - (let ((xml (condition-case err - (xml-parse-region (point-min) (point-max)) - (error - (message "Error while parsing %s: %s" - (shimbun-index-url shimbun) - (error-message-string err)) - nil))) - dc-ns rss-ns author headers) - (when xml - (setq dc-ns (shimbun-rss-get-namespace-prefix - xml "http://purl.org/dc/elements/1.1/") - rss-ns (shimbun-rss-get-namespace-prefix - xml "http://purl.org/rss/1.0/") - author + "Get headers from rss feed described by SHIMBUN. +RANGE is currently ignored. If NEED-DESCRIPTIONS, include node +text as description. By default, only existing and new items +from the feed are returned, i.e., those items which are newer +than the oldest one in the shimbun. If NEED-ALL-ITEMS is +non-nil, all items from the feed are returned. If the entries +from the feed have date information, the result is sorted by +ascending date." + (let* ((xml (if (or debug-on-error debug-on-quit) + (shimbun-xml-parse-buffer) + (condition-case err + (shimbun-xml-parse-buffer) + (error + (message "Error while parsing %s: %s" + (shimbun-index-url shimbun) + (error-message-string err)) + nil)))) + header headers oldheaders newheaders oldest) + (dolist (tmp (shimbun-rss-get-headers-1 xml shimbun need-descriptions)) + (let* ((date (shimbun-header-date tmp)) + (ftime + (when (and (stringp date) + (> (length date) 1)) + (w3m-float-time (date-to-time date))))) + (push (list tmp ftime) headers))) + (when headers + (if (or need-all-items + ;; If there's a header without date information, we + ;; return everything, just to be safe. + (memq nil (mapcar 'cadr headers))) + (mapcar 'car headers) + ;; Otherwise, sort according to date. + (setq headers + (sort headers (lambda (a b) + (> (cadr a) (cadr b))))) + (while headers + (setq header (pop headers)) + (if (shimbun-search-id shimbun (shimbun-header-id (car header))) + (push header oldheaders) + (push header newheaders))) + (if (null oldheaders) + ;; All items are new + (mapcar 'car newheaders) + ;; Delete all items which are older than the ones we already + ;; have + (setq oldest (cadr (car oldheaders))) + (while (and newheaders + (> oldest (cadr (car newheaders)))) + (setq newheaders (cdr newheaders))) + (append + (mapcar 'car newheaders) + (mapcar 'car oldheaders))))))) + +(defun shimbun-rss-get-headers-1 (xml shimbun need-descriptions) + "Retrieve all items found in XML for SHIMBUN and return headers. +If NEED-DESCRIPTIONS, include node text as description." + (when xml + (let ((dc-ns (shimbun-rss-get-namespace-prefix + xml "http://purl.org/dc/elements/1.1/")) + (rss-ns (shimbun-rss-get-namespace-prefix + xml "http://purl.org/rss/1.0/")) + (ignored-subject (luna-slot-value shimbun 'ignored-subject)) + author hankaku headers) + (setq author (catch 'found-author (dolist (channel (shimbun-rss-find-el (intern (concat rss-ns "channel")) @@ -174,54 +244,84 @@ (or (shimbun-rss-node-text rss-ns 'author channel) (shimbun-rss-node-text dc-ns 'creator channel) - (shimbun-rss-node-text dc-ns 'contributor channel)))))) - (dolist (item (shimbun-rss-find-el (intern (concat rss-ns "item")) xml)) - (let ((url (and (listp item) - (eq (intern (concat rss-ns "item")) (car item)) - (shimbun-rss-node-text rss-ns 'link (cddr item))))) - (when url - (let* ((date (or (shimbun-rss-get-date shimbun url) - (shimbun-rss-node-text dc-ns 'date item) - (shimbun-rss-node-text rss-ns 'pubDate item))) - (id (shimbun-rss-build-message-id shimbun url date))) - (when (or need-all-items - (not (shimbun-search-id shimbun id))) - (push (shimbun-create-header - 0 - (shimbun-rss-node-text rss-ns 'title item) - (or (shimbun-rss-node-text rss-ns 'author item) - (shimbun-rss-node-text dc-ns 'creator item) - (shimbun-rss-node-text dc-ns 'contributor item) - author - (shimbun-from-address shimbun)) - (shimbun-rss-process-date shimbun date) - id "" 0 0 url - (when need-descriptions - (let ((description (shimbun-rss-node-text - rss-ns 'description item))) - (when description - (list (cons 'description description)))))) - headers)))))) - headers))) + (shimbun-rss-node-text dc-ns 'contributor channel))))) + hankaku (unless (memq (shimbun-japanese-hankaku shimbun) + '(body nil)) + (generate-new-buffer " *temp*"))) + (unwind-protect + (dolist (item (shimbun-rss-find-el (intern (concat rss-ns "item")) + xml) + headers) + (let ((url (and (listp item) + (eq (intern (concat rss-ns "item")) (car item)) + (shimbun-rss-node-text rss-ns 'link (cddr item))))) + (when url + (let* ((date (or (shimbun-rss-get-date shimbun url) + (shimbun-rss-node-text dc-ns 'date item) + (shimbun-rss-node-text rss-ns 'pubDate item))) + (id (shimbun-rss-build-message-id shimbun url date)) + (subject (shimbun-rss-node-text rss-ns 'title item))) + (when id + (unless (and ignored-subject subject + (string-match ignored-subject subject)) + (push + (shimbun-create-header + 0 + (if hankaku + (with-current-buffer hankaku + (insert (or subject "")) + (shimbun-japanese-hankaku-region (point-min) + (point-max)) + (prog1 (buffer-string) (erase-buffer))) + subject) + (or (shimbun-rss-node-text rss-ns 'author item) + (shimbun-rss-node-text dc-ns 'creator item) + (shimbun-rss-node-text dc-ns 'contributor item) + author + (shimbun-from-address shimbun)) + (shimbun-rss-process-date shimbun date) + id "" 0 0 url + (when need-descriptions + (let ((description (shimbun-rss-node-text + rss-ns 'description item))) + (when description + (list (cons 'description description)))))) + headers))))))) + (when (buffer-live-p hankaku) + (kill-buffer hankaku)))))) ;;; Internal functions ;;; XML functions +(defvar shimbun-rss-compatible-encoding-alist + '((iso-8859-1 . windows-1252) + (iso-8859-8 . windows-1255) + (iso-8859-9 . windows-1254)) + "Alist of encodings and those supersets. +The cdr of each element is used to decode data if it is available when +the car is what the data specify as the encoding. Or, the car is used +for decoding when the cdr that the data specify is not available.") + (defun shimbun-rss-get-encoding () - (let (end encoding) - (cond - ((search-forward "")) - (goto-char pos)) - (setq encoding - (if (re-search-forward "encoding=\"\\([^ ]+\\)\"" end t) - (downcase (match-string-no-properties 1)) - "utf-8"))) - (t ;; XML Default encoding. - (setq encoding "utf-8"))) - (intern-soft (concat encoding "-dos")))) + "Return an encoding attribute specified in the current xml contents. +If `shimbun-rss-compatible-encoding-alist' specifies the compatible +encoding, it is used instead. If the xml contents doesn't specify the +encoding, return `utf-8' which is the default encoding for xml if it +is available, otherwise return nil." + (goto-char (point-min)) + (if (re-search-forward + "<\\?[^>]*encoding=\\(\"\\([^\">]+\\)\"\\|'\\([^'>]+\\)'\\)" + nil t) + (let ((encoding (intern (downcase (or (match-string 2) + (match-string 3)))))) + (or + (shimbun-find-coding-system + (cdr (assq encoding shimbun-rss-compatible-encoding-alist))) + (shimbun-find-coding-system encoding) + (shimbun-find-coding-system + (car (rassq encoding shimbun-rss-compatible-encoding-alist))))) + (shimbun-find-coding-system 'utf-8))) (defun shimbun-rss-node-text (namespace local-name element) (let* ((node (assq (intern (concat namespace (symbol-name local-name))) @@ -230,7 +330,8 @@ (shimbun-rss-node-just-text node) node)) (cleaned-text (if text (shimbun-replace-in-string - text "^[ \000-\037\177]+\\|[ \000-\037\177]+$" "")))) + text "^[ \000-\037\177]+\\|[ \000-\037\177]+$" + "")))) (if (string-equal "" cleaned-text) nil cleaned-text))) @@ -241,26 +342,23 @@ node)) (defun shimbun-rss-find-el (tag data &optional found-list) - "Find the all matching elements in the data. Careful with this on -large documents!" - (if (listp data) - (mapcar (lambda (bit) - (if (car-safe bit) - (progn (if (equal tag (car bit)) - (setq found-list - (append found-list - (list bit)))) - (if (and (listp (car-safe (caddr bit))) - (not (stringp (caddr bit)))) - (setq found-list - (append found-list - (shimbun-rss-find-el - tag (caddr bit)))) - (setq found-list - (append found-list - (shimbun-rss-find-el - tag (cddr bit)))))))) - data)) + "Find the all matching elements in the data. +Careful with this on large documents!" + (when (consp data) + (dolist (bit data) + (when (car-safe bit) + (when (equal tag (car bit)) + ;; Old xml.el may return a list of string. + (when (and (consp (caddr bit)) + (stringp (caaddr bit))) + (setcar (cddr bit) (caaddr bit))) + (setq found-list (append found-list (list bit)))) + (if (and (consp (car-safe (caddr bit))) + (not (stringp (caddr bit)))) + (setq found-list (append found-list + (shimbun-rss-find-el tag (caddr bit)))) + (setq found-list (append found-list + (shimbun-rss-find-el tag (cddr bit)))))))) found-list) (defun shimbun-rss-get-namespace-prefix (el uri) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-ruby.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-ruby.el --- work/emacs-w3m-1.4.4/shimbun/sb-ruby.el 2005-03-14 07:14:42.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-ruby.el 2009-05-21 08:13:31.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-ruby.el --- shimbun backend class for ruby ML archiver. -;; Copyright (C) 2001, 2002, 2003, 2005 +;; Copyright (C) 2001, 2002, 2003, 2005, 2009 ;; NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -50,7 +50,7 @@ ;; ;;) -(defsubst shimbun-ruby-parse-time (str) +(defun shimbun-ruby-parse-time (str) (save-match-data (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\) \\([0-9]+:[0-9]+:[0-9]+\\)" diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-sankei.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sankei.el --- work/emacs-w3m-1.4.4/shimbun/sb-sankei.el 2004-08-03 15:37:47.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sankei.el 2011-10-03 17:16:59.000000000 +0900 @@ -1,6 +1,6 @@ -;;; sb-sankei.el --- shimbun backend for the Sankei Shimbun -*- coding: iso-2022-7bit; -*- +;;; sb-sankei.el --- shimbun backend for the MSN Sankei News -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004 Katsumi Yamaoka +;; Copyright (C) 2003-2011 Katsumi Yamaoka ;; Author: Katsumi Yamaoka ;; Keywords: news @@ -18,51 +18,76 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(require 'shimbun) +(require 'sb-rss) +(require 'sb-multi) -(luna-define-class shimbun-sankei (shimbun-japanese-newspaper shimbun) ()) +(luna-define-class shimbun-sankei (shimbun-japanese-newspaper + shimbun-multi shimbun-rss) ()) -(defvar shimbun-sankei-top-level-domain "sankei.co.jp" - "Name of the top level domain for the Sankei shimbun.") +(defvar shimbun-sankei-url "http://sankei.jp.msn.com/") -(defvar shimbun-sankei-url - (concat "http://www." shimbun-sankei-top-level-domain "/") - "Name of the parent url.") +(defvar shimbun-sankei-top-level-domain "sankei.jp.msn.com") (defvar shimbun-sankei-server-name "産経新聞") -(defvar shimbun-sankei-from-address - (concat "webmaster@" shimbun-sankei-top-level-domain)) - -(defvar shimbun-sankei-content-start - "[\t\n ]*") - -(defvar shimbun-sankei-content-end - "[\t\n ]*") - (defvar shimbun-sankei-group-table - '(("shakai" "社会" "news/shakai.htm") - ("sports" "スポーツ" "news/sports.htm") - ("keizai" "経済" "news/keizai.htm") - ("seiji" "政治" "news/seiji.htm") - ("kokusai" "国際" "news/kokusai.htm") - ("bungei" "文化・芸能" "news/bungei.htm") - ("book" "読書" "news/book.htm") - ("person" "ひと" "news/person.htm") - ("dead" "おくやみ" "news/dead.htm"))) + '(("points" "注目ニュース" + "http://sankei.jp.msn.com/rss/news/points.xml") + ("flash" "速報" + "http://sankei.jp.msn.com/rss/news/flash.xml") + ("affairs" "事件" + "http://sankei.jp.msn.com/rss/news/affairs.xml") + ("politics" "政治" + "http://sankei.jp.msn.com/rss/news/politics.xml") + ("economy" "経済・IT" + "http://sankei.jp.msn.com/rss/news/economy.xml") + ("world" "国際" + "http://sankei.jp.msn.com/rss/news/world.xml") + ("sports" "スポーツ" + "http://sankei.jp.msn.com/rss/news/sports.xml") + ("entertainments" "エンタメ" + "http://sankei.jp.msn.com/rss/news/entertainments.xml") + ("life" "生活" + "http://sankei.jp.msn.com/rss/news/life.xml") + ("science" "科学" + "http://sankei.jp.msn.com/rss/news/science.xml") + ("region" "地方" + "http://sankei.jp.msn.com/rss/news/region.xml") + ;; 産経ニュース west + ("west.flash" "最新ニュース" + "http://sankei.jp.msn.com/rss/news/west_flash.xml") + ("west.points" "注目ニュース" + "http://sankei.jp.msn.com/rss/news/west_points.xml") + ("west.affairs" "できごと" + "http://sankei.jp.msn.com/rss/news/west_affairs.xml") + ("west.sports" "スポーツ" + "http://sankei.jp.msn.com/rss/news/west_sports.xml") + ("west.life" "ライフ" + "http://sankei.jp.msn.com/rss/news/west_life.xml") + ("west.economy" "経済" + "http://sankei.jp.msn.com/rss/news/west_economy.xml") + ;; Non-RSS groups. + ("column.sankeisho" "産経抄" + "http://sankei.jp.msn.com/column/topics/column-14576-t1.htm") + ("column.shucho" "主張" + "http://sankei.jp.msn.com/column/topics/column-14593-t1.htm") + ("column.seiron" "正論" + "http://sankei.jp.msn.com/column/topics/column-14594-t1.htm"))) (defvar shimbun-sankei-x-face-alist - '(("default" . "X-Face: J@?(qGKd~^Tfa]pqTbgVxl61=+G\"Y?}\"]ly',1[6oe\n *b+4?PL^)c5+h&[O=$SZ}D\"I%>\ -DP\\h.OTct|k28-/c`^B-=cDXV;.>3w`/X_.'n$~,<$:3nNe#Jy8Q\n 5l[|\"#w"))) + '(("default" . "\ +Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAGFBMVEX///8An/8Vb38CnwB + Vv1X/vwD/fwD/PwA35I7FAAAAAXRSTlMAQObYZgAAAFpJREFUCNdjYEAF5TC6vICBUYCBgR3MEBQ + ACoAZguwwhlJaWnoBA4OgkFFZWhqQwShspJaWFgDUK2yslpYKYjAbK4WGghgsLk6hoWBzXVzAAiA + hVgiDwQHZfgCXhRLQU+g42QAAAABJRU5ErkJggg=="))) (defvar shimbun-sankei-expiration-days 7) @@ -74,80 +99,199 @@ shimbun-sankei-group-table))) (luna-define-method shimbun-index-url ((shimbun shimbun-sankei)) - (concat (shimbun-url-internal shimbun) - (nth 2 (assoc (shimbun-current-group-internal shimbun) - shimbun-sankei-group-table)))) - -(luna-define-method shimbun-get-headers ((shimbun shimbun-sankei) - &optional range) - (when (re-search-forward "[\t\n ]*" nil t) - (delete-region (point-min) (point))) - (when (re-search-forward "[\t\n ]*" - "") - ;; Remove an advertisement between photo and hombun. - (shimbun-remove-tags "" - "") - (goto-char (point-min))) + (shimbun-sankei-clear-contents shimbun header)) + +(defun shimbun-sankei-clear-contents (shimbun header) + (goto-char (point-min)) + (let ((group (shimbun-current-group-internal shimbun)) + (hankaku (shimbun-japanese-hankaku shimbun)) + (case-fold-search t) + start end) + (if (and (or (re-search-forward "" + nil t)) + (progn + (setq start (match-end 0)) + (re-search-forward "[\t\n ]*" + nil t)) + (progn + (setq start (if (re-search-backward "]+[\t\n ]+\\)*class=\"pager\"\\)\ +\\|\\(]+[\t\n ]+\\)*id=\"RelatedImg\"\\)\ +\\|\\(?:[\t\n ]*]*>[\t\n ]*[\t\n ]*PR[\t\n ]*\\)\ +\\|\\(?:[\t\n  ]*<\\(?:/div\\|/?p\\)>\\)*[\t\n  ]*]+>[^<]*前のページ" + end t)) + (delete-region end (point-max))) + (goto-char start) + (insert " \n")) ;; Page delimiter. + (delete-region (point-min) start) + + ;; Insert a new line after every image. + (goto-char (point-min)) + (while (re-search-forward "\\(]+>\\)[\t\n ]*" nil t) + (replace-match "\\1
    ")) + + ;; Remove useless tags. + (goto-char (point-min)) + (while (re-search-forward "\ +\\(?:[\t\n ]*]+\\)>[\t\n ]*

    \\)[\t\n ]*" + nil t) + (delete-region (match-beginning 0) (match-end 0)) + (when (string-equal (buffer-substring (max (point-min) + (- (point) 6)) + (point)) + " ") + (if (looking-at "]+\\)>[\t\n ]*") + (replace-match "\n") + (insert "\n")))) + (goto-char (point-min)) + (when (re-search-forward "\ +\\(?:[\t\n ]*]+\\)>\\)+[\t\n ]*\\'" + nil t) + (delete-region (match-beginning 0) (point-max)) + (insert "\n")) + (goto-char (point-min)) + (while (re-search-forward "\ +\[\t\n ]*\\(?:]+\\)?>[\t\n ]*\\)+\ +[\t\n ]*\\[PR\\][\t\n ]*[\t\n ]*\\(?:<[^>]+>[\t\n ]*\\)*" nil t) + (setq start (match-beginning 0) + end (match-end 0)) + (goto-char start) + (if (shimbun-end-of-tag "div" t) + (replace-match "\n") + (goto-char end) + (when (eobp) + (delete-region start end) + (insert "\n")))) + (goto-char (point-min)) + (while (search-forward "

    • \\'" + nil t) + (delete-region (match-beginning 0) (match-end 0))) + + (shimbun-remove-orphaned-tag-strips "div\\|span") + + ;; Convert Japanese zenkaku ASCII chars into hankaku. + (when (and hankaku (not (memq hankaku '(header subject)))) + (shimbun-japanese-hankaku-buffer t)) + + ;; Break long lines. + (unless (shimbun-prefer-text-plain-internal shimbun) + (shimbun-break-long-japanese-lines)) + t) + (erase-buffer) + (insert "\ +この記事 (またはこの次のページ) はもうありません。
      \n\ +\(さもなければ通常とは異なる形式を使っているか、
      \n\ + または取得に失敗したのかもしれません。)\n") + nil))) (provide 'sb-sankei) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-savannah.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-savannah.el --- work/emacs-w3m-1.4.4/shimbun/sb-savannah.el 2005-03-14 07:14:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-savannah.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-scipy.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-security-memo.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-security-memo.el --- work/emacs-w3m-1.4.4/shimbun/sb-security-memo.el 2005-03-14 07:25:38.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-security-memo.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-slashdot-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-slashdot-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-slashdot-jp.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-slashdot-jp.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-slashdot-jp.el --- shimbun backend for slashdot.jp -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2003, 2004, 2005 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 +;; NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news @@ -19,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -44,9 +45,6 @@ ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-rss) @@ -74,20 +72,22 @@ (const :tag "Newest first (Ignore threads)" 5))))) (defcustom shimbun-slashdot-jp-group-alist - '(("story" . "http://slashdot.jp/slashdot.rdf") - ("askslashdot" . "http://slashdot.jp/askslashdot.rdf") - ("bookreview" . "http://slashdot.jp/books.rdf") - ("bsd" . "http://slashdot.jp/bsd.rdf") - ("developers" . "http://slashdot.jp/developers.rdf") - ("interview" . "http://slashdot.jp/interview.rdf") - ("linuxkernel" . "http://slashdot.jp/linuxkernel.rdf") - ("mac" . "http://slashdot.jp/mac.rdf") - ("mobile" . "http://slashdot.jp/mobile.rdf") - ("science" . "http://slashdot.jp/science.rdf") - ("security" . "http://slashdot.jp/security.rdf") - ("slash" . "http://slashdot.jp/slash.rdf") + '(("story" . "http://slashdot.jp/index.rss") + ("askslashdot" . "http://slashdot.jp/askslashdot.rss") + ("bookreview" . "http://slashdot.jp/books.rss") + ("bsd" . "http://slashdot.jp/bsd.rss") + ("developers" . "http://slashdot.jp/developers.rss") + ("interview" . "http://slashdot.jp/interview.rss") + ("linux" . "http://slashdot.jp/linux.rss") + ("mac" . "http://slashdot.jp/mac.rss") + ("mobile" . "http://slashdot.jp/mobile.rss") + ("science" . "http://slashdot.jp/science.rss") + ("security" . "http://slashdot.jp/security.rss") + ("slash" . "http://slashdot.jp/slash.rss") + ("it" . "http://slashdot.jp/it.rss") + ("hardware" . "http://slashdot.jp/hardware.rss") ("diary.oliver" . - "http://slashdot.jp/journal.pl?op=display&uid=4&content_type=rss")) + "http://slashdot.jp/~Oliver/journal/rss")) "*Alist of slashdot groups and their RSS feeds." :group 'shimbun :type '(repeat @@ -98,11 +98,15 @@ (luna-define-class shimbun-slashdot-jp (shimbun-rss) ()) (defvar shimbun-slashdot-jp-from-address "slashmaster@slashdot.jp") -(defvar shimbun-slashdot-jp-coding-system 'euc-japan) +;;(defvar shimbun-slashdot-jp-coding-system 'euc-japan) (defvar shimbun-slashdot-jp-content-start - "\n\n") + "\n") (defvar shimbun-slashdot-jp-content-end - "\n\n") + "\n") (luna-define-method shimbun-groups ((shimbun shimbun-slashdot-jp)) (mapcar 'car shimbun-slashdot-jp-group-alist)) @@ -115,12 +119,18 @@ ((shimbun shimbun-slashdot-jp) url date) (cond ((string-match - "\\`http://slashdot\\.jp/article\\.pl\\?sid=\\([/0-9]+\\)&" - url) - (concat "<" (match-string-no-properties 1 url) "@slashdot.jp>")) - ((string-match - "\\`http://slashdot\\.jp/journal\\.pl\\?op=display&uid=\\([0-9]+\\)&id=\\([0-9]+\\)" + "\\`http://slashdot\\.jp/\\([a-zA-Z0-9]+\\)?/?article\\.pl\\?sid=\\([/0-9]+\\)\\(&\\|\\'\\)" url) + (if (match-string-no-properties 1 url) + (concat "<" (match-string-no-properties 1 url) + "%" (match-string-no-properties 2 url) "@slashdot.jp>") + (concat "<" (match-string-no-properties 2 url) "@slashdot.jp>"))) + ((or (string-match + "\\`http://slashdot\\.jp/journal\\.pl\\?op=display&uid=\\([0-9]+\\)&id=\\([0-9]+\\)" + url) + (string-match + "\\`http://slashdot\\.jp/~\\([^/]+\\)/journal/\\([0-9]+\\)\\(\\?from=rss\\)?" + url)) (concat "<" (match-string-no-properties 2 url) "%" (match-string-no-properties 1 url) "@slashdot.jp>")) (t (error "Cannot find message-id base")))) @@ -129,13 +139,29 @@ ((shimbun shimbun-slashdot-jp) &optional range) (let ((headers (luna-call-next-method))) (dolist (head headers) - (shimbun-header-set-xref head - (concat (shimbun-header-xref head) - "&mode=nocomment"))) + (let ((xref (shimbun-header-xref head))) + (if (not (string-match "journal" xref)) + ;; article + (shimbun-header-set-xref head + (concat xref "&mode=nocomment")) + (if (string-match + "\\`http://slashdot\\.jp/~\\([^/]+\\)/journal/\\([0-9]+\\)\\(\\?from=rss\\)?" + xref) + (shimbun-header-set-xref head + (concat + "http://slashdot.jp/~" + (match-string 1 xref) + "/journal/" + (match-string 2 xref) + "?theme=generic&mode=nocomment")) + (shimbun-header-set-xref head + (concat xref + "&theme=generic&mode=nocomment")))))) + headers)) (defun shimbun-slashdot-jp-comment-url (url) - (when (string-match "\\`http://slashdot\\.jp/article\\.pl\\?" url) + (when (string-match "\\`http://slashdot\\.jp/\\([a-zA-Z0-9]+\\)?/?article\\.pl" url) (mapconcat 'identity (cons (if (string-match "&mode=nocomment\\'" url) (substring url 0 (match-beginning 0)) @@ -145,10 +171,27 @@ shimbun-slashdot-jp-comment-arguments)) "&"))) +(luna-define-method shimbun-make-contents :before + ((shimbun shimbun-slashdot-jp) header) + (goto-char (point-min)) + (if (string-match + "\\`http://slashdot\\.jp/\\([a-zA-Z0-9]+\\)?/?article\\.pl" + (shimbun-header-xref header)) + ;; article + (when (re-search-forward "]*class=\"titlebar\"[^>]*>[ \t\n]*\ +]*>[ \t\n]*]*>[ \t\n]*]*>\\([^<]+\\)" nil t) + (shimbun-header-set-subject header (match-string-no-properties 1))) + ;; journal + (when (re-search-forward + "\\([^<]+\\)" nil t) + (shimbun-header-set-subject header (match-string-no-properties 1)))) + (goto-char (point-min))) + (luna-define-method shimbun-clear-contents :around ((shimbun shimbun-slashdot-jp) header) (when (luna-call-next-method) (shimbun-remove-tags "" "") + (shimbun-remove-tags "script\\|noscript" t) (let ((url (shimbun-slashdot-jp-comment-url (shimbun-header-xref header)))) (when url (goto-char (point-max)) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-slashdot.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-sml.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sml.el --- work/emacs-w3m-1.4.4/shimbun/sb-sml.el 2005-03-14 07:14:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sml.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-sourceforge-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sourceforge-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-sourceforge-jp.el 2005-03-22 06:50:44.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sourceforge-jp.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-sourceforge-jp.el --- shimbun backend for lists.sourceforge.jp -;; Copyright (C) 2003, 2004, 2005 TSUCHIYA Masatoshi +;; Copyright (C) 2003, 2004, 2005, 2007 +;; TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -41,8 +42,8 @@ ("iiimf-skk-users-en" . "iiimf-skk-users.en") ("iiimf-skk-cvs-commit" . "iiimf-skk-cvs-commit") ("macemacsjp-users") - ("macemacsjp-dev") - ("macemacsjp-english")) + ("macemacsjp-english") + ("ntemacsjp-users")) "*List of mailing lists serverd by SourceForge-JP." :group 'shimbun :type '(repeat diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-spiegel.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-spiegel.el --- work/emacs-w3m-1.4.4/shimbun/sb-spiegel.el 2004-05-10 07:45:11.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-spiegel.el 2008-02-24 20:00:13.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-spiegel.el --- spiegel online shimbun backend -;; Copyright (C) 2004 David Hansen +;; Copyright (C) 2004, 2006, 2008 David Hansen ;; Author: David Hansen ;; Keywords: news @@ -19,8 +19,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -35,9 +35,12 @@ "http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml") (defvar shimbun-spiegel-groups '("news")) (defvar shimbun-spiegel-from-address "spiegel_online@spiegel.de") -(defvar shimbun-spiegel-content-start "

      ") -(defvar shimbun-spiegel-content-end - "\\(


      \\|
      \\)") +(defvar shimbun-spiegel-content-start "
      ") +(defvar shimbun-spiegel-content-end "
      ") +(defvar shimbun-spiegel-x-face-alist + '(("default" . "X-Face: \"F#SZ#pUmtu//K|u59;;-"))) (luna-define-method shimbun-index-url ((shimbun shimbun-spiegel)) shimbun-spiegel-url) @@ -53,16 +56,6 @@ header) (luna-call-next-method))) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-spiegel) url date) - (unless (string-match "[0-9,]+\\.html" url) - (error "Cannot find message-id base")) - (concat "<" - (shimbun-replace-in-string (match-string 0 url) - "\\(,\\|druck-\\|\\.html\\)" - "") - "@spiegel.de>")) - (provide 'sb-spiegel) ;;; sb-spiegel.el ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-sponichi.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sponichi.el --- work/emacs-w3m-1.4.4/shimbun/sb-sponichi.el 2005-03-14 07:31:24.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-sponichi.el 2007-10-17 20:15:58.000000000 +0900 @@ -21,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-squeak-dev.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-squeak-dev.el --- work/emacs-w3m-1.4.4/shimbun/sb-squeak-dev.el 2005-03-14 07:14:41.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-squeak-dev.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,17 +18,14 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-mailman) (require 'sendmail) @@ -58,4 +55,5 @@ (buffer-string)) (provide 'sb-squeak-dev) + ;;; sb-squeak-dev.el ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-squeak-ja.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-squeak-ja.el --- work/emacs-w3m-1.4.4/shimbun/sb-squeak-ja.el 2005-03-14 07:14:40.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-squeak-ja.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,17 +18,14 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: -(eval-when-compile - (require 'cl)) - (require 'shimbun) (require 'sb-mailman) @@ -40,4 +37,5 @@ (defvar shimbun-squeak-ja-groups '("main")) (provide 'sb-squeak-ja) + ;;; sb-squeak-ja.el ends here Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-sueddeutsche-de.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-tcup.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tcup.el --- work/emacs-w3m-1.4.4/shimbun/sb-tcup.el 2005-03-17 10:26:03.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tcup.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-tdiary-ml.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tdiary-ml.el --- work/emacs-w3m-1.4.4/shimbun/sb-tdiary-ml.el 2003-07-11 09:09:13.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tdiary-ml.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-tdiary-ml.el --- shimbun backend for www.tDiary.org -;; Copyright (C) 2003 Koichiro Ohba +;; Copyright (C) 2003, 2007 Koichiro Ohba ;; Author: Koichiro Ohba ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -45,11 +45,11 @@ "\\([^<]+\\),\n \\([^<]+\\)") (defmacro shimbun-tdiary-ml-concat-url (shimbun url) - (` (concat (shimbun-url-internal (, shimbun)) - (nth 1 (assoc (shimbun-current-group-internal (, shimbun)) - shimbun-tdiary-ml-group-path-alist)) - "/" - (, url)))) + `(concat (shimbun-url-internal ,shimbun) + (nth 1 (assoc (shimbun-current-group-internal ,shimbun) + shimbun-tdiary-ml-group-path-alist)) + "/" + ,url)) (luna-define-method shimbun-index-url ((shimbun shimbun-tdiary-ml)) (shimbun-tdiary-ml-concat-url shimbun "index.html")) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-tdiary.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tdiary.el --- work/emacs-w3m-1.4.4/shimbun/sb-tdiary.el 2005-03-14 07:31:26.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tdiary.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-tdiary.el --- shimbun backend for tDiary -;; Copyright (C) 2003, 2004 OHASHI Akira +;; Copyright (C) 2003, 2004, 2005, 2007 OHASHI Akira ;; Author: OHASHI Akira ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -30,9 +30,8 @@ (require 'cl)) (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-tdiary (shimbun shimbun-text) ()) +(luna-define-class shimbun-tdiary (shimbun) ()) (defvar shimbun-tdiary-content-start "") @@ -55,48 +54,48 @@ shimbun-tdiary-group-alist))) (defmacro shimbun-tdiary-get-headers (shimbun url headers &optional aux) - (` (let ((case-fold-search t)) - (goto-char (point-max)) - (while (re-search-backward "]*> *\\(.+\\)?[^<]*\\(.+]\\|\\) *\\(.+\\)" nil t) - (let ((url (match-string 1)) - (year (match-string 2)) - (month (match-string 3)) - (day (match-string 4)) - (topic (match-string 5)) - (subject (match-string 8)) - date id) - (setq date (shimbun-make-date-string (string-to-number year) - (string-to-number month) - (string-to-number day))) - (setq id (format "<%s.%s%s%s.%s@tdiary.org>" - topic year month day - (eword-encode-string - (shimbun-current-group-internal (, shimbun))))) - (push (shimbun-create-header - 0 subject (or (, aux) (shimbun-from-address (, shimbun))) - date id "" 0 0 (concat (shimbun-index-url (, shimbun)) url)) - (, headers)))) - (, headers)))) + `(let ((case-fold-search t)) + (goto-char (point-max)) + (while (re-search-backward "]*> *\\(.+\\)?[^<]*\\(.+]\\|\\) *\\(.+\\)" nil t) + (let ((url (match-string 1)) + (year (match-string 2)) + (month (match-string 3)) + (day (match-string 4)) + (topic (match-string 5)) + (subject (match-string 8)) + date id) + (setq date (shimbun-make-date-string (string-to-number year) + (string-to-number month) + (string-to-number day))) + (setq id (format "<%s.%s%s%s.%s@tdiary.org>" + topic year month day + (eword-encode-string + (shimbun-current-group-internal ,shimbun)))) + (push (shimbun-create-header + 0 subject (or ,aux (shimbun-from-address ,shimbun)) + date id "" 0 0 (concat (shimbun-index-url ,shimbun) url)) + ,headers))) + ,headers)) (defmacro shimbun-tdiary-make-date (count first) - (` (let* ((today (current-time)) - (month (nth 4 (decode-time today))) - (year (nth 5 (decode-time today))) - (dow (nth 6 (decode-time today))) - (dst (nth 7 (decode-time today))) - (zone (nth 8 (decode-time today)))) - (dotimes (i (1- (, count))) - (decf month) - (when (<= month 0) - (setq month 12) - (decf year))) - (let ((date - (format-time-string - "%Y%m" - (encode-time 0 0 0 1 month year dow dst zone)))) - (if (string< date (, first)) - nil - date))))) + `(let* ((today (current-time)) + (month (nth 4 (decode-time today))) + (year (nth 5 (decode-time today))) + (dow (nth 6 (decode-time today))) + (dst (nth 7 (decode-time today))) + (zone (nth 8 (decode-time today)))) + (dotimes (i (1- ,count)) + (decf month) + (when (<= month 0) + (setq month 12) + (decf year))) + (let ((date + (format-time-string + "%Y%m" + (encode-time 0 0 0 1 month year dow dst zone)))) + (if (string< date ,first) + nil + date)))) (luna-define-method shimbun-get-headers ((shimbun shimbun-tdiary) &optional range) @@ -139,17 +138,16 @@ header) (let ((case-fold-search t) (id (shimbun-header-id header)) - start footnotes) + (start (shimbun-content-start shimbun)) + footnotes) (when (string-match "\\(p[0-9]+\\)\." id) (setq id (substring id (match-beginning 1) (match-end 1))) (re-search-forward (concat "
      \n") - (mapcar 'insert (nreverse footnotes))) + (mapc 'insert (nreverse footnotes))) (shimbun-header-insert-and-buffer-string shimbun header nil t))) (provide 'sb-tdiary) Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-tech-on.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-texfaq.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-texfaq.el --- work/emacs-w3m-1.4.4/shimbun/sb-texfaq.el 2005-03-14 07:25:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-texfaq.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-text.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-text.el --- work/emacs-w3m-1.4.4/shimbun/sb-text.el 2005-03-14 07:25:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-text.el 2009-05-21 08:13:31.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-text.el -- shimbun backend class for text content -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004 Yuuichi Teranishi +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 +;; Yuuichi Teranishi ;; Author: Yuuichi Teranishi ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -49,31 +50,35 @@ (let ((top (point)) chr) (while (if (>= (move-to-column shimbun-fill-column) shimbun-fill-column) - (not (progn - (if (memq (preceding-char) shimbun-kinsoku-eol-list) - (progn - (backward-char) - (while (memq (preceding-char) shimbun-kinsoku-eol-list) - (backward-char)) - (insert "\n")) - (while (memq (setq chr (following-char)) shimbun-kinsoku-bol-list) - (forward-char)) - (if (looking-at "\\s-+") - (or (eolp) (delete-region (point) (match-end 0))) - (or (> (char-width chr) 1) - (re-search-backward "\\<" top t) - (end-of-line))) - (or (eolp) (insert "\n")))))) + (if (memq (char-before) shimbun-kinsoku-eol-list) + (prog1 + t + (backward-char) + (while (memq (char-before) shimbun-kinsoku-eol-list) + (backward-char)) + (insert "\n")) + (while (memq (setq chr (char-after)) shimbun-kinsoku-bol-list) + (forward-char)) + (if (looking-at "\\s-+") + (or (eolp) (delete-region (point) (match-end 0))) + (or (not chr) + (> (char-width chr) 1) + (re-search-backward "\\<" top t) + (end-of-line))) + (if (eolp) + nil + (insert "\n") + t))) (setq top (point)))) (forward-line 1) (not (eobp))) -(defsubst shimbun-shallow-rendering () +(defun shimbun-shallow-rendering () (goto-char (point-min)) (while (search-forward "

      " nil t) (insert "\n\n")) (goto-char (point-min)) - (while (search-forward "
      " nil t) + (while (re-search-forward "" nil t) (insert "\n")) (shimbun-remove-markup) (shimbun-decode-entities) @@ -82,17 +87,14 @@ (goto-char (point-min)) (when (skip-chars-forward "\n") (delete-region (point-min) (point))) - (while (search-forward "\n\n" nil t) - (let ((p (point))) - (when (skip-chars-forward "\n") - (delete-region p (point))))) + (while (re-search-forward "\n\n\n+" nil t) + (replace-match "\n\n")) (goto-char (point-max)) (when (skip-chars-backward "\n") (delete-region (point) (point-max))) (insert "\n")) -(luna-define-method shimbun-make-contents ((shimbun shimbun-text) - header) +(defun shimbun-make-text-contents (shimbun header) (shimbun-header-insert-and-buffer-string shimbun header nil ;; When cleaning has been succeeded, this article is treated as a @@ -102,6 +104,10 @@ (shimbun-shallow-rendering) t))) +(luna-define-method shimbun-make-contents ((shimbun shimbun-text) + header) + (shimbun-make-text-contents shimbun header)) + (provide 'sb-text) ;;; sb-text.el ends here Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-the-onion.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-the-register.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-the-register.el --- work/emacs-w3m-1.4.4/shimbun/sb-the-register.el 2005-01-25 21:17:34.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-the-register.el 2008-07-01 10:04:35.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-the-register.el --- The Register shimbun backend -;; Copyright (C) 2004, 2005 David Hansen +;; Copyright (C) 2004, 2005, 2006, 2007, 2008 David Hansen ;; Author: David Hansen ;; Keywords: news @@ -19,8 +19,8 @@ ;; 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. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -34,7 +34,12 @@ (defvar shimbun-the-register-url "http://www.theregister.co.uk/") (defvar shimbun-the-register-from-address "invalid@theregister.co.uk") (defvar shimbun-the-register-content-start "

      ") -(defvar shimbun-the-register-content-end "

      ") +(defvar shimbun-the-register-content-end + "

      \\|

      ") +(defvar shimbun-the-register-x-face-alist + '(("default" . "X-Face: 'r-3ZQiX|_[TrM[|LF34{X#MX`MHFuL$_2w4Cs\"ET_jx9/JsL)k\ +xvY~i(,cv8ho2=\\L!Tz# @=+.N^%}G<@JRS"))) (defvar shimbun-the-register-path-alist '(("news" . "headlines.rss") @@ -60,16 +65,8 @@ ((shimbun shimbun-the-register) &optional range) (mapcar (lambda (header) - ;; we will get redirected from http://go.theregister.com/feed/... to - ;; http://www.theregister.co.uk/... - ;; if we don't set the URL right shimbun can't follow the " . ")") - ("

      " . "
      ")))) - (while junk - (goto-char (point-min)) - (let ((beg-str (caar junk)) (end-str (cdar junk)) beg end) - (setq junk (cdr junk)) - (while (search-forward beg-str nil t) - (setq beg (match-beginning 0)) - (when (setq end (search-forward end-str nil t)) - (delete-region beg end)))))))) - -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-the-register) url date) - (unless (string-match "http://[^/]+/\\(.+\\)\\(/*print\\.html\\)?" url) - (error "Cannot find message-id base")) - (concat "<" (match-string 1 url) "@the-register.co.uk>")) + (dolist (junk '(("(?" . ")?") + ("
      ") + (""))) + (goto-char (point-min)) + (message "%s" (car junk)) + (while (re-search-forward (car junk) nil t) + (let ((beg (match-beginning 0))) + (when (re-search-forward (cdr junk) nil t) + (delete-region beg (point)))))))) (provide 'sb-the-register) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-tigris.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tigris.el --- work/emacs-w3m-1.4.4/shimbun/sb-tigris.el 2005-02-15 20:04:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-tigris.el 2009-05-21 08:13:31.000000000 +0900 @@ -1,8 +1,8 @@ ;;; sb-tigris.el --- shimbun backend for tigris.org ML -;; Copyright (C) 2005 Tsuyoshi CHO +;; Copyright (C) 2005, 2007, 2009 Tsuyoshi CHO -;; Author: Tsuyoshi CHO +;; Author: Tsuyoshi CHO ;; Keywords: news ;; This file is a part of shimbun. @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: @@ -96,7 +96,7 @@ (shimbun-tigris-get-ml-name shimbun) ))) -(defsubst shimbun-tigris-remove-amp (url) +(defun shimbun-tigris-remove-amp (url) "Remove URL & -> &" (save-match-data (while (string-match "&" url) @@ -141,7 +141,7 @@ (count 0) id) (when (string-match ".*msgNo=\\([0-9]+\\).*" url) - (setq count (string-to-int (match-string 1 url)))) + (setq count (string-to-number (match-string 1 url)))) (setq id (format "<%d%%%s.%s.%s>" count (shimbun-tigris-get-ml-name shimbun) @@ -151,9 +151,9 @@ (if (and (stringp date) (string-match "\\([0-9]*\\)-\\([0-9]*\\)-\\([0-9]*\\)" date)) (setq date (shimbun-make-date-string - (string-to-int (match-string 1 date)) - (string-to-int (match-string 2 date)) - (string-to-int (match-string 3 date)))) + (string-to-number (match-string 1 date)) + (string-to-number (match-string 2 date)) + (string-to-number (match-string 3 date)))) (setq date nil)) ;; change to raw page (setq url (shimbun-expand-url @@ -174,12 +174,12 @@ (beg nil) (end nil)) (when (search-forward "
      ")
      -      (next-line 1)
      +      (forward-line 1)
             (beginning-of-line)
             (setq beg (point))
             (delete-region (point-min) beg))
           (when (search-forward "
      ") - (previous-line 1) + (forward-line -1) (end-of-line) (setq end (point)) (delete-region end (point-max))) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-toshiba.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-toshiba.el --- work/emacs-w3m-1.4.4/shimbun/sb-toshiba.el 2005-03-14 07:14:40.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-toshiba.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-vinelinux.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-vinelinux.el --- work/emacs-w3m-1.4.4/shimbun/sb-vinelinux.el 2004-09-01 13:12:27.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-vinelinux.el 2009-05-21 08:13:31.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-vinelinux.el --- shimbun backend class for vinelinux web site. -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004 NAKAJIMA Mikio +;; Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009 +;; NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news @@ -18,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -32,7 +33,9 @@ (defconst shimbun-vinelinux-url "http://www.vinelinux.org") (defconst shimbun-vinelinux-group-path-alist - '(("errata.3x.i386" . "errata/3x/i386.html") + '(("errata.4x.i386" . "errata/4x/i386.html") + ("errata.4x.ppc" . "errata/4x/ppc.html") + ("errata.3x.i386" . "errata/3x/i386.html") ("errata.3x.ppc" . "errata/3x/ppc.html") ("errata.3x.alpha" . "errata/3x/alpha.html") ("errata.25x.i386" . "errata/25x/i386.html") @@ -49,7 +52,7 @@ (mapcar 'car shimbun-vinelinux-group-path-alist)) (defconst shimbun-vinelinux-from-address "webmaster@www.vinelinux.org") -(defsubst shimbun-vinelinux-parse-time (str) +(defun shimbun-vinelinux-parse-time (str) (shimbun-make-date-string (string-to-number (substring str 0 4)) (string-to-number (substring str 4 6)) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-w3m-dev.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-w3m-dev.el --- work/emacs-w3m-1.4.4/shimbun/sb-w3m-dev.el 2005-01-14 18:07:15.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-w3m-dev.el 2007-10-17 20:15:58.000000000 +0900 @@ -4,7 +4,7 @@ ;; Copyright (C) 2005 Tsuyoshi CHO ;; Authors: NAKAJIMA Mikio , -;; Tsuyoshi CHO +;; Tsuyoshi CHO ;; Keywords: news ;; This file is a part of shimbun. @@ -20,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: Only in work/emacs-w3m-1.4.4/shimbun: sb-weeklyworldnews.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-welt-de.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-welt-de.el --- work/emacs-w3m-1.4.4/shimbun/sb-welt-de.el 2004-06-18 19:26:46.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-welt-de.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-welt-de.el --- shimbun backend for -;; Copyright (C) 2004 Andreas Seltenreich +;; Copyright (C) 2004, 2005, 2006, 2010 +;; Andreas Seltenreich ;; Author: Andreas Seltenreich ;; Keywords: news, shimbun @@ -17,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -43,12 +44,6 @@ (luna-define-method shimbun-groups ((shimbun shimbun-welt-de)) shimbun-welt-de-groups) -(luna-define-method shimbun-rss-build-message-id - ((shimbun shimbun-welt-de) url date) - (unless (string-match "\\?nid=\\([0-9]+\\)" url) - (error "Cannot find message-id")) - (format "<%s@www.welt.de>" (match-string 1 url))) - ;; Kill Javascript (luna-define-method shimbun-clear-contents :before ((shimbun shimbun-welt-de) headers) @@ -60,11 +55,11 @@ "") + (shimbun-remove-tags "table" t) (when javascript-image (goto-char (point-min)) - (re-search-forward shimbun-welt-de-content-start) + (re-search-forward (shimbun-content-start shimbun)) (insert (concat ""))))) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-wiki.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wiki.el --- work/emacs-w3m-1.4.4/shimbun/sb-wiki.el 2005-03-14 07:31:25.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wiki.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-wiki.el --- shimbun backend for wiki -;; Copyright (C) 2003, 2004 NAKAJIMA Mikio +;; Copyright (C) 2003, 2004, 2006 NAKAJIMA Mikio ;; Author: NAKAJIMA Mikio ;; Keywords: news @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; This program currently supports PukiWiki and Hiki. @@ -112,9 +112,9 @@ (cadr (assoc (shimbun-current-group-internal shimbun) shimbun-wiki-group-alist))) -(luna-define-method shimbun-make-contents ((shimbun shimbun-wiki) header) +(luna-define-method shimbun-clear-contents ((shimbun shimbun-wiki) header) (let* ((case-fold-search t) - (alist (assoc (shimbun-current-group-internal shimbun) + (alist (assoc (shimbun-current-group shimbun) shimbun-wiki-group-alist)) (cstart (nth 4 alist)) (cend (nth 5 alist)) @@ -125,14 +125,7 @@ (re-search-forward cend nil t)) (delete-region (match-beginning 0) (point-max)) (delete-region (point-min) start) - (goto-char (point-min)) - (insert "\n\n\n\n\n") - (goto-char (point-max)) - (insert (shimbun-footer shimbun header t) - "\n\n\n")) - (shimbun-make-mime-article shimbun header) - (buffer-string))) + t))) (provide 'sb-wiki) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-wikimedia.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wikimedia.el --- work/emacs-w3m-1.4.4/shimbun/sb-wikimedia.el 2005-03-09 18:00:45.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wikimedia.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,8 +1,8 @@ ;;; sb-wikimedia.el --- shimbun backend for Wikimedia Mailing list -*- coding: utf-8; -*- -;; Copyright (C) 2004, 2005 Tsuyoshi CHO +;; Copyright (C) 2004, 2005, 2007 Tsuyoshi CHO -;; Author: Tsuyoshi CHO +;; Author: Tsuyoshi CHO ;; Keywords: news ;; This file is a part of shimbun. @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; See also ;;; URL @@ -81,11 +81,11 @@ (defvar shimbun-wikimedia-groups (mapcar 'car shimbun-wikimedia-group-path-alist)) (defmacro shimbun-wikimedia-concat-url (shimbun url) - (` (concat (shimbun-url-internal (, shimbun)) - (nth 1 (assoc (shimbun-current-group-internal (, shimbun)) - shimbun-wikimedia-group-path-alist)) - "/" - (, url)))) + `(concat (shimbun-url-internal ,shimbun) + (nth 1 (assoc (shimbun-current-group-internal ,shimbun) + shimbun-wikimedia-group-path-alist)) + "/" + ,url)) (luna-define-method shimbun-index-url ((shimbun shimbun-wikimedia)) (shimbun-expand-url diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-wincefan.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wincefan.el --- work/emacs-w3m-1.4.4/shimbun/sb-wincefan.el 2005-03-14 07:14:40.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wincefan.el 2007-10-17 20:15:58.000000000 +0900 @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-wired-jp.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wired-jp.el --- work/emacs-w3m-1.4.4/shimbun/sb-wired-jp.el 2005-02-24 06:51:10.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-wired-jp.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-wired-jp.el --- shimbun backend for Hotwired Japan -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2005 TSUCHIYA Masatoshi +;; Copyright (C) 2005, 2006 TSUCHIYA Masatoshi ;; Author: TSUCHIYA Masatoshi ;; Keywords: news @@ -18,17 +18,14 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'shimbun) (require 'sb-rss) -(require 'md5) -(eval-when-compile - (require 'cl)) (luna-define-class shimbun-wired-jp (shimbun-rss shimbun) ()) @@ -71,14 +68,6 @@ shimbun-wired-jp-group-table))) (or (nth 1 elem) (nth 2 elem)))) -(defsubst shimbun-wired-jp-build-message-id (shimbun url) - (concat "<" (md5 url) "%" (shimbun-current-group shimbun) - "@hotwired.goo.ne.jp>")) - -(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-wired-jp) - url date) - (shimbun-wired-jp-build-message-id shimbun url)) - (luna-define-method shimbun-headers :around ((shimbun shimbun-wired-jp) &optional range) (if (nth 1 (assoc (shimbun-current-group shimbun) @@ -101,15 +90,15 @@ (buffer-substring (point) (if (search-forward "
      " nil t) (match-beginning 0) - (line-end-position))) + (point-at-eol))) (format "%s (%s)" (shimbun-server-name shimbun) (shimbun-current-group shimbun)) "" - (shimbun-wired-jp-build-message-id shimbun url) + (shimbun-rss-build-message-id shimbun url) "" 0 0 url) headers))) - (nreverse headers))) + headers)) (luna-define-method shimbun-article-url ((shimbun shimbun-wired-jp) header) (let ((url (shimbun-article-base-url shimbun header))) Only in work/emacs-w3m-1.4.4/shimbun: sb-wired.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-x51.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-x51.el --- work/emacs-w3m-1.4.4/shimbun/sb-x51.el 2005-02-11 02:00:24.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-x51.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,8 +1,8 @@ ;;; sb-x51.el --- shimbun backend for x51.org -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2004, 2005 Tsuyoshi CHO +;; Copyright (C) 2004, 2005, 2006, 2010 Tsuyoshi CHO -;; Author: Tsuyoshi CHO +;; Author: Tsuyoshi CHO ;; Keywords: news blog ;; Created: Feb 21, 2004 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -33,41 +33,40 @@ (luna-define-class shimbun-x51 (shimbun-rss) ()) -(defvar shimbun-x51-url "http://x51.org/") (defvar shimbun-x51-group-alist - '(("top" . "index.rdf") ;; Top-RDF - ("art" . "x/art.php") - ("auction" . "x/auction.php") - ("blow" . "x/blow.php") - ("cabal" . "x/cabal.php") - ("crime" . "x/crime.php") - ("disaster" . "x/disaster.php") - ("edge" . "x/edge.php") - ("homme" . "x/homme.php") - ("info" . "x/info.php") - ("life" . "x/life.php") - ("love" . "x/love.php") - ("media" . "x/media.php") - ("medical" . "x/medical.php") - ("military" . "x/military.php") - ("news" . "x/news.php") - ("northkorea" . "x/northkorea.php") - ("oparts" . "x/oparts.php") - ("phallic" . "x/phallic.php") - ("psychic" . "x/psychic.php") - ("religion" . "x/religion.php") - ("science" . "x/science.php") - ("story" . "x/story.php") - ("ufo" . "x/ufo.php") - ("uma" . "x/uma.php") - ("xfiles" . "x/xfiles.php"))) + '(("top" . "http://x51.org/index.rdf") ;; Top-RDF + ("anima" . "http://anima.x51.org/index.rdf") + ("enema" . "http://enema.x51.org/index.rdf") + ("art" . "http://x51.org/x/art/") + ("blow" . "http://x51.org/x/blow/") + ("crime" . "http://x51.org/x/crime/") + ("disaster" . "http://x51.org/x/disaster/") + ("edge" . "http://x51.org/x/edge/") + ("ghost" . "http://x51.org/x/ghost/") + ("info" . "http://x51.org/x/info/") + ("life" . "http://x51.org/x/life/") + ("love" . "http://x51.org/x/love/") + ("media" . "http://x51.org/x/media/") + ("medical" . "http://x51.org/x/medical/") + ("oparts" . "http://x51.org/x/oparts/") + ("phallic" . "http://x51.org/x/phallic/") + ("psychic" . "http://x51.org/x/psychic/") + ("religion" . "http://x51.org/x/religion/") + ("science" . "http://x51.org/x/science/") + ("ufo" . "http://x51.org/x/ufo/") + ("uma" . "http://x51.org/x/uma/") + ("xfiles" . "http://x51.org/x/xfiles/"))) + +(defvar shimbun-x51-obsolete-groups + '("auction" "cabal" "homme" "military" "news" "northkorea" "story") + "Obsolete group names.") (defvar shimbun-x51-server-name "x51.org") (defvar shimbun-x51-from-address "webmaster@x51.org") (defvar shimbun-x51-auther "X51") (defvar shimbun-x51-coding-system 'utf-8) -(defvar shimbun-x51-content-start "") -(defvar shimbun-x51-content-end "") +(defvar shimbun-x51-content-start "\\|
      ") +(defvar shimbun-x51-content-end "\\|
      ") ;; X-Face create from banner (defvar shimbun-x51-x-face-alist @@ -75,42 +74,36 @@ !dzRSN]tO68A5{`1RzK`g+0Yo$0q2RFM\n 7m?9-o[R6ou-[9X$JI1HYc>A-a[+DGgI"))) (luna-define-method shimbun-groups ((shimbun shimbun-x51)) - (mapcar 'car shimbun-x51-group-alist)) + (append + shimbun-x51-obsolete-groups + (mapcar 'car shimbun-x51-group-alist))) (defmacro shimbun-x51-concat-url (shimbun url) - `(concat (shimbun-url-internal ,shimbun) - (cdr (assoc (shimbun-current-group-internal ,shimbun) + `(concat (cdr (assoc (shimbun-current-group-internal ,shimbun) shimbun-x51-group-alist)) ,url)) (luna-define-method shimbun-index-url ((shimbun shimbun-x51)) (shimbun-x51-concat-url shimbun "")) -(luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-x51) - url date) - (unless (string-match - "http://[^\/]+/x/\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\).php" - url) - (error "Cannot find message-id base")) - (format "<%s%s%s@x51.org>" - (match-string-no-properties 1 url) - (match-string-no-properties 2 url) - (match-string-no-properties 3 url))) - (luna-define-method shimbun-get-headers :around ((shimbun shimbun-x51) &optional range) (let* ((case-fold-search t) (url (shimbun-index-url shimbun)) headers) - (if (string-match "top" (car (assoc (shimbun-current-group-internal - shimbun) - shimbun-x51-group-alist))) - (luna-call-next-method) ;; call parent method + (cond + ((member (shimbun-current-group-internal shimbun) + shimbun-x51-obsolete-groups) + (setq headers '())) + ((member (shimbun-current-group-internal shimbun) + '("top" "anima" "enema")) + (setq headers (luna-call-next-method))) ;; call parent method + (t (let* ((pages (shimbun-header-index-pages range)) (beg (point-min)) (end (point-max)) indexes) - (push (concat url "?page=1") indexes) ;; push page 1 + (push (concat url "index.php?page=1") indexes) ;; push page 1 (when (if pages (< 1 pages) t) (goto-char (point-min)) (when (search-forward "
      " nil t) @@ -147,23 +140,16 @@ (goto-char (point-min)) (let (title url date id) (while (re-search-forward - "\\([^<]*\\)" nil t) - (setq url (shimbun-expand-url - (concat - "http://x51.org/x/" - (match-string 1) "/" - (match-string 2) "/" - (match-string 3) (match-string 4) - ".php") - (shimbun-index-url shimbun))) - (setq title (match-string 5)) - (setq date (shimbun-make-date-string - (string-to-int (match-string 1)) - (string-to-int (match-string 2)) - (string-to-int (match-string 3)))) + (setq url (match-string-no-properties 1) + title (match-string-no-properties 6) + date (shimbun-make-date-string + (string-to-number (match-string 2)) + (string-to-number (match-string 3)) + (string-to-number (match-string 4)))) (setq id (shimbun-rss-build-message-id shimbun url date)) ;; check old id (when (shimbun-search-id shimbun id) @@ -176,16 +162,16 @@ date id "" 0 0 url) headers)) - (widen))))) - headers)))) + (widen)))))) + headers)))) ;; normalize date (defun shimbun-x51-prepare-article (shimbun header) "Adjust a date header if there's a correct information available." (let* ((case-fold-search t) - (start (re-search-forward shimbun-x51-content-start nil t)) + (start (re-search-forward (shimbun-content-start shimbun) nil t)) (end (and start - (re-search-forward shimbun-x51-content-end nil t) + (re-search-forward (shimbun-content-end shimbun) nil t) (prog1 (match-beginning 0) (goto-char start))))) @@ -196,7 +182,7 @@ \\([0-9]*\\)\\(月\\|月\\)\ \\([0-9]*\\)\\(日\\|日\\)\ ?\\([012][0-9]:[0-5][0-9]\\)" - nil t) + end t) (shimbun-header-set-date header (shimbun-make-date-string @@ -213,11 +199,9 @@ (luna-define-method shimbun-clear-contents :before ((shimbun shimbun-x51) header) (shimbun-strip-cr) - (shimbun-remove-tags "") - (shimbun-remove-tags "") - (shimbun-remove-tags "
      ") - (shimbun-remove-tags "
      ") - (shimbun-remove-tags "
      ")) + (shimbun-remove-tags "script\\|noscript" t) + (shimbun-remove-tags "\\(div\\) class=\"\\(?:notes\\|line\\|middlebar\\)\"" + t)) (provide 'sb-x51) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-xemacs.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-xemacs.el --- work/emacs-w3m-1.4.4/shimbun/sb-xemacs.el 2005-03-14 07:31:23.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-xemacs.el 2007-10-17 20:15:58.000000000 +0900 @@ -20,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-yahoo-auctions.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo-auctions.el --- work/emacs-w3m-1.4.4/shimbun/sb-yahoo-auctions.el 2005-03-23 06:52:02.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo-auctions.el 2011-10-14 09:16:00.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-yahoo-auctions.el --- shimbun backend for Yahoo! AUCTIONS -;; Copyright (C) 2005 ARISAWA Akihiro +;; Copyright (C) 2005, 2006, 2008, 2011 ARISAWA Akihiro ;; Author: ARISAWA Akihiro ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: @@ -39,8 +39,8 @@ (string :tag "Group name") (string :tag "URL")))) -(defvar shimbun-yahoo-auctions-content-start "
      ") -(defvar shimbun-yahoo-auctions-content-end nil) +(defvar shimbun-yahoo-auctions-content-start "") +(defvar shimbun-yahoo-auctions-content-end "") (luna-define-method shimbun-groups ((shimbun shimbun-yahoo-auctions)) (mapcar 'car shimbun-yahoo-auctions-group-alist)) @@ -73,25 +73,6 @@ ((shimbun shimbun-yahoo-auctions) header) (shimbun-real-url (luna-call-next-method))) -(luna-define-method shimbun-make-contents ((shimbun shimbun-yahoo-auctions) - header) - (let ((case-fold-search t)) - (goto-char (point-min)) - (when (and (stringp (shimbun-content-start-internal shimbun)) - (re-search-forward (shimbun-content-start-internal shimbun) - nil t)) - (delete-region (point-min) (point)) - (insert "\n\n\n\n\n")) - (when (and (stringp (shimbun-content-end-internal shimbun)) - (re-search-forward (shimbun-content-end-internal shimbun) - nil t)) - (delete-region (match-beginning 0) (point-max)) - (insert (shimbun-footer shimbun header t) - "\n\n\n"))) - (shimbun-make-mime-article shimbun header) - (buffer-string)) - (provide 'sb-yahoo-auctions) + ;;; sb-yahoo-auctions.el ends here diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-yahoo-sports.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo-sports.el --- work/emacs-w3m-1.4.4/shimbun/sb-yahoo-sports.el 2005-03-14 21:50:35.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo-sports.el 2007-10-17 20:15:58.000000000 +0900 @@ -19,9 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -31,9 +31,8 @@ ;;; Code: (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-yahoo-sports (shimbun shimbun-text) ()) +(luna-define-class shimbun-yahoo-sports (shimbun) ()) (defvar shimbun-yahoo-sports-url "http://sports.yahoo.co.jp/") diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-yahoo.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo.el --- work/emacs-w3m-1.4.4/shimbun/sb-yahoo.el 2005-03-08 09:19:59.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yahoo.el 2010-11-12 13:37:29.000000000 +0900 @@ -1,9 +1,10 @@ ;;; sb-yahoo.el --- shimbun backend for news.yahoo.co.jp -*- coding: iso-2022-7bit -*- -;; Copyright (C) 2001, 2002, 2003, 2005 -;; Kazuyoshi KOREEDA +;; Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010 +;; Kazuyoshi KOREEDA -;; Author: Kazuyoshi KOREEDA +;; Author: Kazuyoshi KOREEDA , +;; Katsumi Yamaoka ;; Keywords: news ;; This file is a part of shimbun. @@ -19,9 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -32,96 +33,299 @@ ;;; Code: (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-yahoo (shimbun shimbun-text) ()) +(luna-define-class shimbun-yahoo (shimbun) ()) + +(defvar shimbun-yahoo-prefer-text-plain nil + "*Non-nil means prefer text/plain articles rather than html articles.") (defvar shimbun-yahoo-url "http://headlines.yahoo.co.jp/") -(defvar shimbun-yahoo-groups-alist - '(("topnews" . "topnews") - ("politics" . "pol") - ("society" . "soci") - ("people" . "peo") - ("business-all" . "bus_all") - ("market" . "brf") - ("stock" . "biz") - ("industry" . "ind") - ("international" . "int") - ("entertainment" . "ent") - ("sports" . "spo") - ("computer" . "sci") - ("hokkaido" . "hok") - ("tohoku" . "toh") - ("kanto" . "kan") - ("sinetsu" . "sin") - ("hokuriku" . "hor") - ("tokai" . "tok") - ("kinki" . "kin") - ("chugoku" . "chu") - ("sikoku" . "sik") - ("kyushu" . "kyu") - ("okinawa" . "oki"))) +(defvar shimbun-yahoo-groups-table + (let* ((s0 "[\t\n ]*") + (s1 "[\t\n ]+") + (default (list + (concat + "" s0 "\\(?:" s0 "\\)?" + ;; 6. subject + "\\([^<]+\\)" + "\\(?:" s0 "\\)?" + s0 "\\(?:\\(?:[^\n<(]*\\|[\t\n ]*\\)<[^>]+>\\)*" s0 + "\\(?:(" s0 "\\(?:]+>" s0 "\\)?" + ;; 7. source + "\\([^<)]+\\)" + s0 "\\(?:" s0 "\\)?" + s0 ")" + "\\(?:" s0 "-\\(?:[^<]+\)\\)?\ +\\|" s0 "\\(?:<[^>]+>" s0 "\\)?\ +\\(?:[01]?[0-9]月\\)?[0-3]?[0-9]日\\(?:([日月火水木金土])\\)?\\)?\ +\\|[01]?[0-9]月[0-3]?[0-9]日\\(?:([日月火水木金土])\\)?\\)" + s0 + ;; 8. hour + "\\([012]?[0-9]\\)" + s0 "時" s0 + ;; 9. minute + "\\([0-5]?[0-9]\\)" + s0 "分" + "\\(?:\\(?:" s0 "]+>\\)?[^<]+]+\">" s0 + ;; 10. source + "\\([^<)]+\\)" + s0 "\\)?") + 1 2 3 4 5 6 7 8 9 10)) + (topnews (list + (concat + "" s0 + ;; 6. subject + "\\([^<]+\\)" + s0 "\\(?:" s0 "<[^>]+>\\)+" s0 + ;; 7. source + "\\([^<]+\\)" + ".+)" s0 + ;; 8. hour + "\\([012]?[0-9]\\)" + s0 "時" s0 + ;; 9. minute + "\\([0-5]?[0-9]\\)" + s0 "分配信") + 1 2 3 4 5 6 7 8 9))) + `(("topnews" "トップ" "topnews" ,@topnews) + ("news" "ニュース" news ,@default) + ("politics" "政治" "pol" ,@default) + ("society" "社会" "soci" ,@default) + ("people" "人" "peo" ,@default) + ("business-all" "経済総合" "bus_all" ,@default) + ("market" "市況" "brf" ,@default) + ("stock" "株式" "biz" ,@default) + ("industry" "産業" "ind" ,@default) + ("international" "海外" "int" ,@default) + ("entertainment" "エンターテインメント" "ent" ,@default) + ("sports" "スポーツ" "spo" ,@default) + ("computer" "コンピュータ" "sci" ,@default) + ("zenkoku" "全国" "loc" ,@default) + ("hokkaido" "北海道" "hok" ,@default) + ("aomori" "青森" "l02" ,@default) ;; not "102" but "l02" ;-) + ("iwate" "岩手" "l03" ,@default) + ("miyagi" "宮城" "l04" ,@default) + ("akita" "秋田" "l05" ,@default) + ("yamagata" "山形" "l06" ,@default) + ("fukushima" "福島" "l07" ,@default) + ("tokyo" "東京" "l13" ,@default) + ("kanagawa" "神奈川" "l14" ,@default) + ("chiba" "千葉" "l12" ,@default) + ("saitama" "埼玉" "l11" ,@default) + ("ibaraki" "茨城" "l08" ,@default) + ("tochigi" "栃木" "l09" ,@default) + ("gunma" "群馬" "l10" ,@default) + ("yamanashi" "山梨" "l19" ,@default) + ("nagano" "長野" "l20" ,@default) + ("niigata" "新潟" "l15" ,@default) + ("toyama" "富山" "l16" ,@default) + ("ishikawa" "石川" "l17" ,@default) + ("fukui" "福井" "l18" ,@default) + ("aichi" "愛知" "l23" ,@default) + ("gifu" "岐阜" "l21" ,@default) + ("shizuoka" "静岡" "l22" ,@default) + ("mie" "三重" "l24" ,@default) + ("osaka" "大阪" "l27" ,@default) + ("hyogo" "兵庫" "l28" ,@default) + ("kyoto" "京都" "l26" ,@default) + ("shiga" "滋賀" "l25" ,@default) + ("nara" "奈良" "l29" ,@default) + ("wakayama" "和歌山" "l30" ,@default) + ("tottori" "鳥取" "l31" ,@default) + ("shimane" "島根" "l32" ,@default) + ("okayama" "岡山" "l33" ,@default) + ("hiroshima" "広島" "l34" ,@default) + ("yamaguchi" "山口" "l35" ,@default) + ("tokushima" "徳島" "l36" ,@default) + ("kagawa" "香川" "l37" ,@default) + ("ehime" "愛媛" "l38" ,@default) + ("kochi" "高知" "l39" ,@default) + ("fukuoka" "福岡" "l40" ,@default) + ("saga" "佐賀" "l41" ,@default) + ("nagasaki" "長崎" "l42" ,@default) + ("kumamoto" "熊本" "l43" ,@default) + ("oita" "大分" "l44" ,@default) + ("miyazaki" "宮崎" "l45" ,@default) + ("kagoshima" "鹿児島" "l46" ,@default) + ("okinawa" "沖縄" "oki" ,@default))) + "Alist of group names, their Japanese translations, index pages, +regexps and numbers. Where numbers point to the search result in order +of [0]url, [1]serial number, [2]year, [3]month, [4]day, [5]subject, +\[6]news source, [7]hour, [8]minute, and [9]news source (the last one +may not be presented).") + (defvar shimbun-yahoo-groups - (mapcar 'car shimbun-yahoo-groups-alist)) + (mapcar 'car shimbun-yahoo-groups-table)) + +(defvar shimbun-yahoo-from-address "nobody@example.com") +(defvar shimbun-yahoo-content-start + "[012]?[0-9]時[0-5]?[0-9]分配信[\t\n\r ]*\\(?:]+>[\t\n\r ]*\\)*") -(defvar shimbun-yahoo-from-address "news-admin@mail.yahoo.co.jp") -(defvar shimbun-yahoo-content-start "

      \n") -(defvar shimbun-yahoo-content-end "\n
      \n") +(defvar shimbun-yahoo-content-end "[\t\n\r ]*\\(
      [\t\n\r ]*\\)*\ +") (defvar shimbun-yahoo-x-face-alist '(("default" . "X-Face: \"Qj}=TahP*`:b#4o_o63:I=\"~wbql=kpF1a>Sp62\ fpAsVY`saZV[b*GqI!u|i|xKPjNh&P=\n R?n}rh38mkp_:')h=Bh:Rk>0pYF\\I?f\\\ PvPs3>/KG:03n47U?FC[?DNAR4QAQxE3L;m!L10OM$-]kF\n YD\\]-^qzd#'{(o2cu,\ -(}CMi|3b9JDQ(^D\\:@DE}d2+0S2G{VS@E*1Og7Vj#35[77\"z9XBq9$1uF$+W\n u"))) +\(}CMi|3b9JDQ(^D\\:@DE}d2+0S2G{VS@E*1Og7Vj#35[77\"z9XBq9$1uF$+W\n u"))) (defvar shimbun-yahoo-expiration-days 7) (luna-define-method shimbun-index-url ((shimbun shimbun-yahoo)) - (format "%shl?c=%s&t=l" - (shimbun-url-internal shimbun) - (cdr (assoc (shimbun-current-group-internal shimbun) - shimbun-yahoo-groups-alist)))) +;;; +;; (shimbun-yahoo-index-url shimbun)) +;; +;;(defun shimbun-yahoo-index-url (shimbun) +;;; + (let ((group (shimbun-current-group-internal shimbun)) + (url (shimbun-url-internal shimbun))) + (if (string-equal group "news") + (concat url "hl") + (format "%shl?c=%s&t=l" + url + (nth 2 (assoc group shimbun-yahoo-groups-table)))))) (luna-define-method shimbun-get-headers ((shimbun shimbun-yahoo) &optional range) - (let ((case-fold-search t) - headers) +;;; +;; (shimbun-yahoo-get-headers shimbun range)) +;; +;;(defun shimbun-yahoo-get-headers (shimbun range) +;;; + (let* ((case-fold-search t) + (from "Yahoo!ニュース") + (group (shimbun-current-group-internal shimbun)) + (numbers (cdr (assoc group shimbun-yahoo-groups-table))) + (jname (pop numbers)) + (regexp (progn (setq numbers (cdr numbers)) (pop numbers))) + (pages (shimbun-header-index-pages range)) + (count 0) + (index (shimbun-index-url shimbun)) + id headers start) (catch 'stop (while t - (while (re-search-forward "\\([^<]+\\)\\([^0-9]\\|[\n\r]\\)*\\([0-9]+日[^0-9]*\\)?\\([0-9]+\\)時\\([0-9]+\\)分" nil t) - (let ((url (match-string 1)) - (year (match-string 2)) - (month (match-string 3)) - (day (match-string 4)) - (no (match-string 5)) - (subject (match-string 6)) - (hour (string-to-number (match-string 9))) - (min (string-to-number (match-string 10))) - id time) - (setq id (format "<%s%s%s%s.%s@headlines.yahoo.co.jp>" - year month day no - (shimbun-current-group-internal shimbun))) - (if (shimbun-search-id shimbun id) - (throw 'stop nil)) - (setq time (format "%02d:%02d" hour min)) - (push (shimbun-make-header - 0 - (shimbun-mime-encode-string subject) - (shimbun-from-address shimbun) - (shimbun-make-date-string (string-to-number year) - (string-to-number month) - (string-to-number day) time) - id "" 0 0 url) - headers))) - (if (re-search-forward "次のページ" nil t) + (if (string-equal group "news") (progn - (shimbun-retrieve-url (prog1 - (match-string 1) - (erase-buffer)) - t) - (goto-char (point-min))) - (throw 'stop nil)))) - headers)) + (when (and (re-search-forward + "" nil t) + (progn + (setq start (match-end 0)) + (re-search-forward + "" nil t))) + (delete-region (match-beginning 0) (point-max)) + (delete-region (point-min) start) + (goto-char (point-min))) + (when (and (re-search-forward ">[\t\n ]*写真ニュース[\t\n ]*\ +\\(?:[\t\n ]*]+>\\)+[\y\n ]*\\(]+[\t\n ]+\\)*\ +class=\"ymuiContainer\"\\)" nil t) + (shimbun-end-of-tag "div")) + (delete-region (match-beginning 0) (match-end 0)))) + (shimbun-remove-tags "" + "")) + (goto-char (point-min)) + (while (re-search-forward regexp nil t) + (setq id (concat "<" + (save-match-data + (shimbun-replace-in-string + (match-string (nth 1 numbers)) + "-" ".")) + "%" group ".headlines.yahoo.co.jp>")) + (unless (and (shimbun-search-id shimbun id) + (if (and (>= count 1) ;; We're in the next page. + ;; Stop fetching iff range is not specified. + (not pages)) + (throw 'stop nil) + t)) + (if (save-match-data + (string-match "記事全文[\t\n ]*\\'" + (match-string (nth 5 numbers)))) + (goto-char (match-end (nth 5 numbers))) + (push (shimbun-create-header + 0 + (match-string (nth 5 numbers)) + (concat from " (" jname "/" + (or (match-string (nth 6 numbers)) + (match-string (nth 9 numbers))) + ")") + (shimbun-make-date-string + (string-to-number (match-string (nth 2 numbers))) + (string-to-number (match-string (nth 3 numbers))) + (string-to-number (match-string (nth 4 numbers))) + (format + "%02d:%02d" + (string-to-number (match-string (nth 7 numbers))) + (string-to-number (match-string (nth 8 numbers))))) + id "" 0 0 + (match-string (nth 0 numbers))) + headers)))) + (setq count (1+ count)) + (goto-char (point-min)) + (cond ((and pages (>= count pages)) + (throw 'stop nil)) + ((string-equal group "news") + (if (>= count 2) + (throw 'stop nil) + (erase-buffer) + (shimbun-retrieve-url + "http://headlines.yahoo.co.jp/hl?c=flash" + t))) + ((re-search-forward "次のページ" + nil t) + (shimbun-retrieve-url (prog1 + (match-string 1) + (erase-buffer)) + t)) + ((and (re-search-forward "" + nil t) + (progn + (setq start (match-end 0)) + (re-search-forward "" + nil t)) + (progn + (narrow-to-region start (match-beginning 0)) + (goto-char start) + (or (re-search-forward "" + nil t) + (re-search-forward "" + nil t))) + (re-search-forward "" + nil t)) + (shimbun-retrieve-url (prog1 + (concat index "&d=" (match-string 1)) + (erase-buffer)) + t)) + (t + (throw 'stop nil))))) + (shimbun-sort-headers headers))) (provide 'sb-yahoo) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-yomiuri-html.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yomiuri-html.el --- work/emacs-w3m-1.4.4/shimbun/sb-yomiuri-html.el 2003-09-08 20:08:21.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yomiuri-html.el 2007-10-17 20:15:58.000000000 +0900 @@ -1,6 +1,6 @@ ;;; sb-yomiuri-html.el --- shimbun backend for yomiuri online (HTML version) -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003 Yuuichi Teranishi +;; Copyright (C) 2001, 2002, 2003, 2005 Yuuichi Teranishi ;; Author: Yuuichi Teranishi , ;; Katsumi Yamaoka @@ -19,28 +19,25 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: +;; This module is now semi-obsolete. You can use sb-yomiuri.el to read +;; html articles by putting the following line in your init file. +;; +;;(setq shimbun-yomiuri-prefer-text-plain nil) + ;;; Code: -(require 'shimbun) (require 'sb-yomiuri) (luna-define-class shimbun-yomiuri-html (shimbun-yomiuri) ()) -(defvar shimbun-yomiuri-html-content-start - "\n\n\\|\n\n") - -(defvar shimbun-yomiuri-html-content-end "\n\n") - -(luna-define-method shimbun-make-contents ((shimbun shimbun-yomiuri-html) - header) - (shimbun-yomiuri-prepare-article shimbun header) - (shimbun-make-html-contents shimbun header)) +(defconst shimbun-yomiuri-html-prefer-text-plain nil + "Non-nil means prefer text/plain articles rather than html articles.") (provide 'sb-yomiuri-html) diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-yomiuri.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yomiuri.el --- work/emacs-w3m-1.4.4/shimbun/sb-yomiuri.el 2004-12-06 21:42:35.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-yomiuri.el 2008-01-11 16:43:25.000000000 +0900 @@ -1,5 +1,7 @@ ;;; sb-yomiuri.el --- shimbun backend for www.yomiuri.co.jp -*- coding: iso-2022-7bit; -*- +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Authors + ;; Author: TSUCHIYA Masatoshi , ;; Yuuichi Teranishi , ;; Katsumi Yamaoka @@ -19,9 +21,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -30,11 +32,14 @@ ;;; Code: +(eval-when-compile (require 'cl)) ;; caddr, cadddr, cddddr. + (require 'shimbun) -(require 'sb-text) -(luna-define-class shimbun-yomiuri - (shimbun-japanese-newspaper shimbun-text) ()) +(luna-define-class shimbun-yomiuri (shimbun-japanese-newspaper shimbun) ()) + +(defvar shimbun-yomiuri-prefer-text-plain t + "*Non-nil means prefer text/plain articles rather than html articles.") (defvar shimbun-yomiuri-top-level-domain "yomiuri.co.jp" "Name of the top level domain for the Yomiuri On-line.") @@ -46,99 +51,443 @@ (defvar shimbun-yomiuri-group-table (let* ((s0 "[\t\n ]*") (s1 "[\t\n ]+") - (no-nl "[^\n<>]+") (default (list (concat "" s0 - ;; 4. subject - "\\(" no-nl "\\)" - s0 "(" - ;; 5. month + ;; 2. serial number[1] + "\\(" + ;; 3. year + "\\(20[0-9][0-9]\\)" + "[01][0-9][0-3][0-9]\\)" + ;; 4. serial number[2] + "\\([^.]+\\)" + "[^\"]+\\)" + "\"[^>]*>" s0 + ;; 5. subject + "\\([^<]+\\)" + s0 "[^<(]*(" s0 + ;; 6. month "\\([01]?[0-9]\\)" - "/" - ;; 6. day + s0 "月" s0 + ;; 7. day + "\\([0-3]?[0-9]\\)" + s0 "日" s0 + ;; 8. hour:minute + "\\([012][0-9]:[0-5][0-9]\\)") + 1 2 4 3 5 6 7 8)) + (default2 + (list + (concat + "]*>" s0 + ;; 5. subject + "\\([^<]+\\)" + s0 "" s0 "" + "\\(?:" s0 "]+>[^<]+\\)?" + s0 "" s0 + ;; 6. month + "\\([01]?[0-9]\\)" + s0 "月" s0 "" s0 "" s0 + ;; 7. day "\\([0-3]?[0-9]\\)" - s1 - ;; 7. hour:minute - "\\([012][0-9]:[0-5][0-9]\\)" - ")" s0 "") - 1 2 3 4 5 6 7))) - `(("business" "経済" "index.htm" ,@default) - ("culture" "芸能・文化" "index.htm" ,@default) - ("editorial" "社説・コラム" "index.htm" + s0 "日" s0 "") + 1 2 4 3 5 6 7)) + (kyoiku + (cons (format (car default2) "kyoiku\\(?:/[^\"./]+\\)+") + (cdr default2)))) + `(("atmoney" "マネー・経済") + ("editorial" "社説・コラム" "" ,(concat "" s0 - ;; 4. month(ja) - "\\([01]?[0-9]\\)" + ;; 2. serial number[1] + "\\(" + ;; 3. year + "\\(20[0-9][0-9]\\)" + "[01][0-9][0-3][0-9]\\)" + ;; 4. serial number[2] + "\\([^.]+\\)" + "[^\"]+\\)" + "\"[^>]*>" s0 + ;; 5. month + ;; 6. ja month + "\\(?:\\([01]?[0-9]\\)\\|\\([01]?[0-9]\\)\\)" "月" - ;; 5. day(ja) - "\\([0-3]?[0-9]\\)" - "日付・" - ;; 6. subject - "\\(" no-nl "\\)" s0 "") - 1 2 3 6 4 5) - ("kyoiku" "教育メール" "index.htm" - ,(concat "]+>" s0 - ;; 5. subject + ;; 7. day + ;; 8. ja day + "\\(?:\\([0-3]?[0-9]\\)\\|\\([0-3]?[0-9]\\)\\)" + "日付[\t\n  ・]*" + ;; 9. subject "\\([^<]+\\)" - "\\(" s0 "<[^>]+>\\)+" s0 - ;; 7. month - "\\([01]?[0-9]\\)" - "月\\(" s0 "<[^>]+>\\)+" s0 - ;; 9 day - "\\([0-3]?[0-9]\\)" - "日") - 1 3 4 5 7 9) - ("national" "社会" "index.htm" ,@default) - ("obit" "おくやみ" "index.htm" - ,(concat "" s0 + ;; 1. ja genre + "\\(\\cj+\\)" + "[^<]*[^<]*" s0 - ;; 4. subject - "\\(" no-nl "\\)" - s0 "(" - ;; 5. month - "\\([01]?[0-9]\\)" - "/" - ;; 6. day - "\\([0-3]?[0-9]\\)" - ")" s0 "") - 1 2 3 4 5 6) - ("politics" "政治" "index.htm" ,@default) - ("science" "科学" "index.htm" ,@default) - ("sports" "スポーツ" "index.htm" ,@default) - ("world" "国際" "index.htm" ,@default))) + ;; 3. genre + "\\([^_]+\\)" + "_news/" + ;; 4. serial number[1] + "\\(" + ;; 5. year + "\\(20[0-9][0-9]\\)" + ;; 6. month + "\\([01][0-9]\\)" + ;; 7. day + "\\([0-3][0-9]\\)" + "\\)" + ;; 8. serial number[2] + "\\([^.]+\\)" + "[^\"]+\\)" + "\"[^>]*>" s0 + ;; 9. subject + "\\([^<]+\\)" + s0) + 2 4 8 5 9 6 7 nil nil nil 3 1) + ("kyoiku" "教育" "" ,@kyoiku) + ("kyoiku.children" "こども") + ("kyoiku.english" "英語" + "http://www.yomiuri.co.jp/kyoiku/learning/english/" + ,@kyoiku) + ("kyoiku.qanda" "教育Q&A") + ("kyoiku.renaissance" "教育ルネサンス" + "http://www.yomiuri.co.jp/kyoiku/renai/") + ("kyoiku.special" "特集") + ("national" "社会" "" ,@default) + ("politics" "政治" "" ,@default) + ("science" "科学" "" ,@default) + ("sports" "スポーツ" "" + ,(concat + "]*>" s0 + ;; 6. subject + "\\([^<]+\\)" + "\\(?:" s0 "]+>\\)?" s0 "[^<(]*(" s0 + ;; 7. month + "\\([01]?[0-9]\\)" + s0 "月" s0 + ;; 8. day + "\\([0-3]?[0-9]\\)" + s0 "日" s0 + ;; 9. hour:minute + "\\([012][0-9]:[0-5][0-9]\\)") + 1 3 5 4 6 7 8 9 nil nil 2) + ("world" "国際" "" ,@default))) "Alist of group names, their Japanese translations, index pages, regexps and numbers. Regexp may contain the \"%s\" token which is replaced with a regexp-quoted group name. Numbers point to the search result in order -of [0]a url, [1,2]serial numbers, [3]a subject, [4]a month, [5]a day, -\[6]an hour:minute and [7-]extra keywords.") +of [0]url, [1,2]serial numbers, [3]year, [4]subject, [5]month, [6]day, +\[7]hour:minute, [8]ja month, [9]ja day, [10]genre and [11]ja genre.") -(defvar shimbun-yomiuri-content-start "\n\n") +(defvar shimbun-yomiuri-subgroups-alist + (let* ((s0 "[\t\n  ]*") + (s1 "[\t\n ]+") + (default + (list + (concat + "]*>" s0 + ;; 5. subject + "\\([^<]+\\)" + s0 "[^<(]*(" s0 + ;; 6. month + "\\([01]?[0-9]\\)" + s0 "月" s0 + ;; 7. day + "\\([0-3]?[0-9]\\)" + s0 "日\\(?:" s0 + ;; 8. hour:minute + "\\([012][0-9]:[0-5][0-9]\\)\\)?") + 1 2 4 3 5 6 7 8)) + (default2 + (list + (concat + "]*>" s0 + ;; 7. subject + "\\([^<]+\\)" + s0) + 1 2 6 3 7 4 5)) + (default3 + (list + (concat + "]*>" s0 + ;; 8. subject + "\\([^<]+\\)" + s0) + 1 3 7 4 8 5 6 nil nil nil 2)) + (default4 + (list + (concat + "]*>" s0 + ;; 5. subject + "\\([^<]+\\)" + s0 "" s0 "" + "\\(?:" s0 "]+>[^<]+\\)?" + s0 "" s0 + ;; 6. month + "\\([01]?[0-9]\\)" + s0 "月" s0 "" s0 "" s0 + ;; 7. day + "\\([0-3]?[0-9]\\)" + s0 "日" s0 "") + 1 2 4 3 5 6 7)) + (entertainment + (list + (concat + "alt=\"" + ;; 1. ja genre + "\\([^\"]+\\)" + "\"[^>]+>" s0 "\\(?:" s0 "]+>\\)?[^<]*]*>" s0 + ;; 7. subject + "\\([^<]+\\)" + s0 "[^<(]*(" s0 + ;; 8. month + "\\([01]?[0-9]\\)" + s0 "月" s0 + ;; 9. day + "\\([0-3]?[0-9]\\)" + s0 "日") + 2 4 6 5 7 8 9 nil nil nil 3 1))) + `(("atmoney" + ("宝くじ" "lottery" "http://www.yomiuri.co.jp/atmoney/lottery/" + ,(format (car default2) "atmoney/lottery") ,@(cdr default2)) + ("金融ニュース" "mnews" "http://www.yomiuri.co.jp/atmoney/mnews/" + ,(format (car default) "atmoney/mnews") ,@(cdr default)) + ("経済ニュース" "news" "http://www.yomiuri.co.jp/atmoney/news/" + ,(format (car default) "atmoney/news") ,@(cdr default)) + ("新製品情報" "pnews" "http://www.yomiuri.co.jp/atmoney/pnews/" + ,(format (car default) "atmoney/pnews") ,@(cdr default))) + ("entertainment" + ("映画" nil "http://www.yomiuri.co.jp/entertainment/cinema/" + ,(format (car entertainment) "cinema") ,@(cdr entertainment)) + ("donna" "donna" "http://www.yomiuri.co.jp/donna/" + ,(concat + "]*>" s0 + ;; 7. subject + "\\([^<]+\\)") + 1 2 3 4 7 5 6) + ("DVD情報" "dvd" "http://www.yomiuri.co.jp/entertainment/cinema/dvd/" + ,(format (car default) "entertainment/cinema/dvd") ,@(cdr default)) + ("ジブリをいっぱい" "ghibli" + "http://www.yomiuri.co.jp/entertainment/ghibli/" + ,(concat + "]*>" s0 + ;; 5. subject + "\\([^<]+\\)" + "" s0 "(" + ;; 6. year + "\\(20[0-9][0-9]\\)" "年" + ;; 7. month + "\\([01]?[0-9]\\)" "月" + ;; 8. day + "\\([0-3]?[0-9]\\)" "日") + 1 3 4 6 5 7 8 nil nil nil 2) + ("ヘザーの映画館" "heather" + "http://www.yomiuri.co.jp/entertainment/heather/" + ,(format (car entertainment) "heather") ,@(cdr entertainment)) + ("音楽" "music" "http://www.yomiuri.co.jp/entertainment/music/" + ,(format (car default3) "entertainment/music") ,@(cdr default3)) + ("ニュース" "news" "http://www.yomiuri.co.jp/entertainment/news/" + ,(format (car default) "entertainment/news") ,@(cdr default)) + ("舞台" "stage" "http://www.yomiuri.co.jp/entertainment/stage/" + ,(format (car entertainment) "stage") ,@(cdr entertainment)) + ("TV" "tv" "http://www.yomiuri.co.jp/entertainment/tv/" + ,(format (car default) "entertainment/tv") ,@(cdr default)) + ("Y&Yテレビ" "yy" "http://www.yomiuri.co.jp/entertainment/yy/" + ,(format (car default3) "entertainment/yy") ,@(cdr default3))) + ("kyoiku" + ("ニュース" nil "http://www.yomiuri.co.jp/kyoiku/news/" + ,(format (car default4) "kyoiku/news") ,@(cdr default4)) + ("教育行政" nil "http://www.yomiuri.co.jp/kyoiku/news2/06.htm" + ,(format (car default4) "kyoiku/news2") ,@(cdr default4)) + ("ボランティア・その他" nil + "http://www.yomiuri.co.jp/kyoiku/news2/08.htm" + ,(format (car default4) "kyoiku/news2") ,@(cdr default4))) + ("kyoiku.children" + ("Jキッズ通信" "jkids" + "http://www.yomiuri.co.jp/kyoiku/children/jkids/" + ,(format (car default4) "kyoiku/children/jkids") ,@(cdr default4)) + ("子どもの心" "kodomo.hagukumu" + "http://www.yomiuri.co.jp/kyoiku/hagukumu/kodomo/" + ,(format (car default4) "kyoiku/hagukumu/kodomo") ,@(cdr default4)) + ("ニュースウィークリー" "weekly" + "http://www.yomiuri.co.jp/kyoiku/children/weekly/" + ,(format (car default4) "kyoiku/children/weekly") ,@(cdr default4))) + ("kyoiku.qanda" + ("教育相談" "consul" "http://www.yomiuri.co.jp/kyoiku/qanda/consul/" + ,(format (car default4) "kyoiku/qanda/consul") ,@(cdr default4)) + ("悩みのち晴れ" "worries" + "http://www.yomiuri.co.jp/kyoiku/qanda/worries/" + ,(format (car default4) "kyoiku/qanda/worries") ,@(cdr default4))) + ("kyoiku.special" + ("受験ABC" "s06" "http://www.yomiuri.co.jp/kyoiku/special/s06/" + ,(format (car default4) "kyoiku/special/s06") ,@(cdr default4))) + ("national" + ("文化" "culture" "http://www.yomiuri.co.jp/national/culture/" + ,(format (car default) "national/culture/news") ,@(cdr default)) + ("おくやみ" "obit" "http://www.yomiuri.co.jp/national/obit/" + ,(format (car default2) "national/obit/news") ,@(cdr default2))) + ("sports" + ("エトセトラ" "etc" "http://www.yomiuri.co.jp/sports/etc/" + ,(format (car default) "sports/etc/news") ,@(cdr default)) + ("ゴルフ" "golf" "http://www.yomiuri.co.jp/sports/golf/" + ,(format (car default) "sports/golf/news") ,@(cdr default)) + ("大リーグ" "mlb" "http://www.yomiuri.co.jp/sports/mlb/" + ,(format (car default) "sports/mlb/news") ,@(cdr default)) + ("プロ野球" "npb" "http://www.yomiuri.co.jp/sports/npb/" + ,(format (car default) "sports/npb/news") ,@(cdr default)) + ("サッカー" "soccer" "http://www.yomiuri.co.jp/sports/soccer/" + ,(format (car default) "sports/soccer/news") ,@(cdr default)) + ("東京六大学野球07" "ubb07" "http://www.yomiuri.co.jp/sports/ubb07/" + ,(format (car default) "sports/ubb07/news") ,@(cdr default))))) + "Alist of parent groups and lists of subgenres and tables for subgroups. +Each table is the same as the `cdr' of the element of +`shimbun-yomiuri-group-table'.") + +(defvar shimbun-yomiuri-content-start + "\n\n\ +\\|\n\n\ +\\|\n\n\ +\\|\n\n") + +(defvar shimbun-yomiuri-content-end + "\n\n\ +\\|\n\n\ +\\|\n\n") + +(defvar shimbun-yomiuri-text-content-start + "\n\n\ +\\|\n\n\ +\\|\n\n") -(defvar shimbun-yomiuri-content-end "\n\n") +(defvar shimbun-yomiuri-text-content-end shimbun-yomiuri-content-end) (defvar shimbun-yomiuri-x-face-alist '(("default" . "X-Face: #sUhc'&(fVr$~y)\ @@ -148,16 +497,16 @@ (defvar shimbun-yomiuri-expiration-days 7) (luna-define-method initialize-instance :after ((shimbun shimbun-yomiuri) - &rest init-args) + &rest init-args) (shimbun-set-server-name-internal shimbun "讀売新聞") - (shimbun-set-from-address-internal shimbun - (concat "webmaster@www." - shimbun-yomiuri-top-level-domain)) + (shimbun-set-from-address-internal shimbun "nobody@example.com") ;; To share class variables between `shimbun-yomiuri' and its ;; successor `shimbun-yomiuri-html'. (shimbun-set-x-face-alist-internal shimbun shimbun-yomiuri-x-face-alist) (shimbun-set-expiration-days-internal shimbun shimbun-yomiuri-expiration-days) + (shimbun-set-content-start-internal shimbun shimbun-yomiuri-content-start) + (shimbun-set-content-end-internal shimbun shimbun-yomiuri-content-end) shimbun) (luna-define-method shimbun-groups ((shimbun shimbun-yomiuri)) @@ -168,255 +517,352 @@ shimbun-yomiuri-group-table))) (luna-define-method shimbun-index-url ((shimbun shimbun-yomiuri)) - (let ((group (shimbun-current-group-internal shimbun))) - (concat shimbun-yomiuri-url group "/" - (nth 2 (assoc group shimbun-yomiuri-group-table))))) + (let* ((group (shimbun-current-group-internal shimbun)) + (index (nth 2 (assoc group shimbun-yomiuri-group-table)))) + (cond ((not index) + "about:blank") + ((string-match "\\`http:" index) + index) + (t + (concat shimbun-yomiuri-url group "/" index))))) -(defmacro shimbun-yomiuri-japanese-string-to-number (string) +(defun shimbun-yomiuri-japanese-string-to-number (string) "Convert a Japanese zenkaku number to just a number." - (let ((alist ''((?0 . 0) (?1 . 1) (?2 . 2) (?3 . 3) (?4 . 4) - (?5 . 5) (?6 . 6) (?7 . 7) (?8 . 8) (?9 . 9)))) - (if (= (length "0") 1) - `(let* ((str ,string) - (alist ,alist) - (len (length str)) - (idx 0) - (num 0)) - (while (< idx len) - (setq num (+ (cdr (assq (aref str idx) alist)) (* num 10)) - idx (1+ idx))) - num) - `(let* ((str ,string) - (alist ,alist) - (len (length str)) - (idx 0) - (num 0) - char) - (while (< idx len) - (setq char (sref str idx) - num (+ (cdr (assq char alist)) (* num 10)) - idx (+ idx (char-bytes char)))) - num)))) - -(defun shimbun-yomiuri-shorten-brackets-in-string (string) - "Replace Japanes zenkaku brackets with ascii characters in STRING. -It does also shorten too much spaces." - (save-match-data - (with-temp-buffer - (insert string) - (let ((alist '(("(" . " (") (")" . ") ") ("[" . " [") - ("]" . "] ") ("{" . " {") ("}" . "} "))) - elem) - (while alist - (setq elem (pop alist)) - (goto-char (point-min)) - (while (search-forward (car elem) nil t) - (replace-match (cdr elem)))) - (goto-char (point-min)) - (while (re-search-forward "[\t  ]+" nil t) - (replace-match " ")) - (goto-char (point-min)) - (while (re-search-forward "\\([])}]\\) \\([])}]\\)" nil t) - (replace-match "\\1\\2") - (forward-char -1)) - (goto-char (point-min)) - (while (re-search-forward "\\([[({]\\) \\([[({]\\)" nil t) - (replace-match "\\1\\2") - (forward-char -1)) - (goto-char (point-min)) - (while (re-search-forward " ?\\([「」]\\) ?" nil t) - (replace-match "\\1")) - (goto-char (point-min)) - (while (re-search-forward "^ \\| $" nil t) - (replace-match ""))) - (buffer-string)))) - -(defun shimbun-yomiuri-get-headers (shimbun) - "Return a list of headers." - (let ((group (shimbun-current-group-internal shimbun)) - (from (shimbun-from-address shimbun)) - (case-fold-search t) - cyear cmonth month day time regexp numbers headers) - (setq cyear (decode-time) - cmonth (nth 4 cyear) - cyear (nth 5 cyear)) - ;; Extracting top news. - (when (and (not (member group '("editorial" "kyoiku" "obit"))) - (re-search-forward - (format - (eval-when-compile + (let ((alist '((?0 . 0) (?1 . 1) (?2 . 2) (?3 . 3) (?4 . 4) + (?5 . 5) (?6 . 6) (?7 . 7) (?8 . 8) (?9 . 9))) + (len (length string)) + (idx 0) + (num 0)) + (while (< idx len) + (setq num (+ (cdr (assq (aref string idx) alist)) (* num 10)) + idx (1+ idx))) + num)) + +(defun shimbun-yomiuri-get-top-header (group from shimbun) + "Return a list of a header for the top news." + (when (and (search-forward "" nil t) + (re-search-forward + (format + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) (concat - "[\t\n ]*\\(<[^<>]+>[\t\n ]*\\)+" + "\\(%s/" + ;; 2. genre + "\\(?:\\([^/]+\\)/\\)?" + "news/" + ;; 3. serial number[1] + "\\(" + ;; 4. year + "\\(20[0-9][0-9]\\)" + "[01][0-9][0-3][0-9]\\)" + ;; 5. serial number[2] + "\\([^.]+\\)" + "[^\"]+\\)" + "\"[^>]*>" s0 ;; 6. subject - "\\([^<>]+\\)" - "[\t\n ]*<")) - (regexp-quote group)) - nil t)) - (setq month (string-to-number (match-string 3)) - day (string-to-number (match-string 4))) - (save-match-data - (when (re-search-forward - (concat "(\\([01]?[0-9]\\)/\\([0-3]?[0-9]\\)[\t\n ]+\ -\\([012][0-9]:[0-5][0-9]\\))[\t\n ]+= (- month cmonth) 2) - (1- cyear)) - ((and (= 1 month) (= 12 cmonth)) - (1+ cyear)) - (t - cyear)) - month day time) - ;; id - (concat "<" (buffer-substring (match-beginning 2) - (match-end 4)) - "." (buffer-substring (match-end 4) - (match-end 2)) - "%" group "." shimbun-yomiuri-top-level-domain ">") - ;; references, chars, lines - "" 0 0 - ;; xref - (concat shimbun-yomiuri-url (match-string 1))) - headers)) - (setq regexp (assoc group shimbun-yomiuri-group-table) - numbers (nthcdr 4 regexp) - regexp (format (nth 3 regexp) (regexp-quote group))) - ;; Generating headers. - (while (re-search-forward regexp nil t) - (if (string-equal group "editorial") - (setq month (shimbun-yomiuri-japanese-string-to-number - (match-string (nth 4 numbers))) - day (shimbun-yomiuri-japanese-string-to-number - (match-string (nth 5 numbers)))) - (setq month (string-to-number (match-string (nth 4 numbers))) - day (string-to-number (match-string (nth 5 numbers))))) - (push (shimbun-make-header - ;; number - 0 - ;; subject - (if (string-equal "editorial" group) - (shimbun-mime-encode-string - (format "%02d/%02d %s" + "\\([^<]+\\)" + s0))) + group) + nil t)) + (let* ((url (shimbun-expand-url (match-string 1) shimbun-yomiuri-url)) + (genre (match-string 2)) + (id (concat "<" (match-string 3) "." (match-string 5) + "%" (when genre + (concat genre ".")) + group "." shimbun-yomiuri-top-level-domain ">")) + year subject) + (prog1 + (unless (shimbun-search-id shimbun id) + (setq year (string-to-number (match-string 4)) + subject (match-string 6)) + (when (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*")) + (concat + ">" s0 "(" s0 + ;; 1. month + "\\([01]?[0-9]\\)" + s0 "月" s0 + ;; 2. day + "\\([0-3]?[0-9]\\)" + s0 "日" s0 + ;; 3. hour:minute + "\\([012][0-9]:[0-5][0-9]\\)" + s0 ")" s0 "<"))) + nil t) + (list (shimbun-create-header + 0 + subject + from + (shimbun-make-date-string + year + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (match-string 3)) + id "" 0 0 url)))) + (search-forward "" nil t))))) + +(defun shimbun-yomiuri-get-headers (shimbun) + "Return a list of headers." + (let* ((group (shimbun-current-group-internal shimbun)) + (from (concat (shimbun-server-name shimbun) + " (" (shimbun-current-group-name shimbun) ")")) + (case-fold-search t) + (regexp (assoc group shimbun-yomiuri-group-table)) + (subgroups (cdr (assoc group shimbun-yomiuri-subgroups-alist))) + numbers headers subject month day genre subgenre jgenre id year + subgrp) + (setq regexp + (when (setq numbers (nthcdr 4 regexp)) + (format (nth 3 regexp) (regexp-quote group)))) + (catch 'stop + ;; The loop for fetching all the articles in the subgroups. + (while t + (shimbun-strip-cr) + (goto-char (point-min)) + ;; Extract top news. + (when (member group '("atmoney" "entertainment" "national" "politics" + "science" "sports" "world")) + (setq headers + (nconc headers + (shimbun-yomiuri-get-top-header group from shimbun)))) + (when regexp + (while (re-search-forward regexp nil t) + (setq subject (match-string (nth 4 numbers)) + month (if (and (nth 8 numbers) + (match-beginning (nth 8 numbers))) + (shimbun-yomiuri-japanese-string-to-number + (match-string (nth 8 numbers))) + (string-to-number (match-string (nth 5 numbers)))) + day (if (and (nth 9 numbers) + (match-beginning (nth 9 numbers))) + (shimbun-yomiuri-japanese-string-to-number + (match-string (nth 9 numbers))) + (string-to-number (match-string (nth 6 numbers)))) + genre (or subgenre + (when (nth 10 numbers) + (match-string (nth 10 numbers)))) + jgenre (when (nth 11 numbers) + (match-string (nth 11 numbers)))) + (cond ((string-equal group "editorial") + (setq subject + (format + "%02d/%02d %s" month day - (shimbun-yomiuri-shorten-brackets-in-string - (match-string (nth 3 numbers))))) - (shimbun-mime-encode-string (match-string (nth 3 numbers)))) - ;; from - from - ;; date - (shimbun-make-date-string (cond ((>= (- month cmonth) 2) - (1- cyear)) - ((and (= 1 month) (= 12 cmonth)) - (1+ cyear)) - (t - cyear)) - month day - (when (nth 6 numbers) - (match-string (nth 6 numbers)))) - ;; id - (concat "<" (match-string (nth 1 numbers)) - "." (match-string (nth 2 numbers)) - "%" group "." shimbun-yomiuri-top-level-domain ">") - ;; references, chars, lines - "" 0 0 - ;; xref - (concat shimbun-yomiuri-url (match-string (nth 0 numbers)))) - headers)) + (save-match-data + (if (string-match "\\`[\\(.+\\)]「\\(.+\\)」\\'" + subject) + (replace-match "\\1: \\2" nil nil subject) + subject))))) + (jgenre + (setq subject (concat "[" jgenre "] " subject)))) + (setq id (concat "<" (match-string (nth 1 numbers)) + "." (match-string (nth 2 numbers)) + "%" (when genre + (concat genre ".")) + (mapconcat + 'identity + (nreverse (save-match-data + (split-string group "\\."))) + ".") + "." shimbun-yomiuri-top-level-domain ">")) + (unless (shimbun-search-id shimbun id) + (when (< (setq year (string-to-number + (match-string (nth 3 numbers)))) + 100) + (setq year (+ year 2000))) + (push (shimbun-create-header + 0 subject from + (shimbun-make-date-string + year month day + (when (and (nth 7 numbers) + (match-beginning (nth 7 numbers))) + (match-string (nth 7 numbers)))) + id "" 0 0 + (shimbun-expand-url + (match-string (nth 0 numbers)) + (if (string-match "ジブリをいっぱい" from) + "http://www.yomiuri.co.jp/entertainment/ghibli/" + shimbun-yomiuri-url))) + headers)))) + (if subgroups + (progn + (erase-buffer) + (setq subgrp (pop subgroups) + from (concat (shimbun-server-name shimbun) + " (" (car subgrp) ")") + subgenre (cadr subgrp)) + (shimbun-retrieve-url (caddr subgrp)) + (setq regexp (cadddr subgrp) + numbers (cddddr subgrp))) + (throw 'stop nil)))) (shimbun-sort-headers headers))) +(defun shimbun-yomiuri-get-headers-kyoiku-renaissance (shimbun) + (let ((from (concat (shimbun-server-name shimbun) + " (%s/" (shimbun-current-group-name shimbun) ")")) + (case-fold-search t) + next genre start end id headers) + (while (cond ((eq next 'none) + nil) + (next + (set-match-data next) + (goto-char (match-end 0))) + (t + (re-search-forward + "[\t\n ]*\\([^<]+\\)[\t\n ]*

      " + nil t))) + (setq genre (match-string 1) + start (match-end 0)) + (if (re-search-forward + "[\t\n ]*\\([^<]+\\)[\t\n ]*" + nil t) + (setq end (match-beginning 0) + next (match-data)) + (setq end nil + next 'none)) + (goto-char start) + (while (re-search-forward "\ +]*>[\t\n ]*\\([^<]+\\)[\t\n ]*[\t\n ]*\ +[\t\n ]*[\t\n ]*\ +\\(20[0-9][0-9]\\)[\t\n ]*年[\t\n ]*[\t\n ]*\ +\[\t\n ]*\\([01]?[0-9]\\)[\t\n ]*月[\t\n ]*[\t\n ]*\ +[\t\n ]*\\([0-3]?[0-9]\\)[\t\n ]*日[\t\n ]*" + end t) + (setq id (concat "<" (match-string 2) "." (match-string 3) + "%renai.kyoiku." shimbun-yomiuri-top-level-domain + ">")) + (unless (shimbun-search-id shimbun id) + (push (shimbun-create-header + 0 (match-string 4) (format from genre) + (shimbun-make-date-string + (string-to-number (match-string 5)) + (string-to-number (match-string 6)) + (string-to-number (match-string 7))) + id "" 0 0 + (shimbun-expand-url (match-string 1) shimbun-yomiuri-url)) + headers)))) + headers)) + (luna-define-method shimbun-get-headers ((shimbun shimbun-yomiuri) &optional range) - (shimbun-yomiuri-get-headers shimbun)) + (if (string-equal (shimbun-current-group-internal shimbun) + "kyoiku.renaissance") + (shimbun-yomiuri-get-headers-kyoiku-renaissance shimbun) + (shimbun-yomiuri-get-headers shimbun))) (defun shimbun-yomiuri-prepare-article (shimbun header) - "Prepare an article: adjusting a date header if there is a correct -information available, removing useless contents, etc." - (let ((group (shimbun-current-group-internal shimbun)) - (case-fold-search t) - start) - (if (string-equal group "kyoiku") - (progn - (when (or (re-search-forward "\ -[\t\n ]*" - nil t) - (re-search-forward "\ -[\t\n ]*" - nil t)) - (delete-region (point-min) (point))) - (when (or (re-search-forward - "[\t\n ]*" - nil t) - (re-search-forward "[\t\n ]*\ -[\t\n ]*" - nil t) - (re-search-forward - "[\t\n ]*" - nil t)) - (delete-region (match-beginning 0) (point-max))) - (goto-char (point-min)) - (when (re-search-forward "\ -\\([\t\n ]*写真の拡大[\t\n ]*\ -]+>[\t\n ]*\\)" - nil t) - (delete-region (match-beginning 1) (match-end 1)))) - (when (and (re-search-forward (shimbun-content-start-internal shimbun) - nil t) - (setq start (point)) - (re-search-forward (shimbun-content-end-internal shimbun) - nil t)) - (narrow-to-region start (match-beginning 0)) - (goto-char (point-max)) - (forward-line -1) - (when (re-search-forward "\\(20[0-9][0-9]\\)/\\(1?[0-9]\\)/\ -\\([123]?[0-9]\\)/\\([012][0-9]:[0-5][0-9]\\)" - nil t) - (shimbun-header-set-date - header - (shimbun-make-date-string - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3)) - (match-string 4)))) - (goto-char (point-min)) - (shimbun-remove-tags "" - "") - ;; Break continuous lines. - (goto-char (point-min)) - (when (and (string-equal group "editorial") - (string-match " \\(よみうり寸評\\|編集手帳\\)\\'" - (shimbun-header-subject header 'no-encode))) - (goto-char (point-min)) - (while (search-forward "◆" nil t) - (replace-match "。
      \\&
      "))) - (widen)))) - (goto-char (point-min))) + (shimbun-with-narrowed-article + shimbun + ;; Correct Date header. + (when (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+")) + (concat + "" s0 + ;; 1. year + "\\(20[0-9][0-9]\\)" + s0 "年" s0 + ;; 2. month + "\\([01]?[0-9]\\)" + s0 "月" s0 + ;; 3. day + "\\([0-3]?[0-9]\\)" + s0 "日" s0 + ;; 4. hour + "\\([012]?[0-9]\\)" + s0 "時" s0 + ;; 5. minute + "\\([0-5]?[0-9]\\)" + s0 "分" s0 ""))) + nil t) + (shimbun-header-set-date + header + (shimbun-make-date-string + (string-to-number (match-string 1)) + (string-to-number (match-string 2)) + (string-to-number (match-string 3)) + (format "%02d:%02d" + (string-to-number (match-string 4)) + (string-to-number (match-string 5))))) + (goto-char (point-min))) + ;; Remove the フォトニュース, the 写真の拡大 buttons, etc. + (while (re-search-forward + (eval-when-compile + (let ((s0 "[\t\n ]*") + (s1 "[\t\n ]+") + (n1 "[^\t\n >]+")) + (concat + s0 + "\\(?:" + "" + "\\|" + "" + "\\|" + "\\(?:[^<>]+\\)?" + "]+>" s0 "
      " + "\\|" + "" s0 + "" s0 "
      " + "\\|" + s0 "rectangle(\"[^\"]+\");" s0 + "\\)" s0))) + nil t) + (delete-region (match-beginning 0) (match-end 0))) + (goto-char (point-min)) + ;; Replace 写真の拡大 with 写真. + (while (re-search-forward + (eval-when-compile + (let ((s1 "[\t\n ]+") + (n1 "[^\t\n >]+")) + (concat "" + "") + (goto-char (point-min)) + (let ((group (shimbun-current-group-internal shimbun))) + (cond ((string-equal group "editorial") + ;; Break continuous lines. + (when (string-match " \\(?:よみうり寸評\\|編集手帳\\)\\'" + (shimbun-header-subject header 'no-encode)) + (while (search-forward "◆" nil t) + (replace-match "。

      \n ")))) + ((string-equal group "entertainment") + ;; Remove trailing garbage. + (when (re-search-forward "[\t\n ]*\ +◇+

      -+>[\t\n ]*" + nil t) + (delete-region (match-beginning 0) (match-end 0))) + ;; Remove nav and track-back button, etc. + (shimbun-remove-tags + "[\t\n ]*" + "
      [\t\n ]*")))))) (luna-define-method shimbun-make-contents :before ((shimbun shimbun-yomiuri) header) (shimbun-yomiuri-prepare-article shimbun header)) +(luna-define-method shimbun-clear-contents :around ((shimbun shimbun-yomiuri) + header) + (when (luna-call-next-method) + (unless (shimbun-prefer-text-plain-internal shimbun) + (shimbun-break-long-japanese-lines)) + t)) + (provide 'sb-yomiuri) ;;; sb-yomiuri.el ends here Only in /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun: sb-zdnet-jp.el diff -ur --exclude=work --exclude='*texinfo*' --exclude=CVS --exclude='ChangeLog*' --exclude='README*' --exclude='*texi' work/emacs-w3m-1.4.4/shimbun/sb-zeit-de.el /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-zeit-de.el --- work/emacs-w3m-1.4.4/shimbun/sb-zeit-de.el 2005-03-24 09:43:32.000000000 +0900 +++ /export/CHROOT/usr/pkgsrc/wip/emacs-w3m-current/work/emacs-w3m/shimbun/sb-zeit-de.el 2010-11-04 13:32:04.000000000 +0900 @@ -1,6 +1,7 @@ ;;; sb-zeit-de.el --- shimbun backend for -;; Copyright (C) 2004, 2005 Andreas Seltenreich +;; Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 +;; Andreas Seltenreich ;; Author: Andreas Seltenreich ;; Keywords: news @@ -17,9 +18,15 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; Macro used to extract groups from the overview-page +;; (fset 'sb-zeit-de-macro [?\C-s ?d ?e ?/ ?\C-m ?\C- ?\C-a ?\C-w ?\" +;; ?\M-f ?\" ?\C-k ?\C-k ?\C-k return ?\C-k]) ;;; Code: @@ -29,13 +36,23 @@ (luna-define-class shimbun-zeit-de (shimbun-rss) ()) (defvar shimbun-zeit-de-groups - '("news")) + '("politik" "wirtschaft" "meinung" "gesellschaft" "kultur" + "wissen" "digital" "studium" "karriere" "lebensart" "reisen" + "auto" "sport" "blogs" "news")) + +(defvar shimbun-zeit-de-x-face-alist + '(("default" . "X-Face: +@u:6eD3Nq>u{P_Ev&\"A6eW=EA{5H[OqH;|oz7H>atafNFsUS-&7\ +%\\qo;KFS%E`=t5Z)'q~lhfl6<7rQ=]"))) + +(defvar shimbun-zeit-de-content-start + "title\">\\|\\(?:]+>\\)?") -(defvar shimbun-zeit-de-content-start "title\">") (defvar shimbun-zeit-de-content-end (concat "\\|\\|navigation[^><]*>[^A]\\|" - "\n" + "") + nil t) + (setq tmp (match-string 1)) + (delete-region (match-beginning 0) (match-end 0)) + (insert tmp)))) + +(defun w3m-filter-iframe (url) + (goto-char (point-min)) + (while (re-search-forward "