Commit bc23baaa authored by Carsten Dominik's avatar Carsten Dominik

Checking in the correct versions of the files, sorry, I hade used the files

from an experimental branch.....
parent e5f29d66
2008-12-02 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Using the mapping API): Fix bug in mapping example.
(Publishing options): Make the list of properties complete again, in
correspondence to the variable `org-export-plist-vars'.
(Property searches): Document new special values for time comparisons.
(Tag inheritance): Refine the description of tag inheritance.
(Project alist): Add info about the publishing sequence of components.
(Effort estimates): Document the new relativer timer.
2008-12-04 David Engster <dengste@eml.cc>
* gnus.texi (nnmairix): Mention mairix.el. Point out the importance
......
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-id.el (org-id-locations-file): Wrap file name with
`convert-standard-filename'.
(org-id-files): New variable.
(org-id-use-hash): New option.
(org-id-update-id-locations): Also search in all files current
listed in `org-id-files'. Convert the resulting alist to a hash
if the user customation says so.
(org-id-locations-save): Handle he case if `org-id-locations' is a
hash.
(org-id-locations-load): Convert the alist to a hash.
(org-id-add-location): Handle the hast case.
(kill-emacs-hook): Make sure id locations are saved when Emacs is
exited.
(org-id-hash-to-alist, org-id-alist-to-hash)
(org-id-paste-tracker): New functions.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
......@@ -244,9 +227,6 @@
(org-remember-mode): New minor mode.
(org-remember-apply-template): Turn on `org-remember-mode'.
* org-id.el (org-id-add-location): Avoid error when no file is
given.
* org-remember.el (org-remember-apply-template): Fix the way how
the list of allowed properties is retrieved from the target file.
......
......@@ -118,8 +118,7 @@ be visited."
(const :tag "Clock and history" t)
(const :tag "No persistence" nil)))
(defcustom org-clock-persist-file (convert-standard-filename
"~/.emacs.d/org-clock-save.el")
(defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el"
"File to save clock data to"
:group 'org-clock
:type 'string)
......
......@@ -1465,9 +1465,6 @@ on this string to produce the exported version."
;; Handle source code snippets
(org-export-replace-src-segments)
;; Find all headings and compute the targets for them
(setq target-alist (org-export-define-heading-targets target-alist))
;; Get rid of drawers
(org-export-remove-or-extract-drawers drawers
......@@ -1490,6 +1487,9 @@ on this string to produce the exported version."
;; Remove todo-keywords before exporting, if the user has requested so
(org-export-remove-headline-metadata parameters)
;; Find all headings and compute the targets for them
(setq target-alist (org-export-define-heading-targets target-alist))
;; Find targets in comments and move them out of comments,
;; but mark them as targets that should be invisible
(setq target-alist (org-export-handle-invisible-targets target-alist))
......@@ -1513,6 +1513,7 @@ on this string to produce the exported version."
;; Remove comment environment and comment subtrees
(org-export-remove-comment-blocks-and-subtrees)
;; Find matches for radio targets and turn them into internal links
(org-export-mark-radio-links)
......@@ -1570,22 +1571,18 @@ on this string to produce the exported version."
The new targets are added to TARGET-ALIST, which is also returned."
(goto-char (point-min))
(org-init-section-numbers)
(let ((re (concat "^" org-outline-regexp
"\\| [ \t]*:ID:[ \t]*\\([^ \t\r\n]+\\)"))
(let ((re (concat "^" org-outline-regexp))
level target)
(while (re-search-forward re nil t)
(if (match-end 1)
(push (cons (org-match-string-no-properties 1)
target) target-alist)
(setq level (org-reduced-level
(save-excursion (goto-char (point-at-bol))
(org-outline-level))))
(setq target (org-solidify-link-text
(format "sec-%s" (org-section-number level))))
(push (cons target target) target-alist)
(add-text-properties
(point-at-bol) (point-at-eol)
(list 'target target)))))
(setq level (org-reduced-level
(save-excursion (goto-char (point-at-bol))
(org-outline-level))))
(setq target (org-solidify-link-text
(format "sec-%s" (org-section-number level))))
(push (cons target target) target-alist)
(add-text-properties
(point-at-bol) (point-at-eol)
(list 'target target))))
target-alist)
(defun org-export-handle-invisible-targets (target-alist)
......@@ -1614,11 +1611,9 @@ Mark them as invisible targets."
target-alist)
(defun org-export-target-internal-links (target-alist)
"Find all internal links and assign targets to them.
"Find all internal links and assign target to them.
If a link has a fuzzy match (i.e. not a *dedicated* target match),
let the link point to the corresponding section.
This function also handles the id links, if they have a match in
the current file."
let the link point to the corresponding section."
(goto-char (point-min))
(while (re-search-forward org-bracket-link-regexp nil t)
(org-if-unprotected
......@@ -1630,8 +1625,6 @@ the current file."
(target
(cond
((cdr (assoc slink target-alist)))
((and (string-match "^id:" link)
(cdr (assoc (substring link 3) target-alist))))
((string-match org-link-types-re link) nil)
((or (file-name-absolute-p link)
(string-match "^\\." link))
......
This diff is collapsed.
;;; org-clock.el --- The time clocking code for Org-mode
;; Copyright (C) 2008 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.14
;;
;; This file is part of GNU Emacs.
;;
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;; This file contains the relative timer code for Org-mode
(require 'org)
(defvar org-timer-start-time nil
"t=0 for the running timer.")
(defconst org-timer-re "\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
"Regular expression used to match timer stamps.")
(defcustom org-timer-format "%s "
"The format to insert the time of the timer.
This format must contain one instance of \"%s\" which will be replaced by
the value of the relative timer."
:group 'org-time
:type 'string)
;;;###autoload
(defun org-timer-start (&optional offset)
"Set the starting time for the relative timer to now.
When called with prefix argument OFFSET, prompt the user for an offset time,
with the default taken from a timer stamp at point, if any.
If OFFSET is a string or an integer, it is directly taken to be the offset
without user interaction.
When called with a double prefix arg, all timer strings in the active
region will be shifted by a specific amount. You will be prompted for
the amount, with the default to make the first timer string in
the region 0:00:00."
(interactive "P")
(if (equal offset '(16))
(call-interactively 'org-timer-change-times-in-region)
(let (delta def s)
(if (not offset)
(setq org-timer-start-time (current-time))
(cond
((integerp offset) (setq delta offset))
((stringp offset) (setq delta (org-timer-hms-to-secs offset)))
(t
(setq def (if (org-in-regexp org-timer-re)
(match-string 0)
"0:00:00")
s (read-string
(format "Restart timer with offset [%s]: " def)))
(unless (string-match "\\S-" s) (setq s def))
(setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
(setq org-timer-start-time
(seconds-to-time
(-
(time-to-seconds (current-time))
(org-timer-hms-to-secs s)))))
(message "Timer start time set to %s, current value is %s"
(format-time-string "%T" org-timer-start-time)
(org-timer-secs-to-hms (or delta 0))))))
;;;###autoload
(defun org-timer (&optional restart)
"Insert a H:MM:SS string from the timer into the buffer.
The first time this command is used, the timer is started. When used with
a `C-u' prefix, force restarting the timer.
When used with a double prefix arg `C-u C-u', change all the timer string
in the region by a fixed amount. This can be used to recalibrate a timer
that was not started at the correct moment."
(interactive "P")
(if (equal restart '(4)) (org-timer-start))
(or org-timer-start-time (org-timer-start))
(insert (format
org-timer-format
(org-timer-secs-to-hms
(floor
(- (time-to-seconds (current-time))
(time-to-seconds org-timer-start-time)))))))
;;;###autoload
(defun org-timer-change-times-in-region (beg end delta)
"Change all h:mm:ss time in region by a DELTA."
(interactive
"r\nsEnter time difference like \"-1:08:26\". Default is first time to zero: ")
(let ((re "[-+]?[0-9]+:[0-9]\\{2\\}:[0-9]\\{2\\}") p)
(unless (string-match "\\S-" delta)
(save-excursion
(goto-char beg)
(when (re-search-forward re end t)
(setq delta (match-string 0))
(if (equal (string-to-char delta) ?-)
(setq delta (substring delta 1))
(setq delta (concat "-" delta))))))
(setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete delta)))
(when (= delta 0) (error "No change"))
(save-excursion
(goto-char end)
(while (re-search-backward re beg t)
(setq p (point))
(replace-match
(save-match-data
(org-timer-secs-to-hms (+ (org-timer-hms-to-secs (match-string 0)) delta)))
t t)
(goto-char p)))))
;;;###autoload
(defun org-timer-item (&optional arg)
"Insert a description-type item with the curren timer value."
(interactive "P")
(let ((ind 0))
(save-excursion
(skip-chars-backward " \n\t")
(condition-case nil
(progn
(org-beginning-of-item)
(setq ind (org-get-indentation)))
(error nil)))
(or (bolp) (newline))
(org-indent-line-to ind)
(insert "- ")
(org-timer (if arg '(4)))
(insert ":: ")))
(defun org-timer-fix-incomplete (hms)
"If hms is a H:MM:SS string with missing hour or hour and minute, fix it."
(if (string-match "\\(?:\\([0-9]+:\\)?\\([0-9]+:\\)\\)?\\([0-9]+\\)" hms)
(replace-match
(format "%d:%02d:%02d"
(if (match-end 1) (string-to-number (match-string 1 hms)) 0)
(if (match-end 2) (string-to-number (match-string 2 hms)) 0)
(string-to-number (match-string 3 hms)))
t t hms)
(error "Canot parse HMS string \"%s\"" hms)))
(defun org-timer-hms-to-secs (hms)
"Convert h:mm:ss string to an integer time.
If the string starts with a minus sign, the integer will be negative."
(if (not (string-match
"\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
hms))
0
(let* ((h (string-to-number (match-string 1 hms)))
(m (string-to-number (match-string 2 hms)))
(s (string-to-number (match-string 3 hms)))
(sign (equal (substring (match-string 1 hms) 0 1) "-")))
(setq h (abs h))
(* (if sign -1 1) (+ s (* 60 (+ m (* 60 h))))))))
(defun org-timer-secs-to-hms (s)
"Convert integer S into h:mm:ss.
If the integer is negative, the strig will start with \"-\"."
(let (sign m h)
(setq sign (if (< s 0) "-" "")
s (abs s)
m (/ s 60) s (- s (* 60 m))
h (/ m 60) m (- m (* 60 h)))
(format "%s%d:%02d:%02d" sign h m s)))
;; arch-tag: 97538f8c-3871-4509-8f23-1e7b3ff3d107
;;; org-timer.el ends here
......@@ -956,40 +956,6 @@ It should match if the message is from the user him/herself."
:group 'org-link-store
:type 'regexp)
(defcustom org-link-to-org-use-id 'create-if-interactive
"Non-nil means, storing a link to an Org file will use entry ID's.
Note that before this variable is even considered, org-id must be loaded,
to please customize `org-modules' and turn it on.
The variable can have the following values:
t Create an ID if needed to make a link to the current entry.
create-if-interactive
If `org-store-link' is called directly (interactively, as a user
command), do create an ID to support the link. But when doing the
job for remember, only use the ID if it already exists. The
purpose of this setting is to avoid proliferation of unwanted
ID's, just because you happen to be in an Org file when you
call `org-remember' that automatically and preemptively
creates a link. If you do want to get an ID link in a remember
template to an entry not having an ID, create it first by
explicitly creating a link to it, using `C-c C-l' first.
use-existing
Use existing ID, do not create one.
nil Never use an ID to make a link, instead link using a text search for
the headline text."
:group 'org-link-store
:type '(choice
(const :tag "Create ID to make link" t)
(const :tag "Create if string link interactively"
'create-if-interactive)
(const :tag "Only use existing" 'use-existing)
(const :tag "Do not use ID to create link" nil)))
(defcustom org-context-in-file-links t
"Non-nil means, file links from `org-store-link' contain context.
A search string will be added to the file name with :: as separator and
......@@ -2840,12 +2806,11 @@ collapsed state."
;; Autoload ID code
(declare-function org-id-store-link "org-id")
(org-autoload "org-id"
'(org-id-get-create org-id-new org-id-copy org-id-get
org-id-get-with-outline-path-completion
org-id-get-with-outline-drilling
org-id-goto org-id-find org-id-store-link))
org-id-goto org-id-find))
;;; Variables for pre-computed regular expressions, all buffer local
......@@ -5303,7 +5268,6 @@ the inserted text when done."
(beginning-of-line 1)
(unless for-yank (org-back-over-empty-lines))
(setq beg (point))
(and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
(insert-before-markers txt)
(unless (string-match "\n\\'" txt) (insert "\n"))
(setq newend (point))
......@@ -6177,6 +6141,7 @@ type. For a simple example of an export function, see `org-bbdb.el'."
(setcdr (assoc type org-link-protocols) (list follow export))
(push (list type follow export) org-link-protocols)))
;;;###autoload
(defun org-store-link (arg)
"\\<org-mode-map>Store an org-link to the current location.
......@@ -6237,34 +6202,14 @@ For file links, arg negates `org-context-in-file-links'."
link (org-make-link cpltxt)))
((and buffer-file-name (org-mode-p))
(cond
((org-in-regexp "<<\\(.*?\\)>>")
(setq cpltxt
(concat "file:"
(abbreviate-file-name buffer-file-name)
"::" (match-string 1))
link (org-make-link cpltxt)))
((and (featurep 'org-id)
(or (eq org-link-to-org-use-id t)
(and (eq org-link-to-org-use-id 'create-if-interactive)
(interactive-p))
(and org-link-to-org-use-id
(condition-case nil
(org-entry-get nil "ID")
(error nil)))))
;; We can make a link using the ID.
(setq link (condition-case nil
(org-id-store-link)
(error
;; probably before first headling, link to file only
(concat "file:"
(abbreviate-file-name buffer-file-name))))))
(t
;; Just link to current headline
(setq cpltxt (concat "file:"
(abbreviate-file-name buffer-file-name)))
;; Add a context search string
(when (org-xor org-context-in-file-links arg)
;; Just link to current headline
(setq cpltxt (concat "file:"
(abbreviate-file-name buffer-file-name)))
;; Add a context search string
(when (org-xor org-context-in-file-links arg)
;; Check if we are on a target
(if (org-in-regexp "<<\\(.*?\\)>>")
(setq cpltxt (concat cpltxt "::" (match-string 1)))
(setq txt (cond
((org-on-heading-p) nil)
((org-region-active-p)
......@@ -6276,10 +6221,10 @@ For file links, arg negates `org-context-in-file-links'."
(condition-case nil
(org-make-org-heading-search-string txt)
(error "")))
desc "NONE")))
(if (string-match "::\\'" cpltxt)
(setq cpltxt (substring cpltxt 0 -2)))
(setq link (org-make-link cpltxt)))))
desc "NONE"))))
(if (string-match "::\\'" cpltxt)
(setq cpltxt (substring cpltxt 0 -2)))
(setq link (org-make-link cpltxt)))
((buffer-file-name (buffer-base-buffer))
;; Just link to this file here.
......@@ -10614,7 +10559,6 @@ completion."
IDENT can be a string, a symbol or a number, this function will search for
the string representation of it.
Return the position where this entry starts, or nil if there is no such entry."
(interactive "sID: ")
(let ((id (cond
((stringp ident) ident)
((symbol-name ident) (symbol-name ident))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment