+2013-11-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-remote-file-name-spec-regexp): An IPV6
+ address can be empty.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-insert-directory):
+ Accept nil SWITCHES.
+ (tramp-gvfs-handle-write-region): Implement APPEND.
+
2013-11-12 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie-grammar): Disambiguate between
(filename switches &optional wildcard full-directory-p)
"Like `insert-directory' for Tramp files."
;; gvfs-* output is hard to parse. So we let `ls-lisp' do the job.
+ (unless switches (setq switches ""))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
(require 'ls-lisp)
(tramp-flush-file-property v localname))))))
(defun tramp-gvfs-handle-write-region
- (start end filename &optional _append visit _lockname confirm)
+ (start end filename &optional append visit lockname confirm)
"Like `write-region' for Tramp files."
(with-parsed-tramp-file-name filename nil
;; XEmacs takes a coding system as the seventh argument, not `confirm'.
(tramp-error v 'file-error "File not overwritten")))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
- (write-region start end tmpfile)
+ (when (and append (file-exists-p filename))
+ (copy-file filename tmpfile 'ok))
+ ;; We say `no-message' here because we don't want the visited file
+ ;; modtime data to be clobbered from the temp file. We call
+ ;; `set-visited-file-modtime' ourselves later on.
+ (tramp-run-real-handler
+ 'write-region
+ (if confirm ; don't pass this arg unless defined for backward compat.
+ (list start end tmpfile append 'no-message lockname confirm)
+ (list start end tmpfile append 'no-message lockname)))
(condition-case nil
(rename-file tmpfile filename 'ok-if-already-exists)
(error
"\\(?:" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?"
"\\(?:" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?"
"\\(" "\\(?:" tramp-host-regexp "\\|"
- tramp-prefix-ipv6-regexp tramp-ipv6-regexp
+ tramp-prefix-ipv6-regexp "\\(?:" tramp-ipv6-regexp "\\)?"
tramp-postfix-ipv6-regexp "\\)"
"\\(?:" tramp-prefix-port-regexp tramp-port-regexp "\\)?" "\\)?")
"Regular expression matching a Tramp file name between prefix and postfix.")