Mercurial > emacs
comparison lisp/diff-mode.el @ 47518:967c2114c128
(diff-mode): Don't evaluate `compilation-last-buffer' unless it's bound.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 18 Sep 2002 02:35:50 +0000 |
parents | 68e034e01f4c |
children | 78ff9bcb1a38 |
comparison
equal
deleted
inserted
replaced
47517:8e9589a87f9b | 47518:967c2114c128 |
---|---|
1 ;;; diff-mode.el --- a mode for viewing/editing context diffs | 1 ;;; diff-mode.el --- a mode for viewing/editing context diffs |
2 | 2 |
3 ;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 5 ;; Author: Stefan Monnier <monnier@cs.yale.edu> |
6 ;; Keywords: convenience patch diff | 6 ;; Keywords: convenience patch diff |
7 | 7 |
8 ;; This file is part of GNU Emacs. | 8 ;; This file is part of GNU Emacs. |
887 (when (string-match "\\.rej\\'" (or buffer-file-name "")) | 887 (when (string-match "\\.rej\\'" (or buffer-file-name "")) |
888 (set (make-local-variable 'compilation-current-file) | 888 (set (make-local-variable 'compilation-current-file) |
889 (substring buffer-file-name 0 (match-beginning 0)))) | 889 (substring buffer-file-name 0 (match-beginning 0)))) |
890 ;; Be careful not to change compilation-last-buffer when we're just | 890 ;; Be careful not to change compilation-last-buffer when we're just |
891 ;; doing a C-x v = (for example). | 891 ;; doing a C-x v = (for example). |
892 (let ((compilation-last-buffer compilation-last-buffer)) | 892 (let ((compilation-last-buffer |
893 (and (boundp 'compilation-last-buffer) | |
894 compilation-last-buffer))) | |
893 (compilation-shell-minor-mode 1)) | 895 (compilation-shell-minor-mode 1)) |
894 | 896 |
895 (when (and (> (point-max) (point-min)) diff-default-read-only) | 897 (when (and (> (point-max) (point-min)) diff-default-read-only) |
896 (toggle-read-only t)) | 898 (toggle-read-only t)) |
897 ;; setup change hooks | 899 ;; setup change hooks |