From 3c18a4de34d9f07f2719be1ef278466f26e1d531 Mon Sep 17 00:00:00 2001 From: bg66 Date: Fri, 16 Feb 2007 08:36:23 +0000 Subject: [PATCH] * mixi.el: Add autoload cookies. * .cvsignore: New file. * AUTHORS: Ditto. * COMPILE: Ditto. * Makefile.am: Ditto. * NEWS: Ditto. * README: Ditto. * acinclude.m4: Ditto. * configure.ac: Ditto. --- .cvsignore | 12 ++++ COMPILE | 77 +++++++++++++++++++++++ ChangeLog | 12 ++++ Makefile.am | 28 +++++++++ acinclude.m4 | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 15 +++++ mixi.el | 40 +++++++++--- 7 files changed, 371 insertions(+), 10 deletions(-) create mode 100644 .cvsignore create mode 100644 AUTHORS create mode 100644 COMPILE create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100644 acinclude.m4 create mode 100644 configure.ac diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..c00d69e --- /dev/null +++ b/.cvsignore @@ -0,0 +1,12 @@ +install-sh +missing +Makefile.in +Makefile +aclocal.m4 +autom4te.cache +configure +config.log +config.status +config.cache +COPYING +INSTALL diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COMPILE b/COMPILE new file mode 100644 index 0000000..38e3db9 --- /dev/null +++ b/COMPILE @@ -0,0 +1,77 @@ +;;; -*- Emacs-Lisp -*- + +(defun mixi-compile-modules (modules) + (let ((load-path (cons nil load-path)) + error-modules) + (while modules + (let ((source (expand-file-name (car modules)))) + (if (file-newer-than-file-p source (concat source "c")) + (condition-case error + (byte-compile-file source) + (error + (setq error-modules (cons (car modules) error-modules)))))) + (setq modules (cdr modules))) + (if error-modules + (princ (concat "\n\ + WARNING: --------------------------------------------------------- + WARNING: Couldn't compile following modules: + WARNING: + WARNING: " (mapconcat #'identity error-modules ", ") "\n\ + WARNING: + WARNING: You should probably stop here, try \"make distclean\" to clear + WARNING: the last build, and then reconfigure. + WARNING: ---------------------------------------------------------\n\n"))))) + +(defun mixi-install-modules (modules dest just-print) + (unless (or just-print (file-exists-p dest)) + (make-directory dest t)) + (while modules + (let ((name (car modules))) + (princ (format "%s -> %s\n" name dest)) + (unless just-print + (copy-file (expand-file-name name) + (expand-file-name name dest) + t t)) + (princ (format "%sc -> %s\n" name dest)) + (unless just-print + (if (file-exists-p (expand-file-name (concat name "c"))) + (copy-file (expand-file-name (concat name "c")) + (expand-file-name (concat name "c") dest) + t t) + (princ (format "(%s was not successfully compiled, ignored)\n" + name))))) + (setq modules (cdr modules)))) + +(defun mixi-install-just-print-p () + (let ((flag (getenv "MAKEFLAGS")) + case-fold-search) + (if flag + (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)))) + +(defun mixi-compile () + (mixi-compile-modules command-line-args-left)) + +(defun mixi-install () + (mixi-install-modules + (cdr command-line-args-left) + (expand-file-name "mixi" (car command-line-args-left)) + (mixi-install-just-print-p))) + +(defun mixi-compile-package () + (let ((modules (cdr command-line-args-left)) + command-line-args-left) + (setq autoload-package-name "mixi") + (add-to-list 'command-line-args-left ".") + (batch-update-directory) + (add-to-list 'command-line-args-left ".") + (Custom-make-dependencies) + (mixi-compile-modules + (append modules + '("auto-autoloads.el" "custom-load.el"))))) + +(defun mixi-install-package () + (mixi-install-modules + (append (cdr command-line-args-left) + '("auto-autoloads.el" "custom-load.el")) + (expand-file-name "lisp/mixi" (car command-line-args-left)) + (mixi-install-just-print-p))) diff --git a/ChangeLog b/ChangeLog index 5b83982..b693135 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2007-02-16 OHASHI Akira + * mixi.el: Add autoload cookies. + * .cvsignore: New file. + * AUTHORS: Ditto. + * COMPILE: Ditto. + * Makefile.am: Ditto. + * NEWS: Ditto. + * README: Ditto. + * acinclude.m4: Ditto. + * configure.ac: Ditto. + +2007-02-16 OHASHI Akira + * mixi-gnus.el: Avoid errors and warnings when compiling. * mixi-wl.el: Ditto. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..0b1070c --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +MODULES_MIXI = mixi.el +MODULES_ALL = $(MODULES_MIXI) sb-mixi.el mixi-gnus.el mixi-wl.el +EXTRA_DIST = COMPILE ChangeLog $(MODULES_ALL) +CLEANFILES = auto-autoloads.el custom-load.el *.elc +AUTOMAKE_OPTIONS = no-dependencies + +FLAGS ?= -batch -q -no-site-file + +if HAVE_SHIMBUN +MODULES = $(MODULES_ALL) +else +MODULES = $(MODULES_MIXI) +endif + +all: elc + +elc: + $(EMACS) $(FLAGS) -l COMPILE -f mixi-compile $(MODULES) + +install: elc + $(EMACS) $(FLAGS) -l COMPILE -f mixi-install $(lispdir) $(MODULES) + +package: + $(XEMACS) $(FLAGS) -l COMPILE -f mixi-compile-package $(MODULES) + +install-package: package + $(XEMACS) $(FLAGS) -l COMPILE -f mixi-install-package $(PACKAGEDIR) \ + $(MODULES) diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..f1fd3b2 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,197 @@ +AC_DEFUN([AC_CHECK_EMACS], + [dnl Check for Emacsen. + + dnl Apparently, if you run a shell window in Emacs, it sets the EMACS + dnl environment variable to 't'. Lets undo the damage. + test "$EMACS" = t && EMACS= + + dnl Ignore cache. + unset ac_cv_prog_EMACS; unset ac_cv_prog_XEMACS; + + AC_ARG_WITH(emacs, + [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]], + [if test "$withval" = yes -o -z "$withval"; then + AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs) + else + AC_CHECK_PROG(EMACS, $withval, $withval, emacs) + fi]) + AC_ARG_WITH(xemacs, + [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]], + [if test "$withval" = yes -o -z "$withval"; then + AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs) + else + AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs) + fi + EMACS=$XEMACS], + [XEMACS=xemacs + test -z "$EMACS" && AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)]) + AC_SUBST(EMACS) + AC_SUBST(XEMACS)]) + +AC_DEFUN([AC_EMACS_LISP], [ +elisp="$2" +if test -z "$3"; then + AC_MSG_CHECKING(for $1) +fi +AC_CACHE_VAL(EMACS_cv_SYS_$1,[ + OUTPUT=./conftest-$$ + echo ${EMACS}' -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}' -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 + if test -f ${OUTPUT}; then + retval=`cat ${OUTPUT}` + echo "=> ${retval}" >& AC_FD_CC 2>&1 + rm -f ${OUTPUT} + EMACS_cv_SYS_$1=$retval + else + EMACS_cv_SYS_$1= + fi +]) +$1=${EMACS_cv_SYS_$1} +if test -z "$3"; then + AC_MSG_RESULT($$1) +fi +]) + +AC_DEFUN([AC_CHECK_EMACS_FLAVOR], + [AC_MSG_CHECKING([what flavor does $EMACS have]) + + dnl Ignore cache. + unset EMACS_cv_SYS_flavor; + + AC_EMACS_LISP(flavor, + (cond ((featurep (quote xemacs)) \"XEmacs\")\ + ((boundp (quote MULE)) \"MULE\")\ + (t \"FSF Emacs\")), + "noecho") + case $EMACS_cv_SYS_flavor in + XEmacs) + EMACS_FLAVOR=xemacs;; + MULE) + EMACS_FLAVOR=mule;; + *) + EMACS_FLAVOR=emacs;; + esac + AC_MSG_RESULT($EMACS_cv_SYS_flavor)]) + +AC_DEFUN([AC_PATH_LISPDIR], [ + AC_CHECK_EMACS_FLAVOR + if test "$prefix" = NONE; then + AC_MSG_CHECKING([prefix for your Emacs]) + AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho") + prefix=${EMACS_cv_SYS_prefix} + AC_MSG_RESULT($prefix) + fi + AC_ARG_WITH(lispdir, + [ --with-lispdir=DIR Where to install lisp files + (for XEmacs package, use --with-packagedir instead)], + lispdir=${withval}) + AC_MSG_CHECKING([where lisp files should go]) + if test -z "$lispdir"; then + dnl Set default value + theprefix=$prefix + if test "$theprefix" = NONE; then + theprefix=$ac_default_prefix + fi + lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lis" + for thedir in share lib; do + potential= + if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then + lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp" + break + fi + done + fi + if test ${EMACS_FLAVOR} = xemacs; then + AC_MSG_RESULT([$lispdir + (it will be ignored when \"make install-package[[-ja]]\" is done)]) + else + AC_MSG_RESULT([$lispdir]) + fi + AC_SUBST(lispdir) +]) + +dnl +dnl Perform sanity checking and try to locate the Shimbun package +dnl +AC_DEFUN([AC_CHECK_SHIMBUN], [ + AC_MSG_CHECKING(for shimbun) + + dnl Ignore cache. + unset EMACS_cv_SYS_shimbun_dir; + + AC_ARG_WITH(shimbun,[ --with-shimbun[[=ARG]] Use shimbun [[ARG=yes]]], + [if test "$withval" = yes -o -z "$withval"; then + HAVE_SHIMBUN=yes + else + HAVE_SHIMBUN=$withval + fi], HAVE_SHIMBUN=yes) + AC_SUBST(HAVE_SHIMBUN) + + if test "${HAVE_SHIMBUN}" = yes; then + AC_EMACS_LISP(shimbun_dir,(file-name-directory (locate-library \"shimbun\")),"noecho") + SHIMBUN_DIR=$EMACS_cv_SYS_shimbun_dir + fi + + if test "${HAVE_SHIMBUN}" != yes; then + AC_MSG_RESULT(no) + elif test -z "${SHIMBUN_DIR}"; then + HAVE_SHIMBUN=no + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT(${HAVE_SHIMBUN}) + fi +]) + +AC_DEFUN([AC_EXAMINE_PACKAGEDIR], + [dnl Examine PACKAGEDIR. + AC_EMACS_LISP(PACKAGEDIR, + (let (package-dir)\ + (if (boundp (quote early-packages))\ + (let ((dirs (delq nil (append (if early-package-load-path\ + early-packages)\ + (if late-package-load-path\ + late-packages)\ + (if last-package-load-path\ + last-packages)))))\ + (while (and dirs (not package-dir))\ + (if (file-directory-p (car dirs))\ + (setq package-dir (car dirs)\ + dirs (cdr dirs))))))\ + (or package-dir \"\")), + "noecho")]) + +AC_DEFUN([AC_PATH_PACKAGEDIR], + [dnl Check for PACKAGEDIR. + if test ${EMACS_FLAVOR} = xemacs; then + AC_MSG_CHECKING([where the XEmacs package is]) + AC_ARG_WITH(packagedir, + [ --with-packagedir=DIR package DIR for XEmacs], + [if test "$withval" != yes -a -n "$withval"; then + PACKAGEDIR=$withval + else + AC_EXAMINE_PACKAGEDIR + fi], + AC_EXAMINE_PACKAGEDIR) + if test -z "$PACKAGEDIR"; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PACKAGEDIR) + fi + else + PACKAGEDIR= + fi + AC_SUBST(PACKAGEDIR)]) + +AC_DEFUN([AC_ADD_LOAD_PATH], + [dnl Check for additional load path. + AC_ARG_WITH(addpath, + [ --with-addpath=PATH search Emacs-Lisp libraries with PATH + use colons to separate directory names], + [if test "$withval" != yes -a -n "$withval"; then + AC_MSG_CHECKING([where to find the additional elisp libraries]) + ADDITIONAL_LOAD_PATH=$withval + AC_MSG_RESULT($ADDITIONAL_LOAD_PATH) + fi], + ADDITIONAL_LOAD_PATH=) + AC_SUBST(ADDITIONAL_LOAD_PATH)]) + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..bcc8308 --- /dev/null +++ b/configure.ac @@ -0,0 +1,15 @@ +AC_INIT +AC_PREREQ(2.59) +AC_CONFIG_SRCDIR([mixi.el]) +AM_INIT_AUTOMAKE(mixi, 1.0.0) + +AC_CHECK_EMACS +AC_PATH_LISPDIR +AC_PATH_PACKAGEDIR + +AC_CHECK_SHIMBUN + +AM_CONDITIONAL(HAVE_SHIMBUN, test "${HAVE_SHIMBUN}" = yes) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/mixi.el b/mixi.el index 4242d5c..1ecf419 100644 --- a/mixi.el +++ b/mixi.el @@ -1030,6 +1030,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-friend-list-nick-regexp "\\(.+\\)¤µ¤ó([0-9]+)
") +;;;###autoload (defun mixi-get-friends (&rest friend-or-range) "Get friends of FRIEND." (when (> (length friend-or-range) 2) @@ -1066,6 +1067,7 @@ Increase this value when unexpected error frequently occurs." "̾  Á° \\(.+\\)") +;;;###autoload (defun mixi-get-favorites (&optional range) "Get favorites." (let ((ids (mixi-get-matched-items (mixi-favorite-list-page) @@ -1108,6 +1110,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-log-list-regexp "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) \\(.*\\)") +;;;###autoload (defun mixi-get-logs (&optional range) "Get logs." (let ((items (mixi-get-matched-items (mixi-log-list-page) @@ -1261,6 +1264,7 @@ Increase this value when unexpected error frequently occurs." \\([0-9]+\\)·î\\([0-9]+\\)Æü
\\([0-9]+\\):\\([0-9]+\\)
\\(
\\|\\)  \\(.*\\)") +;;;###autoload (defun mixi-get-diaries (&rest friend-or-range) "Get diaries of FRIEND." (when (> (length friend-or-range) 2) @@ -1299,6 +1303,7 @@ Increase this value when unexpected error frequently occurs." "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) \\(.+\\) (\\(.*\\)) ") +;;;###autoload (defun mixi-get-new-diaries (&optional range) "Get new diaries." (let ((items (mixi-get-matched-items (mixi-new-diary-list-page) @@ -1343,6 +1348,7 @@ Increase this value when unexpected error frequently occurs." ") +;;;###autoload (defun mixi-search-diaries (keyword &optional range) (let ((items (mixi-get-matched-items (mixi-search-diary-list-page keyword) mixi-search-diary-list-regexp @@ -1375,6 +1381,7 @@ Increase this value when unexpected error frequently occurs." "\\(ºîÀ®\\|½ñ¤­¹þ¤ß\\)¤¬´°Î»¤·¤Þ¤·¤¿¡£È¿±Ç¤Ë»þ´Ö¤¬¤«¤«¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¾¯¡¹¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£") ;; FIXME: Support photos. +;;;###autoload (defun mixi-post-diary (title content) "Post a diary." (unless (stringp title) @@ -1618,6 +1625,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-community-list-name-regexp "\\(.+\\)([0-9]+)") +;;;###autoload (defun mixi-get-communities (&rest friend-or-range) "Get communities of FRIEND." (when (> (length friend-or-range) 2) @@ -1655,6 +1663,7 @@ Increase this value when unexpected error frequently occurs." \\([^<]+\\)") ;; FIXME: Support category. +;;;###autoload (defun mixi-search-communities (keyword &optional range) (let ((items (mixi-get-matched-items (mixi-search-community-list-page keyword) @@ -1814,6 +1823,7 @@ Increase this value when unexpected error frequently occurs." `(concat "/add_bbs.pl?id=" (mixi-community-id community))) ;; FIXME: Support photos. +;;;###autoload (defun mixi-post-topic (community title content) "Post a topic to COMMUNITY." (unless (mixi-community-p community) @@ -2124,6 +2134,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-bbs-list-regexp "") +;;;###autoload (defun mixi-get-new-bbses (&optional range) "Get new topics." (let ((items (mixi-get-matched-items (mixi-new-bbs-list-page) @@ -2176,6 +2188,7 @@ Increase this value when unexpected error frequently occurs." "¾ÜºÙ¤ò¸«¤ë") ;; FIXME: Support community and category. +;;;###autoload (defun mixi-search-bbses (keyword &optional range) (let ((items (mixi-get-matched-items (mixi-search-bbs-list-page keyword) mixi-search-bbs-list-regexp @@ -2333,6 +2346,7 @@ Increase this value when unexpected error frequently occurs." ") +;;;###autoload (defun mixi-get-comments (parent &optional range) "Get comments of PARENT." (unless (mixi-parent-p parent) @@ -2366,23 +2380,24 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-new-comment-list-regexp "") +;;;###autoload (defun mixi-get-new-comments (&optional range) "Get new comments." (let ((items (mixi-get-matched-items (mixi-new-comment-list-page) - mixi-new-comment-list-regexp - range))) + mixi-new-comment-list-regexp + range))) (delq nil - (mapcar (lambda (item) - (let* ((diary (mixi-make-diary - (mixi-make-friend (nth 1 item)) + (mapcar (lambda (item) + (let* ((diary (mixi-make-diary + (mixi-make-friend (nth 1 item)) (nth 0 item))) - (comment-count (mixi-diary-comment-count diary)) + (comment-count (mixi-diary-comment-count diary)) (count (string-to-number (nth 2 item)))) - (when (or (null comment-count) - (< comment-count count)) + (when (or (null comment-count) + (< comment-count count)) (mixi-diary-set-comment-count diary count) - diary))) - items)))) + diary))) + items)))) (defun mixi-post-diary-comment-page (diary) (concat "/add_comment.pl?&diary_id=" (mixi-diary-id diary))) @@ -2396,6 +2411,7 @@ Increase this value when unexpected error frequently occurs." "&comm_id=" (mixi-community-id (mixi-event-community event)))) ;; FIXME: Support photos. +;;;###autoload (defun mixi-post-comment (parent content) "Post a comment to PARENT." (unless (mixi-object-p parent) @@ -2570,6 +2586,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-message-list-regexp "") +;;;###autoload (defun mixi-get-messages (&rest box-or-range) "Get messages of BOX." (when (> (length box-or-range) 2) @@ -2599,6 +2616,7 @@ Increase this value when unexpected error frequently occurs." (defconst mixi-post-message-succeed-regexp "Á÷¿®´°Î»¤·¤Þ¤·¤¿¡£") +;;;###autoload (defun mixi-post-message (friend title content) "Post a message to FRIEND." (unless (mixi-friend-p friend) @@ -2695,6 +2713,7 @@ Increase this value when unexpected error frequently occurs." ") +;;;###autoload (defun mixi-get-introductions (&rest friend-or-range) "Get introductions of FRIEND." (when (> (length friend-or-range) 2) @@ -2897,6 +2916,7 @@ Increase this value when unexpected error frequently occurs." \\(.+\\) \\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)") +;;;###autoload (defun mixi-get-news (category sort &optional range) "Get news of CATEGORY and SORT." (unless (mixi-news-category-p category) -- 1.7.10.4