[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2 Reading web newspapers with Mew

Mew Shimbun is an Emacs Lisp program meant to be used with `shimbun' and Mew (version 2.1 and later). The `mew-shimbun' module will be installed together with emacs-w3m if Mew, APEL, and FLIM are also installed.

We recommend you also see 6.2 Reading HTML mails in Mew.

  1. Setting things up

    Put the following lines in the last of the `~/.mew.el' file:

     
    ;;; Loading mew-shimbun, defining keys.
    ;; (setq mew-shimbun-use-unseen t)              ;;; (10)
    (require 'mew-shimbun)
    (define-key mew-summary-mode-map "G"  (make-sparse-keymap))
    (define-key mew-summary-mode-map "Gg" 'mew-shimbun-goto-folder)
    (define-key mew-summary-mode-map "GG" 'mew-shimbun-goto-unseen-folder)
    (define-key mew-summary-mode-map "Gi" 'mew-shimbun-retrieve)
    (define-key mew-summary-mode-map "GI" 'mew-shimbun-retrieve-all)
    (define-key mew-summary-mode-map "Gr" 'mew-shimbun-re-retrieve)
    (define-key mew-summary-mode-map "GR" 'mew-shimbun-re-retrieve-all)
    (define-key mew-summary-mode-map "Ge" 'mew-shimbun-expire)
    (define-key mew-summary-mode-map "GE" 'mew-shimbun-expire-all)
    
    ;; Specifying `shimbun' servers and groups to be read with Mew in the
    ;; mew-shimbun-folder-groups variable.  Each element has the form
    ;; ("folder" ("server.group" . range) ...).  You can use all,
    ;; last, and a number for the range item.
    
    (setq mew-shimbun-folder-groups
          '(;; Fetching `yomiuri.shakai', `yomiuri.sports', etc.
            ;; into the `+shimbun/yomiuri' folder collectively.
            ("yomiuri"
             ("yomiuri.shakai" . 2)
             ("yomiuri.sports". 2)
             ("yomiuri.kokusai". 2))
            ;; Fetching `security-memo.memo'
            ;; into `+shimbun/security-memo'.
            ("security-memo"
             ("security-memo.memo" . 2))
            ("slashdot-jp"
             ("slashdot-jp.story" . last))
            ;; You can read several groups in one folder (`+shimbun/emacs')
            ;; as follows even if each group comes from a different server.
            ("emacs"
             ("airw.wl" . last)
             ("emacs-w3m.emacs-w3m" . last))
            ;; Fetching diaries into `+shimbun/hns/arisawa' and
            ;; `+shimbun/hns/miyoshi' respectively.
            ("hns/arisawa"
             ("hns.arisawa" . last))
            ("hns/miyoshi"
             ("hns.miyoshi" . last))))
    

    You did the fundamental setups. For the other user definable variables, use M-x customize-group for the mew-shimbun group or see the source code.

  2. Reading `shimbun' messages

    1. Getting started

      Type G I (mew-shimbun-retrieve-all) first, after setting things up as mentioned above. The `shimbun' folders specified by the mew-shimbun-folder-groups variable will be created under the `+shimbun' parent folder. Typing G I is also useful when you have added new groups. You can change the name of the parent folder (`+shimbun' by default) by customizing the mew-shimbun-folder variable.

    2. Moving into a `shimbun' folder

      You can move to any folder (including `shimbun') by typing g (mew-summary-goto-folder), but G g (mew-shimbun-goto-folder) is restricted to moving to only the `shimbun' folder. In addition, folders which have new messages (in other words, folders which have not been scanned) will be displayed when using a prefix argument with G g (i.e. C-u G g). A prefix argument similarly affects G G as well.

    3. Fetching messages in each folder

      You can fetch new messages for the current folder exclusively by typing G i (mew-shimbun-retrieve) in a `shimbun' folder.

    4. Fetching updated messages

      If you perform the G r command (mew-shimbun-re-retrieve) when a particular message is being displayed, the message will be updated if it is possible, and new messages will be fetched. With a prefix argument (i.e. C-u G r), it will attempt to update messages which are marked with the mark specified by the mew-shimbun-mark-re-retrieve variable (`@' by default). It would be useful for CNET, etc.

      The G R command (mew-shimbun-re-retrieve-all) checks the freshness of all messages and re-fetches the updated messages. If a prefix argument is given (i.e. C-u G R), the messages within the region will be processed. It is probably worthwhile if the site is running the hyper nikki system (`nikki' means "diary" in Japanese).

  3. Managing unseen messages

    If you have the following setting in the `~/.mew.el' file,

     
    (setq mew-shimbun-use-unseen t)
    

    newly fetched messages will be marked with the mark specified by the mew-shimbun-mark-unseen variable (`*' by default), and it will disappear automatically after reading the message.

    Normally, the unseen marks will not be saved in the `.mew-cache' file if scanning is not performed after adding or deleting marks in the Mew summary mode, but if you add the following line to the `~/.mew.el' file,

     
    (setq mew-shimbun-use-unseen-cache-save t)
    

    the unseen marks will be saved in the `.mew-cache' file automatically for the `shimbun' groups when exiting Mew or killing a folder (using C-c C-q). However, it is not securely saved (11). To do this securely, you had better have the habit of performing the `scan update' command after reading the folder.

    If you don't like the `*' mark for unseen messages, customize the mew-shimbun-mark-unseen variable (see above). By specifying the mark by C-u N, you will be able to lead a better life with taking care of unseen messages.

  4. Expiring messages

    You can expire messages if you set the mew-shimbun-expires variable beforehand. For example:

     
    (setq mew-shimbun-expires
          '(("yomiuri" . 7)
            ("asahi" . 1)
            ("slashdot-jp" . 7)
            ("emacs" . 7)))
    

    If you set this variable as shown above, you can specify the expiry period; 7 days for `+shimbun/yomiuri', 1 day for `+shimbun/asahi'. Messages in the `shimbun' folder where the expiry period is not specified will never be expired. You can use the G e command (mew-shimbun-expire) to expire the expirable messages in the current folder. The G E command (mew-shimbun-expire-all) is for expiring the expirable messages in all the `shimbun' folders. Note that once the messages have been expired, you cannot recover them.

  5. How to mark messages with `$' as unseen

    Put the following lines in the `~/.mew.el' file in order to define the `$' mark and use `$' for the mark of unseen. See http://www.mew.org/ml/mew-dist-2.0/msg01251.html if you would like to replace the `$' mark with another.

     
    ;;----------------------------------------------------------------------
    ;;; Code for using `$' as the unseen mark.
    (setq mew-mark-unseen ?$)
    (setq mew-shimbun-mark-unseen mew-mark-unseen)
    (setq mew-mark-show-list (cons mew-mark-unseen mew-mark-show-list))
    (setq mew-mark-afterstep-spec
          (cons (cons mew-mark-unseen '(1 0 1 0 0 0 0))
                mew-mark-afterstep-spec))
    (setq mew-mark-spec
          (cons (list mew-mark-unseen "unseen" 0 nil nil nil nil nil)
                mew-mark-spec))
    (setq mew-highlight-mark-keywords
          (cons
           (cons mew-mark-unseen 'mew-face-mark-unseen)
           mew-highlight-mark-keywords))
    (defface mew-face-mark-unseen
      '((((class color) (type tty))
         (:foreground "green"))
        (((class color) (background light))
         (:foreground "deep pink" :bold t :italic t))
        (((class color) (background dark))
         (:foreground "thistle"))
        (t (:bold t)))
      "*Face to highlight the unseen mark"
      :group 'mew-highlight)
    (defun mew-summary-unseen (&optional count)
      "Put the unseen mark(default is '$') in COUNT times."
      (interactive "P")
      (mew-mark-put-mark-loop (function mew-summary-unseen-one) count nil))
    (defun mew-summary-unseen-one (&optional no-msg)
      "Put the unseen mark(default is '$') on this message."
      (mew-mark-put-mark mew-mark-unseen no-msg))
    (defun mew-summary-mark-unseen ()
      "Change the '*' mark into the '$' mark."
      (interactive)
      (mew-summary-exchange-mark mew-mark-review mew-mark-unseen))
    (defun mew-thread-mark-unseen ()
      "Put the '$' mark on all messages of the current sub-thread."
      (interactive)
      (mew-thread-mark mew-mark-unseen))
    
    (define-key mew-summary-mode-map "$"  'mew-summary-unseen)
    (define-key mew-summary-mode-map "m$" 'mew-summary-mark-unseen)
    (define-key mew-summary-mode-map "t$" 'mew-thread-mark-unseen)
    ;;----------------------------------------------------------------------
    


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by TSUCHIYA Masatoshi on November, 3 2005 using texi2html