emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el
Date: Mon, 13 Dec 2004 00:18:47 -0500

Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.731 emacs/lisp/files.el:1.732
*** emacs/lisp/files.el:1.731   Fri Dec 10 16:38:49 2004
--- emacs/lisp/files.el Mon Dec 13 05:08:00 2004
***************
*** 932,939 ****
  
  To visit a file without any kind of conversion and without
  automatically choosing a major mode, use \\[find-file-literally]."
!   (interactive
!    (find-file-read-args "Find file: " nil))
    (let ((value (find-file-noselect filename nil nil wildcards)))
      (if (listp value)
        (mapcar 'switch-to-buffer (nreverse value))
--- 932,938 ----
  
  To visit a file without any kind of conversion and without
  automatically choosing a major mode, use \\[find-file-literally]."
!   (interactive (find-file-read-args "Find file: " nil))
    (let ((value (find-file-noselect filename nil nil wildcards)))
      (if (listp value)
        (mapcar 'switch-to-buffer (nreverse value))
***************
*** 955,962 ****
      (if (listp value)
        (progn
          (setq value (nreverse value))
!         (switch-to-buffer-other-window (car value))
!         (mapcar 'switch-to-buffer (cdr value)))
        (switch-to-buffer-other-window value))))
  
  (defun find-file-other-frame (filename &optional wildcards)
--- 954,961 ----
      (if (listp value)
        (progn
          (setq value (nreverse value))
!         (cons (switch-to-buffer-other-window (car value))
!               (mapcar 'switch-to-buffer (cdr value))))
        (switch-to-buffer-other-window value))))
  
  (defun find-file-other-frame (filename &optional wildcards)
***************
*** 975,982 ****
      (if (listp value)
        (progn
          (setq value (nreverse value))
!         (switch-to-buffer-other-frame (car value))
!         (mapcar 'switch-to-buffer (cdr value)))
        (switch-to-buffer-other-frame value))))
  
  (defun find-file-existing (filename &optional wildcards)
--- 974,981 ----
      (if (listp value)
        (progn
          (setq value (nreverse value))
!         (cons (switch-to-buffer-other-frame (car value))
!               (mapcar 'switch-to-buffer (cdr value))))
        (switch-to-buffer-other-frame value))))
  
  (defun find-file-existing (filename &optional wildcards)
***************
*** 991,1025 ****
    "Edit file FILENAME but don't allow changes.
  Like \\[find-file] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only: " t))
!   (unless (file-exists-p filename) (error "%s does not exist" filename))
!   (find-file filename wildcards)
!   (toggle-read-only 1)
!   (current-buffer))
  
  (defun find-file-read-only-other-window (filename &optional wildcards)
    "Edit file FILENAME in another window but don't allow changes.
  Like \\[find-file-other-window] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only other window: " t))
!   (unless (file-exists-p filename) (error "%s does not exist" filename))
!   (find-file-other-window filename wildcards)
!   (toggle-read-only 1)
!   (current-buffer))
  
  (defun find-file-read-only-other-frame (filename &optional wildcards)
    "Edit file FILENAME in another frame but don't allow changes.
  Like \\[find-file-other-frame] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only other frame: " t))
!   (unless (file-exists-p filename) (error "%s does not exist" filename))
!   (find-file-other-frame filename wildcards)
!   (toggle-read-only 1)
!   (current-buffer))
  
! (defun find-alternate-file-other-window (filename)
    "Find file FILENAME as a replacement for the file in the next window.
! This command does not select that window."
    (interactive
     (save-selected-window
       (other-window 1)
--- 990,1042 ----
    "Edit file FILENAME but don't allow changes.
  Like \\[find-file] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only: " nil))
!   (unless (or (and wildcards find-file-wildcards
!                  (not (string-match "\\`/:" filename))
!                  (string-match "[[*?]" filename))
!             (file-exists-p filename))
!     (error "%s does not exist" filename))
!   (let ((value (find-file filename wildcards)))
!     (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
!         (if (listp value) value (list value)))
!     value))
  
  (defun find-file-read-only-other-window (filename &optional wildcards)
    "Edit file FILENAME in another window but don't allow changes.
  Like \\[find-file-other-window] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only other window: " nil))
!   (unless (or (and wildcards find-file-wildcards
!                  (not (string-match "\\`/:" filename))
!                  (string-match "[[*?]" filename))
!             (file-exists-p filename))
!     (error "%s does not exist" filename))
!   (let ((value (find-file-other-window filename wildcards)))
!     (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
!         (if (listp value) value (list value)))
!     value))
  
  (defun find-file-read-only-other-frame (filename &optional wildcards)
    "Edit file FILENAME in another frame but don't allow changes.
  Like \\[find-file-other-frame] but marks buffer as read-only.
  Use \\[toggle-read-only] to permit editing."
!   (interactive (find-file-read-args "Find file read-only other frame: " nil))
!   (unless (or (and wildcards find-file-wildcards
!                  (not (string-match "\\`/:" filename))
!                  (string-match "[[*?]" filename))
!             (file-exists-p filename))
!     (error "%s does not exist" filename))
!   (let ((value (find-file-other-frame filename wildcards)))
!     (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
!         (if (listp value) value (list value)))
!     value))
  
! (defun find-alternate-file-other-window (filename &optional wildcards)
    "Find file FILENAME as a replacement for the file in the next window.
! This command does not select that window.
! 
! Interactively, or if WILDCARDS is non-nil in a call from Lisp,
! expand wildcards (if any) and replace the file with multiple files."
    (interactive
     (save-selected-window
       (other-window 1)
***************
*** 1030,1046 ****
            (setq file-name (file-name-nondirectory file)
                  file-dir (file-name-directory file)))
         (list (read-file-name
!             "Find alternate file: " file-dir nil nil file-name)))))
    (if (one-window-p)
!       (find-file-other-window filename)
      (save-selected-window
        (other-window 1)
!       (find-alternate-file filename))))
  
! (defun find-alternate-file (filename)
    "Find file FILENAME, select its buffer, kill previous buffer.
  If the current buffer now contains an empty file that you just visited
! \(presumably by mistake), use this command to visit the file you really want."
    (interactive
     (let ((file buffer-file-name)
         (file-name nil)
--- 1047,1067 ----
            (setq file-name (file-name-nondirectory file)
                  file-dir (file-name-directory file)))
         (list (read-file-name
!             "Find alternate file: " file-dir nil nil file-name)
!            t))))
    (if (one-window-p)
!       (find-file-other-window filename wildcards)
      (save-selected-window
        (other-window 1)
!       (find-alternate-file filename wildcards))))
  
! (defun find-alternate-file (filename &optional wildcards)
    "Find file FILENAME, select its buffer, kill previous buffer.
  If the current buffer now contains an empty file that you just visited
! \(presumably by mistake), use this command to visit the file you really want.
! 
! Interactively, or if WILDCARDS is non-nil in a call from Lisp,
! expand wildcards (if any) and replace the file with multiple files."
    (interactive
     (let ((file buffer-file-name)
         (file-name nil)
***************
*** 1049,1055 ****
          (setq file-name (file-name-nondirectory file)
                file-dir (file-name-directory file)))
       (list (read-file-name
!           "Find alternate file: " file-dir nil nil file-name))))
    (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
      (error "Aborted"))
    (when (and (buffer-modified-p) (buffer-file-name))
--- 1070,1077 ----
          (setq file-name (file-name-nondirectory file)
                file-dir (file-name-directory file)))
       (list (read-file-name
!           "Find alternate file: " file-dir nil nil file-name)
!          t)))
    (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
      (error "Aborted"))
    (when (and (buffer-modified-p) (buffer-file-name))
***************
*** 1077,1083 ****
          (setq buffer-file-truename nil)
          ;; Likewise for dired buffers.
          (setq dired-directory nil)
!         (find-file filename))
        (when (eq obuf (current-buffer))
        ;; This executes if find-file gets an error
        ;; and does not really find anything.
--- 1099,1105 ----
          (setq buffer-file-truename nil)
          ;; Likewise for dired buffers.
          (setq dired-directory nil)
!         (find-file filename wildcards))
        (when (eq obuf (current-buffer))
        ;; This executes if find-file gets an error
        ;; and does not really find anything.
***************
*** 1247,1254 ****
  Optional second arg RAWFILE non-nil means the file is read literally.
  Optional third arg WILDCARDS non-nil means do wildcard processing
  and visit all the matching files.  When wildcards are actually
! used and expanded, the value is a list of buffers
! that are visiting the various files."
    (setq filename
        (abbreviate-file-name
         (expand-file-name filename)))
--- 1269,1276 ----
  Optional second arg RAWFILE non-nil means the file is read literally.
  Optional third arg WILDCARDS non-nil means do wildcard processing
  and visit all the matching files.  When wildcards are actually
! used and expanded, return a list of buffers that are visiting
! the various files."
    (setq filename
        (abbreviate-file-name
         (expand-file-name filename)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]