Remove final parts of XEmacs compatibility code

* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
This commit is contained in:
Nicolas Goaziou 2016-05-26 12:18:00 +02:00
parent a54dd63e28
commit 0ac099a6f8
32 changed files with 455 additions and 667 deletions

View File

@ -130,7 +130,7 @@ simple timestamp string."
(pr :file (nth org-notify-parse-file (org-agenda-files 'unrestricted)))
(pr :timestamp deadline) (pr :uid (md5 (concat heading deadline)))
(pr :deadline (- (org-time-string-to-seconds deadline)
(org-float-time))))
(float-time))))
result)))
(defun org-notify-todo-list ()
@ -165,7 +165,7 @@ forgotten tasks."
(dolist (prms (plist-get org-notify-map (td :notify)))
(when (< deadline (org-notify-string->seconds (prm :time)))
(let ((period (org-notify-string->seconds (prm :period)))
(last-run (prm last-run-sym)) (now (org-float-time))
(last-run (prm last-run-sym)) (now (float-time))
(actions (prm :actions)) diff plist)
(when (or (not last-run)
(and period (< period (setq diff (- now last-run)))

View File

@ -203,7 +203,7 @@ setting of `org-wikinodes-create-targets'."
(widen)
(goto-char (point-min))
(while (re-search-forward re nil t)
(push (org-match-string-no-properties 4) targets))))
(push (match-string-no-properties 4) targets))))
(nreverse targets)))
(defun org-wikinodes-get-links-for-directory (dir)

View File

@ -603,7 +603,7 @@ doesn't include leading \"depends\"."
(let ((id (org-element-property :TASK_ID dep)))
(and id
(string-match (concat id " +\\({.*?}\\)") dep-str)
(org-match-string-no-properties 1 dep-str))))
(match-string-no-properties 1 dep-str))))
path)
;; Compute number of exclamation marks by looking for the
;; common ancestor between TASK and DEP.

View File

@ -73,8 +73,6 @@
(declare-function org-uniquify "org" (list))
(declare-function org-current-level "org" ())
(declare-function org-table-import "org-table" (file arg))
(declare-function org-add-hook "org-compat"
(hook function &optional append local))
(declare-function org-table-align "org-table" ())
(declare-function org-table-end "org-table" (&optional table-type))
(declare-function orgtbl-to-generic "org-table" (table params))
@ -1407,8 +1405,8 @@ portions of results lines."
(add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe)
;; Remove overlays when changing major mode
(add-hook 'org-mode-hook
(lambda () (org-add-hook 'change-major-mode-hook
'org-babel-show-result-all 'append 'local)))
(lambda () (add-hook 'change-major-mode-hook
'org-babel-show-result-all 'append 'local)))
(defvar org-file-properties)
(defun org-babel-params-from-properties (&optional lang)
@ -1730,7 +1728,7 @@ to `org-babel-named-src-block-regexp'."
(let ((re (org-babel-named-src-block-regexp-for-name))
names)
(while (ignore-errors (org-next-block 1 nil re))
(push (org-match-string-no-properties 9) names))
(push (match-string-no-properties 9) names))
names)))
;;;###autoload

View File

@ -1023,8 +1023,8 @@ headlines as the agenda display heavily relies on them."
(defcustom org-agenda-mouse-1-follows-link nil
"Non-nil means mouse-1 on a link will follow the link in the agenda.
A longer mouse click will still set point. Does not work on XEmacs.
Needs to be set before org.el is loaded."
A longer mouse click will still set point. Needs to be set
before org.el is loaded."
:group 'org-agenda-startup
:type 'boolean)
@ -2170,10 +2170,10 @@ The following commands are available:
(easy-menu-add org-agenda-menu)
(if org-startup-truncated (setq truncate-lines t))
(setq-local line-move-visual nil)
(org-add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local)
(org-add-hook 'pre-command-hook 'org-unhighlight nil 'local)
(add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local)
(add-hook 'pre-command-hook 'org-unhighlight nil 'local)
;; Make sure properties are removed when copying text
(org-add-hook 'filter-buffer-substring-functions
(add-hook 'filter-buffer-substring-functions
(lambda (fun start end delete)
(substring-no-properties (funcall fun start end delete)))
nil t)
@ -2841,7 +2841,7 @@ Pressing `<' twice means to restrict to the current subtree or region
((equal org-keys "M") (org-call-with-arg 'org-tags-view (or arg '(4))))
((equal org-keys "e") (call-interactively 'org-store-agenda-views))
((equal org-keys "?") (org-tags-view nil "+FLAGGED")
(org-add-hook
(add-hook
'post-command-hook
(lambda ()
(unless (current-message)
@ -3795,7 +3795,7 @@ FILTER-ALIST is an alist of filters we need to apply when
(when (get 'org-agenda-effort-filter :preset-filter)
(org-agenda-filter-apply
(get 'org-agenda-effort-filter :preset-filter) 'effort))
(org-add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))))
(add-hook 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)))))
(defun org-agenda-mark-clocking-task ()
"Mark the current clock entry in the agenda if it is present."
@ -3952,7 +3952,7 @@ functions do."
(defvar org-agenda-markers nil
"List of all currently active markers created by `org-agenda'.")
(defvar org-agenda-last-marker-time (org-float-time)
(defvar org-agenda-last-marker-time (float-time)
"Creation time of the last agenda marker.")
(defun org-agenda-new-marker (&optional pos)
@ -3960,7 +3960,7 @@ functions do."
Maker is at point, or at POS if non-nil. Org mode keeps a list of
these markers and resets them when they are no longer in use."
(let ((m (copy-marker (or pos (point)) t)))
(setq org-agenda-last-marker-time (org-float-time))
(setq org-agenda-last-marker-time (float-time))
(if org-agenda-buffer
(with-current-buffer org-agenda-buffer
(push m org-agenda-markers))
@ -5118,12 +5118,12 @@ of what a project is and how to check if it stuck, customize the variable
(tags (nth 2 org-stuck-projects))
(tags-re (if (member "*" tags)
(concat org-outline-regexp-bol
(org-re ".*:[[:alnum:]_@#%]+:[ \t]*$"))
".*:[[:alnum:]_@#%]+:[ \t]*$")
(if tags
(concat org-outline-regexp-bol
".*:\\("
(mapconcat 'identity tags "\\|")
(org-re "\\):[[:alnum:]_@#%:]*[ \t]*$")))))
(mapconcat #'identity tags "\\|")
"\\):[[:alnum:]_@#%:]*[ \t]*$"))))
(gen-re (nth 3 org-stuck-projects))
(re-list
(delq nil
@ -5290,7 +5290,7 @@ So the example above may also be written as
The function expects the lisp variables `entry' and `date' to be provided
by the caller, because this is how the calendar works. Don't use this
function from a program - use `org-agenda-get-day-entries' instead."
(when (> (- (org-float-time)
(when (> (- (float-time)
org-agenda-last-marker-time)
5)
;; I am not sure if this works with sticky agendas, because the marker
@ -5302,7 +5302,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
(let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
(list entry)
(org-agenda-files t)))
(time (org-float-time))
(time (float-time))
file rtn results)
(when (or (not org-diary-last-run-time)
(> (- time
@ -5945,7 +5945,7 @@ See also the user option `org-agenda-clock-consistency-checks'."
(re (concat "^[ \t]*"
org-clock-string
"[ \t]+"
"\\(\\[.*?\\]\\)" ; group 1 is first stamp
"\\(\\[.*?\\]\\)" ; group 1 is first stamp
"\\(-\\{1,3\\}\\(\\[.*?\\]\\)\\)?")) ; group 3 is second
(tlstart 0.)
(tlend 0.)
@ -5981,10 +5981,10 @@ See also the user option `org-agenda-clock-consistency-checks'."
(throw 'next t))
(setq ts (match-string 1)
te (match-string 3)
ts (org-float-time
(apply 'encode-time (org-parse-time-string ts)))
te (org-float-time
(apply 'encode-time (org-parse-time-string te)))
ts (float-time
(apply #'encode-time (org-parse-time-string ts)))
te (float-time
(apply #'encode-time (org-parse-time-string te)))
dt (- te ts))))
(cond
((> dt (* 60 maxtime))
@ -6580,8 +6580,7 @@ Any match of REMOVE-RE will be removed from TXT."
(setq duration (- (org-hh:mm-string-to-minutes s2)
(org-hh:mm-string-to-minutes s1)))))
(when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
txt)
(when (string-match "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" txt)
;; Tags are in the string
(if (or (eq org-agenda-remove-tags t)
(and org-agenda-remove-tags
@ -6656,7 +6655,7 @@ Any match of REMOVE-RE will be removed from TXT."
The modified list may contain inherited tags, and tags matched by
`org-agenda-hide-tags-regexp' will be removed."
(when (or add-inherited hide-re)
(if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") txt)
(if (string-match "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" txt)
(setq txt (substring txt 0 (match-beginning 0))))
(setq tags
(delq nil
@ -7152,7 +7151,7 @@ their type."
'face 'org-agenda-restriction-lock)
(overlay-put org-agenda-restriction-lock-overlay
'help-echo "Agendas are currently limited to this subtree.")
(org-detach-overlay org-agenda-restriction-lock-overlay)
(delete-overlay org-agenda-restriction-lock-overlay)
;;;###autoload
(defun org-agenda-set-restriction-lock (&optional type)
@ -7198,8 +7197,8 @@ in the file. Otherwise, restriction will be to the current subtree."
(defun org-agenda-remove-restriction-lock (&optional noupdate)
"Remove the agenda restriction lock."
(interactive "P")
(org-detach-overlay org-agenda-restriction-lock-overlay)
(org-detach-overlay org-speedbar-restriction-lock-overlay)
(delete-overlay org-agenda-restriction-lock-overlay)
(delete-overlay org-speedbar-restriction-lock-overlay)
(setq org-agenda-overriding-restriction nil)
(setq org-agenda-restrict nil)
(put 'org-agenda-files 'org-restrict nil)
@ -8144,7 +8143,7 @@ so that the date SD will be in that range."
(defun org-unhighlight ()
"Detach overlay INDEX."
(org-detach-overlay org-hl))
(delete-overlay org-hl))
(defun org-unhighlight-once ()
"Remove the highlight from its position, and this function from the hook."
@ -8291,7 +8290,7 @@ When called with a prefix argument, include all archive files as well."
(t ""))
(if (or org-agenda-category-filter
(get 'org-agenda-category-filter :preset-filter))
'(:eval (org-propertize
'(:eval (propertize
(concat " <"
(mapconcat
'identity
@ -8304,7 +8303,7 @@ When called with a prefix argument, include all archive files as well."
'help-echo "Category used in filtering")) "")
(if (or org-agenda-tag-filter
(get 'org-agenda-tag-filter :preset-filter))
'(:eval (org-propertize
'(:eval (propertize
(concat " {"
(mapconcat
'identity
@ -8317,7 +8316,7 @@ When called with a prefix argument, include all archive files as well."
'help-echo "Tags used in filtering")) "")
(if (or org-agenda-effort-filter
(get 'org-agenda-effort-filter :preset-filter))
'(:eval (org-propertize
'(:eval (propertize
(concat " {"
(mapconcat
'identity
@ -8330,7 +8329,7 @@ When called with a prefix argument, include all archive files as well."
'help-echo "Effort conditions used in filtering")) "")
(if (or org-agenda-regexp-filter
(get 'org-agenda-regexp-filter :preset-filter))
'(:eval (org-propertize
'(:eval (propertize
(concat " ["
(mapconcat
'identity
@ -8986,7 +8985,7 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
(let ((inhibit-read-only t) l c)
(save-excursion
(goto-char (if line (point-at-bol) (point-min)))
(while (re-search-forward (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
(while (re-search-forward "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
(if line (point-at-eol) nil) t)
(add-text-properties
(match-beginning 2) (match-end 2)
@ -9530,7 +9529,7 @@ a timestamp can be added there."
(insert text)
(org-end-of-meta-data)
(unless (bolp) (insert "\n"))
(when org-adapt-indentation (org-indent-to-column 2)))
(when org-adapt-indentation (indent-to-column 2)))
(defun org-agenda-insert-diary-make-new-entry (text)
"Make a new entry with TEXT as a child of the current subtree.
@ -9552,8 +9551,8 @@ a timestamp can be added there."
(org-end-of-meta-data)
;; Ensure point is left on a blank line, at proper indentation.
(unless (bolp) (insert "\n"))
(unless (org-looking-at-p "^[ \t]*$") (save-excursion (insert "\n")))
(when org-adapt-indentation (org-indent-to-column col)))
(unless (looking-at-p "^[ \t]*$") (save-excursion (insert "\n")))
(when org-adapt-indentation (indent-to-column col)))
(org-show-set-visibility 'lineage))
(defun org-agenda-diary-entry ()

View File

@ -171,7 +171,7 @@ archive file is."
(if (eq (match-string 1) ":") (org-at-property-p)
(eq (org-element-type (org-element-at-point)) 'keyword)))
(let ((file (org-extract-archive-file
(org-match-string-no-properties 2))))
(match-string-no-properties 2))))
(when (and (org-string-nw-p file) (file-exists-p file))
(push file files))))))
(setq files (nreverse files))
@ -318,7 +318,7 @@ this heading."
(progn
(if (re-search-forward
(concat "^" (regexp-quote heading)
(org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
"[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)")
nil t)
(goto-char (match-end 0))
;; Heading not found, just insert it at the end

View File

@ -671,19 +671,19 @@ If not, show simply the clocked time like 01:50."
(let* ((effort-in-minutes
(org-duration-string-to-minutes org-clock-effort))
(work-done-str
(org-propertize
(propertize
(org-minutes-to-clocksum-string clocked-time)
'face (if (and org-clock-task-overrun (not org-clock-task-overrun-text))
'org-mode-line-clock-overrun 'org-mode-line-clock)))
(effort-str (org-minutes-to-clocksum-string effort-in-minutes))
(clockstr (org-propertize
(clockstr (propertize
(concat " [%s/" effort-str
"] (" (replace-regexp-in-string "%" "%%" org-clock-heading) ")")
'face 'org-mode-line-clock)))
(format clockstr work-done-str))
(org-propertize (concat "[" (org-minutes-to-clocksum-string clocked-time)
"]" (format " (%s)" org-clock-heading))
'face 'org-mode-line-clock))))
(propertize (concat "[" (org-minutes-to-clocksum-string clocked-time)
"]" (format " (%s)" org-clock-heading))
'face 'org-mode-line-clock))))
(defun org-clock-get-last-clock-out-time ()
"Get the last clock-out time for the current subtree."
@ -698,20 +698,20 @@ If not, show simply the clocked time like 01:50."
(org-clock-notify-once-if-expired)
(setq org-clock-task-overrun nil))
(setq org-mode-line-string
(org-propertize
(propertize
(let ((clock-string (org-clock-get-clock-string))
(help-text "Org-mode clock is running.\nmouse-1 shows a menu\nmouse-2 will jump to task"))
(if (and (> org-clock-string-limit 0)
(> (length clock-string) org-clock-string-limit))
(org-propertize
(propertize
(substring clock-string 0 org-clock-string-limit)
'help-echo (concat help-text ": " org-clock-heading))
(org-propertize clock-string 'help-echo help-text)))
(propertize clock-string 'help-echo help-text)))
'local-map org-clock-mode-line-map
'mouse-face 'mode-line-highlight))
(if (and org-clock-task-overrun org-clock-task-overrun-text)
(setq org-mode-line-string
(concat (org-propertize
(concat (propertize
org-clock-task-overrun-text
'face 'org-mode-line-clock-overrun) org-mode-line-string)))
(force-mode-line-update))
@ -721,8 +721,8 @@ If not, show simply the clocked time like 01:50."
The time returned includes the time spent on this task in
previous clocking intervals."
(let ((currently-clocked-time
(floor (- (org-float-time)
(org-float-time org-clock-start-time)) 60)))
(floor (- (float-time)
(float-time org-clock-start-time)) 60)))
(+ currently-clocked-time (or org-clock-total-time 0))))
(defun org-clock-modify-effort-estimate (&optional value)
@ -1033,7 +1033,7 @@ to be CLOCKED OUT."))))
nil 45)))
(and (not (memq char-pressed '(?i ?q))) char-pressed)))))
(default
(floor (/ (org-float-time
(floor (/ (float-time
(time-subtract (current-time) last-valid)) 60)))
(keep
(and (memq ch '(?k ?K))
@ -1042,8 +1042,8 @@ to be CLOCKED OUT."))))
(and (memq ch '(?g ?G))
(read-number "Got back how many minutes ago? " default)))
(subtractp (memq ch '(?s ?S)))
(barely-started-p (< (- (org-float-time last-valid)
(org-float-time (cdr clock))) 45))
(barely-started-p (< (- (float-time last-valid)
(float-time (cdr clock))) 45))
(start-over (and subtractp barely-started-p)))
(cond
((memq ch '(?j ?J))
@ -1102,8 +1102,8 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling
(lambda (clock)
(format
"Dangling clock started %d mins ago"
(floor (- (org-float-time)
(org-float-time (cdr clock)))
(floor (- (float-time)
(float-time (cdr clock)))
60)))))
(or last-valid
(cdr clock)))))))))))
@ -1112,7 +1112,7 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling
"Return the current Emacs idle time in seconds, or nil if not idle."
(let ((idle-time (current-idle-time)))
(if idle-time
(org-float-time idle-time)
(float-time idle-time)
0)))
(defun org-mac-idle-seconds ()
@ -1163,7 +1163,7 @@ so long."
org-clock-start-time)
(lambda (_)
(format "Clocked in & idle for %.1f mins"
(/ (org-float-time
(/ (float-time
(time-subtract (current-time)
org-clock-user-idle-start))
60.0)))
@ -1204,7 +1204,7 @@ make this the default behavior.)"
(not org-clock-resolving-clocks))
(setq org-clock-leftover-time nil)
(let ((org-clock-clocking-in t))
(org-resolve-clocks))) ; check if any clocks are dangling
(org-resolve-clocks))) ; check if any clocks are dangling
(when (equal select '(64))
;; Set start-time to `org-clock-out-time'
@ -1316,7 +1316,7 @@ make this the default behavior.)"
(end-of-line 0)
(org-in-item-p)))
(beginning-of-line 1)
(org-indent-line-to (- (org-get-indentation) 2)))
(indent-line-to (- (org-get-indentation) 2)))
(insert org-clock-string " ")
(setq org-clock-effort (org-entry-get (point) org-effort-property))
(setq org-clock-total-time (org-clock-sum-current-item
@ -1327,9 +1327,10 @@ make this the default behavior.)"
(y-or-n-p
(format
"You stopped another clock %d mins ago; start this one from then? "
(/ (- (org-float-time
(/ (- (float-time
(org-current-time org-clock-rounding-minutes t))
(org-float-time leftover)) 60)))
(float-time leftover))
60)))
leftover)
start-time
(org-current-time org-clock-rounding-minutes t)))
@ -1580,8 +1581,10 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(delete-region (point) (point-at-eol))
(insert "--")
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
(setq s (- (org-float-time (apply 'encode-time (org-parse-time-string te)))
(org-float-time (apply 'encode-time (org-parse-time-string ts))))
(setq s (- (float-time
(apply #'encode-time (org-parse-time-string te)))
(float-time
(apply #'encode-time (org-parse-time-string ts))))
h (floor (/ s 3600))
s (- s (* 3600 h))
m (floor (/ s 60))
@ -1691,7 +1694,7 @@ Optional argument N tells to change by that many units."
(save-excursion
(goto-char begts)
(org-timestamp-change
(round (/ (org-float-time tdiff)
(round (/ (float-time tdiff)
(cond ((eq org-ts-what 'minute) 60)
((eq org-ts-what 'hour) 3600)
((eq org-ts-what 'day) (* 24 3600))
@ -1712,8 +1715,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 ".*")
(line-beginning-position))
(if (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 (point)))
(message "Clock gone, cancel the timer anyway")
@ -1799,8 +1802,8 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
time)
(if (stringp tstart) (setq tstart (org-time-string-to-seconds tstart)))
(if (stringp tend) (setq tend (org-time-string-to-seconds tend)))
(if (consp tstart) (setq tstart (org-float-time tstart)))
(if (consp tend) (setq tend (org-float-time tend)))
(if (consp tstart) (setq tstart (float-time tstart)))
(if (consp tend) (setq tend (float-time tend)))
(remove-text-properties (point-min) (point-max)
`(,(or propname :org-clock-minutes) t
:org-clock-force-headline-inclusion t))
@ -1812,10 +1815,10 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
;; Two time stamps
(setq ts (match-string 2)
te (match-string 3)
ts (org-float-time
(apply 'encode-time (org-parse-time-string ts)))
te (org-float-time
(apply 'encode-time (org-parse-time-string te)))
ts (float-time
(apply #'encode-time (org-parse-time-string ts)))
te (float-time
(apply #'encode-time (org-parse-time-string te)))
ts (if tstart (max ts tstart) ts)
te (if tend (min te tend) te)
dt (- te ts)
@ -1831,10 +1834,11 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
(equal (marker-position org-clock-hd-marker) (point))
tstart
tend
(>= (org-float-time org-clock-start-time) tstart)
(<= (org-float-time org-clock-start-time) tend))
(let ((time (floor (- (org-float-time)
(org-float-time org-clock-start-time)) 60)))
(>= (float-time org-clock-start-time) tstart)
(<= (float-time org-clock-start-time) tend))
(let ((time (floor (- (float-time)
(float-time org-clock-start-time))
60)))
(setq t1 (+ t1 time))))
(let* ((headline-forced
(get-text-property (point)
@ -1922,7 +1926,7 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
m (- org-clock-file-total-minutes (* 60 h)))
;; Arrange to remove the overlays upon next change.
(when org-remove-highlights-with-change
(org-add-hook 'before-change-functions 'org-clock-remove-overlays
(add-hook 'before-change-functions 'org-clock-remove-overlays
nil 'local))))
(message (concat (format "Total file time%s: "
(cond (todayp " for today")
@ -2703,18 +2707,17 @@ LEVEL is an integer. Indent by two spaces per level above 1."
((numberp ts)
;; If ts is a number, it's an absolute day number from org-agenda.
(destructuring-bind (month day year) (calendar-gregorian-from-absolute ts)
(setq ts (org-float-time (encode-time 0 0 0 day month year)))))
(setq ts (float-time (encode-time 0 0 0 day month year)))))
(ts
(setq ts (org-float-time
(apply 'encode-time (org-parse-time-string ts))))))
(setq ts (float-time
(apply #'encode-time (org-parse-time-string ts))))))
(cond
((numberp te)
;; Likewise for te.
(destructuring-bind (month day year) (calendar-gregorian-from-absolute te)
(setq te (org-float-time (encode-time 0 0 0 day month year)))))
(setq te (float-time (encode-time 0 0 0 day month year)))))
(te
(setq te (org-float-time
(apply 'encode-time (org-parse-time-string te))))))
(setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
(setq tsb
(if (eq step0 'week)
(- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws)))
@ -2814,7 +2817,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(when (setq time (get-text-property p :org-clock-minutes))
(save-excursion
(beginning-of-line 1)
(when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))
(when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$")
(setq level (org-reduced-level
(- (match-end 1) (match-beginning 1))))
(<= level maxlevel))
@ -2907,10 +2910,10 @@ Otherwise, return nil."
(end-of-line 1)
(setq ts (match-string 1)
te (match-string 3))
(setq s (- (org-float-time
(apply 'encode-time (org-parse-time-string te)))
(org-float-time
(apply 'encode-time (org-parse-time-string ts))))
(setq s (- (float-time
(apply #'encode-time (org-parse-time-string te)))
(float-time
(apply #'encode-time (org-parse-time-string ts))))
neg (< s 0)
s (abs s)
h (floor (/ s 3600))

View File

@ -263,7 +263,7 @@ initialized."
org-agenda-columns-add-appointments-to-effort-sum
(string= p (upcase org-effort-property))
(get-text-property (point) 'duration)
(org-propertize
(propertize
(org-minutes-to-clocksum-string
(get-text-property (point) 'duration))
'face 'org-warning))
@ -438,7 +438,7 @@ for the duration of the command.")
(org-add-props " " nil 'display '(space :align-to 0))
(org-add-props (substring title 0 -1) nil 'face 'org-column-title)))
(setq org-columns-previous-hscroll -1)
(org-add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
(add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
(defun org-columns-hscoll-title ()
"Set the `header-line-format' so that it scrolls along with the table."

View File

@ -24,45 +24,34 @@
;;
;;; Commentary:
;; This file contains code needed for compatibility with XEmacs and older
;; This file contains code needed for compatibility with older
;; versions of GNU Emacs.
;;; Code:
(eval-when-compile
(require 'cl))
(require 'org-macs)
;; The following constant is for backward compatibility. We do not use
;; it in org-mode, because the Byte compiler evaluates (featurep 'xemacs)
;; at compilation time and can therefore optimize code better.
(defconst org-xemacs-p (featurep 'xemacs))
(defun org-compatible-face (inherits specs)
"Make a compatible face specification.
If INHERITS is an existing face and if the Emacs version supports it,
just inherit the face. If INHERITS is set and the Emacs version does
not support it, copy the face specification from the inheritance face.
If INHERITS is not given and SPECS is, use SPECS to define the face.
XEmacs and Emacs 21 do not know about the `min-colors' attribute.
For them we convert a (min-colors 8) entry to a `tty' entry and move it
to the top of the list. The `min-colors' attribute will be removed from
any other entries, and any resulting duplicates will be removed entirely."
If INHERITS is not given and SPECS is, use SPECS to define the face."
(when (and inherits (facep inherits) (not specs))
(setq specs (or specs
(get inherits 'saved-face)
(get inherits 'face-defface-spec))))
(cond
((and inherits (facep inherits)
(not (featurep 'xemacs))
(>= emacs-major-version 22)
;; do not inherit outline faces before Emacs 23
(or (>= emacs-major-version 23)
(not (string-match "\\`outline-[0-9]+"
(symbol-name inherits)))))
(list (list t :inherit inherits)))
((or (featurep 'xemacs) (< emacs-major-version 22))
((< emacs-major-version 22)
;; These do not understand the `min-colors' attribute.
(let (r e a)
(while (setq e (pop specs))
@ -104,7 +93,7 @@ any other entries, and any resulting duplicates will be removed entirely."
t)))
;;;; Emacs/XEmacs compatibility
;;; Emacs/XEmacs compatibility
(eval-and-compile
(defun org-defvaralias (new-alias base-variable &optional docstring)
@ -118,95 +107,39 @@ Don't do the aliasing when `defvaralias' is not bound."
(boundp 'user-init-directory))
(org-defvaralias 'user-emacs-directory 'user-init-directory)))
(when (featurep 'xemacs)
(defadvice custom-handle-keyword
(around org-custom-handle-keyword
activate preactivate)
"Remove custom keywords not recognized to avoid producing an error."
(cond
((eq (ad-get-arg 1) :package-version))
(t ad-do-it)))
(defadvice define-obsolete-variable-alias
(around org-define-obsolete-variable-alias
(obsolete-name current-name &optional when docstring)
activate preactivate)
"Declare arguments defined in later versions of Emacs."
ad-do-it)
(defadvice define-obsolete-function-alias
(around org-define-obsolete-function-alias
(obsolete-name current-name &optional when docstring)
activate preactivate)
"Declare arguments defined in later versions of Emacs."
ad-do-it)
(defvar customize-package-emacs-version-alist nil)
(defvar temporary-file-directory (temp-directory)))
(define-obsolete-function-alias 'org-add-hook 'add-hook "Org 9.0")
(define-obsolete-function-alias 'org-decompose-region 'decompose-region "Org 9.0")
(define-obsolete-function-alias 'org-detach-overlay 'delete-overlay "Org 9.0")
(define-obsolete-function-alias 'org-file-equal-p 'file-equal-p "Org 9.0")
(define-obsolete-function-alias 'org-float-time 'float-time "Org 9.0")
(define-obsolete-function-alias 'org-indent-line-to 'indent-line-to "Org 9.0")
(define-obsolete-function-alias 'org-indent-to-column 'indent-to-column "Org 9.0")
(define-obsolete-function-alias 'org-looking-at-p 'looking-at-p "Org 9.0")
(define-obsolete-function-alias 'org-looking-back 'looking-back "Org 9.0")
(define-obsolete-function-alias 'org-match-string-no-properties 'match-string-properties "Org 9.0")
(define-obsolete-function-alias 'org-propertize 'propertize "Org 9.0")
(define-obsolete-function-alias 'org-select-frame-set-input-focus 'select-frame-set-input-focus "Org 9.0")
;; Keys
(defconst org-xemacs-key-equivalents
'(([mouse-1] . [button1])
([mouse-2] . [button2])
([mouse-3] . [button3])
([C-mouse-4] . [(control mouse-4)])
([C-mouse-5] . [(control mouse-5)]))
"Translation alist for a couple of keys.")
(defmacro org-re (s)
"Replace posix classes in regular expression."
(declare (debug (form)))
s)
(make-obsolete 'org-re "It is now a no-op. Please remove it altogether." "Org 9.0")
;; Overlay compatibility functions
(defun org-detach-overlay (ovl)
(if (featurep 'xemacs) (detach-extent ovl) (delete-overlay ovl)))
(defun org-overlay-display (ovl text &optional face evap)
"Make overlay OVL display TEXT with face FACE."
(if (featurep 'xemacs)
(let ((gl (make-glyph text)))
(and face (set-glyph-face gl face))
(set-extent-property ovl 'invisible t)
(set-extent-property ovl 'end-glyph gl))
(overlay-put ovl 'display text)
(if face (overlay-put ovl 'face face))
(if evap (overlay-put ovl 'evaporate t))))
(defun org-overlay-before-string (ovl text &optional face evap)
"Make overlay OVL display TEXT with face FACE."
(if (featurep 'xemacs)
(let ((gl (make-glyph text)))
(and face (set-glyph-face gl face))
(set-extent-property ovl 'begin-glyph gl))
(if face (org-add-props text nil 'face face))
(overlay-put ovl 'before-string text)
(if evap (overlay-put ovl 'evaporate t))))
(defun org-find-overlays (prop &optional pos delete)
"Find all overlays specifying PROP at POS or point.
If DELETE is non-nil, delete all those overlays."
(let ((overlays (overlays-at (or pos (point))))
ov found)
(while (setq ov (pop overlays))
(if (overlay-get ov prop)
(if delete (delete-overlay ov) (push ov found))))
found))
;;; Miscellaneous functions
(defun org-get-x-clipboard (value)
"Get the value of the x or Windows clipboard, compatible with XEmacs, and GNU Emacs 21."
"Get the value of the X or Windows clipboard."
(cond ((eq window-system 'x)
(let ((x (org-get-x-clipboard-compat value)))
(if x (org-no-properties x))))
(org-no-properties
(ignore-errors
(or (x-get-selection value 'UTF8_STRING)
(x-get-selection value 'COMPOUND_TEXT)
(x-get-selection value 'STRING)
(x-get-selection value 'TEXT)))))
((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data))
(w32-get-clipboard-data))))
(defsubst org-decompose-region (beg end)
"Decompose from BEG to END."
(if (featurep 'xemacs)
(let ((modified-p (buffer-modified-p))
(buffer-read-only nil))
(remove-text-properties beg end '(composition nil))
(set-buffer-modified-p modified-p))
(decompose-region beg end)))
;; Miscellaneous functions
(defun org-add-hook (hook function &optional append local)
"Add-hook, compatible with both Emacsen."
(if (and local (featurep 'xemacs))
(add-local-hook hook function append)
(add-hook hook function append local)))
(defun org-add-props (string plist &rest props)
"Add text properties to entire string, from beginning to end.
PLIST may be a list of properties, PROPS are individual properties and values
@ -259,31 +192,28 @@ ignored in this case."
'set-transient-map
'set-temporary-overlay-map))
;; Region compatibility
;;; Region compatibility
(defvar org-ignore-region nil
"Non-nil means temporarily disable the active region.")
(defun org-region-active-p ()
"Is `transient-mark-mode' on and the region active?
Works on both Emacs and XEmacs."
"Is `transient-mark-mode' on and the region active?"
(if org-ignore-region
nil
(if (featurep 'xemacs)
(and zmacs-regions (region-active-p))
(if (fboundp 'use-region-p)
(use-region-p)
(and transient-mark-mode mark-active))))) ; Emacs 22 and before
(if (fboundp 'use-region-p)
(use-region-p)
(and transient-mark-mode mark-active)))) ; Emacs 22 and before
(defun org-cursor-to-region-beginning ()
(when (and (org-region-active-p)
(> (point) (region-beginning)))
(exchange-point-and-mark)))
;; Old alias for emacs 22 compatibility, now dropped
;;; Old alias for emacs 22 compatibility, now dropped
(define-obsolete-function-alias 'org-activate-mark 'activate-mark)
;; Invisibility compatibility
;;; Invisibility compatibility
(defun org-remove-from-invisibility-spec (arg)
"Remove elements from `buffer-invisibility-spec'."
@ -298,65 +228,14 @@ Works on both Emacs and XEmacs."
(if (consp buffer-invisibility-spec)
(member arg buffer-invisibility-spec)))
(defmacro org-xemacs-without-invisibility (&rest body)
"Turn off extents with invisibility while executing BODY."
`(let ((ext-inv (extent-list nil (point-at-bol) (point-at-eol)
'all-extents-closed-open 'invisible))
ext-inv-specs)
(dolist (ext ext-inv)
(when (extent-property ext 'invisible)
(add-to-list 'ext-inv-specs (list ext (extent-property
ext 'invisible)))
(set-extent-property ext 'invisible nil)))
,@body
(dolist (ext-inv-spec ext-inv-specs)
(set-extent-property (car ext-inv-spec) 'invisible
(cadr ext-inv-spec)))))
(def-edebug-spec org-xemacs-without-invisibility (body))
(defun org-indent-to-column (column &optional minimum buffer)
"Work around a bug with extents with invisibility in XEmacs."
(if (featurep 'xemacs)
(org-xemacs-without-invisibility (indent-to-column column minimum buffer))
(indent-to-column column minimum)))
(defun org-indent-line-to (column)
"Work around a bug with extents with invisibility in XEmacs."
(if (featurep 'xemacs)
(org-xemacs-without-invisibility (indent-line-to column))
(indent-line-to column)))
(defun org-move-to-column (column &optional force buffer)
"Move to column COLUMN.
Pass COLUMN and FORCE to `move-to-column'.
Pass BUFFER to the XEmacs version of `move-to-column'."
Pass COLUMN and FORCE to `move-to-column'."
(let ((buffer-invisibility-spec
(if (listp buffer-invisibility-spec)
(remove '(org-filtered) buffer-invisibility-spec)
buffer-invisibility-spec)))
(if (featurep 'xemacs)
(org-xemacs-without-invisibility
(move-to-column column force buffer))
(move-to-column column force))))
(defun org-get-x-clipboard-compat (value)
"Get the clipboard value on XEmacs or Emacs 21."
(cond ((featurep 'xemacs)
(org-no-warnings (get-selection-no-error value)))
((fboundp 'x-get-selection)
(condition-case nil
(or (x-get-selection value 'UTF8_STRING)
(x-get-selection value 'COMPOUND_TEXT)
(x-get-selection value 'STRING)
(x-get-selection value 'TEXT))
(error nil)))))
(defun org-propertize (string &rest properties)
(if (featurep 'xemacs)
(progn
(add-text-properties 0 (length string) properties string)
string)
(apply 'propertize string properties)))
(move-to-column column force)))
(defmacro org-find-library-dir (library)
`(file-name-directory (or (locate-library ,library) "")))
@ -375,32 +254,6 @@ Pass BUFFER to the XEmacs version of `move-to-column'."
string)
(apply 'kill-new string args))
(defun org-select-frame-set-input-focus (frame)
"Select FRAME, raise it, and set input focus, if possible."
(cond ((featurep 'xemacs)
(if (fboundp 'select-frame-set-input-focus)
(select-frame-set-input-focus frame)
(raise-frame frame)
(select-frame frame)
(focus-frame frame)))
;; `select-frame-set-input-focus' defined in Emacs 21 will not
;; set the input focus.
((>= emacs-major-version 22)
(select-frame-set-input-focus frame))
(t
(raise-frame frame)
(select-frame frame)
(cond ((memq window-system '(x ns mac))
(x-focus-frame frame))
((and (eq window-system 'w32)
(fboundp 'w32-focus-frame))
(w32-focus-frame frame)))
(when focus-follows-mouse
(set-mouse-position frame (1- (frame-width frame)) 0)))))
(defalias 'org-float-time
(if (featurep 'xemacs) 'time-to-seconds 'float-time))
;; `user-error' is only available from 24.2.50 on
(unless (fboundp 'user-error)
(defalias 'user-error 'error))
@ -432,46 +285,6 @@ effect, which variables to use depends on the Emacs version."
(save-match-data
(funcall 'string-match regexp string start))))
(if (fboundp 'looking-at-p)
(defalias 'org-looking-at-p 'looking-at-p)
(defun org-looking-at-p (&rest args)
(save-match-data
(apply 'looking-at args))))
;; XEmacs does not have `looking-back'.
(if (fboundp 'looking-back)
(defalias 'org-looking-back 'looking-back)
(defun org-looking-back (regexp &optional limit greedy)
"Return non-nil if text before point matches regular expression REGEXP.
Like `looking-at' except matches before point, and is slower.
LIMIT if non-nil speeds up the search by specifying a minimum
starting position, to avoid checking matches that would start
before LIMIT.
If GREEDY is non-nil, extend the match backwards as far as
possible, stopping when a single additional previous character
cannot be part of a match for REGEXP. When the match is
extended, its starting position is allowed to occur before
LIMIT."
(let ((start (point))
(pos
(save-excursion
(and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
(point)))))
(if (and greedy pos)
(save-restriction
(narrow-to-region (point-min) start)
(while (and (> pos (point-min))
(save-excursion
(goto-char pos)
(backward-char 1)
(looking-at (concat "\\(?:" regexp "\\)\\'"))))
(setq pos (1- pos)))
(save-excursion
(goto-char pos)
(looking-at (concat "\\(?:" regexp "\\)\\'")))))
(not (null pos)))))
(defun org-floor* (x &optional y)
"Return a list of the floor of X and the fractional part of X.
With two arguments, return floor and remainder of their quotient."
@ -526,16 +339,6 @@ With two arguments, return floor and remainder of their quotient."
(defun org-release () "N/A")
(defun org-git-version () "N/A !!check installation!!"))))))
(defun org-file-equal-p (f1 f2)
"Return t if files F1 and F2 are the same.
Implements `file-equal-p' for older emacsen and XEmacs."
(if (fboundp 'file-equal-p)
(file-equal-p f1 f2)
(let (f1-attr f2-attr)
(and (setq f1-attr (file-attributes (file-truename f1)))
(setq f2-attr (file-attributes (file-truename f2)))
(equal f1-attr f2-attr)))))
;; `buffer-narrowed-p' is available for Emacs >=24.3
(defun org-buffer-narrowed-p ()
"Compatibility function for `buffer-narrowed-p'."

View File

@ -142,7 +142,7 @@ See `org-crypt-disable-auto-save'."
(message "org-decrypt: Decrypting entry with auto-save-mode enabled. This may cause leakage."))
((eq org-crypt-disable-auto-save 'encrypt)
(message "org-decrypt: Enabling re-encryption on auto-save.")
(org-add-hook 'auto-save-hook
(add-hook 'auto-save-hook
(lambda ()
(message "org-crypt: Re-encrypting all decrypted entries due to auto-save.")
(org-encrypt-entries))
@ -263,7 +263,7 @@ See `org-crypt-disable-auto-save'."
"Add a hook to automatically encrypt entries before a file is saved to disk."
(add-hook
'org-mode-hook
(lambda () (org-add-hook 'before-save-hook 'org-encrypt-entries nil t))))
(lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
(add-hook 'org-reveal-start-hook 'org-decrypt-entry)

View File

@ -716,7 +716,7 @@ Assume point is at beginning of drawer."
(save-excursion
(let* ((drawer-end-line (match-beginning 0))
(name (progn (looking-at org-drawer-regexp)
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
(begin (car affiliated))
(post-affiliated (point))
;; Empty drawers have no contents.
@ -772,8 +772,8 @@ Assume point is at beginning of dynamic block."
(let ((block-end-line (match-beginning 0)))
(save-excursion
(let* ((name (progn (looking-at org-dblock-start-re)
(org-match-string-no-properties 1)))
(arguments (org-match-string-no-properties 3))
(match-string-no-properties 1)))
(arguments (match-string-no-properties 3))
(begin (car affiliated))
(post-affiliated (point))
;; Empty blocks have no contents.
@ -831,7 +831,7 @@ a plist containing `:label', `:begin' `:end', `:contents-begin',
Assume point is at the beginning of the footnote definition."
(save-excursion
(let* ((label (progn (looking-at org-footnote-definition-re)
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
(begin (car affiliated))
(post-affiliated (point))
(ending
@ -846,7 +846,7 @@ Assume point is at the beginning of the footnote definition."
;; before any affiliated keyword above.
(forward-line -1)
(while (and (> (point) post-affiliated)
(org-looking-at-p org-element--affiliated-re))
(looking-at-p org-element--affiliated-re))
(forward-line -1))
(line-beginning-position 2))
(t (match-beginning 0)))))
@ -889,13 +889,13 @@ obtained through property drawer and default properties from the
parser (e.g. `:end' and :END:). Return value is a plist."
(save-excursion
(forward-line)
(when (org-looking-at-p org-planning-line-re) (forward-line))
(when (looking-at-p org-planning-line-re) (forward-line))
(when (looking-at org-property-drawer-re)
(forward-line)
(let ((end (match-end 0)) properties)
(while (< (line-end-position) end)
(looking-at org-property-re)
(push (org-match-string-no-properties 3) properties)
(push (match-string-no-properties 3) properties)
(push (intern (concat ":" (upcase (match-string 2)))) properties)
(forward-line))
properties))))
@ -958,7 +958,7 @@ Assume point is at beginning of the headline."
(goto-char (match-end 0))))
(title-start (point))
(tags (when (re-search-forward
(org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
"[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
(line-end-position)
'move)
(goto-char (match-beginning 0))
@ -1100,7 +1100,7 @@ Assume point is at beginning of the inline task."
(aref (match-string 0) 2))))
(title-start (point))
(tags (when (re-search-forward
(org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
"[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
(line-end-position)
'move)
(goto-char (match-beginning 0))
@ -1111,7 +1111,7 @@ Assume point is at beginning of the inline task."
(task-end (save-excursion
(end-of-line)
(and (re-search-forward org-outline-regexp-bol limit t)
(org-looking-at-p "END[ \t]*$")
(looking-at-p "END[ \t]*$")
(line-beginning-position))))
(standard-props (and task-end (org-element--get-node-properties)))
(time-props (and task-end (org-element--get-time-properties)))
@ -1214,7 +1214,7 @@ Assume point is at the beginning of the item."
(beginning-of-line)
(looking-at org-list-full-item-re)
(let* ((begin (point))
(bullet (org-match-string-no-properties 1))
(bullet (match-string-no-properties 1))
(checkbox (let ((box (match-string 3)))
(cond ((equal "[ ]" box) 'off)
((equal "[X]" box) 'on)
@ -1363,7 +1363,7 @@ CONTENTS is the contents of the element."
(forward-line)
(let ((origin (point)))
(when (re-search-forward inlinetask-re limit t)
(if (org-looking-at-p "END[ \t]*$") (forward-line)
(if (looking-at-p "END[ \t]*$") (forward-line)
(goto-char origin)))))
;; At some text line. Check if it ends any previous item.
(t
@ -1405,7 +1405,7 @@ containing `:type', `:begin', `:end', `:contents-begin' and
Assume point is at the beginning of the list."
(save-excursion
(let* ((struct (or structure (org-element--list-struct limit)))
(type (cond ((org-looking-at-p "[ \t]*[A-Za-z0-9]") 'ordered)
(type (cond ((looking-at-p "[ \t]*[A-Za-z0-9]") 'ordered)
((nth 5 (assq (point) struct)) 'descriptive)
(t 'unordered)))
(contents-begin (point))
@ -1701,7 +1701,7 @@ Return a list whose CAR is `clock' and CDR is a plist containing
(duration (and (search-forward " => " (line-end-position) t)
(progn (skip-chars-forward " \t")
(looking-at "\\(\\S-+\\)[ \t]*$"))
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
(status (if duration 'closed 'running))
(post-blank (let ((before-blank (progn (forward-line) (point))))
(skip-chars-forward " \r\t\n" limit)
@ -1850,7 +1850,7 @@ containing `:begin', `:end', `:value', `:post-blank' and
(let ((begin (car affiliated))
(post-affiliated (point))
(value (progn (looking-at "\\(%%(.*\\)[ \t]*$")
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
(pos-before-blank (progn (forward-line) (point)))
(end (progn (skip-chars-forward " \r\t\n" limit)
(if (eobp) (point) (line-beginning-position)))))
@ -1892,7 +1892,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
(let* ((switches
(progn
(looking-at "^[ \t]*#\\+BEGIN_EXAMPLE\\(?: +\\(.*\\)\\)?")
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
;; Switches analysis.
(number-lines
(and switches
@ -2123,7 +2123,7 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and
(let ((begin (or (car affiliated) (point)))
(post-affiliated (point))
(key (progn (looking-at "[ \t]*#\\+\\(\\S-+*\\):")
(upcase (org-match-string-no-properties 1))))
(upcase (match-string-no-properties 1))))
(value (org-trim (buffer-substring-no-properties
(match-end 0) (point-at-eol))))
(pos-before-blank (progn (forward-line) (point)))
@ -2214,8 +2214,8 @@ containing `:key', `:value', `:begin', `:end', `:post-blank' and
(looking-at org-property-re)
(let ((case-fold-search t)
(begin (point))
(key (org-match-string-no-properties 2))
(value (org-match-string-no-properties 3))
(key (match-string-no-properties 2))
(value (match-string-no-properties 3))
(end (save-excursion
(end-of-line)
(if (re-search-forward org-property-re limit t)
@ -2403,11 +2403,11 @@ Assume point is at the beginning of the block."
\\(?: +\\(\\S-+\\)\\)?\
\\(\\(?: +\\(?:-\\(?:l \".+\"\\|[ikr]\\)\\|[-+]n\\(?: *[0-9]+\\)?\\)\\)+\\)?\
\\(.*\\)[ \t]*$")
(org-match-string-no-properties 1)))
(match-string-no-properties 1)))
;; Get switches.
(switches (org-match-string-no-properties 2))
(switches (match-string-no-properties 2))
;; Get parameters.
(parameters (org-match-string-no-properties 3))
(parameters (match-string-no-properties 3))
;; Switches analysis.
(number-lines
(and switches
@ -2522,7 +2522,7 @@ Assume point is at the beginning of the table."
(point)))
(tblfm (let (acc)
(while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$")
(push (org-match-string-no-properties 1) acc)
(push (match-string-no-properties 1) acc)
(forward-line))
acc))
(pos-before-blank (point))
@ -2704,7 +2704,7 @@ Assume point is at the first tilde marker."
(unless (bolp) (backward-char 1))
(when (looking-at org-emph-re)
(let ((begin (match-beginning 2))
(value (org-match-string-no-properties 4))
(value (match-string-no-properties 4))
(post-blank (progn (goto-char (match-end 2))
(skip-chars-forward " \t")))
(end (point)))
@ -2780,7 +2780,7 @@ Assume point is at the beginning of the snippet."
(re-search-forward "@@" nil t)
(match-beginning 0))))
(let* ((begin (match-beginning 0))
(back-end (org-match-string-no-properties 1))
(back-end (match-string-no-properties 1))
(value (buffer-substring-no-properties
(match-end 0) contents-end))
(post-blank (skip-chars-forward " \t"))
@ -3039,7 +3039,7 @@ and cdr a plist with `:begin', `:end' and `:post-blank' keywords.
Otherwise, return nil.
Assume point is at the beginning of the line break."
(when (and (org-looking-at-p "\\\\\\\\[ \t]*$")
(when (and (looking-at-p "\\\\\\\\[ \t]*$")
(not (eq (char-before) ?\\)))
(list 'line-break
(list :begin (point)
@ -3074,7 +3074,7 @@ Assume point is at the beginning of the link."
(looking-at org-target-link-regexp)))
(setq type "radio"
link-end (match-end 1)
path (org-match-string-no-properties 1)
path (match-string-no-properties 1)
contents-begin (match-beginning 1)
contents-end (match-end 1)))
;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]]
@ -3096,7 +3096,7 @@ Assume point is at the beginning of the link."
(setq raw-link (org-link-expand-abbrev
(replace-regexp-in-string
"[ \t]*\n[ \t]*" " "
(org-match-string-no-properties 1))))
(match-string-no-properties 1))))
;; Determine TYPE of link and set PATH accordingly. According
;; to RFC 3986, remove whitespaces from URI in external links.
;; In internal ones, treat indentation as a single space.
@ -3130,21 +3130,21 @@ Assume point is at the beginning of the link."
(setq path raw-link))))
;; Type 3: Plain link, e.g., http://orgmode.org
((looking-at org-plain-link-re)
(setq raw-link (org-match-string-no-properties 0)
type (org-match-string-no-properties 1)
(setq raw-link (match-string-no-properties 0)
type (match-string-no-properties 1)
link-end (match-end 0)
path (org-match-string-no-properties 2)))
path (match-string-no-properties 2)))
;; Type 4: Angular link, e.g., <http://orgmode.org>. Unlike to
;; bracket links, follow RFC 3986 and remove any extra
;; whitespace in URI.
((looking-at org-angle-link-re)
(setq type (org-match-string-no-properties 1))
(setq type (match-string-no-properties 1))
(setq link-end (match-end 0))
(setq raw-link
(buffer-substring-no-properties
(match-beginning 1) (match-end 2)))
(setq path (replace-regexp-in-string
"[ \t]*\n[ \t]*" "" (org-match-string-no-properties 2))))
"[ \t]*\n[ \t]*" "" (match-string-no-properties 2))))
(t (throw 'no-object nil)))
;; In any case, deduce end point after trailing white space from
;; LINK-END variable.
@ -3211,12 +3211,12 @@ Assume point is at the macro."
(save-excursion
(when (looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}")
(let ((begin (point))
(key (downcase (org-match-string-no-properties 1)))
(value (org-match-string-no-properties 0))
(key (downcase (match-string-no-properties 1)))
(value (match-string-no-properties 0))
(post-blank (progn (goto-char (match-end 0))
(skip-chars-forward " \t")))
(end (point))
(args (let ((args (org-match-string-no-properties 3)))
(args (let ((args (match-string-no-properties 3)))
(and args (org-macro-extract-arguments args)))))
(list 'macro
(list :key key
@ -3247,7 +3247,7 @@ Assume point is at the radio target."
(let ((begin (point))
(contents-begin (match-beginning 1))
(contents-end (match-end 1))
(value (org-match-string-no-properties 1))
(value (match-string-no-properties 1))
(post-blank (progn (goto-char (match-end 0))
(skip-chars-forward " \t")))
(end (point)))
@ -3441,7 +3441,7 @@ Assume point is at the target."
(save-excursion
(when (looking-at org-target-regexp)
(let ((begin (point))
(value (org-match-string-no-properties 1))
(value (match-string-no-properties 1))
(post-blank (progn (goto-char (match-end 0))
(skip-chars-forward " \t")))
(end (point)))
@ -3479,7 +3479,7 @@ cdr a plist with `:type', `:raw-value', `:year-start',
Otherwise, return nil.
Assume point is at the beginning of the timestamp."
(when (org-looking-at-p org-element--timestamp-regexp)
(when (looking-at-p org-element--timestamp-regexp)
(save-excursion
(let* ((begin (point))
(activep (eq (char-after) ?<))
@ -3709,7 +3709,7 @@ Assume point is at the first equal sign marker."
(unless (bolp) (backward-char 1))
(when (looking-at org-emph-re)
(let ((begin (match-beginning 2))
(value (org-match-string-no-properties 4))
(value (match-string-no-properties 4))
(post-blank (progn (goto-char (match-end 2))
(skip-chars-forward " \t")))
(end (point)))
@ -3915,7 +3915,7 @@ position of point and CDR is nil."
(dualp (member kwd org-element-dual-keywords))
(dual-value
(and dualp
(let ((sec (org-match-string-no-properties 2)))
(let ((sec (match-string-no-properties 2)))
(if (or (not sec) (not parsedp)) sec
(save-match-data
(org-element--parse-objects
@ -6025,7 +6025,7 @@ end of ELEM-A."
(goto-char beg-B)
(when specialp
(setq body-B (replace-regexp-in-string "\\`[ \t]*" "" body-B))
(org-indent-to-column ind-B))
(indent-to-column ind-B))
(insert body-A)
;; Restore ex ELEM-A overlays.
(let ((offset (- beg-B beg-A)))

View File

@ -182,11 +182,7 @@ character (this might for example be the a TODO keyword) might still
shine through in some properties. So when your column view looks
funny, with \"random\" colors, weight, strike-through, try to explicitly
set the properties in the `org-column' face. For example, set
:underline to nil, or the :slant to `normal'.
Under XEmacs, the rules are simpler, because the XEmacs version of
column view defines special faces for each outline level. See the file
`org-colview-xemacs.el' in Org's contrib/ directory for details."
:underline to nil, or the :slant to `normal'."
:group 'org-faces)
(defface org-column-title

View File

@ -625,7 +625,7 @@ containing the properties `:guid' and `:item-full-text'."
(match-beginning 0)))
(setq item (buffer-substring beg end)
guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
(xml-substitute-special (org-match-string-no-properties 1 item))))
(xml-substitute-special (match-string-no-properties 1 item))))
(setq entry (list :guid guid :item-full-text item))
(push entry entries)
(widen)

View File

@ -244,7 +244,7 @@ otherwise."
(concat org-outline-regexp-bol
"\\|^\\([ \t]*\n\\)\\{2,\\}") nil t))))
(when (re-search-backward org-footnote-definition-re lim t)
(let ((label (org-match-string-no-properties 1))
(let ((label (match-string-no-properties 1))
(beg (match-beginning 0))
(beg-def (match-end 0))
(end (if (progn

View File

@ -185,7 +185,7 @@ This list represents a \"habit\" for the rest of this module."
habit-entry))
(setq sr-days (org-habit-duration-to-days scheduled-repeat)
sr-type (progn (string-match "[\\.+]?\\+" scheduled-repeat)
(org-match-string-no-properties 0 scheduled-repeat)))
(match-string-no-properties 0 scheduled-repeat)))
(unless (> sr-days 0)
(error "Habit %s scheduled repeat period is less than 1d" habit-entry))
(when (string-match "/\\([0-9]+[dwmy]\\)" scheduled-repeat)
@ -222,8 +222,8 @@ This list represents a \"habit\" for the rest of this module."
(while (and (< count maxdays) (funcall search re limit t))
(push (time-to-days
(org-time-string-to-time
(or (org-match-string-no-properties 1)
(org-match-string-no-properties 2))))
(or (match-string-no-properties 1)
(match-string-no-properties 2))))
closed-dates)
(setq count (1+ count))))
(list scheduled sr-days deadline dr-days closed-dates sr-type))))

View File

@ -495,7 +495,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
(goto-char (point-min))
(while (re-search-forward "^[ \t]*:ID:[ \t]+\\(\\S-+\\)[ \t]*$"
nil t)
(setq id (org-match-string-no-properties 1))
(setq id (match-string-no-properties 1))
(if (member id found)
(progn
(message "Duplicate ID \"%s\", also in file %s"

View File

@ -139,13 +139,13 @@ during idle time."
(setq-local org-hide-leading-stars-before-indent-mode
org-hide-leading-stars)
(setq-local org-hide-leading-stars t))
(org-add-hook 'filter-buffer-substring-functions
(add-hook 'filter-buffer-substring-functions
(lambda (fun start end delete)
(org-indent-remove-properties-from-string
(funcall fun start end delete)))
nil t)
(org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
(org-add-hook 'before-change-functions
(add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
(add-hook 'before-change-functions
'org-indent-notify-modified-headline nil 'local)
(and font-lock-mode (org-restart-font-lock))
(org-indent-remove-properties (point-min) (point-max))
@ -314,7 +314,7 @@ stopped."
;; Headline or inline task.
((looking-at org-outline-regexp)
(let* ((nstars (- (match-end 0) (match-beginning 0) 1))
(type (or (org-looking-at-p limited-re) 'inlinetask)))
(type (or (looking-at-p limited-re) 'inlinetask)))
(org-indent-set-line-properties nstars 0 type)
;; At an headline, define new value for LEVEL.
(unless (eq type 'inlinetask) (setq level nstars))))

View File

@ -167,9 +167,9 @@ The number of levels is controlled by `org-inlinetask-min-level'."
(stars-re (org-inlinetask-outline-regexp))
(task-beg-re (concat stars-re "\\(?:.*\\)"))
(task-end-re (concat stars-re "END[ \t]*$")))
(or (org-looking-at-p task-beg-re)
(or (looking-at-p task-beg-re)
(and (re-search-forward "^\\*+[ \t]+" nil t)
(progn (beginning-of-line) (org-looking-at-p task-end-re)))))))
(progn (beginning-of-line) (looking-at-p task-end-re)))))))
(defun org-inlinetask-goto-beginning ()
"Go to the beginning of the inline task at point."
@ -177,7 +177,7 @@ The number of levels is controlled by `org-inlinetask-min-level'."
(let ((case-fold-search t)
(inlinetask-re (org-inlinetask-outline-regexp)))
(re-search-backward inlinetask-re nil t)
(when (org-looking-at-p (concat inlinetask-re "END[ \t]*$"))
(when (looking-at-p (concat inlinetask-re "END[ \t]*$"))
(re-search-backward inlinetask-re nil t))))
(defun org-inlinetask-goto-end ()

View File

@ -370,7 +370,7 @@ called with one argument, the key used for comparison."
t)))
reports)
(while (re-search-forward regexp nil t)
(let ((key (upcase (org-match-string-no-properties 1))))
(let ((key (upcase (match-string-no-properties 1))))
(when (< (point)
(org-element-property :post-affiliated (org-element-at-point)))
(push
@ -416,7 +416,7 @@ instead"
(list (org-element-property :begin datum)
(format "Deprecated syntax for \"%s\". \
Use header-args instead"
(org-match-string-no-properties 1 value))))))
(match-string-no-properties 1 value))))))
(`node-property
(and (member-ignore-case key deprecated-babel-properties)
(list
@ -757,7 +757,7 @@ Use \"export %s\" instead"
(defun org-lint-incomplete-drawer (_)
(let (reports)
(while (re-search-forward org-drawer-regexp nil t)
(let ((name (org-trim (org-match-string-no-properties 0)))
(let ((name (org-trim (match-string-no-properties 0)))
(element (org-element-at-point)))
(pcase (org-element-type element)
((or `drawer `property-drawer)
@ -812,7 +812,7 @@ Use \"export %s\" instead"
(regexp-opt org-element-dual-keywords)))
reports)
(while (re-search-forward regexp nil t)
(let ((name (org-match-string-no-properties 1)))
(let ((name (match-string-no-properties 1)))
(unless (or (string-prefix-p "BEGIN" name t)
(string-prefix-p "END" name t)
(save-excursion

View File

@ -1330,7 +1330,7 @@ This function modifies STRUCT."
(size-offset (- item-size (length text-cut))))
;; 4. Insert effectively item into buffer.
(goto-char item)
(org-indent-to-column ind)
(indent-to-column ind)
(insert body item-sep)
;; 5. Add new item to STRUCT.
(mapc (lambda (e)
@ -1889,8 +1889,8 @@ Initial position of cursor is restored after the changes."
((and inlinetask-re (looking-at inlinetask-re))
(org-inlinetask-goto-beginning))
;; Shift only non-empty lines.
((org-looking-at-p "^[ \t]*\\S-")
(org-indent-line-to (+ (org-get-indentation) delta))))
((looking-at-p "^[ \t]*\\S-")
(indent-line-to (+ (org-get-indentation) delta))))
(forward-line -1)))))
(modify-item
(function
@ -1973,7 +1973,7 @@ Initial position of cursor is restored after the changes."
(while (< (point) down)
;; Ignore empty lines. Also ignore blocks and
;; drawers contents.
(unless (org-looking-at-p "[ \t]*$")
(unless (looking-at-p "[ \t]*$")
(setq min-ind (min (org-get-indentation) min-ind))
(cond
((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)")
@ -2808,7 +2808,7 @@ Return t at each successful move."
((and (= ind (car org-tab-ind-state))
(ignore-errors (org-list-indent-item-generic 1 t struct))))
(t (delete-region (point-at-bol) (point-at-eol))
(org-indent-to-column (car org-tab-ind-state))
(indent-to-column (car org-tab-ind-state))
(insert (cdr org-tab-ind-state) " ")
;; Break cycle
(setq this-command 'identity)))
@ -2911,7 +2911,7 @@ ignores hidden links."
(save-excursion (re-search-forward org-ts-regexp-both
(point-at-eol) t)))
(org-time-string-to-seconds (match-string 0)))
(t (org-float-time now))))
(t (float-time now))))
((= dcst ?x) (or (and (stringp (match-string 1))
(match-string 1))
""))

View File

@ -57,14 +57,12 @@
(defmacro org-called-interactively-p (&optional kind)
(declare (debug (&optional ("quote" symbolp)))) ;Why not just t?
(if (featurep 'xemacs)
`(interactive-p)
(if (or (> emacs-major-version 23)
(and (>= emacs-major-version 23)
(>= emacs-minor-version 2)))
;; defined with no argument in <=23.1
`(with-no-warnings (called-interactively-p ,kind))
`(interactive-p))))
(if (or (> emacs-major-version 23)
(and (>= emacs-major-version 23)
(>= emacs-minor-version 2)))
;; defined with no argument in <=23.1
`(with-no-warnings (called-interactively-p ,kind))
`(interactive-p)))
(defmacro org-bound-and-true-p (var)
"Return the value of symbol VAR if it is bound, else nil."
@ -97,11 +95,6 @@ Otherwise return nil."
(setq ss (replace-match "\001-@[-`{-~" t t ss)))
ss)))
(defmacro org-re (s)
"Replace posix classes in regular expression."
(declare (debug (form)))
(if (featurep 'xemacs) `(org-substitute-posix-classes ,s) s))
(defmacro org-preserve-lc (&rest body)
(declare (debug (body)))
(org-with-gensyms (line col)
@ -200,13 +193,6 @@ We use a macro so that the test can happen at compilation time."
org-emphasis t)
"Properties to remove when a string without properties is wanted.")
(defsubst org-match-string-no-properties (num &optional string)
(if (featurep 'xemacs)
(let ((s (match-string num string)))
(and s (remove-text-properties 0 (length s) org-rm-props s))
s)
(match-string-no-properties num string)))
(defsubst org-no-properties (s &optional restricted)
"Remove all text properties from string S.
When RESTRICTED is non-nil, only remove the properties listed

View File

@ -191,7 +191,7 @@ Changing this variable requires a restart of Emacs to get activated."
(interactive)
(end-of-line)
(skip-chars-backward "\t ")
(when (org-looking-back ":[A-Za-z]+:" (line-beginning-position))
(when (looking-back ":[A-Za-z]+:" (line-beginning-position))
(skip-chars-backward ":A-Za-z")
(skip-chars-backward "\t ")))
@ -575,7 +575,7 @@ This means, between the beginning of line and the point."
(beginning-of-line)
(looking-at "[ \t]*")
(open-line 1)
(org-indent-to-column (- (match-end 0) (match-beginning 0)))
(indent-to-column (- (match-end 0) (match-beginning 0)))
(insert "+ "))
(:middle ; insert after
(end-of-line)
@ -585,7 +585,7 @@ This means, between the beginning of line and the point."
(:end ; insert text here
(skip-chars-backward " \t")
(kill-region (point) (point-at-eol))
(unless (org-looking-back org-mouse-punctuation (line-beginning-position))
(unless (looking-back org-mouse-punctuation (line-beginning-position))
(insert (concat org-mouse-punctuation " ")))))
(insert text)
(beginning-of-line))
@ -643,7 +643,7 @@ This means, between the beginning of line and the point."
'org-mode-restart))))
((or (eolp)
(and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
(org-looking-back " \\|\t" (- (point) 2)
(looking-back " \\|\t" (- (point) 2)
(line-beginning-position))))
(org-mouse-popup-global-menu))
((funcall get-context :checkbox)

View File

@ -59,7 +59,7 @@
"Examine the thing at point and let the caller know what it is.
The return value is a string naming the thing at point."
(let ((beg1 (save-excursion
(skip-chars-backward (org-re "[:alnum:]-_@"))
(skip-chars-backward "[:alnum:]-_@")
(point)))
(beg (save-excursion
(skip-chars-backward "a-zA-Z0-9-_:$")
@ -95,10 +95,10 @@ The return value is a string naming the thing at point."
(skip-chars-backward "[ \t\n]")
;; org-drawer-regexp matches a whole line but while
;; looking-back, we just ignore trailing whitespaces
(or (org-looking-back (substring org-drawer-regexp 0 -1)
(line-beginning-position))
(org-looking-back org-property-re
(line-beginning-position)))))
(or (looking-back (substring org-drawer-regexp 0 -1)
(line-beginning-position))
(looking-back org-property-re
(line-beginning-position)))))
(cons "prop" nil))
((and (equal (char-before beg1) ?:)
(not (equal (char-after (point-at-bol)) ?*)))

View File

@ -376,7 +376,7 @@ Assume point is in the corresponding edit buffer."
(let ((ind (make-string indentation ?\s)))
(goto-char (point-min))
(while (not (eobp))
(when (org-looking-at-p "[ \t]*\\S-") (insert ind))
(when (looking-at-p "[ \t]*\\S-") (insert ind))
(forward-line))))
(buffer-string))))
@ -607,7 +607,7 @@ See also `org-src-mode-hook'."
(defun org-src-mode-configure-edit-buffer ()
(when (org-bound-and-true-p org-src--from-org-mode)
(org-add-hook 'kill-buffer-hook #'org-src--remove-overlay nil 'local)
(add-hook 'kill-buffer-hook #'org-src--remove-overlay nil 'local)
(if (org-bound-and-true-p org-src--allow-write-back)
(progn
(setq buffer-offer-save t)
@ -616,7 +616,7 @@ See also `org-src-mode-hook'."
"[" (buffer-name) "]")))
(setq buffer-read-only t))))
(org-add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer)
(add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer)
@ -636,7 +636,7 @@ See also `org-src-mode-hook'."
(when org-src--babel-info
(org-src-associate-babel-session org-src--babel-info)))
(org-add-hook 'org-src-mode-hook #'org-src-babel-configure-edit-buffer)
(add-hook 'org-src-mode-hook #'org-src-babel-configure-edit-buffer)
(defmacro org-src-do-at-code-block (&rest body)
"Execute a command from an edit buffer in the Org mode buffer."

View File

@ -672,7 +672,7 @@ extension of the given file name, and finally on the variable
(when (file-directory-p file)
(user-error "This is a directory path, not a file"))
(when (and (buffer-file-name (buffer-base-buffer))
(org-file-equal-p
(file-equal-p
(file-truename file)
(file-truename (buffer-file-name (buffer-base-buffer)))))
(user-error "Please specify a file name that is different from current"))
@ -1721,7 +1721,7 @@ numeric compare based on the type of the first key in the table."
((?t ?T)
(lambda (f)
(cond ((string-match org-ts-regexp-both f)
(org-float-time
(float-time
(org-time-string-to-time (match-string 0 f))))
((string-match "[0-9]\\{1,2\\}:[0-9]\\{2\\}" f)
(org-hh:mm-string-to-minutes f))
@ -2064,8 +2064,8 @@ current field. The mode exits automatically when the cursor leaves the
table (but see `org-table-exit-follow-field-mode-when-leaving-table')."
nil " TblFollow" nil
(if org-table-follow-field-mode
(org-add-hook 'post-command-hook 'org-table-follow-fields-with-editor
'append 'local)
(add-hook 'post-command-hook 'org-table-follow-fields-with-editor
'append 'local)
(remove-hook 'post-command-hook 'org-table-follow-fields-with-editor 'local)
(let* ((buf (get-buffer "*Org Table Edit Field*"))
(win (and buf (get-buffer-window buf))))
@ -2303,7 +2303,7 @@ LOCATION is a buffer position, consider the formulas there."
(goto-char (org-table-end)))
(let ((case-fold-search t))
(when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM: *\\(.*\\)")
(let ((strings (org-split-string (org-match-string-no-properties 2)
(let ((strings (org-split-string (match-string-no-properties 2)
" *:: *"))
eq-alist seen)
(dolist (string strings (nreverse eq-alist))
@ -3471,7 +3471,7 @@ borders of the table using the @< @> $< $> makers."
(when value
(setq new (replace-match
(concat (and pp "(") value (and pp ")")) t t new))))))
(if org-table-formula-debug (org-propertize new :orig-formula f)) new))
(if org-table-formula-debug (propertize new :orig-formula f) new)))
(defun org-table-get-constant (const)
"Find the value for a parameter or constant in a formula.
@ -3573,7 +3573,7 @@ Parameters get priority."
(setq-local org-window-configuration wc)
(setq-local org-selected-window sel-win)
(use-local-map org-table-fedit-map)
(org-add-hook 'post-command-hook #'org-table-fedit-post-command t t)
(add-hook 'post-command-hook #'org-table-fedit-post-command t t)
(easy-menu-add org-table-fedit-menu)
(setq startline (org-current-line))
(dolist (entry eql)
@ -3960,8 +3960,8 @@ When LOCAL is non-nil, show references for the table at point."
(when (and match (not (equal (match-beginning 0) (point-at-bol))))
(org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
'secondary-selection))
(org-add-hook 'before-change-functions
#'org-table-remove-rectangle-highlight)
(add-hook 'before-change-functions
#'org-table-remove-rectangle-highlight)
(when (eq what 'name) (setq var (substring match 1)))
(when (eq what 'range)
(unless (eq (string-to-char match) ?@) (setq match (concat "@" match)))
@ -4273,15 +4273,15 @@ FACE, when non-nil, for the highlight."
(and c (setq minor-mode-map-alist
(cons c (delq c minor-mode-map-alist)))))
(setq-local org-table-may-need-update t)
(org-add-hook 'before-change-functions 'org-before-change-function
nil 'local)
(add-hook 'before-change-functions 'org-before-change-function
nil 'local)
(setq-local org-old-auto-fill-inhibit-regexp
auto-fill-inhibit-regexp)
auto-fill-inhibit-regexp)
(setq-local auto-fill-inhibit-regexp
(if auto-fill-inhibit-regexp
(concat orgtbl-line-start-regexp "\\|"
auto-fill-inhibit-regexp)
orgtbl-line-start-regexp))
(if auto-fill-inhibit-regexp
(concat orgtbl-line-start-regexp "\\|"
auto-fill-inhibit-regexp)
orgtbl-line-start-regexp))
(add-to-invisibility-spec '(org-cwidth))
(when (fboundp 'font-lock-add-keywords)
(font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)

View File

@ -140,10 +140,10 @@ the region 0:00:00."
(setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
(setq org-timer-start-time
(seconds-to-time
;; Pass `current-time' result to `org-float-time'
;; (instead of calling without arguments) so that only
;; Pass `current-time' result to `float-time' (instead
;; of calling without arguments) so that only
;; `current-time' has to be overriden in tests.
(- (org-float-time (current-time)) delta))))
(- (float-time (current-time)) delta))))
(setq org-timer-pause-time nil)
(org-timer-set-mode-line 'on)
(message "Timer start time set to %s, current value is %s"
@ -159,8 +159,8 @@ With prefix arg STOP, stop it entirely."
(stop (org-timer-stop))
((not org-timer-start-time) (error "No timer is running"))
(org-timer-pause-time
(let ((start-secs (org-float-time org-timer-start-time))
(pause-secs (org-float-time org-timer-pause-time)))
(let ((start-secs (float-time org-timer-start-time))
(pause-secs (float-time org-timer-pause-time)))
(if org-timer-countdown-timer
(let ((new-secs (- start-secs pause-secs)))
(setq org-timer-countdown-timer
@ -169,10 +169,10 @@ With prefix arg STOP, stop it entirely."
(setq org-timer-start-time
(time-add (current-time) (seconds-to-time new-secs))))
(setq org-timer-start-time
;; Pass `current-time' result to `org-float-time'
;; (instead of calling without arguments) so that only
;; Pass `current-time' result to `float-time' (instead
;; of calling without arguments) so that only
;; `current-time' has to be overriden in tests.
(seconds-to-time (- (org-float-time (current-time))
(seconds-to-time (- (float-time (current-time))
(- pause-secs start-secs)))))
(setq org-timer-pause-time nil)
(org-timer-set-mode-line 'on)
@ -229,14 +229,14 @@ it in the buffer."
(abs (floor (org-timer-seconds))))))
(defun org-timer-seconds ()
;; Pass `current-time' result to `org-float-time' (instead of
;; calling without arguments) so that only `current-time' has to be
;; Pass `current-time' result to `float-time' (instead of calling
;; without arguments) so that only `current-time' has to be
;; overriden in tests.
(if org-timer-countdown-timer
(- (org-float-time org-timer-start-time)
(org-float-time (or org-timer-pause-time (current-time))))
(- (org-float-time (or org-timer-pause-time (current-time)))
(org-float-time org-timer-start-time))))
(- (float-time org-timer-start-time)
(float-time (or org-timer-pause-time (current-time))))
(- (float-time (or org-timer-pause-time (current-time)))
(float-time org-timer-start-time))))
;;;###autoload
(defun org-timer-change-times-in-region (beg end delta)

File diff suppressed because it is too large Load Diff

View File

@ -511,7 +511,7 @@ that is according to the widest non blank line in CONTENTS."
;; possible.
(save-excursion
(while (not (eobp))
(unless (org-looking-at-p "[ \t]*$")
(unless (looking-at-p "[ \t]*$")
(end-of-line)
(let ((column (current-column)))
(cond
@ -524,8 +524,8 @@ that is according to the widest non blank line in CONTENTS."
(if (eq how 'right) 1 2))))
(if (zerop offset) (throw 'exit contents)
(while (not (eobp))
(unless (org-looking-at-p "[ \t]*$")
(org-indent-to-column offset))
(unless (looking-at-p "[ \t]*$")
(indent-to-column offset))
(forward-line)))))
(buffer-string))))))))

View File

@ -2047,7 +2047,7 @@ CONTENTS is nil. INFO is a plist holding contextual information."
;;;; Latex Fragment
;; (when latex-frag ; FIXME
;; (setq href (org-propertize href :title "LaTeX Fragment"
;; (setq href (propertize href :title "LaTeX Fragment"
;; :description latex-frag)))
;; handle verbatim
;; provide descriptions

View File

@ -1405,7 +1405,7 @@ for export. Return options as a plist."
(cons "TITLE"
(or (org-entry-get (point) "EXPORT_TITLE" 'selective)
(progn (looking-at org-complex-heading-regexp)
(org-match-string-no-properties 4))))))
(match-string-no-properties 4))))))
;; Look for both general keywords and back-end specific
;; options, with priority given to the latter.
(options (append (and backend (org-export-get-all-options backend))
@ -2675,7 +2675,7 @@ the document. Narrowing, if any, is ignored."
end)
(progn
(forward-line -1)
(or (org-looking-at-p "^[ \t]*$")
(or (looking-at-p "^[ \t]*$")
(org-with-limited-levels
(org-at-heading-p)))))))))
(delete-region start end)
@ -3386,7 +3386,7 @@ Return a string of lines to be included in the format expected by
(memq (org-element-type element) '(headline inlinetask)))
;; Skip planning line and property-drawer.
(goto-char (point-min))
(when (org-looking-at-p org-planning-line-re) (forward-line))
(when (looking-at-p org-planning-line-re) (forward-line))
(when (looking-at org-property-drawer-re) (goto-char (match-end 0)))
(unless (bolp) (forward-line))
(narrow-to-region (point) (point-max))))
@ -6213,7 +6213,7 @@ files or buffers, only the display.
header-line-format
'(:eval
(format " %-12s | %6s | %s" "Back-End" "Age" "Source")))
(org-add-hook 'post-command-hook 'org-export-stack-refresh nil t)
(add-hook 'post-command-hook 'org-export-stack-refresh nil t)
(setq-local revert-buffer-function
'org-export-stack-refresh))
@ -6329,12 +6329,12 @@ back to standard interface."
;; on the first key, if any. A nil value means KEY will
;; only be activated at first level.
(if (or (eq access-key t) (eq access-key first-key))
(org-propertize key 'face 'org-warning)
(propertize key 'face 'org-warning)
key)))
(fontify-value
(lambda (value)
;; Fontify VALUE string.
(org-propertize value 'face 'font-lock-variable-name-face)))
(propertize value 'face 'font-lock-variable-name-face)))
;; Prepare menu entries by extracting them from registered
;; back-ends and sorting them by access key and by ordinal,
;; if any.

View File

@ -43,7 +43,7 @@
blah(message hello)
#+end_src
"))
(should (org-looking-at-p "(message hello)")))))
(should (looking-at-p "(message hello)")))))
(ert-deftest test-org-src/point-outside-block ()
"Editing with point before/after block signals expected error."

View File

@ -972,7 +972,7 @@
(should
(org-test-with-temp-text "| <point>a |\n| b |"
(org-return)
(org-looking-at-p "b")))
(looking-at-p "b")))
;; Open link or timestamp under point when `org-return-follows-link'
;; is non-nil.
(should
@ -980,27 +980,27 @@
(let ((org-return-follows-link t)
(org-link-search-must-match-exact-headline nil))
(org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
(should-not
(org-test-with-temp-text "Link [[target<point>]] <<target>>"
(let ((org-return-follows-link nil)) (org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
(should
(org-test-with-temp-text "* [[b][a<point>]]\n* b"
(let ((org-return-follows-link t)) (org-return))
(org-looking-at-p "* b")))
(looking-at-p "* b")))
(should
(org-test-with-temp-text "Link [[target][/descipt<point>ion/]] <<target>>"
(let ((org-return-follows-link t)
(org-link-search-must-match-exact-headline nil))
(org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
(should-not
(org-test-with-temp-text "Link [[target]]<point> <<target>>"
(let ((org-return-follows-link t)
(org-link-search-must-match-exact-headline nil))
(org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
;; When `org-return-follows-link' is non-nil, tolerate links and
;; timestamps in comments, node properties, etc.
(should
@ -1008,22 +1008,22 @@
(let ((org-return-follows-link t)
(org-link-search-must-match-exact-headline nil))
(org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
(should-not
(org-test-with-temp-text "# Comment [[target<point>]]\n <<target>>"
(let ((org-return-follows-link nil)) (org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
(should-not
(org-test-with-temp-text "# Comment [[target]]<point>\n <<target>>"
(let ((org-return-follows-link t)
(org-link-search-must-match-exact-headline nil))
(org-return))
(org-looking-at-p "<<target>>")))
(looking-at-p "<<target>>")))
;; However, do not open link when point is in a table.
(should
(org-test-with-temp-text "| [[target<point>]] |\n| between |\n| <<target>> |"
(let ((org-return-follows-link t)) (org-return))
(org-looking-at-p "between")))
(looking-at-p "between")))
;; Special case: in a list, when indenting, do not break structure.
(should
(equal "- A\n B"
@ -1886,13 +1886,13 @@ SCHEDULED: <2014-03-04 tue.>"
(org-test-with-temp-text
"* H1\n:PROPERTIES:\n:CUSTOM_ID: custom\n:END:\n* H2\n[[#custom<point>]]"
(org-open-at-point)
(org-looking-at-p "\\* H1")))
(looking-at-p "\\* H1")))
;; Throw an error on false positives.
(should-error
(org-test-with-temp-text
"* H1\n:DRAWER:\n:CUSTOM_ID: custom\n:END:\n* H2\n[[#custom<point>]]"
(org-open-at-point)
(org-looking-at-p "\\* H1"))))
(looking-at-p "\\* H1"))))
;;;; Fuzzy Links
@ -2882,7 +2882,7 @@ Outside."
(should
(org-test-with-temp-text "#+key1: v\n#+key<point>2: v\n#+key3: v"
(org-drag-element-backward)
(org-looking-at-p "2")))
(looking-at-p "2")))
;; Error when trying to move first element of buffer.
(should-error
(org-test-with-temp-text "Paragraph 1.\n\nParagraph 2."
@ -3064,7 +3064,7 @@ Text.
(org-odd-levels-only nil))
(org-demote))
(org-move-to-column 10)
(org-looking-at-p ":tag:$")))
(looking-at-p ":tag:$")))
(should-not
(org-test-with-temp-text "* H :tag:"
(let ((org-tags-column 10)
@ -3072,7 +3072,7 @@ Text.
(org-odd-levels-only nil))
(org-demote))
(org-move-to-column 10)
(org-looking-at-p ":tag:$")))
(looking-at-p ":tag:$")))
;; When `org-adapt-indentation' is non-nil, always indent planning
;; info and property drawers accordingly.
(should
@ -3222,7 +3222,7 @@ Text.
(org-odd-levels-only nil))
(org-promote))
(org-move-to-column 10)
(org-looking-at-p ":tag:$")))
(looking-at-p ":tag:$")))
(should-not
(org-test-with-temp-text "** H :tag:"
(let ((org-tags-column 10)
@ -3230,7 +3230,7 @@ Text.
(org-odd-levels-only nil))
(org-promote))
(org-move-to-column 10)
(org-looking-at-p ":tag:$")))
(looking-at-p ":tag:$")))
;; When `org-adapt-indentation' is non-nil, always indent planning
;; info and property drawers.
(should
@ -3844,12 +3844,12 @@ Paragraph<point>"
;; Get "FILE" property.
(should
(org-test-with-temp-text-in-file "* H\nParagraph"
(org-file-equal-p (cdr (assoc "FILE" (org-entry-properties nil "FILE")))
(buffer-file-name))))
(file-equal-p (cdr (assoc "FILE" (org-entry-properties nil "FILE")))
(buffer-file-name))))
(should
(org-test-with-temp-text-in-file "* H\nParagraph"
(org-file-equal-p (cdr (assoc "FILE" (org-entry-properties)))
(buffer-file-name))))
(file-equal-p (cdr (assoc "FILE" (org-entry-properties)))
(buffer-file-name))))
(should-not
(org-test-with-temp-text "* H\nParagraph"
(cdr (assoc "FILE" (org-entry-properties nil "FILE")))))