Allow unrestricted completion on properties

This commit is contained in:
Carsten Dominik 2009-12-11 08:44:35 +01:00
parent bc096078a3
commit e8ec6d6d11
4 changed files with 28 additions and 3 deletions

View File

@ -1,5 +1,16 @@
2009-12-11 Carsten Dominik <carsten.dominik@gmail.com>
* org-colview-xemacs.el (org-columns-edit-value): Use
org-unrestricted property.
* org-colview.el (org-columns-edit-value): Use
org-unrestricted property.
* org.el (org-compute-property-at-point): Set org-unrestricted
text property if the list contains ":ETC".
(org-insert-property-drawer): Use
org-unrestricted property.
* org-exp.el
(org-export-preprocess-before-selecting-backend-code-hook): New hook.
(org-export-preprocess-string): Run

View File

@ -638,7 +638,10 @@ Where possible, use the standard interface for changing this line."
(t
(setq allowed (org-property-get-allowed-values pom key 'table))
(if allowed
(setq nval (org-icompleting-read "Value: " allowed nil t))
(setq nval (org-icompleting-read
"Value: " allowed nil
(not (get-text-property 0 'org-unrestricted
(caar allowed)))))
(setq nval (read-string "Edit: " value)))
(setq nval (org-trim nval))
(when (not (equal nval value))

View File

@ -459,10 +459,16 @@ Where possible, use the standard interface for changing this line."
((equal key "SCHEDULED")
(setq eval '(org-with-point-at pom
(call-interactively 'org-schedule))))
((equal key "BEAMER_env")
(setq eval '(org-with-point-at pom
(call-interactively 'org-beamer-set-environment-tag))))
(t
(setq allowed (org-property-get-allowed-values pom key 'table))
(if allowed
(setq nval (org-icompleting-read "Value: " allowed nil t))
(setq nval (org-icompleting-read
"Value: " allowed nil
(not (get-text-property 0 'org-unrestricted
(caar allowed)))))
(setq nval (read-string "Edit: " value)))
(setq nval (org-trim nval))
(when (not (equal nval value))

View File

@ -12710,7 +12710,9 @@ in the current file."
(allowed (org-property-get-allowed-values nil prop 'table))
(existing (mapcar 'list (org-property-values prop)))
(val (if allowed
(org-completing-read "Value: " allowed nil 'req-match)
(org-completing-read "Value: " allowed nil
(not (get-text-property 0 'org-unrestricted
(caar allowed))))
(let (org-completion-use-ido org-completion-use-iswitchb)
(org-completing-read
(concat "Value " (if (and cur (string-match "\\S-" cur))
@ -12794,6 +12796,9 @@ completion."
((symbolp x) (symbol-name x))
(t "???")))
vals)))))
(when (member ":ETC" vals)
(setq vals (remove ":ETC" vals))
(org-add-props (car vals) '(org-unrestricted t)))
(if table (mapcar 'list vals) vals)))
(defun org-property-previous-allowed-value (&optional previous)