From 73d854cdd53f391afeef974862a27d5fe77338da Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 4 Sep 2009 08:15:28 +0000 Subject: [PATCH] * net/tramp-compat.el (tramp-compat-line-beginning-position): New defun. --- lisp/ChangeLog | 8 ++++++++ lisp/net/tramp-compat.el | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77bd47f3f30..3aebf7aa7f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2009-09-04 Michael Albinus + + * net/tramp.el (tramp-handle-insert-directory): Handle "--dired" + also when adding a new directory. + + * net/tramp-compat.el (tramp-compat-line-beginning-position): New + defun. + 2009-09-04 Stefan Monnier * files.el (locate-file-completion-table): Make it provide boundary diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 3a10a0c3c37..96c8bd86b77 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -143,6 +143,16 @@ (tramp-file-name-handler 'set-file-times filename time)))))) +(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) + (funcall (symbol-function 'line-beginning-position))) + ((fboundp 'point-at-bol) (funcall (symbol-function 'point-at-bol))) + (t (save-excursion (beginning-of-line) (point))))) + (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 -- 2.39.2