Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
80169ab5
Commit
80169ab5
authored
Mar 16, 1993
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vc-error-occurred: moved to vc-hooks.el in order for ^X^F of a
nonexistent file to work.
parent
2dd8d31b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
43 deletions
+32
-43
lisp/vc-hooks.el
lisp/vc-hooks.el
+32
-43
No files found.
lisp/vc-hooks.el
View file @
80169ab5
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
;; Copyright (C) 1992 Free Software Foundation, Inc.
;; Copyright (C) 1992 Free Software Foundation, Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Version:
4
.0
;; Version:
5
.0
;; $Id: vc-hooks.el,v 1.
6 1992/10/24 20:07:08 rms Exp rms
$
;; $Id: vc-hooks.el,v 1.
48 1993/03/15 21:42:57 esr Exp
$
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
...
@@ -51,6 +51,9 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
...
@@ -51,6 +51,9 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
;; control state of a file is expensive to derive --- we don't
;; control state of a file is expensive to derive --- we don't
;; want to recompute it even on every find.
;; want to recompute it even on every find.
(
defmacro
vc-error-occurred
(
&rest
body
)
(
list
'condition-case
nil
(
cons
'progn
(
append
body
'
(
nil
)))
'
(
error
t
)))
(
defvar
vc-file-prop-obarray
[0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0]
(
defvar
vc-file-prop-obarray
[0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0]
"Obarray for per-file properties."
)
"Obarray for per-file properties."
)
...
@@ -65,18 +68,6 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
...
@@ -65,18 +68,6 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
;;; actual version-control code starts here
;;; actual version-control code starts here
(
defun
vc-registered
(
file
)
(
defun
vc-registered
(
file
)
(
let
(
handler
handlers
)
(
if
(
boundp
'file-name-handler-alist
)
(
save-match-data
(
setq
handlers
file-name-handler-alist
)
(
while
(
and
(
consp
handlers
)
(
null
handler
))
(
if
(
and
(
consp
(
car
handlers
))
(
stringp
(
car
(
car
handlers
)))
(
string-match
(
car
(
car
handlers
))
file
))
(
setq
handler
(
cdr
(
car
handlers
))))
(
setq
handlers
(
cdr
handlers
)))))
(
if
handler
(
funcall
handler
'vc-registered
file
)
;; Search for a master corresponding to the given file
;; Search for a master corresponding to the given file
(
let
((
dirname
(
or
(
file-name-directory
file
)
""
))
(
let
((
dirname
(
or
(
file-name-directory
file
)
""
))
(
basename
(
file-name-nondirectory
file
)))
(
basename
(
file-name-nondirectory
file
)))
...
@@ -98,7 +89,8 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
...
@@ -98,7 +89,8 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
(
file-attributes
trial
)))))
(
file-attributes
trial
)))))
(
throw
'found
(
cons
trial
(
cdr
s
)))))))
(
throw
'found
(
cons
trial
(
cdr
s
)))))))
vc-master-templates
)
vc-master-templates
)
nil
)))))
nil
)
))
(
defun
vc-backend-deduce
(
file
)
(
defun
vc-backend-deduce
(
file
)
"Return the version-control type of a file, nil if it is not registered"
"Return the version-control type of a file, nil if it is not registered"
...
@@ -107,7 +99,7 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
...
@@ -107,7 +99,7 @@ the make-backup-files variable. Otherwise, prevents backups being made.")
(
vc-file-setprop
file
'vc-backend
(
cdr
(
vc-registered
file
))))))
(
vc-file-setprop
file
'vc-backend
(
cdr
(
vc-registered
file
))))))
(
defun
vc-toggle-read-only
()
(
defun
vc-toggle-read-only
()
"If the file in the current buffer i
s
under version control, perform the
"If the file in the current buffer i
d
under version control, perform the
logical next version-control action; otherwise, just toggle the buffer's
logical next version-control action; otherwise, just toggle the buffer's
read-only flag."
read-only flag."
(
interactive
)
(
interactive
)
...
@@ -119,7 +111,6 @@ read-only flag."
...
@@ -119,7 +111,6 @@ read-only flag."
"Set `vc-mode-string' to display type of version control for FILE.
"Set `vc-mode-string' to display type of version control for FILE.
The value is set in the current buffer, which should be the buffer
The value is set in the current buffer, which should be the buffer
visiting FILE."
visiting FILE."
(
interactive
(
list
buffer-file-name
nil
))
(
let
((
vc-type
(
vc-backend-deduce
file
)))
(
let
((
vc-type
(
vc-backend-deduce
file
)))
(
if
vc-type
(
if
vc-type
(
progn
(
progn
...
@@ -134,9 +125,6 @@ visiting FILE."
...
@@ -134,9 +125,6 @@ visiting FILE."
;;; install a call to the above as a find-file hook
;;; install a call to the above as a find-file hook
(
defun
vc-find-file-hook
()
(
defun
vc-find-file-hook
()
;; Recompute whether file is version controlled,
;; if user has killed the buffer and revisited.
(
vc-file-setprop
buffer-file-name
'vc-backend
nil
)
(
if
(
and
(
vc-mode-line
buffer-file-name
)
(
not
vc-make-backup-files
))
(
if
(
and
(
vc-mode-line
buffer-file-name
)
(
not
vc-make-backup-files
))
(
progn
(
progn
(
make-local-variable
'make-backup-files
)
(
make-local-variable
'make-backup-files
)
...
@@ -170,7 +158,7 @@ Returns t if checkout was successful, nil otherwise."
...
@@ -170,7 +158,7 @@ Returns t if checkout was successful, nil otherwise."
(
define-key
global-map
"\C-xv"
vc-prefix-map
)
(
define-key
global-map
"\C-xv"
vc-prefix-map
)
(
define-key
vc-prefix-map
"a"
'vc-update-change-log
)
(
define-key
vc-prefix-map
"a"
'vc-update-change-log
)
(
define-key
vc-prefix-map
"c"
'vc-cancel-version
)
(
define-key
vc-prefix-map
"c"
'vc-cancel-version
)
(
define-key
vc-prefix-map
"
d"
'vc-directory
)
(
define-key
vc-prefix-map
"
="
'vc-diff
)
(
define-key
vc-prefix-map
"h"
'vc-insert-headers
)
(
define-key
vc-prefix-map
"h"
'vc-insert-headers
)
(
define-key
vc-prefix-map
"i"
'vc-register
)
(
define-key
vc-prefix-map
"i"
'vc-register
)
(
define-key
vc-prefix-map
"l"
'vc-print-log
)
(
define-key
vc-prefix-map
"l"
'vc-print-log
)
...
@@ -178,9 +166,10 @@ Returns t if checkout was successful, nil otherwise."
...
@@ -178,9 +166,10 @@ Returns t if checkout was successful, nil otherwise."
(
define-key
vc-prefix-map
"s"
'vc-create-snapshot
)
(
define-key
vc-prefix-map
"s"
'vc-create-snapshot
)
(
define-key
vc-prefix-map
"u"
'vc-revert-buffer
)
(
define-key
vc-prefix-map
"u"
'vc-revert-buffer
)
(
define-key
vc-prefix-map
"v"
'vc-next-action
)
(
define-key
vc-prefix-map
"v"
'vc-next-action
)
(
define-key
vc-prefix-map
"
="
'vc-diff
)
(
define-key
vc-prefix-map
"
d"
'vc-directory
)
))
))
(
provide
'vc-hooks
)
(
provide
'vc-hooks
)
;;; vc-hooks.el ends here
;;; vc-hooks.el ends here
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment