From F.Pierresteguy@frcl.bull.fr Wed Jun  1 10:39:24 1994
Received: from clbull.frcl.bull.fr (clbull.frcl.bull.fr [129.182.1.17]) by godot.lysator.liu.se (8.6.8.1/8.6.6) with SMTP id KAA25742 for <ceder@lysator.liu.se>; Wed, 1 Jun 1994 10:39:06 +0200
From: F.Pierresteguy@frcl.bull.fr
Received: from agate.frcl.bull.fr by clbull.frcl.bull.fr; Wed, 1 Jun 1994 10:37:20 +0200 (MET)
Received: by agate.frcl.bull.fr; Wed, 1 Jun 94 10:38:13 +0200 (MET)
Received: by papayer (AIX 3.2/UCB 5.64/4.03)
          id AA15626; Wed, 1 Jun 1994 10:39:28 +0200
Date: Wed, 1 Jun 1994 10:39:28 +0200
Message-Id: <9406010839.AA15626@papayer>
To: ceder@lysator.liu.se
Cc: pierrest@frcl.bull.fr
Subject: ##pcl-cvs-bug-143## Patch for emacs 19 support for pcl-cvs
Return-Receipt-To: 
Reply-To: F.Pierresteguy@frcl.bull.fr

Hi Per,
I written the emacs 19 support (from 19.23) to your package pcl-cvs. It
provides the same things than the one for Lucid.

This would be useful to merge them to the standard distibution.

thanks,
-Fred

