* net/tramp-compat.el (tramp-compat-line-beginning-position): New defun.
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 4 Sep 2009 08:15:28 +0000 (08:15 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 4 Sep 2009 08:15:28 +0000 (08:15 +0000)
lisp/ChangeLog
lisp/net/tramp-compat.el

index 77bd47f..3aebf7a 100644 (file)
@@ -1,3 +1,11 @@
+2009-09-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * 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  <monnier@iro.umontreal.ca>
 
        * files.el (locate-file-completion-table): Make it provide boundary
index 3a10a0c..96c8bd8 100644 (file)
          (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