Reply to topic  [ 2 posts ] 
Yorick in Emacs >= 24 [SOLVED] 
Author Message
Yorick Guru

Joined: Wed Nov 24, 2004 12:51 pm
Posts: 97
Location: Observatoire de Lyon (France)
Post Yorick in Emacs >= 24 [SOLVED]
Yorick mode does not work in Emacs 24, because make-local-hook became obsolete (in fact it is obsolete since Emacs 21.1) the work is done automatically by add-hook. I have modified yorick.el to fix this (and hopefully maintain compatibility with older versions of Emacs). Below are the differences (output of command diff -p):
Code:
*** yorick.el.orig     2011-04-04 18:03:03.000000000 +0200
--- yorick.el   2013-05-15 09:13:56.471311836 +0200
***************
*** 271,278 ****
  ;;    do not exist at all in emacs 19.28, so 19.29 is the earliest version
  ;;    that will work at all.
 
! (if (not (fboundp 'make-local-hook))
!     (error "You need at least emacs 19.29, preferably 19.34, for yorick.el"))
  ;; try to get rid of c-mode if it was loaded instead of cc-mode (19.29)
  ;; this may be antisocial, but cc-mode really is better
  (if (not (and (featurep 'c-mode) (not (featurep 'cc-mode)))) nil
--- 271,281 ----
  ;;    do not exist at all in emacs 19.28, so 19.29 is the earliest version
  ;;    that will work at all.
 
! (if (or (< emacs-major-version 19)
!       (and (= emacs-major-version 19) (< emacs-minor-version 29)))
!     (error "You need at least emacs 19.29, preferably 19.34, for yorick.el")
!     (message "Your Emacs version is OK"))
!
  ;; try to get rid of c-mode if it was loaded instead of cc-mode (19.29)
  ;; this may be antisocial, but cc-mode really is better
  (if (not (and (featurep 'c-mode) (not (featurep 'cc-mode)))) nil
*************** Key bindings:
*** 678,684 ****
        (add-hook 'comint-input-filter-functions
                  'shell-directory-tracker nil t)))
    (setq yoterm-histbuf (generate-new-buffer (concat (buffer-name) "H")))
!   (make-local-hook 'kill-buffer-hook)
    (add-hook 'kill-buffer-hook 'yoterm-killbuf nil t)
    (let ((buf (current-buffer)))
      (save-excursion
--- 681,691 ----
        (add-hook 'comint-input-filter-functions
                  'shell-directory-tracker nil t)))
    (setq yoterm-histbuf (generate-new-buffer (concat (buffer-name) "H")))
!   ;; make-local-hook is obsolete since Emacs 21.1, the work is done
!   ;; automatically by add-hook
!   (if (or (< emacs-major-version 21)
!       (and (= emacs-major-version 21) (< emacs-minor-version 1)))
!       (make-local-hook 'kill-buffer-hook))
    (add-hook 'kill-buffer-hook 'yoterm-killbuf nil t)
    (let ((buf (current-buffer)))
      (save-excursion


Wed May 15, 2013 12:22 am
Profile WWW
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post Re: Yorick in Emacs >= 24 [SOLVED]
This should be fixed with commit 99aec6e444 to github.com/dhmunro/yorick.


Fri May 17, 2013 8:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.