Minor improvements

This commit is contained in:
Carsten Dominik 2009-07-18 08:14:03 +02:00
parent b62e7fc5a0
commit 6596d005ef
3 changed files with 43 additions and 21 deletions

View File

@ -1,3 +1,11 @@
2009-07-18 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-activate-plain-links): Make single-match.
(org-adapt-indentation): Fix docstring.
* org-macs.el (org-unmodified): Turn of modification hooks while
running this macro.
2009-07-08 Carsten Dominik <carsten.dominik@gmail.com> 2009-07-08 Carsten Dominik <carsten.dominik@gmail.com>
* org-clock.el (org-clock-goto): Find hidden headlines as well. * org-clock.el (org-clock-goto): Find hidden headlines as well.

View File

@ -46,7 +46,9 @@
(defmacro org-unmodified (&rest body) (defmacro org-unmodified (&rest body)
"Execute body without changing `buffer-modified-p'." "Execute body without changing `buffer-modified-p'."
`(set-buffer-modified-p `(set-buffer-modified-p
(prog1 (buffer-modified-p) ,@body))) (prog1 (buffer-modified-p)
(let (before-change-functions after-change-functions)
,@body))))
(defmacro org-re (s) (defmacro org-re (s)
"Replace posix classes in regular expression." "Replace posix classes in regular expression."

View File

@ -684,15 +684,26 @@ lines to the buffer:
:type 'boolean) :type 'boolean)
(defcustom org-adapt-indentation t (defcustom org-adapt-indentation t
"Non-nil means, adapt indentation when promoting and demoting. "Non-nil means, adapt indentation to outline node level.
When this is set and the *entire* text in an entry is indented, the
indentation is increased by one space in a demotion command, and
decreased by one in a promotion command. If any line in the entry
body starts at column 0, indentation is not changed at all.
This variable also influences how property drawers and planning When this variable is set, Org assumes that you write outlines by
information is inserted. When t, these lines drawers will be inserted indenting text in each node to align with the headline (after the stars).
indented. When nil, they will not be indented." The following issues are influenced by this variable:
- When this is set and the *entire* text in an entry is indented, the
indentation is increased by one space in a demotion command, and
decreased by one in a promotion command. If any line in the entry
body starts at column 0, indentation is not changed at all.
- Property drawers and planning information is inserted indented when
this variable s set. When nil, they will not be indented.
- TAB indents a line relative to context. The lines below a headline
will be indented when this variable is set.
Note that this is all about true indentation, by adding and removing
spaces. See also `org-indent.el' which does level-dependent indentation
in a virtual way, i.e. only for display in Emacs."
:group 'org-edit-structure :group 'org-edit-structure
:type 'boolean) :type 'boolean)
@ -3808,7 +3819,7 @@ This variable is set by `org-before-change-function'.
(defvar org-inhibit-startup nil) ; Dynamically-scoped param. (defvar org-inhibit-startup nil) ; Dynamically-scoped param.
(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param. (defvar org-agenda-keep-modes nil) ; Dynamically-scoped param.
(defvar org-inhibit-logging nil) ; Dynamically-scoped param. (defvar org-inhibit-logging nil) ; Dynamically-scoped param.
(defvar org-inhibit-blocking nil) ; Dynamically-scoped param. (defvar org-inhibit-blocking nil) ; Dynamically-scoped param.
(defvar org-table-buffer-is-an nil) (defvar org-table-buffer-is-an nil)
(defconst org-outline-regexp "\\*+ ") (defconst org-outline-regexp "\\*+ ")
@ -4171,17 +4182,18 @@ will be prompted for."
"Run through the buffer and add overlays to links." "Run through the buffer and add overlays to links."
(catch 'exit (catch 'exit
(let (f) (let (f)
(while (re-search-forward org-plain-link-re limit t) (if (re-search-forward org-plain-link-re limit t)
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (progn
(setq f (get-text-property (match-beginning 0) 'face)) (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(if (or (eq f 'org-tag) (setq f (get-text-property (match-beginning 0) 'face))
(and (listp f) (memq 'org-tag f))) (if (or (eq f 'org-tag)
nil (and (listp f) (memq 'org-tag f)))
(add-text-properties (match-beginning 0) (match-end 0) nil
(list 'mouse-face 'highlight (add-text-properties (match-beginning 0) (match-end 0)
'keymap org-mouse-map)) (list 'mouse-face 'highlight
(org-rear-nonsticky-at (match-end 0)) 'keymap org-mouse-map))
(throw 'exit t)))))) (org-rear-nonsticky-at (match-end 0)))
t)))))
(defun org-activate-code (limit) (defun org-activate-code (limit)
(if (re-search-forward "^[ \t]*\\(: .*\n?\\)" limit t) (if (re-search-forward "^[ \t]*\\(: .*\n?\\)" limit t)