]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-clock.el
Fix byte-compiler warnings about looking-back.
[gnu-emacs] / lisp / org / org-clock.el
index 51c87892a9c6a5e83a695b36aa7cb699f3d46083..c0a45b3ad13bab5b547c9763686f2024aebb13de 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-clock.el --- The time clocking code for Org-mode
 
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -1066,9 +1066,11 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling
 (defvar org-x11idle-exists-p
   ;; Check that x11idle exists
   (and (eq window-system 'x)
-       (eq (call-process-shell-command "command" nil nil nil "-v" org-clock-x11idle-program-name) 0)
+       (eq 0 (call-process-shell-command
+              (format "command -v %s" org-clock-x11idle-program-name)))
        ;; Check that x11idle can retrieve the idle time
-       (eq (call-process-shell-command org-clock-x11idle-program-name nil nil nil) 0)))
+       ;; FIXME: Why "..-shell-command" rather than just `call-process'?
+       (eq 0 (call-process-shell-command org-clock-x11idle-program-name))))
 
 (defun org-x11-idle-seconds ()
   "Return the current X11 idle time in seconds."
@@ -1654,7 +1656,8 @@ Optional argument N tells to change by that many units."
   (save-excursion ; Do not replace this with `with-current-buffer'.
     (org-no-warnings (set-buffer (org-clocking-buffer)))
     (goto-char org-clock-marker)
-    (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*"))
+    (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*")
+                          (line-beginning-position))
        (progn (delete-region (1- (point-at-bol)) (point-at-eol))
               (org-remove-empty-drawer-at "LOGBOOK" (point)))
       (message "Clock gone, cancel the timer anyway")
@@ -2811,8 +2814,8 @@ The details of what will be saved are regulated by the variable
          (delete-region (point-min) (point-max))
          ;;Store clock
          (insert (format ";; org-persist.el - %s at %s\n"
-                         system-name (format-time-string
-                                      (cdr org-time-stamp-formats))))
+                         (system-name) (format-time-string
+                                        (cdr org-time-stamp-formats))))
          (if (and (memq org-clock-persist '(t clock))
                   (setq b (org-clocking-buffer))
                   (setq b (or (buffer-base-buffer b) b))