*** pcl-cvs.el    Tue May 31 13:17:33 1994
--- /usr/triton/lib/emacs/site-lisp/pcl-cvs.el  Tue May 31 18:05:12 1994
*************** If second optional argument REVISION is 
*** 2204,2206 ****
--- 2204,2211 ----
      (progn
        (autoload 'pcl-cvs-fontify "pcl-cvs-lucid")
        (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
+ 
+ (if (string-match "^19" emacs-version)
+     (progn
+       (autoload 'pcl-cvs-fontify "pcl-cvs-e19")
+       (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
*** /dev/null        Wed Jun  1 09:09:36 1994
--- /usr/triton/lib/emacs/site-lisp/pcl-cvs-e19.el      Wed Jun  1 10:28:56 1994
***************
*** 0 ****
--- 1,166 ----
+ ;;; Mouse and font support for PCL-CVS 1.3 running in GNU Emacs-19
+ ;; @(#) Id: pcl-cvs-lucid.el,v 1.2 1993/05/31 19:37:34 ceder Exp 
+ ;; Copyright (C) 1992-1993 Free Software Foundation, Inc.
+ 
+ ;; This file is part of GNU Emacs.
+ 
+ ;; GNU Emacs is free software; you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation; either version 2, or (at your option)
+ ;; any later version.
+ 
+ ;; GNU Emacs is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ;; GNU General Public License for more details.
+ 
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with GNU Emacs; see the file COPYING.  If not, write to
+ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+ 
+ ;; This simply adds a menu of the common CVS commands to the menubar and to
+ ;; the right mouse button.  Clicking right moves point, and then pops up a
+ ;; menu from which commands can be executed.
+ ;; 
+ ;; This could stand to be a lot more clever: for example, the "Commit Changes"
+ ;; command should only be active on files for which there is something to
+ ;; commit.  Also, some indication of which files the command applies to
+ ;; (especially in the presence of multiple marked files) would be nice.
+ ;;
+ ;; Middle-click runs find-file.
+ 
+ ;; Rewritten for Emacs 19 by Fred Pierresteguy
+ 
+ 
+ (require 'pcl-cvs)
+ (require 'lmenu)
+ 
+ ;; Set up the menu-bar
+ (define-key cvs-mode-map [menu-bar cvs-menu]
+   (cons "CVS" (make-sparse-keymap "CVS")))
+ 
+ (define-key cvs-mode-map [menu-bar cvs-menu bury-buffer]
+   '("Quit" . bury-buffer))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-separator1]
+   '("----" . nil))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-unmark-all-files]
+   '("Unmark All Files" . cvs-mode-unmark-all-files))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-mark-all-files]
+   '("Mark All Files" . cvs-mode-mark-all-files))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-unmark]
+   '("Unmark File" . cvs-mode-unmark))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-mark]
+   '("Mark File" . cvs-mode-mark))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-separator2]
+   '("----" . nil))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-status]
+   '("Show CVS Status" . cvs-mode-status))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-log]
+   '("Show CVS Log" . cvs-mode-log))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-add-change-log-entry-other-window]
+   '("Add ChangeLog Entry" . cvs-mode-add-change-log-entry-other-window))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-separator3]
+   '("----" . nil))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-remove-handled]
+   '("Hide Handled Files" . cvs-mode-remove-handled))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-acknowledge]
+   '("Hide File" . cvs-mode-acknowledge))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-ignore]
+   '("Ignore File" . cvs-mode-ignore))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-remove-file]
+   '("Remove File from Repository" . cvs-mode-remove-file))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-add]
+   '("Add File to Repository" . cvs-mode-add))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-undo-local-changes]
+   '("Revert File from Repository" . cvs-mode-undo-local-changes))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-commit]
+   '("Commit Changes to Repository" . cvs-mode-commit))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-separator4]
+   '("----" . nil))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-diff-backup]
+   '("Diff against Backup Version" . cvs-mode-diff-backup))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-diff-cvs]
+   '("Diff against Repository" . cvs-mode-diff-cvs))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-emerge]
+   '("Interactively Merge (emerge)" . cvs-mode-emerge))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-find-file-other-window]
+   '("Find File Other Window" . cvs-mode-find-file-other-window))
+ (define-key cvs-mode-map [menu-bar cvs-menu cvs-mode-find-file]
+   '("Find File"   . cvs-mode-find-file))
+ 
+ (defvar cvs-menu
+   '("CVS"
+     ["Find File"                        cvs-mode-find-file              t]
+     ["Find File Other Window"               cvs-mode-find-file-other-window t]
+     ["Interactively Merge (emerge)" cvs-mode-emerge                 t]
+     ["Diff against Repository"              cvs-mode-diff-cvs               t]
+     ["Diff against Backup Version"  cvs-mode-diff-backup            t]
+     "----"
+     ["Commit Changes to Repository"     cvs-mode-commit                 t]
+     ["Revert File from Repository"  cvs-mode-undo-local-changes     t]
+     ["Add File to Repository"               cvs-mode-add                    t]
+     ["Remove File from Repository"  cvs-mode-remove-file            t]
+     ["Ignore File"                  cvs-mode-ignore                 t]
+     ["Hide File"                    cvs-mode-acknowledge            t]
+     ["Hide Handled Files"           cvs-mode-remove-handled         t]
+     "----"
+     ["Add ChangeLog Entry"      cvs-mode-add-change-log-entry-other-window t]
+     ["Show CVS Log"                      cvs-mode-log                    t]
+     ["Show CVS Status"                      cvs-mode-status                 t]
+     "----"
+     ["Mark File"                        cvs-mode-mark                   t]
+     ["Unmark File"                  cvs-mode-unmark                 t]
+     ["Mark All Files"                       cvs-mode-mark-all-files         t]
+     ["Unmark All Files"                     cvs-mode-unmark-all-files       t]
+     "----"
+     ["Quit"                             bury-buffer                     t]
+     ))
+ 
+ (defun cvs-menu (e)
+   (interactive "e")
+   (mouse-set-point e)
+   (beginning-of-line)
+   (or (looking-at "^[* ] ") (error "No CVS file line here"))
+   (popup-menu cvs-menu))
+ 
+ (defun cvs-mouse-find-file (e)
+   (interactive "e")
+   (mouse-set-point e)
+   (beginning-of-line)
+   (or (looking-at "^[* ] ") (error "No CVS file line here"))
+   (cvs-mode-find-file (point)))
+ 
+ (define-key cvs-mode-map [down-mouse-3] 'cvs-menu)
+ (define-key cvs-mode-map [mouse-2] 'cvs-mouse-find-file)
+ 
+ (defun pcl-mode-motion-highlight-line ()
+   (interactive)
+   (save-excursion
+     (set-buffer (get-buffer cvs-buffer-name))
+     (let ((buffer-read-only nil))
+       (goto-char (point-min))
+       (while (re-search-forward "^[* ] " nil t)
+     (end-of-line)
+  (put-text-property (match-beginning 0) (point)
+                            'mouse-face 'highlight)))))
+ 
+ (defconst pcl-cvs-font-lock-keywords
+   '(("^In directory \\(.+\\)$" 1 font-lock-comment-face)
+     ("^[* ] \\w+ +\\(ci\\)" 1 font-lock-function-name-face)
+     ("^[* ] \\(Conflict\\|Merged\\)" 1 font-lock-function-name-face)
+     ("^[* ] \\w+ +\\(ci +\\)?\\(.+\\)$" 2 font-lock-keyword-face)
+     )
+   "Patterns to highlight in the *cvs* buffer.")
+ 
+ (defun pcl-cvs-fontify ()
+   ;;
+   ;; set up line highlighting
+   (pcl-mode-motion-highlight-line)
+   ;;
+   ;; fontify mousable lines
+   (set (make-local-variable 'font-lock-keywords) pcl-cvs-font-lock-keywords)
+   (font-lock-mode 1)
+   )
+ 
+ (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)


From <@elrond.ida.liu.se:TRANLE@caliph.intellicorp.com> Mon Jun  6 21:12:47 1994
Date: Mon, 6 Jun 94 12:11:14 PDT
From: Minh Tran-Le <TRANLE@intellicorp.com>
Subject: Re: Is there a new version of pcl-cvs for emacs-19.25 with
To: ceder@lysator.liu.se
In-Reply-To: <199406052231.AAA02336@astrid.lysator.liu.se>
Reply-To: tranle@intellicorp.com

|There is.  Only four days ago, F.Pierresteguy sent me a mail which
|does this for FSF emacs 19.23.  His mail, which contains the required
|changes as a patch, is available via anonymous ftp from
|ftp://ftp.lysator.liu.se/pub/emacs/pcl-cvs-1.05-FSF-19-support
|
|I have not tested the changes myself, mostly due to lack of time.  If
|you find any bugs in this file, please tell me - I plan to include it
|in the next release of pcl-cvs.
|
|				/ceder
|

I have tested the changes with emacs-19.25 and I have found a few small
problems (I have appended my fixes a the end of this message).

1) The loading of "pcl-cvs-e19" should be done only if running under
   X11.

2) Changed Makefile to install also pcl-cvs-e19.

3) Changed Makefile 'install' target to install *.elc after installing
   *.el otherwise emacs think that you should recompile them.

4) Changed compile-all.el to compile pcl-cvs-e19.el when using emacs-19.x.
   Maybe it should be an unconditional compile of both pcl-cvs-lucid and
   pcl-cvs-e19 because the Makefile will try to install both.


*** pcl-cvs.el.orig	Wed Feb  2 20:33:00 1994
--- pcl-cvs.el	Mon Jun  6 11:08:51 1994
***************
*** 2200,2206 ****
  			    " Change cvs-cvsroot anyhow?")))
        (setq cvs-cvsroot newroot)))
  
! (if (string-match "Lucid" emacs-version)
      (progn
        (autoload 'pcl-cvs-fontify "pcl-cvs-lucid")
        (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
--- 2200,2211 ----
  			    " Change cvs-cvsroot anyhow?")))
        (setq cvs-cvsroot newroot)))
  
! (if (and (eq window-system 'x) (string-match "Lucid" emacs-version))
      (progn
        (autoload 'pcl-cvs-fontify "pcl-cvs-lucid")
+       (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
+ 
+ (if (and (eq window-system 'x) (string-match "^19" emacs-version))
+     (progn
+       (autoload 'pcl-cvs-fontify "pcl-cvs-e19")
        (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
*** Makefile.orig	Mon Jun  6 10:55:24 1994
--- Makefile	Mon Jun  6 11:05:36 1994
***************
*** 37,44 ****
  # Just in case...
  SHELL = /bin/sh
  
! ELFILES = pcl-cvs.el pcl-cvs-lucid.el
! ELCFILES = pcl-cvs.elc pcl-cvs-lucid.elc
  INFOFILES = pcl-cvs
  TEXTMPS = pcl-cvs.aux pcl-cvs.log pcl-cvs.toc pcl-cvs.dvi pcl-cvs.cp \
  	pcl-cvs.fn pcl-cvs.vr pcl-cvs.tp pcl-cvs.ky pcl-cvs.pg \
--- 37,44 ----
  # Just in case...
  SHELL = /bin/sh
  
! ELFILES = pcl-cvs.el pcl-cvs-lucid.el pcl-cvs-e19.el
! ELCFILES = pcl-cvs.elc pcl-cvs-lucid.elc pcl-cvs-e19.elc
  INFOFILES = pcl-cvs
  TEXTMPS = pcl-cvs.aux pcl-cvs.log pcl-cvs.toc pcl-cvs.dvi pcl-cvs.cp \
  	pcl-cvs.fn pcl-cvs.vr pcl-cvs.tp pcl-cvs.ky pcl-cvs.pg \
***************
*** 57,63 ****
  # version 2.something (and version 1.something is distributed with emacs).
  #
  # install: install_elc install_info
! install: install_elc
  	for i in $(ELFILES); do $(INSTALL_DATA) $$i $(lispdir)/$$i; done
  
  install_elc: elcfiles
--- 57,65 ----
  # version 2.something (and version 1.something is distributed with emacs).
  #
  # install: install_elc install_info
! install: install_el install_elc
! 
! install_el:
  	for i in $(ELFILES); do $(INSTALL_DATA) $$i $(lispdir)/$$i; done
  
  install_elc: elcfiles
*** compile-all.el.orig	Mon Jun  6 10:42:12 1994
--- compile-all.el	Mon Jun  6 10:43:34 1994
***************
*** 22,28 ****
  ;;;;
  
  
! (setq files-to-compile '("pcl-cvs" "pcl-cvs-lucid"))
  
  
  (defun compile-file-if-necessary (file)
--- 22,30 ----
  ;;;;
  
  
! (if (string-match "^19" emacs-version)
!     (setq files-to-compile '("pcl-cvs" "pcl-cvs-e19"))
!     (setq files-to-compile '("pcl-cvs" "pcl-cvs-lucid")))
  
  
  (defun compile-file-if-necessary (file)
-------