emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/woman.el


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/woman.el
Date: Wed, 07 Sep 2005 17:23:43 -0400

Index: emacs/lisp/woman.el
diff -c emacs/lisp/woman.el:1.33 emacs/lisp/woman.el:1.34
*** emacs/lisp/woman.el:1.33    Sat Aug  6 22:13:43 2005
--- emacs/lisp/woman.el Wed Sep  7 21:23:34 2005
***************
*** 1741,1747 ****
    (define-key woman-mode-map "w" 'woman)
    (define-key woman-mode-map "\en" 'WoMan-next-manpage)
    (define-key woman-mode-map "\ep" 'WoMan-previous-manpage)
!   (define-key woman-mode-map [M-mouse-2] 'woman-follow-word))
  
  (defun woman-follow-word (event)
    "Run WoMan with word under mouse as topic.
--- 1741,1750 ----
    (define-key woman-mode-map "w" 'woman)
    (define-key woman-mode-map "\en" 'WoMan-next-manpage)
    (define-key woman-mode-map "\ep" 'WoMan-previous-manpage)
!   (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)
! 
!   ;; We don't need to call `man' when we are in `woman-mode'.
!   (define-key woman-mode-map [remap man] 'woman))
  
  (defun woman-follow-word (event)
    "Run WoMan with word under mouse as topic.
***************
*** 1942,1966 ****
  (defvar WoMan-Man-start-time nil
    "Used to record formatting time used by the `man' command.")
  
! (defadvice Man-getpage-in-background
!   (around Man-getpage-in-background-advice (topic) activate)
!   "Use WoMan unless invoked outside a WoMan buffer or invoked explicitly.
! Otherwise use Man and record start of formatting time."
!   (if (and (eq major-mode 'woman-mode)
!          (not (eq (caar command-history) 'man)))
!       (WoMan-getpage-in-background topic)
!     ;; Initiates man processing
!     (setq WoMan-Man-start-time (current-time))
!     ad-do-it))
! 
! (defadvice Man-bgproc-sentinel
!   (after Man-bgproc-sentinel-advice activate)
!   ;; Terminates man processing
!   "Report formatting time."
!   (let* ((time (current-time))
!        (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536)
!                 (- (cadr time) (cadr WoMan-Man-start-time)))))
!     (message "Man formatting done in %d seconds" time)))
  
  
  ;;; Buffer handling:
--- 1945,1977 ----
  (defvar WoMan-Man-start-time nil
    "Used to record formatting time used by the `man' command.")
  
! ;; Both advices are disabled because "a file in Emacs should not put
! ;; advice on a function in Emacs" (see Info node "(elisp)Advising
! ;; Functions").  Counting the formatting time is useful for
! ;; developping, but less applicable for daily use.  The advice for
! ;; `Man-getpage-in-background' can be discarded, because the
! ;; key-binding in `woman-mode-map' has been remapped to call `woman'
! ;; but `man'.  Michael Albinus <address@hidden>
! 
! ;; (defadvice Man-getpage-in-background
! ;;   (around Man-getpage-in-background-advice (topic) activate)
! ;;   "Use WoMan unless invoked outside a WoMan buffer or invoked explicitly.
! ;; Otherwise use Man and record start of formatting time."
! ;;   (if (and (eq major-mode 'woman-mode)
! ;;       (not (eq (caar command-history) 'man)))
! ;;       (WoMan-getpage-in-background topic)
! ;;     ;; Initiates man processing
! ;;     (setq WoMan-Man-start-time (current-time))
! ;;     ad-do-it))
! 
! ;; (defadvice Man-bgproc-sentinel
! ;;   (after Man-bgproc-sentinel-advice activate)
! ;;   ;; Terminates man processing
! ;;   "Report formatting time."
! ;;   (let* ((time (current-time))
! ;;     (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536)
! ;;              (- (cadr time) (cadr WoMan-Man-start-time)))))
! ;;     (message "Man formatting done in %d seconds" time)))
  
  
  ;;; Buffer handling:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]