(tramp-compat-line-end-position): Remove them.
* net/tramp.el (tramp-parse-rhosts-group)
(tramp-parse-shosts-group, tramp-parse-sconfig-group)
(tramp-parse-hosts-group, tramp-parse-passwd-group)
(tramp-parse-netrc-group, tramp-parse-putty-group)
* net/tramp-cmds.el (tramp-append-tramp-buffers)
* net/tramp-sh.el (tramp-do-file-attributes-with-ls)
(tramp-sh-handle-file-selinux-context)
(tramp-sh-handle-file-name-all-completions)
(tramp-sh-handle-insert-directory)
(tramp-sh-handle-expand-file-name, tramp-find-executable)
(tramp-wait-for-output, tramp-send-command-and-read)
* net/tramp-smb.el (tramp-smb-read-file-entry)
(tramp-smb-get-cifs-capabilities): Use `point-at-eol'.
* net/tramp-sh.el (tramp-sh-handle-insert-directory) Use
`point-at-bol'.
(tramp-remote-coding-commands): Add an alternative using "base64
-d -i". This is needed for older base64 versions from GNU
coreutils. Reported by Klaus Reichl
<Klaus.Reichl@thalesgroup.com>.
+2010-11-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-compat.el (tramp-compat-line-beginning-position)
+ (tramp-compat-line-end-position): Remove them.
+
+ * net/tramp.el (tramp-parse-rhosts-group)
+ (tramp-parse-shosts-group, tramp-parse-sconfig-group)
+ (tramp-parse-hosts-group, tramp-parse-passwd-group)
+ (tramp-parse-netrc-group, tramp-parse-putty-group)
+ * net/tramp-cmds.el (tramp-append-tramp-buffers)
+ * net/tramp-sh.el (tramp-do-file-attributes-with-ls)
+ (tramp-sh-handle-file-selinux-context)
+ (tramp-sh-handle-file-name-all-completions)
+ (tramp-sh-handle-insert-directory)
+ (tramp-sh-handle-expand-file-name, tramp-find-executable)
+ (tramp-wait-for-output, tramp-send-command-and-read)
+ * net/tramp-smb.el (tramp-smb-read-file-entry)
+ (tramp-smb-get-cifs-capabilities): Use `point-at-eol'.
+
+ * net/tramp-sh.el (tramp-sh-handle-insert-directory) Use
+ `point-at-bol'.
+ (tramp-remote-coding-commands): Add an alternative using "base64
+ -d -i". This is needed for older base64 versions from GNU
+ coreutils. Reported by Klaus Reichl
+ <Klaus.Reichl@thalesgroup.com>.
+
2010-11-13 Hrvoje Niksic <hniksic@xemacs.org>
* simple.el (count-words-region): New function.
* newcomment.el (comment-dwim): Fix the intentation in the doc string.
-010-10-21 Michael Albinus <michael.albinus@gmx.de>
+2010-10-21 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-do-file-attributes-with-stat): Do not use
space in stat format string.
(setq buffer-read-only nil)
(goto-char (point-min))
(while (not (eobp))
- (if (re-search-forward
- tramp-buf-regexp (tramp-compat-line-end-position) t)
+ (if (re-search-forward tramp-buf-regexp (point-at-eol) t)
(forward-line 1)
(forward-line 0)
(let ((start (point)))
;; ordinary variable that gets its initial value from
;; tramp-default-user-alist and then is added to. (Pete Forman)
-;; arch-tag: 190d4c33-76bb-4e99-8b6f-71741f23d98c
;;; tramp-cmds.el ends here
(ignore-errors
(tramp-compat-funcall 'font-lock-add-keywords mode keywords how)))
-;; FIXME is this really necessary? Eg Emacs has both l-b-p and p-at-b
-;; since at least 21.1.
-(defsubst tramp-compat-line-beginning-position ()
- "Return point at beginning of line (compat function).
-Calls `line-beginning-position' or `point-at-bol' if defined, else
-own implementation."
- (cond
- ((fboundp 'line-beginning-position)
- (tramp-compat-funcall 'line-beginning-position))
- ((fboundp 'point-at-bol) (tramp-compat-funcall 'point-at-bol))
- (t (save-excursion (beginning-of-line) (point)))))
-
-;; FIXME is this really necessary? Eg Emacs has both l-e-p and p-at-e
-;; since at least 21.1.
-(defsubst tramp-compat-line-end-position ()
- "Return point at end of line (compat function).
-Calls `line-end-position' or `point-at-eol' if defined, else
-own implementation."
- (cond
- ((fboundp 'line-end-position) (tramp-compat-funcall 'line-end-position))
- ((fboundp 'point-at-eol) (tramp-compat-funcall 'point-at-eol))
- (t (save-excursion (end-of-line) (point)))))
-
(defsubst tramp-compat-temporary-file-directory ()
"Return name of directory for temporary files (compat function).
For Emacs, this is the variable `temporary-file-directory', for XEmacs
;; if symlink, find out file name pointed to
(when symlinkp
(search-forward "-> ")
- (setq res-symlink-target
- (buffer-substring (point) (tramp-compat-line-end-position))))
+ (setq res-symlink-target (buffer-substring (point) (point-at-eol))))
;; return data gathered
(list
;; 0. t for directory, string (name linked to) for symbolic
(tramp-shell-quote-argument localname))))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
- (when (re-search-forward regexp (tramp-compat-line-end-position) t)
+ (when (re-search-forward regexp (point-at-eol) t)
(setq context (list (match-string 1) (match-string 2)
(match-string 3) (match-string 4))))))
;; Return the context.
(tramp-error
v 'file-error
"tramp-sh-handle-file-name-all-completions: %s"
- (buffer-substring
- (point) (tramp-compat-line-end-position))))
+ (buffer-substring (point) (point-at-eol))))
;; For peace of mind, if buffer doesn't end in `fail'
;; then it should end in `ok'. If neither are in the
;; buffer something went seriously wrong on the remote
(tramp-shell-quote-argument localname) (buffer-string))))
(while (zerop (forward-line -1))
- (push (buffer-substring
- (point) (tramp-compat-line-end-position))
- result)))
+ (push (buffer-substring (point) (point-at-eol)) result)))
;; Because the remote op went through OK we know the
;; directory we `cd'-ed to exists
(forward-line -1))
(when (looking-at "//DIRED//\\s-+")
(let ((databeg (match-end 0))
- (end (tramp-compat-line-end-position)))
+ (end (point-at-eol)))
;; Now read the numeric positions of file names.
(goto-char databeg)
(while (< (point) end)
;; End is followed by \n or by " -> ".
(put-text-property start end 'dired-filename t))))))
;; Remove trailing lines.
- (goto-char (tramp-compat-line-beginning-position))
+ (goto-char (point-at-bol))
(while (looking-at "//")
(forward-line 1)
(delete-region (match-beginning 0) (point)))
v (format "cd %s; pwd" (tramp-shell-quote-argument uname)))
(with-current-buffer (tramp-get-buffer v)
(goto-char (point-min))
- (buffer-substring
- (point) (tramp-compat-line-end-position)))))
+ (buffer-substring (point) (point-at-eol)))))
(setq localname (concat uname fname))))
;; There might be a double slash, for example when "~/"
;; expands to "/". Remove this.
(when (search-backward "tramp_executable " nil t)
(skip-chars-forward "^ ")
(skip-chars-forward " ")
- (setq result (buffer-substring
- (point) (tramp-compat-line-end-position)))))
+ (setq result (buffer-substring (point) (point-at-eol)))))
result)))
(defun tramp-set-remote-path (vec)
;; the single quotes makes it work under `rc', too. We also unset
;; the variable $ENV because that is read by some sh
;; implementations (eg, bash when called as sh) on startup; this
- ;; way, we avoid the startup file clobbering $PS1. $PROMP_COMMAND
+ ;; way, we avoid the startup file clobbering $PS1. $PROMPT_COMMAND
;; is another way to set the prompt in /bin/bash, it must be
;; discarded as well.
(tramp-open-shell
with the encoded or decoded results, respectively.")
(defconst tramp-remote-coding-commands
- '((b64 "base64" "base64 -d")
+ '((b64 "base64" "base64 -d -i")
+ ;; "-i" is more robust with older base64 from GNU coreutils.
+ ;; However, I don't know whether all base64 versions do supports
+ ;; this option.
+ (b64 "base64" "base64 -d")
(b64 "mimencode -b" "mimencode -u -b")
(b64 "mmencode -b" "mmencode -u -b")
(b64 "recode data..base64" "recode base64..data")
(tramp-set-connection-property p "check-remote-echo" t)
(setq command (format "%s%s%s" tramp-echo-mark command tramp-echo-mark)))
(when (string-match "<<'EOF'" command)
- ;; Unset $PS1 when using here documents, in order not to get
- ;; several prompts.
+ ;; Unset $PS1 when using here documents, in order to avoid
+ ;; multiple prompts.
(setq command (concat "(PS1= ; " command "\n)")))
;; Send the command.
(tramp-message vec 6 "%s" command)
;; A simple-minded busybox has sent " ^H" sequences.
;; Delete them.
(goto-char (point-min))
- (when (re-search-forward
- "^\\(.\b\\)+$" (tramp-compat-line-end-position) t)
+ (when (re-search-forward "^\\(.\b\\)+$" (point-at-eol) t)
(forward-line 1)
(delete-region (point-min) (point)))
;; Delete the prompt.
(condition-case nil
(prog1 (read (current-buffer))
;; Error handling.
- (when (re-search-forward "\\S-" (tramp-compat-line-end-position) t)
+ (when (re-search-forward "\\S-" (point-at-eol) t)
(error nil)))
(error (tramp-error
vec 'file-error
;; rsync.
;; * Try telnet+curl as new method. It might be useful for busybox,
;; without built-in uuencode/uudecode.
+;; * Try ssh+netcat as out-of-band method.
;;; tramp-sh.el ends here
Result is the list (LOCALNAME MODE SIZE MTIME)."
;; We are called from `tramp-smb-get-file-entries', which sets the
;; current buffer.
- (let ((line (buffer-substring (point) (tramp-compat-line-end-position)))
+ (let ((line (buffer-substring (point) (point-at-eol)))
localname mode size month day hour min sec year mtime)
(if (not share)
(member
"pathnames"
(split-string
- (buffer-substring
- (point) (tramp-compat-line-end-position)) nil t)))))))))
+ (buffer-substring (point) (point-at-eol)) nil t)))))))))
(defun tramp-smb-get-stat-capability (vec)
"Check, whether the SMB server supports the STAT command."
;; regular again.
;; * Make it multi-hop capable.
-;; arch-tag: fcc9dbec-7503-4d73-b638-3c8aa59575f5
;;; tramp-smb.el ends here
(concat
"^\\(" tramp-host-regexp "\\)"
"\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (append (list (match-string 3) (match-string 1)))))
(widen)
User is always nil."
(let ((result)
(regexp (concat "^\\(" tramp-host-regexp "\\)")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list nil (match-string 1))))
(widen)
User is always nil."
(let ((result)
(regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list nil (match-string 1))))
(widen)
(let ((result)
(regexp
(concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list nil (match-string 1))))
(widen)
Host is always \"localhost\"."
(let ((result)
(regexp (concat "^\\(" tramp-user-regexp "\\):")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list (match-string 1) "localhost")))
(widen)
(concat
"^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)"
"\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list (match-string 3) (match-string 1))))
(widen)
User is always nil."
(let ((result)
(regexp (concat (regexp-quote registry) "\\\\\\(.+\\)")))
- (narrow-to-region (point) (tramp-compat-line-end-position))
+ (narrow-to-region (point) (point-at-eol))
(when (re-search-forward regexp nil t)
(setq result (list nil (match-string 1))))
(widen)
;; expects English? Or just to set LC_MESSAGES to "C" if Tramp
;; expects only English messages? (Juri Linkov)
;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846)
-;; * Load ~/.emacs_SHELLNAME on the remote host for `shell'.
;; * I was wondering it it would be possible to use tramp even if I'm
;; actually using sshfs. But when I launch a command I would like
;; to get it executed on the remote machine where the files really
;; Functions for file-name-handler-alist:
;; diff-latest-backup-file -- in diff.el
-;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a
;;; tramp.el ends here
;; Local Variables: