Re: [O] Define org-capture-templates with variables via customize
2015-04-04 23:54 GMT+02:00 Xavier Maillard : > > > Ok, sounds like there is something I can /hack/ to permit such thing > then. > > Update: I finally got it running as I wanted to through an ugly hack. > Hi Xavier, could you please elaborate a bit on your hack ? Thanks in advance, Nicolas
Re: [O] Define org-capture-templates with variables via customize
Nicolas Goaziou writes: > Xavier Maillard writes: > >> Nicolas Goaziou writes: >> >>> Hello, >>> >>> Nick Dokos writes: >>> Trying to just read Xavier's email message in Gnus, I get the following backtrace (with unprintable characters replaced by periods) - to me, this looks like a bug somewhere, but not sure where: Debugger entered--Lisp error: (error "Before first headline at position 114 in buffer *fontification*<2>") >>> >>> Fixed in c1a744659d2b44c067ecb195b3e5d51e837bddd1. Thank you. >> >> Glad you fixed that bug. Now that I am visible, is there any way to achieve >> what I need >> ? :D > > I don't think so. You are trying to mix two different concepts. > Customize is self-contained and generally helps users to avoid Elisp. > OTOH when you're defining a new variable, you embrace Elisp. I do embrace Elisp from time to time but I do not want to clutter my init files :) Ok, sounds like there is something I can /hack/ to permit such thing then. Update: I finally got it running as I wanted to through an ugly hack. Regards -- Xavier.
Re: [O] Define org-capture-templates with variables via customize
Xavier Maillard writes: > Nicolas Goaziou writes: > >> Hello, >> >> Nick Dokos writes: >> >>> Trying to just read Xavier's email message in Gnus, I get the following >>> backtrace (with unprintable characters replaced by periods) - to me, this >>> looks like a bug somewhere, but not sure where: >>> >>> Debugger entered--Lisp error: (error "Before first headline at position 114 >>> in buffer *fontification*<2>") >> >> Fixed in c1a744659d2b44c067ecb195b3e5d51e837bddd1. Thank you. > > Glad you fixed that bug. Now that I am visible, is there any way to achieve > what I need > ? :D I don't think so. You are trying to mix two different concepts. Customize is self-contained and generally helps users to avoid Elisp. OTOH when you're defining a new variable, you embrace Elisp. Regards,
Re: [O] Define org-capture-templates with variables via customize
Nicolas Goaziou writes: > Hello, > > Nick Dokos writes: > >> Trying to just read Xavier's email message in Gnus, I get the following >> backtrace (with unprintable characters replaced by periods) - to me, this >> looks like a bug somewhere, but not sure where: >> >> Debugger entered--Lisp error: (error "Before first headline at position 114 >> in buffer *fontification*<2>") > > Fixed in c1a744659d2b44c067ecb195b3e5d51e837bddd1. Thank you. Glad you fixed that bug. Now that I am visible, is there any way to achieve what I need ? :D Regards -- Xavier.
Re: [O] Define org-capture-templates with variables via customize
Hello, Nick Dokos writes: > Trying to just read Xavier's email message in Gnus, I get the following > backtrace (with unprintable characters replaced by periods) - to me, this > looks like a bug somewhere, but not sure where: > > Debugger entered--Lisp error: (error "Before first headline at position 114 > in buffer *fontification*<2>") Fixed in c1a744659d2b44c067ecb195b3e5d51e837bddd1. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Define org-capture-templates with variables via customize
Trying to just read Xavier's email message in Gnus, I get the following backtrace (with unprintable characters replaced by periods) - to me, this looks like a bug somewhere, but not sure where: Debugger entered--Lisp error: (error "Before first headline at position 114 in buffer *fontification*<2>") signal(error ("Before first headline at position 114 in buffer *fontification*<2>")) error("Before first headline at position %d in buffer %s" 114 #>) (condition-case nil (outline-back-to-heading invisible-ok) (error (error "Before first headline at position %d in buffer %s" (point) (current-buffer org-back-to-heading(t) (save-excursion (org-back-to-heading t) (if (symbolp tprop) (put-text-property (point) (or (outline-next-heading) (point-max)) tprop p) (mapc (function (lambda (al) (save-excursion (put-text-property (point-at-bol) (or ... ...) (car al) (funcall ... p) tprop))) org-refresh-property(((effort . identity) (effort-minutes . org-duration-string-to-minutes)) "%^{effort|1:00|0:30|0:05|0:15|2:00|3:00|4:00}") (while (re-search-forward (concat "^[ ]*:" dprop ": +\\(.*\\)[ ]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1))) (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward (concat "^[ ]*:" dprop ": +\\(.*\\)[]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1 (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward (concat "^[ ]*:" dprop ": +\\(.*\\)[]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1) (progn (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward (concat "^[]*:" dprop ": +\\(.*\\)[ ]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1)) (unwind-protect (progn (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward (concat "^[]*:" dprop ": +\\(.*\\)[]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1)) (if modified nil (restore-buffer-modified-p nil))) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward (concat "^[ ]*:" dprop ": +\\(.*\\)[]*$") nil t) (org-refresh-property tprop (org-match-string-no-properties 1)) (if modified nil (restore-buffer-modified-p nil (let ((case-fold-search t) (inhibit-read-only t)) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-modification-hooks t)) (unwind-protect (progn (save-excursion (save-restriction (widen) (goto-char (point-min)) (while (re-search-forward ... nil t) (org-refresh-property tprop ...) (if modified nil (restore-buffer-modified-p nil) org-refresh-properties("Effort" ((effort . identity) (effort-minutes . org-duration-string-to-minutes))) org-refresh-effort-properties() (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and org-startup-with-beamer-mode (org-beamer-mode)) (if org-startup-align-all-tables (progn (org-table-map-tables (quote org-table-align) (quote quietly (if org-startup-with-inline-images (progn (org-display-inline-images))) (if org-startup-with-latex-preview (progn (org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil (org-set-startup-visibility)) (org-refresh-effort-properties)) (unwind-protect (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and org-startup-with-beamer-mode (org-beamer-mode)) (if org-startup-align-all-tables (progn (org-table-map-tables (quote org-table-align) (quote quietly (if org-startup-with-inline-images (progn (org-display-inline-images))) (if org-startup-with-latex-preview (progn (org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil (org-set-startup-visibility)) (org-refresh-effort-properties)) (set-buffer-modified-p --was-modified)) (let ((--was-modified (buffer-modified-p))) (unwind-protect (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and org-startup-with-beamer-mode (org-beamer-mode)) (if org-startup-align-all-tables (progn (org-table-map-tables (quote org-table-align) (quote quietly (if org-startup-with-inline-images (progn (org-display-inline-images))) (if org-startup-with-latex-preview (progn (org-toggle-latex-fragment))) (if org-inhibit-startup-visibility-stuff nil (org-set-startup-visibility)) (org-refresh-effort-properties)) (set-buffer-modified-p --was-modified))) (if org-inhibit-startup nil (let ((--was-modified (buffer-modified-p))) (unwind-protect (let ((buffer-undo-list t) (inhibit-modification-hooks t)) (and org-startup-with-beamer-mode (org-beamer-mode)) (if org-startup-align-all-tables (progn (org-table-map-tables (quot
[O] Define org-capture-templates with variables via customize
Hello, Given the fact I defvar'ed a custom variable holding a template of my own: #+BEGIN_SRC emacs-lisp (defvar xma/org-task-with-effort-template "* TODO %^{Task} %U SCHEDULED: %^t :PROPERTIES: :Effort: %^{effort|1:00|0:30|0:05|0:15|2:00|3:00|4:00} :END: %? %a " "Une tache avec une duree d'effort") #+END_SRC How would you use that in a template declared via the customize UI ? How to do the equivalent of this: #+BEGIN_SRC emacs-lisp (setq org-capture-templates `(("e" "Task with effort" entry (file "~/Dropbox/refile.org") ,xma/org-task-with-effort-template))) #+END_SRC ? Thank you -- Xavier.