;;; org-macs.el --- Top-level definitions for Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.29c
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
(while (string-match "\\[:alpha:\\]" ss)
(setq ss (replace-match "a-zA-Z" t t ss)))
+ (while (string-match "\\[:punct:\\]" ss)
+ (setq ss (replace-match "\001-@[-`{-~" t t ss)))
ss))
s))
(_col (current-column)))
(unwind-protect
(progn ,@body)
- (goto-line _line)
+ (org-goto-line _line)
(org-move-to-column _col))))
(defmacro org-without-partial-completion (&rest body)
(save-excursion
(goto-char (or ,pom (point)))
,@body)))
+(put 'org-with-point-at 'lisp-indent-function 1)
(defmacro org-no-warnings (&rest body)
(cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
,@body))
(defmacro org-if-unprotected-at (pos &rest body)
- "Execute BODY if there is no `org-protected' text property at point-1."
+ "Execute BODY if there is no `org-protected' text property at POS."
`(unless (get-text-property ,pos 'org-protected)
,@body))
+(put 'org-if-unprotected-at 'lisp-indent-function 1)
+
+(defun org-re-search-forward-unprotected (&rest args)
+ "Like re-search-forward, but stop only in unprotected places."
+ (catch 'exit
+ (while t
+ (unless (apply 're-search-forward args)
+ (throw 'exit nil))
+ (unless (get-text-property (match-beginning 0) 'org-protected)
+ (throw 'exit (point))))))
(defmacro org-with-remote-undo (_buffer &rest _body)
"Execute BODY while recording undo information in two buffers."
(t (cdr (assq 'default option)))))
(defsubst org-check-external-command (cmd &optional use no-error)
- "Check if external progam CMD for USE exists, error if not.
-When the program does exist, return it's path.
+ "Check if external program CMD for USE exists, error if not.
+When the program does exist, return its path.
When it does not exist and NO-ERROR is set, return nil.
Otherwise, throw an error. The optional argument USE can describe what this
program is needed for, so that the error message can be more informative."
;; works also in narrowed buffer, because we start at 1, not point-min
(+ (if (bolp) 1 0) (count-lines 1 (point)))))
+(defsubst org-goto-line (N)
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line (1- N))))
+
(defsubst org-current-line-string (&optional to-here)
(buffer-substring (point-at-bol) (if to-here (point) (point-at-eol))))