Commits

Anonymous committed 0ebbfab

Makefile: Fix to compile in the absence of an installed package tree.

Makefile: Fix to compile in the absence of an installed package tree.

texi\Makefile: Fix to compile in the absence of an installed package tree.

hexl.el: Sync with FSF 21.0.103. Now works on MS Windows.

diff-mode.el: Reapply patch.

Makefile: Fix to compile in the absence of an installed package tree.

Makefile, ilisp-mak.el: Fix to compile in the absence of an installed package tree.

texi\Makefile: Fix to compile in the absence of an installed package tree.

Makefile: Fix to compile in the absence of an installed package tree.

Local.rules.template: Give default values for these variables that will generally work.
XEmacs.rules: Document what these mean.

  • Participants
  • Parent commits dc2b5ca

Comments (0)

Files changed (2)

+2001-06-18  Ben Wing  <ben@xemacs.org>
+
+	* diff-mode.el:
+	* diff-mode.el (diff-jump-to-old-file-flag): Removed.
+	* diff-mode.el (diff-jump-to-old-file): New.
+	* diff-mode.el ('diff-jump-to-old-file-flag): New.
+	* diff-mode.el (diff-update-on-the-fly-flag): Removed.
+	* diff-mode.el (diff-update-on-the-fly): New.
+	* diff-mode.el ('diff-update-on-the-fly-flag): New.
+	* diff-mode.el (diff-begin-in-read-only-mode): New.
+	* diff-mode.el (diff-metify-map): New.
+	* diff-mode.el (diff-mode-map): New.
+	* diff-mode.el (diff-goto-source):
+	* diff-mode.el (diff-mode):
+	Reapply patch.
+
+2001-05-20  Ben Wing  <ben@xemacs.org>
+
+	* diff-mode.el:
+	* diff-mode.el (diff-jump-to-old-file-flag): Removed.
+	* diff-mode.el (diff-jump-to-old-file): New.
+	* diff-mode.el (diff-update-on-the-fly-flag): Removed.
+	* diff-mode.el (diff-update-on-the-fly): New.
+	* diff-mode.el (diff-begin-in-read-only-mode): New.
+	* diff-mode.el (diff-metify-map): New.
+	* diff-mode.el (diff-mode-map): New.
+	* diff-mode.el (diff-goto-source):
+	* diff-mode.el (diff-mode):
+	Eliminate nonstandard -flag ending on variables.
+	
+	Add var to control whether we begin in read-only mode; FALSE
+	by default (principle of least surprise; and do not assume that
+	people opening any file named .diff have no interest in editing
+	it).
+
+	Comment out bogus behavior of setting the selection in
+	diff-goto-source.
+
+	Fix keymap-hacking tricks.
+
 2001-04-11  Barry Warsaw  <bwarsaw@anthem>
 
 	* python-mode.el: Bumping to version 4.0 since we now support only

File diff-mode.el

 ;; Bugs:
 
 ;; - reverse doesn't work with normal diffs.
-;; - (nitpick) the mark is not always quite right in diff-goto-source.
 
 ;; Todo:
 
   :group 'tools
   :group 'diff)
 
-(defcustom diff-jump-to-old-file-flag nil
+;; XEmacs change: eliminate non-standard -flag ending.
+(defcustom diff-jump-to-old-file nil
   "*Non-nil means `diff-goto-source' jumps to the old file.
 Else, it jumps to the new file."
   :group 'diff-mode
   :type '(boolean))
+(define-obsolete-variable-alias 'diff-jump-to-old-file-flag
+  'diff-jump-to-old-file)
 
-(defcustom diff-update-on-the-fly-flag t
+;; XEmacs change: eliminate non-standard -flag ending.
+(defcustom diff-update-on-the-fly t
   "*Non-nil means hunk headers are kept up-to-date on-the-fly.
 When editing a diff file, the line numbers in the hunk headers
 need to be kept consistent with the actual diff.  This can
 when editing big diffs)."
   :group 'diff-mode
   :type '(boolean))
+(define-obsolete-variable-alias 'diff-update-on-the-fly-flag
+  'diff-update-on-the-fly)
+
+;; XEmacs change: new var.
+(defcustom diff-begin-in-read-only-mode nil
+  "*Non-nil means files start out viewed in read-only mode.
+This means that commands are available without the need to use the
+Meta key with them.")
 
 (defvar diff-mode-hook nil
   "Run after setting up the `diff-mode' major mode.")
 ;;;; keymap, menu, ...
 ;;;; 
 
+;; XEmacs change: the clever keymap tricks here didn't work; fix them.
+
 (defmacro diff-defmap (var bindings doc)
   `(defvar ,var
      (let ((m (make-keymap)))
        m)
      ,doc))
 
-(diff-defmap diff-mode-shared-map
-  '(;; from Pavel Machek's patch-mode
-    ("n" . diff-next-hunk)
-    ("N" . diff-next-file)
-    ("p" . diff-prev-hunk)
-    ("P" . diff-prev-file)
-    ("k" . diff-kill-hunk)
-    ("K" . diff-kill-file)
-    ;; from compilation-minor-mode
-    ("}" . diff-next-file)
-    ("{" . diff-prev-file)
-    ("\C-m" . diff-goto-source)
-    ;; from XEmacs' diff-mode
-    ("W" . widen)
-    ;;("." . diff-goto-source)		;display-buffer
-    ;;("f" . diff-goto-source)		;find-file
-    ("o" . diff-goto-source)		;other-window
-    ;;("w" . diff-goto-source)		;other-frame
-    ;;("N" . diff-narrow)
-    ;;("h" . diff-show-header)
-    ;;("j" . diff-show-difference)	;jump to Nth diff
-    ;;("q" . diff-quit)
-    (" " . scroll-up)
-    ("\177" . scroll-down)
-    ;; our very own bindings
-    ("A" . diff-ediff-patch)
-    ("r" . diff-restrict-view)
-    ("R" . diff-reverse-direction)
-    ("U" . diff-context->unified)
-    ("C" . diff-unified->context))
-  "Keymap for read-only `diff-mode'. Only active in read-only mode.")
+(defmacro diff-metify-map (var bindings doc)
+  `(defvar ,var
+     (let ((m (make-keymap)))
+       (dolist (b ,bindings)
+	 (define-key m (char-to-string (+ 128 (string-to-char (car b))))
+	   (cdr b)))
+       m)
+     ,doc))
 
-(diff-defmap diff-mode-map
-  `(("\e" . ,diff-mode-shared-map)
-    ;; from compilation-minor-mode
-    ("\C-c\C-c" . diff-goto-source))
-  "Keymap for `diff-mode'.  See also `diff-mode-shared-map'.")
+(let ((bindings
+       '(;; from Pavel Machek's patch-mode
+	 ("n" . diff-next-hunk)
+	 ("N" . diff-next-file)
+	 ("p" . diff-prev-hunk)
+	 ("P" . diff-prev-file)
+	 ("k" . diff-kill-hunk)
+	 ("K" . diff-kill-file)
+	 ;; from compilation-minor-mode
+	 ("}" . diff-next-file)
+	 ("{" . diff-prev-file)
+	 ("\C-m" . diff-goto-source)
+	 ;; from XEmacs' diff-mode
+	 ("W" . widen)
+	 ;;("." . diff-goto-source)		;display-buffer
+	 ;;("f" . diff-goto-source)		;find-file
+	 ("o" . diff-goto-source)	;other-window
+	 ;;("w" . diff-goto-source)		;other-frame
+	 ;;("N" . diff-narrow)
+	 ;;("h" . diff-show-header)
+	 ;;("j" . diff-show-difference)	;jump to Nth diff
+	 ;;("q" . diff-quit)
+	 (" " . scroll-up)
+	 ("\177" . scroll-down)
+	 ;; our very own bindings
+	 ("A" . diff-ediff-patch)
+	 ("r" . diff-restrict-view)
+	 ("R" . diff-reverse-direction)
+	 ("U" . diff-context->unified)
+	 ("C" . diff-unified->context))))
+  (diff-defmap
+   diff-mode-shared-map bindings
+   "Keymap for read-only `diff-mode'. Only active in read-only mode.")
+  (diff-metify-map
+   diff-mode-map bindings
+   "Keymap for `diff-mode'.  See also `diff-mode-shared-map'."))
+
+;; from compilation-minor-mode
+(define-key diff-mode-map "\C-c\C-c" 'diff-goto-source)
 
 (easy-menu-define diff-mode-menu diff-mode-map
   "Menu for `diff-mode'."
 
 (defun diff-goto-source (&optional other-file)
   "Jump to the corresponding source line.
-`diff-jump-to-old-file-flag' (or its opposite if the OTHER-FILE prefix arg
+`diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg
 is give) determines whether to jump to the old or the new file.
 If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument])
-  then `diff-jump-to-old-file-flag' is also set, for the next invokations."
+  then `diff-jump-to-old-file' is also set, for the next invokations."
   (interactive "P")
   (save-excursion
-    (let ((old (if (not other-file) diff-jump-to-old-file-flag
-		 (not diff-jump-to-old-file-flag))))
+    (let ((old (if (not other-file) diff-jump-to-old-file
+		 (not diff-jump-to-old-file))))
       (when (> (prefix-numeric-value other-file) 8)
-	(setq diff-jump-to-old-file-flag old))
+	(setq diff-jump-to-old-file old))
       (diff-beginning-of-hunk)
       (let* ((loc (if (not (looking-at "[-@*\n ]*\\([0-9,]+\\)\\([ acd+]+\\([0-9,]+\\)\\)?"))
 		      (error "Can't find the hunk header")
 			 (- (cdr lines) line)))))
 	  (ignore-errors
 	    (goto-line line)
-	    (forward-line span)
-	    (push-mark (point) t t)
-	    (goto-line line)))))))
+	    ;; XEmacs change:
+	    ;; this is utterly bogus. --ben
+; 	    (forward-line span)
+; 	    (push-mark (point) t t)
+; 	    (goto-line line)
+	    ))))))
 
 
 (defun diff-ediff-patch ()
 	 (substring buffer-file-name 0 (match-beginning 0))))
   (compilation-shell-minor-mode 1)
   ;; 
-  (setq buffer-read-only t)
-  (if (not diff-update-on-the-fly-flag)
+  (if diff-begin-in-read-only-mode (setq buffer-read-only t))
+  (if (not diff-update-on-the-fly)
       (add-hook 'write-contents-hooks 'diff-write-contents-hooks)
     (make-local-variable 'diff-unhandled-changes)
     (make-local-hook 'after-change-functions)