changeset 104851:5e1bd0e3a13b

* net/tramp-compat.el (tramp-compat-line-beginning-position): New defun.
author Michael Albinus <michael.albinus@gmx.de>
date Fri, 04 Sep 2009 08:15:15 +0000
parents 5d5bbec3b1c8
children e066b8cdbefb
files lisp/net/tramp-compat.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp-compat.el	Fri Sep 04 08:14:30 2009 +0000
+++ b/lisp/net/tramp-compat.el	Fri Sep 04 08:15:15 2009 +0000
@@ -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