From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: [PATCH] Make use of the constant `org-clock-string' whenever possible Date: Tue, 26 Aug 2014 09:29:55 +0200 Message-ID: <87r403d7yk.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMBCm-0006Mh-P6 for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 03:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMBCd-0000vl-FL for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 03:30:12 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:43064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMBCd-0000oQ-5D for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 03:30:03 -0400 Received: by mail-wi0-f173.google.com with SMTP id f8so3679476wiw.12 for ; Tue, 26 Aug 2014 00:30:01 -0700 (PDT) Received: from localhost (162.48.7.109.rev.sfr.net. [109.7.48.162]) by mx.google.com with ESMTPSA id h6sm5951195wjb.33.2014.08.26.00.30.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 00:30:00 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: OrgMode ML --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi, I would like to submit a tiny patch to make use of `org-clock-string' instead of the hard coded value CLOCK: whenever possible. I also found out that :CLOCK: was hard coded in `org-insert-property-drawer' (git sha 67ae102b4be87976240555d1c0d80ee55906f53c, file lisp/org.el:15897) instead of using `org-clock-drawer-start-re' but I did not have time to fix this one. Please find the patch attached to this mail. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-use-of-the-constant-org-clock-string-whenever-p.patch Content-Transfer-Encoding: quoted-printable From=208eedb019d277f7f1e8baa6641244ddf7e298d397 Mon Sep 17 00:00:00 2001 From: Konubinix Date: Tue, 26 Aug 2014 09:11:23 +0200 Subject: [PATCH] Make use of the constant `org-clock-string' whenever possi= ble Instead of the hardcoded value "CLOCK:". * lisp/org-clock.el (org-find-open-clocks) * lisp/org.el (org-clone-subtree-with-time-shift) * lisp/org.el (org-insert-property-drawer) * lisp/org.el (org-at-clock-log-p) TINYCHANGE =2D-- lisp/org-clock.el | 2 +- lisp/org.el | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 179d395..14b613e 100644 =2D-- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -799,7 +799,7 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-soun= d'." (with-current-buffer buf (save-excursion (goto-char (point-min)) =2D (while (re-search-forward "CLOCK: \\(\\[.*?\\]\\)$" nil t) + (while (re-search-forward (concat org-clock-string " \\(\\[.*?\\]\\)$") n= il t) (push (cons (copy-marker (match-end 1) t) (org-time-string-to-time (match-string 1))) clocks)))) clocks)) diff --git a/lisp/org.el b/lisp/org.el index 750b9d1..4559280 100755 =2D-- a/lisp/org.el +++ b/lisp/org.el @@ -8698,7 +8698,8 @@ and still retain the repeater to cover future instanc= es of the task." (org-entry-delete nil "ID") (org-id-get-create t))) (unless (=3D n 0) =2D (while (re-search-forward "^[ \t]*CLOCK:.*$" nil t) + (while (re-search-forward + (format "^[ \t]*%s.*$" org-clock-string) nil t) (kill-whole-line)) (goto-char (point-min)) (while (re-search-forward drawer-re nil t) @@ -15891,8 +15892,12 @@ formats in the current buffer." (setq hiddenp (outline-invisible-p)) (end-of-line 1) (and (equal (char-after) ?\n) (forward-char 1)) =2D (while (looking-at "^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\= )") =2D (if (member (match-string 1) '("CLOCK:" ":END:")) + (while (looking-at + (format + "^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|%s\\|:END:\\)" + org-clock-string)) + (if (member (match-string 1) + (list org-clock-string ":END:")) ;; just skip this line (beginning-of-line 2) ;; Drawer start, find the end @@ -17589,7 +17594,8 @@ With prefix ARG, change that many days." "Is the cursor on the clock log line?" (save-excursion (move-beginning-of-line 1) =2D (looking-at "^[ \t]*CLOCK:"))) + (looking-at + (concat "^[ \t]*" org-clock-string)))) =20 (defvar org-clock-history) ; defined in org-clock.el (defvar org-clock-adjust-closest nil) ; defined in org-clock.el =2D-=20 2.1.0.rc1 --=-=-= Content-Type: text/plain -- Samuel --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT/Dd0AAoJEHXSPO10ORBq41IH/Ashiw9TVJZNst8arypIRGCY eKfz0LolSZ0UN8o1YS97BKtBheYSnBuQDgIPg2Q8A7qPG/+CCQEEw2RQH4JV1Vqu GESSuFcBWCCUAdBhtqFZadBWAhje8BA8GjJQuym5UhWWpvKUfm1qLh6VcHRukokO hKUnRmSOmpkwk9Bj7bLl8zTcBVFqln3CBFAjNV6WC8Y+KWvMvb/r8T6roLms2Lk1 i71Kf4eAIp/RBJ6HFLuSbvVR2aVNvMO2DOa4TxarC9TOX84Szm5JXy2CvkZY7MPr EoYl8LvFYh+5rtG8DrWuX/yE19ivgkObsHMMFt7FTDyzdirJp8VAILF2RItiObw= =5oqj -----END PGP SIGNATURE----- --==-=-=--