vms-patch.el 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ;; Override parts of files.el for VMS.
  2. ;; Copyright (C) 1986 Free Software Foundation, Inc.
  3. ;; This file is part of GNU Emacs.
  4. ;; GNU Emacs is distributed in the hope that it will be useful,
  5. ;; but WITHOUT ANY WARRANTY. No author or distributor
  6. ;; accepts responsibility to anyone for the consequences of using it
  7. ;; or for whether it serves any particular purpose or works at all,
  8. ;; unless he says so in writing. Refer to the GNU Emacs General Public
  9. ;; License for full details.
  10. ;; Everyone is granted permission to copy, modify and redistribute
  11. ;; GNU Emacs, but only under the conditions described in the
  12. ;; GNU Emacs General Public License. A copy of this license is
  13. ;; supposed to have been given to you along with GNU Emacs so you
  14. ;; can know your rights and responsibilities. It should be in a
  15. ;; file named COPYING. Among other things, the copyright notice
  16. ;; and this notice must be preserved on all copies.
  17. ;;; Functions that need redefinition
  18. ;;; Auto save filesnames start with _$ and end with $.
  19. (defun make-auto-save-file-name ()
  20. "Return file name to use for auto-saves of current buffer.
  21. Does not consider auto-save-visited-file-name; that is checked
  22. before calling this function.
  23. This is a separate function so your .emacs file or site-init.el can redefine it.
  24. See also auto-save-file-name-p."
  25. (if buffer-file-name
  26. (concat (file-name-directory buffer-file-name)
  27. "_$"
  28. (file-name-nondirectory buffer-file-name)
  29. "$")
  30. (expand-file-name (concat "_$_" (buffer-name) "$"))))
  31. (defun auto-save-file-name-p (filename)
  32. "Return t if FILENAME can be yielded by make-auto-save-file-name.
  33. FILENAME should lack slashes.
  34. This is a separate function so your .emacs file or site-init.el can redefine it."
  35. (string-match "^_\\$.*\\$" filename))