diff options
Diffstat (limited to 'lisp/vc')
-rw-r--r-- | lisp/vc/cvs-status.el | 5 | ||||
-rw-r--r-- | lisp/vc/ediff-diff.el | 15 | ||||
-rw-r--r-- | lisp/vc/ediff-init.el | 75 | ||||
-rw-r--r-- | lisp/vc/ediff-util.el | 4 | ||||
-rw-r--r-- | lisp/vc/smerge-mode.el | 5 | ||||
-rw-r--r-- | lisp/vc/vc-bzr.el | 27 | ||||
-rw-r--r-- | lisp/vc/vc-cvs.el | 18 | ||||
-rw-r--r-- | lisp/vc/vc-dir.el | 62 | ||||
-rw-r--r-- | lisp/vc/vc-dispatcher.el | 3 | ||||
-rw-r--r-- | lisp/vc/vc-git.el | 38 | ||||
-rw-r--r-- | lisp/vc/vc-hg.el | 4 | ||||
-rw-r--r-- | lisp/vc/vc-svn.el | 4 | ||||
-rw-r--r-- | lisp/vc/vc.el | 3 |
13 files changed, 144 insertions, 119 deletions
diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el index ff3a2944a17..26fb6206c80 100644 --- a/lisp/vc/cvs-status.el +++ b/lisp/vc/cvs-status.el @@ -356,9 +356,8 @@ the list is a three-string list TAG, KIND, REV." (defvar font-lock-mode) ;; (defun cvs-refontify (beg end) -;; (when (and (boundp 'font-lock-mode) -;; font-lock-mode -;; (fboundp 'font-lock-fontify-region)) +;; (when (and font-lock-mode +;; (fboundp 'font-lock-fontify-region)) ;; (font-lock-fontify-region (1- beg) (1+ end)))) (defun cvs-status-trees () diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index e90eaa11565..fde9d4338f3 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -1230,35 +1230,30 @@ are ignored." Used for splitting difference regions into individual words.") ;; \240 is Unicode symbol for nonbreakable whitespace -(defvar ediff-whitespace " \n\t\f\r\240" +(defvar-local ediff-whitespace " \n\t\f\r\240" "Characters constituting white space. These characters are ignored when differing regions are split into words.") -(make-variable-buffer-local 'ediff-whitespace) -(defvar ediff-word-1 "-[:word:]_" +(defvar-local ediff-word-1 "-[:word:]_" "Characters that constitute words of type 1. More precisely, [ediff-word-1] is a regexp that matches type 1 words. See `ediff-forward-word' for more details.") -(make-variable-buffer-local 'ediff-word-1) -(defvar ediff-word-2 "0-9.," +(defvar-local ediff-word-2 "0-9.," "Characters that constitute words of type 2. More precisely, [ediff-word-2] is a regexp that matches type 2 words. See `ediff-forward-word' for more details.") -(make-variable-buffer-local 'ediff-word-2) -(defvar ediff-word-3 "`'?!:;\"{}[]()" +(defvar-local ediff-word-3 "`'?!:;\"{}[]()" "Characters that constitute words of type 3. More precisely, [ediff-word-3] is a regexp that matches type 3 words. See `ediff-forward-word' for more details.") -(make-variable-buffer-local 'ediff-word-3) -(defvar ediff-word-4 +(defvar-local ediff-word-4 (concat "^" ediff-word-1 ediff-word-2 ediff-word-3 ediff-whitespace) "Characters that constitute words of type 4. More precisely, [ediff-word-4] is a regexp that matches type 4 words. See `ediff-forward-word' for more details.") -(make-variable-buffer-local 'ediff-word-4) ;; Split region along word boundaries. Each word will be on its own line. ;; Output to buffer out-buffer. diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 0865ac5ce41..3f33e6aae2e 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -80,13 +80,12 @@ that Ediff doesn't know about.") ;; so that `kill-all-local-variables' (called by major-mode setting ;; commands) won't destroy Ediff control variables. ;; -;; Plagiarized from `emerge-defvar-local' for XEmacs. +;; Plagiarized from `emerge-defvar-local'. (defmacro ediff-defvar-local (var value doc) "Defines VAR as a local variable." (declare (indent defun) (doc-string 3)) `(progn - (defvar ,var ,value ,doc) - (make-variable-buffer-local ',var) + (defvar-local ,var ,value ,doc) (put ',var 'permanent-local t))) @@ -798,13 +797,6 @@ to temp files in buffer jobs and when Ediff needs to find fine differences." (message "Pixmap not found for %S: %s" (face-name face) pixmap) (sit-for 1))))) -(defun ediff-hide-face (face) - (if (and (ediff-has-face-support-p) - (boundp 'add-to-list) - (boundp 'facemenu-unlisted-faces)) - (add-to-list 'facemenu-unlisted-faces face))) - - (defface ediff-current-diff-A '((((class color) (min-colors 88) (background light)) @@ -825,7 +817,6 @@ to temp files in buffer jobs and when Ediff needs to find fine differences." DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-current-diff-A' this variable represents.") -(ediff-hide-face ediff-current-diff-face-A) (defface ediff-current-diff-B '((((class color) (min-colors 88) (background light)) @@ -847,7 +838,6 @@ this variable represents.") this variable. Instead, use the customization widget to customize the actual face `ediff-current-diff-B' this variable represents.") -(ediff-hide-face ediff-current-diff-face-B) (defface ediff-current-diff-C '((((class color) (min-colors 88) (background light)) @@ -868,7 +858,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-current-diff-C' this variable represents.") -(ediff-hide-face ediff-current-diff-face-C) (defface ediff-current-diff-Ancestor '((((class color) (min-colors 88) (background light)) @@ -891,7 +880,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-current-diff-Ancestor' this variable represents.") -(ediff-hide-face ediff-current-diff-face-Ancestor) (defface ediff-fine-diff-A '((((class color) (min-colors 88) (background light)) @@ -912,7 +900,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-fine-diff-A' this variable represents.") -(ediff-hide-face ediff-fine-diff-face-A) (defface ediff-fine-diff-B '((((class color) (min-colors 88) (background light)) @@ -933,7 +920,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-fine-diff-B' this variable represents.") -(ediff-hide-face ediff-fine-diff-face-B) (defface ediff-fine-diff-C '((((class color) (min-colors 88) (background light)) @@ -957,7 +943,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-fine-diff-C' this variable represents.") -(ediff-hide-face ediff-fine-diff-face-C) (defface ediff-fine-diff-Ancestor '((((class color) (min-colors 88) (background light)) @@ -982,7 +967,6 @@ ancestor buffer." DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-fine-diff-Ancestor' this variable represents.") -(ediff-hide-face ediff-fine-diff-face-Ancestor) ;; Some installs don't have stipple or Stipple. So, try them in turn. (defvar stipple-pixmap @@ -996,8 +980,10 @@ this variable represents.") (defface ediff-even-diff-A `((((type pc)) (:foreground "green3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -1013,11 +999,12 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-even-diff-A' this variable represents.") -(ediff-hide-face ediff-even-diff-face-A) (defface ediff-even-diff-B - `((((class color) (min-colors 88)) - (:background "Grey" :extend t)) + `((((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1032,13 +1019,14 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-even-diff-B' this variable represents.") -(ediff-hide-face ediff-even-diff-face-B) (defface ediff-even-diff-C `((((type pc)) (:foreground "yellow3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -1054,13 +1042,14 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-even-diff-C' this variable represents.") -(ediff-hide-face ediff-even-diff-face-C) (defface ediff-even-diff-Ancestor `((((type pc)) (:foreground "cyan3" :background "light grey" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1076,7 +1065,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-even-diff-Ancestor' this variable represents.") -(ediff-hide-face ediff-even-diff-face-Ancestor) ;; Association between buffer types and even-diff-face symbols (defconst ediff-even-diff-face-alist @@ -1088,8 +1076,10 @@ this variable represents.") (defface ediff-odd-diff-A '((((type pc)) (:foreground "green3" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1104,14 +1094,14 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-odd-diff-A' this variable represents.") -(ediff-hide-face ediff-odd-diff-face-A) - (defface ediff-odd-diff-B '((((type pc)) (:foreground "White" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "light grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "light grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dark grey" :extend t)) (((class color) (min-colors 16)) (:foreground "Black" :background "light grey" :extend t)) (((class color)) @@ -1126,13 +1116,14 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-odd-diff-B' this variable represents.") -(ediff-hide-face ediff-odd-diff-face-B) (defface ediff-odd-diff-C '((((type pc)) (:foreground "yellow3" :background "gray40" :extend t)) - (((class color) (min-colors 88)) - (:background "Grey" :extend t)) + (((class color) (min-colors 88) (background light)) + (:distant-foreground "Black" :background "Grey" :extend t)) + (((class color) (min-colors 88) (background dark)) + (:distant-foreground "White" :background "dim grey" :extend t)) (((class color) (min-colors 16)) (:foreground "White" :background "Grey" :extend t)) (((class color)) @@ -1147,7 +1138,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-odd-diff-C' this variable represents.") -(ediff-hide-face ediff-odd-diff-face-C) (defface ediff-odd-diff-Ancestor '((((class color) (min-colors 88)) @@ -1166,7 +1156,6 @@ this variable represents.") DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face object `ediff-odd-diff-Ancestor' this variable represents.") -(ediff-hide-face ediff-odd-diff-face-Ancestor) ;; Association between buffer types and odd-diff-face symbols (defconst ediff-odd-diff-face-alist @@ -1572,6 +1561,8 @@ This default should work without changes." (ediff-file-attributes filename 5)) +;;; Obsolete + (defun ediff-convert-standard-filename (fname) (declare (obsolete convert-standard-filename "28.1")) (convert-standard-filename fname)) @@ -1579,5 +1570,7 @@ This default should work without changes." (define-obsolete-function-alias 'ediff-with-syntax-table #'with-syntax-table "27.1") +(define-obsolete-function-alias 'ediff-hide-face #'ignore "28.1") + (provide 'ediff-init) ;;; ediff-init.el ends here diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index f955ba8283a..9909dcd5424 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -3998,8 +3998,8 @@ Mail anyway? (y or n) ") (define-obsolete-function-alias 'ediff-deactivate-mark #'deactivate-mark "27.1") (defun ediff-activate-mark () - (make-local-variable 'transient-mark-mode) - (setq mark-active 'ediff-util transient-mark-mode t)) + (setq mark-active 'ediff-util) + (setq-local transient-mark-mode t)) (define-obsolete-function-alias 'ediff-nuke-selective-display #'ignore "27.1") diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 3b09dfe5d2e..c66a4fb2d6a 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -173,8 +173,7 @@ Used in `smerge-diff-base-upper' and related functions." `((,smerge-command-prefix . ,smerge-basic-map)) "Keymap for `smerge-mode'.") -(defvar smerge-check-cache nil) -(make-variable-buffer-local 'smerge-check-cache) +(defvar-local smerge-check-cache nil) (defun smerge-check (n) (condition-case nil (let ((state (cons (point) (buffer-modified-tick)))) @@ -1411,7 +1410,7 @@ with a \\[universal-argument] prefix, makes up a 3-way conflict." \\{smerge-mode-map}" :group 'smerge :lighter " SMerge" - (when (and (boundp 'font-lock-mode) font-lock-mode) + (when font-lock-mode (save-excursion (if smerge-mode (font-lock-add-keywords nil smerge-font-lock-keywords 'append) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index e4eff486f5e..d1385ea7784 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -860,9 +860,8 @@ If LIMIT is non-nil, show no more than this many entries." (vc-bzr-command "mv" nil 0 new old) (message "Renamed %s => %s" old new)) -(defvar vc-bzr-annotation-table nil +(defvar-local vc-bzr-annotation-table nil "Internal use.") -(make-variable-buffer-local 'vc-bzr-annotation-table) (defun vc-bzr-annotate-command (file buffer &optional revision) "Prepare BUFFER for `vc-annotate' on FILE. @@ -1077,49 +1076,49 @@ stream. Standard error output is discarded." (when (string-match ".+checkout of branch: \\(.+\\)$" str) (match-string 1 str))))) (concat - (propertize "Parent branch : " 'face 'font-lock-type-face) + (propertize "Parent branch : " 'face 'vc-dir-header) (propertize (if (string-match "parent branch: \\(.+\\)$" str) (match-string 1 str) "None") - 'face 'font-lock-variable-name-face) + 'face 'vc-dir-header-value) "\n" (when light-checkout (concat - (propertize "Light checkout root: " 'face 'font-lock-type-face) - (propertize light-checkout 'face 'font-lock-variable-name-face) + (propertize "Light checkout root: " 'face 'vc-dir-header) + (propertize light-checkout 'face 'vc-dir-header-value) "\n")) (when light-checkout-branch (concat - (propertize "Checkout of branch : " 'face 'font-lock-type-face) - (propertize light-checkout-branch 'face 'font-lock-variable-name-face) + (propertize "Checkout of branch : " 'face 'vc-dir-header) + (propertize light-checkout-branch 'face 'vc-dir-header-value) "\n")) (when pending-merge (concat - (propertize "Warning : " 'face 'font-lock-warning-face + (propertize "Warning : " 'face 'vc-dir-status-warning 'help-echo pending-merge-help-echo) (propertize "Pending merges, commit recommended before any other action" 'help-echo pending-merge-help-echo - 'face 'font-lock-warning-face) + 'face 'vc-dir-status-warning) "\n")) (if shelve (concat - (propertize "Shelves :\n" 'face 'font-lock-type-face + (propertize "Shelves :\n" 'face 'vc-dir-header 'help-echo shelve-help-echo) (mapconcat (lambda (x) (propertize x - 'face 'font-lock-variable-name-face + 'face 'vc-dir-header-value 'mouse-face 'highlight 'help-echo "mouse-3: Show shelve menu\nA: Apply and keep shelf\nP: Apply and remove shelf (pop)\nS: Snapshot to a shelf\nC-k: Delete shelf" 'keymap vc-bzr-shelve-map)) shelve "\n")) (concat - (propertize "Shelves : " 'face 'font-lock-type-face + (propertize "Shelves : " 'face 'vc-dir-header 'help-echo shelve-help-echo) (propertize "No shelved changes" 'help-echo shelve-help-echo - 'face 'font-lock-variable-name-face)))))) + 'face 'vc-dir-header-value)))))) ;; Follows vc-bzr-command, which uses vc-do-command from vc-dispatcher. (declare-function vc-resynch-buffer "vc-dispatcher" diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index a595cc9778b..0adb5328bc2 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -1047,29 +1047,29 @@ Query all files in DIR if files is nil." (file-error nil)))) (concat (cond (repo - (concat (propertize "Repository : " 'face 'font-lock-type-face) - (propertize repo 'face 'font-lock-variable-name-face))) + (concat (propertize "Repository : " 'face 'vc-dir-header) + (propertize repo 'face 'vc-dir-header-value))) (t "")) (cond (module - (concat (propertize "Module : " 'face 'font-lock-type-face) - (propertize module 'face 'font-lock-variable-name-face))) + (concat (propertize "Module : " 'face 'vc-dir-header) + (propertize module 'face 'vc-dir-header-value))) (t "")) (if (file-readable-p "CVS/Tag") (let ((tag (vc-cvs-file-to-string "CVS/Tag"))) (cond ((string-match "\\`T" tag) - (concat (propertize "Tag : " 'face 'font-lock-type-face) + (concat (propertize "Tag : " 'face 'vc-dir-header) (propertize (substring tag 1) - 'face 'font-lock-variable-name-face))) + 'face 'vc-dir-header-value))) ((string-match "\\`D" tag) - (concat (propertize "Date : " 'face 'font-lock-type-face) + (concat (propertize "Date : " 'face 'vc-dir-header) (propertize (substring tag 1) - 'face 'font-lock-variable-name-face))) + 'face 'vc-dir-header-value))) (t "")))) ;; In CVS, branch is a per-file property, not a per-directory property. ;; We can't really do this here without making dangerous assumptions. - ;;(propertize "Branch: " 'face 'font-lock-type-face) + ;;(propertize "Branch: " 'face 'vc-dir-header) ;;(propertize "ADD CODE TO PRINT THE BRANCH NAME\n" ;; 'face 'font-lock-warning-face) ))) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9d0808c0435..a416474e16d 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -54,6 +54,42 @@ See `run-hooks'." :type 'hook :group 'vc) +(defface vc-dir-header '((t :inherit font-lock-type-face)) + "Face for headers in VC-dir buffers." + :group 'vc) + +(defface vc-dir-header-value '((t :inherit font-lock-variable-name-face)) + "Face for header values in VC-dir buffers." + :group 'vc) + +(defface vc-dir-directory '((t :inherit font-lock-comment-delimiter-face)) + "Face for directories in VC-dir buffers." + :group 'vc) + +(defface vc-dir-file '((t :inherit font-lock-function-name-face)) + "Face for files in VC-dir buffers." + :group 'vc) + +(defface vc-dir-mark-indicator '((t :inherit font-lock-type-face)) + "Face for mark indicators in VC-dir buffers." + :group 'vc) + +(defface vc-dir-status-warning '((t :inherit font-lock-warning-face)) + "Face for warning status in VC-dir buffers." + :group 'vc) + +(defface vc-dir-status-edited '((t :inherit font-lock-variable-name-face)) + "Face for edited status in VC-dir buffers." + :group 'vc) + +(defface vc-dir-status-up-to-date '((t :inherit font-lock-builtin-face)) + "Face for up-to-date status in VC-dir buffers." + :group 'vc) + +(defface vc-dir-status-ignored '((t :inherit shadow)) + "Face for ignored or empty values in VC-dir buffers." + :group 'vc) + ;; Used to store information for the files displayed in the directory buffer. ;; Each item displayed corresponds to one of these defstructs. (cl-defstruct (vc-dir-fileinfo @@ -1126,11 +1162,11 @@ It calls the `dir-extra-headers' backend method to display backend specific headers." (concat ;; First layout the common headers. - (propertize "VC backend : " 'face 'font-lock-type-face) - (propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face) - (propertize "Working dir: " 'face 'font-lock-type-face) + (propertize "VC backend : " 'face 'vc-dir-header) + (propertize (format "%s\n" backend) 'face 'vc-dir-header-value) + (propertize "Working dir: " 'face 'vc-dir-header) (propertize (format "%s\n" (abbreviate-file-name dir)) - 'face 'font-lock-variable-name-face) + 'face 'vc-dir-header-value) ;; Then the backend specific ones. (vc-call-backend backend 'dir-extra-headers dir) "\n")) @@ -1386,9 +1422,9 @@ These are the commands available for use in the file status buffer: ;; backend specific headers. ;; XXX: change this to return nil before the release. (concat - (propertize "Extra : " 'face 'font-lock-type-face) + (propertize "Extra : " 'face 'vc-dir-header) (propertize "Please add backend specific headers here. It's easy!" - 'face 'font-lock-warning-face))) + 'face 'vc-dir-status-warning))) (defvar vc-dir-status-mouse-map (let ((map (make-sparse-keymap))) @@ -1414,21 +1450,23 @@ These are the commands available for use in the file status buffer: (insert (propertize (format "%c" (if (vc-dir-fileinfo->marked fileentry) ?* ? )) - 'face 'font-lock-type-face) + 'face 'vc-dir-mark-indicator) " " (propertize (format "%-20s" state) - 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face) - ((memq state '(missing conflict)) 'font-lock-warning-face) - ((eq state 'edited) 'font-lock-constant-face) - (t 'font-lock-variable-name-face)) + 'face (cond + ((eq state 'up-to-date) 'vc-dir-status-up-to-date) + ((memq state '(missing conflict needs-update unlocked-changes)) + 'vc-dir-status-warning) + ((eq state 'ignored) 'vc-dir-status-ignored) + (t 'vc-dir-status-edited)) 'mouse-face 'highlight 'keymap vc-dir-status-mouse-map) " " (propertize (format "%s" filename) 'face - (if isdir 'font-lock-comment-delimiter-face 'font-lock-function-name-face) + (if isdir 'vc-dir-directory 'vc-dir-file) 'help-echo (if isdir "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu" diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 6b17f2afe74..2573964c42c 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -531,8 +531,7 @@ ARG and NO-CONFIRM are passed on to `revert-buffer'." (revert-buffer arg no-confirm t)) (vc-restore-buffer-context context))) -(defvar vc-mode-line-hook nil) -(make-variable-buffer-local 'vc-mode-line-hook) +(defvar-local vc-mode-line-hook nil) (put 'vc-mode-line-hook 'permanent-local t) (defvar view-old-buffer-read-only) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 94fac3a83b8..25ae26d746a 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -462,7 +462,7 @@ or an empty string if none." (eq 0 (logand ?\111 (logxor old-perm new-perm)))) " " (if (eq 0 (logand ?\111 old-perm)) "+x" "-x")) - 'face 'font-lock-type-face)) + 'face 'vc-dir-header)) (defun vc-git-dir-printer (info) "Pretty-printer for the vc-dir-fileinfo structure." @@ -474,20 +474,21 @@ or an empty string if none." (insert " " (propertize (format "%c" (if (vc-dir-fileinfo->marked info) ?* ? )) - 'face 'font-lock-type-face) + 'face 'vc-dir-mark-indicator) " " (propertize (format "%-12s" state) - 'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face) - ((eq state 'missing) 'font-lock-warning-face) - (t 'font-lock-variable-name-face)) + 'face (cond ((eq state 'up-to-date) 'vc-dir-status-up-to-date) + ((memq state '(missing conflict)) 'vc-dir-status-warning) + ((eq state 'ignored) 'vc-dir-status-ignored) + (t 'vc-dir-status-edited)) 'mouse-face 'highlight 'keymap vc-dir-status-mouse-map) " " (vc-git-permissions-as-string old-perm new-perm) " " (propertize (vc-git-escape-file-name (vc-dir-fileinfo->name info)) - 'face (if isdir 'font-lock-comment-delimiter-face - 'font-lock-function-name-face) + 'face (if isdir 'vc-dir-directory + 'vc-dir-file) 'help-echo (if isdir "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu" @@ -784,7 +785,7 @@ or an empty string if none." (mapconcat (lambda (x) (propertize x - 'face 'font-lock-variable-name-face + 'face 'vc-dir-header-value 'mouse-face 'highlight 'vc-git-hideable all-hideable 'help-echo vc-git-stash-list-help @@ -800,7 +801,7 @@ or an empty string if none." (mapconcat (lambda (x) (propertize x - 'face 'font-lock-variable-name-face + 'face 'vc-dir-header-value 'mouse-face 'highlight 'invisible t 'vc-git-hideable t @@ -810,33 +811,32 @@ or an empty string if none." (propertize "\n" 'invisible t 'vc-git-hideable t)))))))) - ;; FIXME: maybe use a different face when nothing is stashed. (concat - (propertize "Branch : " 'face 'font-lock-type-face) + (propertize "Branch : " 'face 'vc-dir-header) (propertize branch - 'face 'font-lock-variable-name-face) + 'face 'vc-dir-header-value) (when remote-url (concat "\n" - (propertize "Remote : " 'face 'font-lock-type-face) + (propertize "Remote : " 'face 'vc-dir-header) (propertize remote-url - 'face 'font-lock-variable-name-face))) + 'face 'vc-dir-header-value))) ;; For now just a heading, key bindings can be added later for various bisect actions (when (file-exists-p (expand-file-name ".git/BISECT_START" (vc-git-root dir))) - (propertize "\nBisect : in progress" 'face 'font-lock-warning-face)) + (propertize "\nBisect : in progress" 'face 'vc-dir-status-warning)) (when (file-exists-p (expand-file-name ".git/rebase-apply" (vc-git-root dir))) - (propertize "\nRebase : in progress" 'face 'font-lock-warning-face)) + (propertize "\nRebase : in progress" 'face 'vc-dir-status-warning)) (if stash-list (concat - (propertize "\nStash : " 'face 'font-lock-type-face) + (propertize "\nStash : " 'face 'vc-dir-header) stash-button stash-string) (concat - (propertize "\nStash : " 'face 'font-lock-type-face) + (propertize "\nStash : " 'face 'vc-dir-header) (propertize "Nothing stashed" 'help-echo vc-git-stash-shared-help 'keymap vc-git-stash-shared-map - 'face 'font-lock-variable-name-face)))))) + 'face 'vc-dir-header-value)))))) (defun vc-git-branches () "Return the existing branches, as a list of strings. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 1d163a64ab2..adb0fce8759 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1403,8 +1403,8 @@ This runs the command \"hg summary\"." (cons (capitalize (match-string 1)) (match-string 2)) (cons "" (buffer-substring (point) (line-end-position)))))) (concat - (propertize (format "%-11s: " (car entry)) 'face 'font-lock-type-face) - (propertize (cdr entry) 'face 'font-lock-variable-name-face))) + (propertize (format "%-11s: " (car entry)) 'face 'vc-dir-header) + (propertize (cdr entry) 'face 'vc-dir-header-value))) result) (forward-line)) (nreverse result)) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index da5471107d2..22becc91cd1 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -239,8 +239,8 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." (concat (cond (repo (concat - (propertize "Repository : " 'face 'font-lock-type-face) - (propertize repo 'face 'font-lock-variable-name-face))) + (propertize "Repository : " 'face 'vc-dir-header) + (propertize repo 'face 'vc-dir-header-value))) (t ""))))) (defun vc-svn-working-revision (file) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index bc9f11202b1..00976a07d42 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1549,6 +1549,9 @@ After check-out, runs the normal hook `vc-checkout-hook'." (vc-call-backend backend 'mark-resolved files) ;; FIXME: Is this TRTD? Might not be. `((vc-state . edited))) + ;; Recompute mode lines. + (dolist (file files) + (vc-mode-line file backend)) (message (substitute-command-keys "Conflicts have been resolved in %s. \ |