summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-04-10 11:18:21 +0800
committerJSDurand <mmemmew@gmail.com>2022-04-10 11:18:21 +0800
commitb6a0e0eaa69d071317f1d4fff6b0b2340f11c47d (patch)
tree615f26d489d8ee722ea443fdeec00ab797c309dc
parent6e5a7137328a48a3ae17f654338349ea8bf67d4e (diff)
Move the tramp configuration to tramp-conf.
* common.el: Tramp configurations should be put in a separate file. * tramp-conf.el (tramp-methods): Fix the copy arg. (backup-directory-alist): Disable backups for Tramp. (tramp-allow-unsafe-temporary-files): Don't ask this every time.
-rw-r--r--common.el19
-rw-r--r--tramp-conf.el55
2 files changed, 55 insertions, 19 deletions
diff --git a/common.el b/common.el
index 73d00c8..0bc0d60 100644
--- a/common.el
+++ b/common.el
@@ -196,25 +196,6 @@ the window to the function with max-height equal to
(define-key Info-mode-map (vector 41) #'Info-forward-node)
-;;; Fix a Tramp arg
-
-(require 'tramp)
-
-(cond
- ((assoc "rsync" tramp-methods #'equal)
- (setcar
- (cdr
- (assoc
- 'tramp-copy-args
- (assoc "rsync" tramp-methods #'equal)))
- (list
- (list "-t" "%k")
- (list "-p")
- (list "-r")
- ;; this option is invalid for my rsync program, for some reason
- ;; ("-s")
- (list "-c")))))
-
;; (defun durand-display-in-one-window (buffer _alist)
;; "Display BUFFER in one window.
;; ALIST is an association list of action symbols and values. See
diff --git a/tramp-conf.el b/tramp-conf.el
new file mode 100644
index 0000000..8614be3
--- /dev/null
+++ b/tramp-conf.el
@@ -0,0 +1,55 @@
+;;; tramp-conf.el --- Configurations of Tramp -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 李俊緯
+
+;; Author: 李俊緯 <mmemmew@gmail.com>
+;; Keywords: comm, convenience, files, processes
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; My configurations of the wonderful Tramp.
+
+;;; Code:
+
+(require 'tramp)
+
+;;; Fix a Tramp copy arg
+
+(cond
+ ((assoc "rsync" tramp-methods #'equal)
+ (setcar
+ (cdr
+ (assoc
+ 'tramp-copy-args
+ (assoc "rsync" tramp-methods #'equal)))
+ (list
+ (list "-t" "%k")
+ (list "-p")
+ (list "-r")
+ ;; this option is invalid for my rsync program, for some reason
+ ;; ("-s")
+ (list "-c")))))
+
+;;; Disable backups for Tramp
+
+(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil))
+
+;;; Don't ask this over and over.
+
+(setq tramp-allow-unsafe-temporary-files t)
+
+(provide 'tramp-conf)
+;;; tramp-conf.el ends here