namazu-dev(ring)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

namazu.el patch for GNU Emacs 19.28



namazu.el を GNU Emacs 19.28 で動かすためのパッチです。

変更点は、下記のとおりです。

(1)replace-match を使わないようにした。元のコードに戻しただけ。

(2)font-lock-reference-face が未定義の場合に、他の face で代用するよう
   にした。

(3)font-lock の face をクォートした。クォートなしでも大丈夫そうだが、
   クォートするのが正しいと考えた。

(4)font-lock の初期化方法を、Emacs のバージョンではなく、
   font-lock-defaults の定義状態に応じて変更するようにした。


(4)については、ちょっと自信がないのですが、よろしいでしょうか?

なお、
Mule for Windows (GNU Emacs 19.28)
Meadow 1.10 (GNU Emacs 20.4)
で動作確認済みです。


*** namazu.el.orig	Wed Jan 19 17:46:24 2000
--- namazu.el	Wed Jan 19 23:44:56 2000
***************
*** 583,590 ****
        (let ((url (buffer-substring (match-beginning 1) (match-end 1))))
          (beginning-of-line)
          (sit-for 0)
!         (and (string-match "^/\\([a-zA-Z]\\)|" url) ;; if DOS/Windows /c|...
!              (setq url (replace-match "\\1:" t nil url)))
          (let ((ext '("" ".gz" ".Z" "bz2")) 
                (fl namazu-view-function-alist)
                (file url) (name "") path done)
--- 583,594 ----
        (let ((url (buffer-substring (match-beginning 1) (match-end 1))))
          (beginning-of-line)
          (sit-for 0)
!         (and (string-match "^/\\([a-zA-Z]\\)|\\(/.*\\)$" url)
! 	     ;; if DOS/Windows /c|...
! 	     (setq url
! 		   (concat (substring url (match-beginning 1) (match-end 1))
! 			   ":"
! 			   (substring url (match-beginning 2) (match-end 2)))))
          (let ((ext '("" ".gz" ".Z" "bz2")) 
                (fl namazu-view-function-alist)
                (file url) (name "") path done)
***************
*** 681,710 ****
   ((featurep 'font-lock)
    (or (boundp 'font-lock-variable-name-face)
        (setq font-lock-variable-name-face font-lock-type-face))
    (defvar namazu-font-lock-keywords
      (list
!      (list namazu-output-title-pattern         1 font-lock-comment-face)
!      (list namazu-output-title-pattern         2 font-lock-keyword-face)
!      (list namazu-output-title-pattern         3 font-lock-reference-face)
!      (list namazu-output-header-pattern        1 font-lock-variable-name-face)
!      (list namazu-output-url-pattern           1 font-lock-function-name-face)
!      (list namazu-output-url-pattern           3 font-lock-type-face)
!      (list namazu-output-current-list-pattern  0 font-lock-comment-face)
!      (list namazu-output-pages-pattern         0 font-lock-comment-face))
      "Namazu での検索結果にお化粧をするための設定です. ")
!   (if (and (>= (string-to-int emacs-version) 19)
! 	   (not (featurep 'xemacs)))
!       (add-hook
!        'namazu-display-hook
!        (lambda ()
! 	 (make-local-variable 'font-lock-defaults)
! 	 (setq font-lock-defaults
! 	       '((namazu-font-lock-keywords) t))
! 	 (font-lock-mode 1)))
!     (add-hook 'namazu-display-hook
!              (lambda ()
!                (setq font-lock-keywords namazu-font-lock-keywords)
!                (font-lock-mode 1)))))
   ((featurep 'hilit19)
    (hilit-set-mode-patterns
     'namazu-mode
--- 685,715 ----
   ((featurep 'font-lock)
    (or (boundp 'font-lock-variable-name-face)
        (setq font-lock-variable-name-face font-lock-type-face))
+   (or (boundp 'font-lock-reference-face)
+       (setq font-lock-reference-face font-lock-function-name-face))
    (defvar namazu-font-lock-keywords
      (list
!      (list namazu-output-title-pattern         1 'font-lock-comment-face)
!      (list namazu-output-title-pattern         2 'font-lock-keyword-face)
!      (list namazu-output-title-pattern         3 'font-lock-reference-face)
!      (list namazu-output-header-pattern        1 'font-lock-variable-name-face)
!      (list namazu-output-url-pattern           1 'font-lock-function-name-face)
!      (list namazu-output-url-pattern           3 'font-lock-type-face)
!      (list namazu-output-current-list-pattern  0 'font-lock-comment-face)
!      (list namazu-output-pages-pattern         0 'font-lock-comment-face))
      "Namazu での検索結果にお化粧をするための設定です. ")
!     (if (boundp 'font-lock-defaults)
! 	(add-hook
! 	 'namazu-display-hook
! 	 (lambda ()
! 	   (make-local-variable 'font-lock-defaults)
! 	   (setq font-lock-defaults
! 		 '((namazu-font-lock-keywords) t))
! 	   (font-lock-mode 1)))
!       (add-hook 'namazu-display-hook
! 		(lambda ()
! 		  (setq font-lock-keywords namazu-font-lock-keywords)
! 		  (font-lock-mode 1)))))
   ((featurep 'hilit19)
    (hilit-set-mode-patterns
     'namazu-mode


--
三好 雅則 mailto:miyoshi@xxxxxxxxx
          http://www.ask.ne.jp/~miyoshi/ (Meadow のページ作成中)