Re: [O] disable org-decrypt: auto-save-mode may cause leakage
Pieter Praet pie...@praet.org writes: Apparently not config-related. So it does happen with just emacs -Q? I cannot reproduce this. Regards, Achim. -- +[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
[O] Export issue: Text not exportet to latex but to html (emacs23.2 windows and orgmode 7.7)
Dear List, I've been fighting the whole night but I' can't get it fixed: I have a simple and short file (to test why the big document 70 pages is not exported completely) which I want to export to latex. But if I do so, a portion of text is missing (in the tex file! So it doesn't seem to be related to latex setup?) If I export the same text to html it works fine. I fixed the file encoding to utf 8 and checked encoding also using jedit. .emacs tex- relevant part: 8 (add-to-list 'org-export-latex-classes '(book \\documentclass{book} (\\part{%s} . \\part*{%s}) (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . \\section*{%s}) (\\subsection{%s} . \\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s})) ) (add-to-list 'org-export-latex-classes '(IEEEtran \\documentclass{IEEEtran} ;; (\\part{%s} . \\part*{%s}) ;; (\\chapter{%s} . \\chapter*{%s}) (\\section{%s} . \\section*{%s}) (\\subsection{%s} . \\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s})) ) (add-to-list 'org-export-latex-classes '(djcb-org-article \\documentclass[11pt,a4paper]{article} \\usepackage[T1]{fontenc} \\usepackage{fontspec} \\usepackage{graphicx} \\defaultfontfeatures{Mapping=tex-text} \\setromanfont{Gentium} \\setromanfont [BoldFont={Gentium Basic Bold}, ItalicFont={Gentium Basic Italic}]{Gentium Basic} \\setsansfont{Charis SIL} \\setmonofont[Scale=0.8]{DejaVu Sans Mono} \\usepackage{geometry} \\geometry{a4paper, textwidth=6.5in, textheight=10in, marginparsep=7pt, marginparwidth=.6in} \\pagestyle{empty} \\title{} [NO-DEFAULT-PACKAGES] [NO-PACKAGES] (\\section{%s} . \\section*{%s}) (\\subsection{%s} . \\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s}) (\\paragraph{%s} . \\paragraph*{%s}) (\\subparagraph{%s} . \\subparagraph*{%s}))) ;; acitvate RefTex ;; Master Bib (setq reftex-default-bibliography '(D:/grebenst/My_Info_Local/Daten/Diss/svn_grebi/trunk/DISS/Scrivener/Diss-zotero)) (setq reftex-cite-format 'natbib) (defun my-org-mode-setup () (when (and (buffer-file-name) (file-exists-p (buffer-file-name))) (load-library reftex) (and (buffer-file-name) (file-exists-p (buffer-file-name)) (reftex-parse-all)) (reftex-set-cite-format '((?N 'natbib) (?b . [[bib::%l]]) (?n . [[note::%l]]) (?p . [[citep][%l]]) (?c . [[cite][%l]]) (?C . \\cite{%l} (define-key org-mode-map \C-c\C-g 'reftex-citation) ) (add-hook 'org-mode-hook 'my-org-mode-setup) ;; Mehrerer Latex prozessoren ;; Aus Orgmode FAQS ;; LATEX_CMD auf nicht pdflatex oder xelatex setzen (require 'org-latex) (setq org-export-latex-listings t) ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432 ;; but adapted to use latexmk 4.20 or higher. (defun my-auto-tex-cmd () When exporting from .org with latex, automatically run latex, pdflatex, or xelatex as appropriate, using latexmk. (let ((texcmd))) ;; default command: oldstyle latex via dvi (setq texcmd latexmk -dvi -pdfps -quiet %f) ;; pdflatex - .pdf (if (string-match LATEX_CMD: pdflatex (buffer-string)) (setq texcmd latexmk -pdf -quiet %f)) ;; xelatex - .pdf (if (string-match LATEX_CMD: xelatex (buffer-string)) (setq texcmd latexmk -pdflatex=xelatex -pdf -quiet %f)) ;; LaTeX compilation command (setq org-latex-to-pdf-process (list texcmd))) (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd) ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex (setq org-export-latex-packages-alist '(( graphicx t) ( longtable nil) ( float nil))) (defun my-auto-tex-parameters () Automatically select the tex packages to include. ;; default packages for ordinary latex or pdflatex export (setq org-export-latex-default-packages-alist '((AUTO inputenc t) (T1 fontenc t) ( fixltx2e nil) ( wrapfig nil) ( soul t) ( textcomp t) ( marvosym t) ( wasysym t) ( latexsym t) ( amssymb t) ( hyperref nil))) ;; Packages to include when xelatex is used (if (string-match LATEX_CMD: xelatex (buffer-string)) (setq org-export-latex-default-packages-alist '(( fontspec t) ( xunicode t) ( url t) ( rotating t) (american babel t) (babel csquotes t) ( soul t)
[O] Away from today till sept. 5th
Dear all, I will be quite offline next week, I won't be able to address urgent matters -- I will still read/write my emails once a day. Keep up with the flow of bug reports and ideas! And thanks for taking care of the nice atmosphere here. Thanks a lot, -- Bastien
[O] Hints for contributors -- correct ChangeLog entries
Dear all, here is a quick summary of things to keep in mind when submitting a patch to Org-mode: - prefer `git format-patch': it makes it easy to apply patches without having to manually amend the patch (with the author's name, etc.) - always add an emacs ChangeLog in the commit message: you can create the ChangeLog with `C-x 4 a' (M-x add-change-log-entry-other-window). When merging Org into Emacs, we collect these logs and put them into emacs/lisp/org/ChangeLog. - If your copyright is not assigned to the FSF, take extra care of adding a TINYCHANGE cookie at the end of your ChangeLog entry so that we can easily track those changes. - Take care of a few formatting issues in the ChangeLog itself: - Start all sentences with an uppercase letter. - Use a full-stop and double-space at the end of each sentence. - Quote variables and functions names like this: `org-agenda'. Here is an example: , | * org-publish.el (org-publish-index-generate-theindex): Rename | from `org-publish-index-generate-theindex.inc'. Use the file | theindex.org directly instead of including theindex.inc. | (org-publish-projects): Don't delete .orgx files. | (org-publish-aux-preprocess): Use .file.orgx. ` Thanks all for your efforts! Best, -- Bastien
Re: [O] a new way to navigate your org files
On 08/27/2011 09:26 AM, Nathan Neff wrote: I just found this and it's great -- thanks! On Mon, Apr 25, 2011 at 2:25 PM, Tomadatgyu...@gmail.com wrote: Suvayu Alifatkasuvayu+linuxat gmail.com writes: This is very useful. I made some enhancements in the attached patches. The first one adds a very basic minibuffer history. You can navigate the history by the usual `M-p' and `M-n'. The second patch fixes an issue, now you can go to the first match by just hitting `RET' instead of `down RET'. I added your changes to the code (implementing the second one slightly differently, but it works the same way). I also turned on full cursor for the Occur buffer, instead of the hollow one, so it can be seen more easily. The code is on EmacsWiki for easier downloed: http://www.emacswiki.org/emacs/org-occur-goto.el Sorry for the stupid question, but how do I enable this? Thanks! S.
Re: [O] a new way to navigate your org files
On Sun, Aug 28, 2011 at 10:44 AM, Stelian Iancu stelian.ia...@gmail.com wrote: The code is on EmacsWiki for easier downloed: http://www.emacswiki.org/emacs/org-occur-goto.el Sorry for the stupid question, but how do I enable this? Something like this in your `org-mode-hook' maybe? ;; keybinding for oog (`org-occur-goto') for quick navigation (org-defkey org-mode-map (kbd C-c g) 'oog) -- Suvayu Open source is the future. It sets us free.
Re: [O] Is it possible to markup one character in a word?
The whitespace module seems not to support this kind of spaces. Is there any centralized feature to show/hide those things? The whitespace module does support this, see the variable `whitespace-display-mappings'. Something like this should do the trick (if not done via M-x customize-variable RET whitespace-display-mappings RET): (add-to-list 'whitespace-display-mappings '(space-mark 8203 [?|] [?-])) You'll have to M-x whitespace-mode after evaluating this to update the buffer display. Ciau, Niels. -- http://pft.github.com
Re: [O] Underline ONLY the first character of a word?
What about using something well-structured like a table or a (definition) list and CSS :first-letter pseudoselector and text-decoration: underline? e.g. td:first-child { font-weight:bold; } td~td:first-letter { text-decoration:underline; } for a two-column table. On Fri, Aug 26, 2011 at 10:35 AM, Carsten Dominik carsten.domi...@gmail.com wrote: Hi, I don't think the following trick has come up yet. If you are only exporting to HTML, you can do: @ue@/uvent HTH - Carsten On 25.8.2011, at 01:34, Nick Dokos wrote: Nick Dokos nicholas.do...@hp.com wrote: Not without some code I think. D'oh - as John Hendy points out, you can do it by hand: --8---cut here---start-8--- #+begin_html ba/b ua/uctionablebr/ bb/b ub/uibulousbr/ bc/b uc/ualifragilisticbr/ #+end_html --8---cut here---end---8--- It always amazes me how fixated I can get on the wrong approach. Nick -- http://pft.github.com
[O] Bug: wrong-type-argument when changing TODO state [7.7]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. I am trying to switch between TODO and DONE states with Shift-Right Arrow and I get a (wrong-type-argument stringp nil) error. Please find attached the backtrace. Emacs : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian Package: Org-mode version 7.7 current state: == (setq org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-agenda-custom-commands '((d todo #(DELEGATED 0 9 (face org-warning)) nil) (c todo #(DONE|DEFERRED|CANCELLED 0 23 (face org-warning)) nil) (w todo #(WAITING 0 7 (face org-warning)) nil) (W agenda ((org-agenda-ndays 21))) (A agenda ((org-agenda-skip-function (lambda nil (org-agenda-skip-entry-if (quote notregexp) \\=.*\\[#A\\])) ) (org-agenda-ndays 1) (org-agenda-overriding-header Today's Priority #A tasks: )) ) (u alltodo ((org-agenda-skip-function (lambda nil (org-agenda-skip-entry-if (quote scheduled) (quote deadline) (quote regexp) [^\n]+) ) ) (org-agenda-overriding-header Unscheduled TODO entries: )) ) ) org-agenda-files '(~/Docs/org/todo.org) org-metaup-hook '(org-babel-load-in-session-maybe) org-after-todo-state-change-hook '(org-clock-out-if-current) org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) org-export-latex-format-toc-function 'org-export-latex-format-toc-default org-agenda-skip-scheduled-if-done t org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-shell-link-function 'yes-or-no-p org-export-first-hook '(org-beamer-initialize-open-trackers) org-startup-indented 1 org-agenda-before-write-hook '(org-agenda-add-entry-text) org-default-notes-file ~/Docs/org/notes.org org-blank-before-new-entry nil org-babel-pre-tangle-hook '(save-buffer) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers) org-mode-hook '((lambda nil (org-add-hook (quote change-major-mode-hook) (quote org-show-block-all) (quote append) (quote local)) ) (lambda nil (org-add-hook (quote change-major-mode-hook) (quote org-babel-show-result-all) (quote append) (quote local)) ) org-babel-result-hide-spec org-babel-hide-all-hashes) org-agenda-ndays 7 org-refile-targets '((org-agenda-files :maxlevel . 5)) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-cycle-separator-lines 1 org-confirm-elisp-link-function 'yes-or-no-p org-fast-tag-selection-single-key 'expert org-agenda-start-on-weekday nil org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks)) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-agenda-skip-deadline-if-done t org-reverse-note-order t org-occur-hook '(org-first-headline-recenter) org-from-is-user-regexp \\User\\ org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code) org-tags-column 120 org-remember-templates '((Journal 106 * %U %? %^g\n\n %x ~/Dropbox/org/journal.org (quote top)) ) org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames org-beamer-place-default-actions-for-lists) org-metadown-hook '(org-babel-pop-to-session-maybe) org-export-blocks '((src org-babel-exp-src-block nil) (comment org-export-blocks-format-comment t) (ditaa
Re: [O] disable org-decrypt: auto-save-mode may cause leakage
On Sun, 28 Aug 2011 09:02:58 +0200, Achim Gratz strom...@nexgo.de wrote: Pieter Praet pie...@praet.org writes: Apparently not config-related. So it does happen with just emacs -Q? I cannot reproduce this. Well, not quite... :) Some minimal config is required. 1. Run EMACS like this: (don't forget to adjust the load-path) #+begin_src sh emacs -Q --eval=(progn (setq debug-on-error t) (add-to-list 'load-path \~/src/org-mode/lisp\) (require 'org-install) (require 'org-crypt) (org-crypt-use-before-save-magic)) #+end_src 2. Open the ECM (in att) and complete the TODO's in sequence. When running `org-clock-goto', the user will be prompted: : org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? (y or n) ... which is rather uncalled for in this context. I we'd be calling an error @ lisp/org-crypt.el::170, we'd get the following backtrace upon running `org-clock-goto': #+begin_example Debugger entered--Lisp error: (error blah) signal(error (blah)) error(blah) (progn (error blah) (cond (... ... ...) (... ...) (... ... ...) (t nil))) (if buffer-auto-save-file-name (progn (error blah) (cond ... ... ... ...))) (when buffer-auto-save-file-name (error blah) (cond (... ... ...) (... ...) (... ... ...) (t nil))) org-decrypt-entry() run-hooks(org-reveal-start-hook) org-reveal() (let* ((recent nil) (m ...)) (org-pop-to-buffer-same-window (marker-buffer m)) (if (or ... ...) (widen)) (goto-char m) (org-show-entry) (org-back-to-heading t) (org-cycle-hide-drawers (quote children)) (recenter) (org-reveal) (if recent (message No running clock, this is the most recently clocked task)) (run-hooks (quote org-clock-goto-hook))) org-clock-goto(nil) call-interactively(org-clock-goto nil nil) #+end_example So, either org-crypt shouldn't be imposing itself on `org-reveal-start-hook' (see lisp/org-crypt.el::250) XOR `org-clock-goto' shouldn't call `org-reveal'. I'll let others decide... Peace Regards, Achim. -- +[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables Peace -- Pieter * NOTE here's an encrypted entry (symmetric, pass = test) :crypt: -BEGIN PGP MESSAGE- Version: GnuPG v1.4.10 (GNU/Linux) jA0ECgMCBqqZSbotsitg0nwBKep+l0L85gNUFsipCPc6Nn/VKiRoZrbBU37f0+7w yTBvfSXMpBKc+D8TZ4ZoIPwqNwc52TZA4phh5VQIs5T96PAXYH6yAQIBbG7ggMWV 4zrU6NiHU/dCCznsbObQXGkMg1tVU1Kp6A9EapGBklh24mcrwhG3BZQcqzN2 =uLcl -END PGP MESSAGE- * TODO run `org-clock-in' (`C-c C-x C-i') here * TODO run `org-clock-goto' (`C-c C-x C-j') here
[O] org-agenda-custom-commands clarification on filters needed
Hi org'ers, I am currently trying to figure out a way to build a composite view for an agenda containing agenda and todos, which works well but when it comes to setting filters... In the first example (agenda and todo list below) the filter +home for the agenda does not take effect. When reordering that the todo list is on top and the agenda below, it works as expected. That is, both items of the composite view are correctly filtered with tag +home. #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ( (agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) (tags-todo +home) (setq org-agenda-custom-commands '((h Agenda and home related todos ( (tags-todo +home) (agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) #+end_src Having a discussion with Thumper_ on the irc channel he found out some more oddities (copied and slightly modified by courtesy of Thumper_): #+STARTUP: * This one works [2011-08-28 Sun 07:07] #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ((agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) (tags-todo +home ((org-agenda-filter-preset '(+home) nil))) #+end_src * This also incorrectly filters the first agenda [2011-08-28 Sun 07:07] #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ((agenda ((org-agenda-span 4))) (tags-todo +home ((org-agenda-filter-preset '(+home) nil))) #+end_src So, how would I set the filters properly given that I want the agenda tob be first and a list of todo items below? Any pointers to documentation or hints greatly appreciated :) bye, thomas
[O] [PATCH] org-crypt: when running org-decrypt-entry, only run auto-save-mode check if on an encrypted entry
* lisp/org-crypt.el (org-crypt-check-auto-save): New function, see next change. * lisp/org-crypt.el (org-decrypt-entry): Break the auto-save-mode check out into a separate function, and call it at a later point, to assure it only runs when visiting an encrypted entry. Currently `org-decrypt-entry' is doing the auto-save-mode check whenever it's run, regardless of context, while this only makes sense when run on an entry which is actually encrypted (or looks like it, at least). Signed-off-by: Pieter Praet pie...@praet.org --- lisp/org-crypt.el | 54 +--- 1 files changed, 30 insertions(+), 24 deletions(-) diff --git a/lisp/org-crypt.el b/lisp/org-crypt.el index 5991192..f764404 100644 --- a/lisp/org-crypt.el +++ b/lisp/org-crypt.el @@ -116,6 +116,35 @@ nil : Leave auto-save-mode enabled. (const :tag Ask ask) (const :tag Encrypt encrypt))) +(defun org-crypt-check-auto-save () + Check whether auto-save-mode is enabled for the current buffer. + +`auto-save-mode' may cause leakage when decrypting entries, so +check whether it's enabled, and decide what to do about it. + +See `org-crypt-disable-auto-save'. + (when buffer-auto-save-file-name +(cond + ((or + (eq org-crypt-disable-auto-save t) + (and + (eq org-crypt-disable-auto-save 'ask) + (y-or-n-p org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ))) + (message (concat org-decrypt: Disabling auto-save-mode for (or (buffer-file-name) (current-buffer + ; The argument to auto-save-mode has to be -1, since + ; giving a nil argument toggles instead of disabling. + (auto-save-mode -1)) + ((eq org-crypt-disable-auto-save nil) + (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.) + (add-hook 'auto-save-hook + (lambda () + (message org-crypt: Re-encrypting all decrypted entries due to auto-save.) + (org-encrypt-entries)) + nil t)) + (t nil + (defun org-crypt-key-for-heading () Return the encryption key for the current heading. (save-excursion @@ -164,30 +193,6 @@ nil : Leave auto-save-mode enabled. (defun org-decrypt-entry () Decrypt the content of the current headline. (interactive) - - ; auto-save-mode may cause leakage, so check whether it's enabled. - (when buffer-auto-save-file-name -(cond - ((or - (eq org-crypt-disable-auto-save t) - (and -(eq org-crypt-disable-auto-save 'ask) -(y-or-n-p org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ))) - (message (concat org-decrypt: Disabling auto-save-mode for (or (buffer-file-name) (current-buffer - ; The argument to auto-save-mode has to be -1, since - ; giving a nil argument toggles instead of disabling. - (auto-save-mode -1)) - ((eq org-crypt-disable-auto-save nil) - (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.) - (add-hook 'auto-save-hook -(lambda () - (message org-crypt: Re-encrypting all decrypted entries due to auto-save.) - (org-encrypt-entries)) -nil t)) - (t nil))) - (require 'epg) (unless (org-before-first-heading-p) (save-excursion @@ -199,6 +204,7 @@ nil : Leave auto-save-mode enabled. (outline-invisible-p (forward-line) (when (looking-at -BEGIN PGP MESSAGE-) + (org-crypt-check-auto-save) (let* ((end (save-excursion (search-forward -END PGP MESSAGE-) (forward-line) -- 1.7.5.4
Re: [O] [PATCH 0/5] loop over headlines in active region
At Thu, 25 Aug 2011 12:08:42 +0200, Štěpán Němec wrote: On Thu, 25 Aug 2011 06:25:29 +0200 David Maus wrote: As for the macro: What stop me to implement a macro for the generic operation is that for now the macro would depend on the global customization variable. That's not a problem per se but according to my readings about macros (mostly in context of Common Lisp, but that shouldn't matter) it should be considered bad style. Could you expand on this a bit? As far as I can tell, you obviously shouldn't depend on a customisation variable at macro expansion time, but I don't see how depending on it at run time is any different from a function doing the same. At expansion time the macro performs a transformation of the lisp at the place where the macro is used. At runtime the code of the expanded macro runs in the scope of the function where the macro was expanded into. A macro that uses a variable inside the expanded code that is not under its control (e.g. part of the argument list or gensym'd) is prone to introduce a bug caused by expanding the macro in an environment where this variable is not bound or used with a different semantics. In this particular case this should not be a problem indeed because we use a global dynamically scoped customization variable. Thus, whereever we would use the macro we can be sure the variable in the macro expansion is bound and carries the same meaning. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp4wAB3wZmkl.pgp Description: PGP signature
Re: [O] [PATCH 0/5] loop over headlines in active region
Hi Carsten, At Thu, 25 Aug 2011 08:13:21 +0200, Carsten Dominik wrote: I am wondering, why did you choose to skip invisible headlines? I would worry that this introduces inconsistent behavior and also makes it hard to use this feature in a programmatic way. Good points. I though of skipping invisible headlines as a way to control which headlines are 'looped over' but if this is inconsistent with already present behaviour of Org mode or Emacs in general we can scratch that idea. What brings up the question: What is the current behavior of Org mode with regards to operations in a region? Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpMdN7x13PuZ.pgp Description: PGP signature
Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active
Hi Carsten, At Thu, 25 Aug 2011 07:43:48 +0200, Carsten Dominik wrote: On 25.8.2011, at 06:25, David Maus wrote: * org.el (org-map-entries): Immediately return if scope is region but no region is active. --- lisp/org.el | 116 ++- 1 files changed, 59 insertions(+), 57 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b69b77c..27bad52 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13608,65 +13608,67 @@ with `org-get-tags-at'. If your function gets properties with to t around the call to `org-entry-properties' to get the same speedup. Note that if your function moves around to retrieve tags and properties at a *different* entry, you cannot use these techniques. - (let* ((org-agenda-archives-mode nil) ; just to make sure -(org-agenda-skip-archived-trees (memq 'archive skip)) -(org-agenda-skip-comment-trees (memq 'comment skip)) -(org-agenda-skip-function - (car (org-delete-all '(comment archive) skip))) -(org-tags-match-list-sublevels t) -matcher file res -org-todo-keywords-for-agenda -org-done-keywords-for-agenda -org-todo-keyword-alist-for-agenda -org-drawers-for-agenda -org-tag-alist-for-agenda) + (unless (and (eq scope 'region) + (not (org-region-active-p))) Would it be good to throw an error here? (if (and (eq scope 'region) (not (org-region-active-p))) (error No active region) Not necessarily. I look at map-entries as a function that applies FUNC to a subset of all headlines. SCOPE, MATCH, and SKIP are selectors that narrow down the set of headlines. First SCOPE is applied to the set containing all headlines, than MATCH is applied to the set of headlines selected by SCOPE, finally FUNC is applied to all headlines in the final subset if not SKIP. If you look at `org-map-entries' this way then calling it with SCOPE 'region but no active region is not an error. How many headlines are in the active region if there is no active region? Exactly zero. Its the same with a SCOPE 'file but no headline in current file. Applying SCOPE to the set of all headings produces the empty set and `org-map-entries' can simply leave because MATCH and SKIP wouldn't match anything. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp33UKFGiPiv.pgp Description: PGP signature
[O] Small patch for org-lparse.el -- Macro edebug spec
Attached patch for org-lparse.el adds an edebug specification to `with-org-lparse-preserve-paragraph-state'. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpdNxPKq8hcd.pgp Description: PGP signature
Re: [O] Small patch for org-lparse.el -- Macro edebug spec
At Sun, 28 Aug 2011 16:06:49 +0200, David Maus wrote: Attached patch for org-lparse.el adds an edebug specification to `with-org-lparse-preserve-paragraph-state'. And here's the patch. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de From 7e11e940a0f8d89a21724ee9a7a548292c5ed867 Mon Sep 17 00:00:00 2001 From: David Maus dm...@ictsoc.de Date: Sun, 28 Aug 2011 16:03:38 +0200 Subject: [PATCH] Provide edebug spec for with-org-lparse-preserve-paragraph-state * org-lparse.el (with-org-lparse-preserve-paragraph-state): Provide edebug spec. --- contrib/lisp/org-lparse.el |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index fd0488b..41c6936 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -335,6 +335,7 @@ OPT-PLIST is the export options list. ,@body (when org-lparse-do-open-par (org-lparse-begin-paragraph +(def-edebug-spec with-org-lparse-preserve-paragraph-state (body)) (defvar org-lparse-native-backends nil List of native backends registered with `org-lparse'. -- 1.7.2.5 pgpYGJiJucFOQ.pgp Description: PGP signature
Re: [O] Using Code Blocks in Org Tables
Henri-Paul Indiogine hindiog...@gmail.com writes: Hi Eric! 2011/8/26 Eric Schulte schulte.e...@gmail.com: sh code blocks are different in that they don't really have a :results value option in the same way as most code blocks. Two options would be to either 1. remove the echo $HOME line from your code blocks, or 2. change the '(sbe test-sh) formula to '(second (second (sbe test-sh))) I was going by: http://orgmode.org/worg/org-contrib/babel/intro.html#results Capturing the results of code evaluation. The 'result' of code evaluation is the value of the last statement in the code block. I have a long bash script that outputs a lot of information to a log file. But I would like one piece of information to end up in a cell of an org-mode table. I can place this value as the last one in the bash script. How could I make that work? Hi Henri-Paul, You could define another code block which could be used to take just the last line of the output, e.g., #+source: stuff #+begin_src sh echo 1 echo 2 echo 3 #+end_src #+source: last-of-stuff #+begin_src sh :var input=stuff echo $input |tail -1 #+end_src | one | | two | | 3 | #+TBLFM: @3$1='(sbe last-of-stuff) Hope this helps -- Eric Thanks, Henri-Paul -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] Library of Babel function
Hi Tom, This sounds great, would you mind submitting this as a patch to the library-of-babel.org file in the git repository, with some included usage instructions in the same subtree as the code block? Thanks! -- Eric t...@tsdye.com (Thomas S. Dye) writes: Hi Eric, The booktabs-notes function, below, is based on the booktabs function in the library of Babel. It takes a second table and adds it to the bottom of the main table. I use it to add multicolumn footnotes to the bottom of the table. There is also a switch that adds a linespace between the main table and the notes table. I think the function might be a useful addition to the library of Babel. I tried to design it to be a functional replacement for the booktabs function, but don't trust my emacs-lisp (or other) programming skills. All the best, Tom #+srcname: booktabs-notes #+begin_src emacs-lisp :var table='((:head) hline (:body)) :var notes='() :var align='() :var env=tabular :var width='() :var lspace='() :noweb yes :results latex (flet ((to-tab (tab) (orgtbl-to-generic (mapcar (lambda (lis) (if (listp lis) (mapcar (lambda (el) (if (stringp el) el (format %S el))) lis) lis)) tab) (list :lend :sep:hline \\hline (org-fill-template \\begin{%env}%width%align \\toprule %table \\bottomrule%spacer %notes \\end{%env}\n (list (cons env (or env table)) (cons width (if width (format {%s} width) )) (cons align (if align (format {%s} align) )) (cons spacer(if lspace \\addlinespace )) (cons table ;; only use \midrule if it looks like there are column headers (if (equal 'hline (second table)) (concat (to-tab (list (first table))) \n\\midrule\n (to-tab (cddr table))) (to-tab table))) (cons notes (if notes (to-tab notes) )) ))) #+end_src -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] difference between #+source and #+srcname; passing parameters to Awk.
Feiming Chen feimingc...@yahoo.com writes: Hi, I'd like to ask two questions. 1. What's the difference between header options #+source and #+srcname? They seem to have identical utilities. No difference, these are synonyms for the same thing. 2. I'd like to pass parameters (filenames) to Awk (language) code block, but #+srcname: subset(file=~/tmp/a) #+begin_src awk #+end_src fails upon C-c C-v v (org-babel-expand-src-block) with error: wrong type argument: sequencep, file. So does: #+begin_src awk :var file=~/tmp/a #+end_src In comparison, it works with a Perl code block: #+srcname: subset(file=~/tmp/a) #+begin_src perl #+end_src Thanks a lot! This is actually a bug in ob-awk. I've just pushed up a fix so your example should work with the latest git HEAD. Thanks -- Eric -- Feiming Chen -- Eric Schulte http://cs.unm.edu/~eschulte/
[O] [PATCH] Library of Babel source block
Eric Schulte schulte.e...@gmail.com writes: Hi Tom, This sounds great, would you mind submitting this as a patch to the library-of-babel.org file in the git repository, with some included usage instructions in the same subtree as the code block? Thanks! -- Eric t...@tsdye.com (Thomas S. Dye) writes: Hi Eric, The booktabs-notes function, below, is based on the booktabs function in the library of Babel. It takes a second table and adds it to the bottom of the main table. I use it to add multicolumn footnotes to the bottom of the table. There is also a switch that adds a linespace between the main table and the notes table. I think the function might be a useful addition to the library of Babel. I tried to design it to be a functional replacement for the booktabs function, but don't trust my emacs-lisp (or other) programming skills. All the best, Tom #+srcname: booktabs-notes #+begin_src emacs-lisp :var table='((:head) hline (:body)) :var notes='() :var align='() :var env=tabular :var width='() :var lspace='() :noweb yes :results latex (flet ((to-tab (tab) (orgtbl-to-generic (mapcar (lambda (lis) (if (listp lis) (mapcar (lambda (el) (if (stringp el) el (format %S el))) lis) lis)) tab) (list :lend :sep:hline \\hline (org-fill-template \\begin{%env}%width%align \\toprule %table \\bottomrule%spacer %notes \\end{%env}\n (list (cons env (or env table)) (cons width (if width (format {%s} width) )) (cons align (if align (format {%s} align) )) (cons spacer(if lspace \\addlinespace )) (cons table ;; only use \midrule if it looks like there are column headers (if (equal 'hline (second table)) (concat (to-tab (list (first table))) \n\\midrule\n (to-tab (cddr table))) (to-tab table))) (cons notes (if notes (to-tab notes) )) ))) #+end_src Hi Eric, Here is the patch that adds the booktabs-notes source block. I took the liberty of editing the description of the booktabs source block, which contained a contradiction about the number of required and optional arguments. Take a look to make sure I resolved the contradiction correctly. I tried to follow Bastien's suggestion about adding a change log to the commit message, but ended up with something that looks different than his example. I'm not sure why--perhaps Bastien is not working in magit, so his instructions apply to some other context? All the best, Tom From ebc18deea7958cf70f761b1fff8134c1e0a35288 Mon Sep 17 00:00:00 2001 From: Tom Dye t...@tsdye.com Date: Sun, 28 Aug 2011 07:00:32 -1000 Subject: [PATCH] * contrib/babel/library-of-babel.org: 2011-08-28 Thomas Dye t...@tsdye.com * Add booktabs-notes source block to the Library of Babel. Minor edits to booktabs documentation. --- contrib/babel/library-of-babel.org | 74 +--- 1 files changed, 68 insertions(+), 6 deletions(-) diff --git a/contrib/babel/library-of-babel.org b/contrib/babel/library-of-babel.org index e76b313..c3b000c 100644 --- a/contrib/babel/library-of-babel.org +++ b/contrib/babel/library-of-babel.org @@ -194,18 +194,26 @@ plot(data) * Tables -** LaTeX Table export +** LaTeX Table Export *** booktabs -This block can be used to wrap a table in the latex =booktabs= -environment, it takes the following arguments -- all but the first two -are optional. +This source block can be used to wrap a table in the latex =booktabs= +environment. The source block adds a =toprule= and =bottomrule= (so +don't use =hline= at the top or bottom of the table). The =hline= +after the header is replaced with a =midrule=. + +Note that this function bypasses the Org-mode LaTeX exporter and calls +=orgtbl-to-generic= to create the output table. This means that the +entries in the table are not translated from Org-mode to LaTeX. + +It takes the following arguments -- all but the first two are +optional. | arg | description| |---+| | table | a reference to the table | -| align | optional alignment string | +| align | alignment string | | env | optional environment, default to tabular | | width | optional width specification string| @@ -241,7 +249,7 @@ are optional. (to-tab table)) #+end_src -*** Longtable +*** longtable This block can be used to wrap a table in the latex =longtable= environment, it takes the following arguments -- all
Re: [O] Bug: wrong-type-argument when changing TODO state [7.7]
Stelian Iancu stelian.ia...@gmail.com wrote: I am trying to switch between TODO and DONE states with Shift-Right Arrow and I get a (wrong-type-argument stringp nil) error. Please find attached the backtrace. Emacs : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian Package: Org-mode version 7.7 Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) (and (outline-on-heading-p) (not (bolp)) (save-excursion (beginning-of-line 1) (looking-at org-todo-line-regexp)) ( (point) (+ 2 ...))) (if (and (outline-on-heading-p) (not ...) (save-excursion ... ...) ( ... ...)) (progn (goto-char ...) (and ... ...))) (let* ...) (catch (quote exit) ...) (save-excursion (catch (quote exit)...) (let ...) org-todo(right) call-interactively(org-todo) (let ((current-prefix-arg arg)) (call-interactively command)) org-call-with-arg(org-todo right) (let ...) (cond ...) org-shiftright(nil) call-interactively(org-shiftright nil nil) The problem is that org-todo-line-regexp is nil. This variable is made buffer-local and initialized when the buffer's mode is set to org-mode. Are you sure that your buffer's major mode is org-mode? Nick
Re: [O] Export issue: Text not exportet to latex but to html (emacs23.2 windows and orgmode 7.7)
Markus Grebenstein p...@mgrebenstein.de wrote: Dear List, I've been fighting the whole night but I' can't get it fixed: I have a simple and short file (to test why the big document 70 pages is not exported completely) which I want to export to latex. But if I do so, a portion of text is missing (in the tex file! So it doesn't seem to be related to latex setup?) Correct - orgmode and emacs setup are the primary suspects. If I export the same text to html it works fine. I tried a minimal .emacs plus your .emacs customizations (after fixing up some unfortunate line breaks that the email suffered) and I get a good tex file with no chapters missing (tex file attached). Org-mode version 7.7 (release_7.7.205.gce02a) GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-07-30 You might want to check your version of orgmode and upgrade if necessary, but the primary suspect is still your configuration I think (maybe the rest of your .emacs). Nick % Created 2011-08-28 Sun 12:30 \documentclass[a4paper,11pt]{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{wrapfig} \usepackage{soul} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} \usepackage{latexsym} \usepackage{amssymb} \usepackage{hyperref} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \input{D:/grebenst/My_Info_Local/Daten/Diss/svn_grebi/trunk/DISS/Templates/book_header.tex} \bibliography{Diss-zotero} \providecommand{\alert}[1]{\textbf{#1}} \title{Testfile fuer Orgmode spezifische Dinge zur Diss} \author{Nick Dokos} \date{\today} \begin{document} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \part{Section 1} \label{sec-1} HIer steht ein Bild Hier ein Zitat in Latex syntax Hier steht ein Zitat in orgmode markup Hier eine Fussnote \footnote{Ich bin die Fussnote } \part{Formatierungen} \label{sec-2} Warum fehlen denn hier schon wieder Dinge?? \chapter{Fuer Text} \label{sec-2-1} wumm das wieda nich geht?? \chapter{liegts an dem Markup Zeuch?} \label{sec-2-2} asdf Komisch ist das?? \printbibliography \end{document} 8- The orgmode file: 8 #+STARTUP: hidestars #+STARTUP: indent #+TODO: TODO | DONE #+TODO: FirstDraft RevisedDraft | Final #+OPTIONS: toc:4 *:t(only to two levels in TOC) ##+OPTIONS: toc:nil(no TOC at all) #+LATEX_CMD: pdflatex #+LaTeX_CLASS: book #+LaTeX_CLASS_OPTIONS: [a4paper,11pt] #+LATEX_HEADER: \input{D:/grebenst/My_Info_Local/Daten/Diss/svn_grebi/trunk/DISS/Templates/book_header.tex} #+LaTeX_HEADER: \bibliography{Diss-zotero} #+TITLE: Testfile fuer Orgmode spezifische Dinge zur Diss * Section 1 HIer steht ein Bild Hier ein Zitat in Latex syntax Hier steht ein Zitat in orgmode markup Hier eine Fussnote [fn:1_1] * Formatierungen Warum fehlen denn hier schon wieder Dinge?? ** Fuer Text wumm das wieda nich geht?? ** liegts an dem Markup Zeuch? asdf Komisch ist das?? [fn:1_1]Ich bin die Fussnote \printbibliography 8
Re: [O] [PATCH] Library of Babel source block
Here is the patch that adds the booktabs-notes source block. Applied, thanks. I took the liberty of editing the description of the booktabs source block, which contained a contradiction about the number of required and optional arguments. Take a look to make sure I resolved the contradiction correctly. This looks good to me. I tried to follow Bastien's suggestion about adding a change log to the commit message, but ended up with something that looks different than his example. I'm not sure why--perhaps Bastien is not working in magit, so his instructions apply to some other context? To easily add a changelog entry from within Magit, I do the following 1. from within magit view the diff of the current changes (often this can be done through pressing TAB with the cursor on the Modified line in the magit buffer) 2. from within the diff view press capital c C with the cursor on either a green or white line (e.g., not a red line). This will pop to the commit log buffer with an appropriately formatted changelog entry. Do this for every portion of the diff. Hope this helps, thanks for the contribution -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/
Re: [O] [PATCH] Library of Babel source block
On Sun, 28 Aug 2011 07:11:36 -1000, t...@tsdye.com (Thomas S. Dye) wrote: [...] I tried to follow Bastien's suggestion about adding a change log to the commit message, but ended up with something that looks different than his example. I'm not sure why--perhaps Bastien is not working in magit, so his instructions apply to some other context? [...] Bastien was referring to `add-change-log-entry{,-other-window}', which is part of Emacs [1], and is mainly intended to add entries to a dedicated ChangeLog file (when this file isn't present, it'll open a new buffer for the entry). While it *does* most definitely produce properly formatted entries when called with point on a diff hunk, it always requires the extra step of yanking the entry into your commit message buffer. When using Magit (which I highly recommend) however, you can add properly formatted entries *much* faster by positioning point on a (staged) diff hunk in the status buffer, and calling `magit-add-log' (bound to 'C') [2]. If you don't already have a commit buffer ('*magit-edit-log*'), it will create one for you, so you don't even need to call `magit-log-edit' (bound to 'c') in advance anymore. :) Peace -- Pieter [1] [[info:emacs#Change Log]] [2] [[info:magit#Staging and Committing]]
Re: [O] [PATCH] Library of Babel source block
Pieter Praet pie...@praet.org writes: On Sun, 28 Aug 2011 07:11:36 -1000, t...@tsdye.com (Thomas S. Dye) wrote: [...] I tried to follow Bastien's suggestion about adding a change log to the commit message, but ended up with something that looks different than his example. I'm not sure why--perhaps Bastien is not working in magit, so his instructions apply to some other context? [...] Bastien was referring to `add-change-log-entry{,-other-window}', which is part of Emacs [1], and is mainly intended to add entries to a dedicated ChangeLog file (when this file isn't present, it'll open a new buffer for the entry). While it *does* most definitely produce properly formatted entries when called with point on a diff hunk, it always requires the extra step of yanking the entry into your commit message buffer. When using Magit (which I highly recommend) however, you can add properly formatted entries *much* faster by positioning point on a (staged) diff hunk in the status buffer, and calling `magit-add-log' (bound to 'C') [2]. If you don't already have a commit buffer ('*magit-edit-log*'), it will create one for you, so you don't even need to call `magit-log-edit' (bound to 'c') in advance anymore. :) Peace Thanks Pieter. Your instructions cut through a lot of the complexity. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] PATCH Make org-open-at-point only ask once
Hi! If an org buffer is narrowed, and one tries to do org-open-at-point on a link that points to outside of the restriction it asks: No match - create this as a new heading?. When answering no the buffer is widened and the reseach is done, and if the link still can't be resolved the question is asked again. For nonexistant links this happens even if the buffer isn't narrowed - one needs to answer n twice. I also attached an alternate patch which (IMHO) simplifies the implementation by hiding the hard work in a macro, and as a bonus it only calls org-link-search once. But it is much more intrusive. anders ;; simple testcase to show the bug (progn (insert * A\n\n* B\n\n[[A]]) (org-narrow-to-subtree) (org-open-at-point)) commit 54702f063ae2df48dec7f9feb80859a6b64002a4 Author: Anders Waldenborg and...@0x63.nu Date: Sat Aug 27 21:18:46 2011 +0200 Make org-open-at-point only ask once whether new header should be created. When following thisfile links org-open-at-point is kind enough to retry org-link-search again after widening the buffer it can't be found. However org-link-search also asks the question No match - create this as a new heading? (y or n) when target can't be found. This means that the question is asked twice when following a nonexistent link and answering no. This is fixed by setting org-link-search-inhibit-query in first try, so only second invocation asks the question. diff --git a/lisp/org.el b/lisp/org.el index d63b854..781de88 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9537,7 +9537,8 @@ application the system uses for this file type. ((equal arg '(16)) ''org-occur) (t nil)) ,pos))) - (condition-case nil (eval cmd) + (condition-case nil (let ((org-link-search-inhibit-query t)) + (eval cmd)) (error (progn (widen) (eval cmd)) (t diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 13aff02..153a041 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -414,6 +414,24 @@ the value in cdr. (cons (list (car flat) (cadr flat)) (org-make-parameter-alist (cddr flat) +(defmacro org-widen-and-maybe-renarrow (rest BODY) + Widen buffer and evaluate body, and if point is outside +the previously narrowed-to region after evaluation permanetly +lift the restriction. + (declare (indent defun)) + (org-with-gensyms (res pnt) +`(let ((,res) + (,pnt)) + (save-restriction + (widen) + (setq ,res ,@BODY) + (setq ,pnt (point))) + (when (or ( ,pnt (point-min)) + ( ,pnt (point-max))) + (widen) + (goto-char ,pnt)) + ,res))) + (provide 'org-macs) ;;; org-macs.el ends here diff --git a/lisp/org.el b/lisp/org.el index d63b854..efe936e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9531,15 +9531,12 @@ application the system uses for this file type. (switch-to-buffer-other-window (org-get-buffer-for-internal-link (current-buffer))) (org-mark-ring-push)) - (let ((cmd `(org-link-search - ,path - ,(cond ((equal arg '(4)) ''occur) - ((equal arg '(16)) ''org-occur) - (t nil)) - ,pos))) - (condition-case nil (eval cmd) - (error (progn (widen) (eval cmd)) - + (org-widen-and-maybe-renarrow + (org-link-search path + (cond ((equal arg '(4)) 'occur) + ((equal arg '(16)) 'org-occur) + (t nil)) + pos))) (t (browse-url-at-point))) (move-marker org-open-link-marker nil)
Re: [O] org-odt/html table export: adjusting default behaviour?
Matt It would be nice if I could code the table formatting into the org file so that I don't have to hand-fix the formatting on each iteration. Thanks for your feedback. I have worked up a patch which intends to give users more control over how tables are formatted. The patch modifies files that I don't own so the changes will take sometime to hit the repo. With this patch applied one can 1. Choose the style of the table (Is the table wide or narrow?) 2. Control relative size of the individual columns The new feature is best illustrated by an example. If you look at the attached file you will see that: 1. The first table which has only 2 columns and less text has the following attribute. , |#+ATTR_ODT: OrgTableSmall ` The intention is to format the table so that it occupies lesser width. The table styles are stored in contrib/odt/styles/OrgOdtAutomaticStyles.xml. Visit this file and look for OrgTable property and you will that it occupies 90% of page width. , OrgTable | style:style style:name=OrgTable style:family=table |style:table-properties style:rel-width=90% table:align=center/ | /style:style ` Now I add another entry OrgTableSmall which occupies 30% of page width as below , OrgTableSmall | style:style style:name=OrgTableSmall style:family=table |style:table-properties style:rel-width=30% table:align=center/ | /style:style ` 2. Modify the bigger table as below - specify no #+ATTR_ODT This will ensure that the default 90% style is used for the table - indicate colgroups (Note the new row full of as field entries) This will ensure that exported table will have vertical grid lines - horizontal separators This will ensure that exported table has horizontal grid lines - The width specifier has been adjusted so that exported table is well-balanced. Note that the Readings columns which has no entries is given very negligible weightage and other columns has fairly good weightage. 3. Export the file to Odt. 4. Now you will have a resonably good looking Table. To make it more pleasing you need to reduce the font size of the table entries. This you can do by F11-Paragraph Styles-OrgTableContents-set font size to 10 pt Or If you are imaptient you can grok the contrib/odt/styles/OrgOdtStyles.xml file for OrgTableContents and fix the font-size there. I am attaching the resulting file at the end of step 4. Hope these adjustments make the export of table more flexible. Let me know what you know think. Rant: The only way to customize Tables in LibreOffice is through the Autoformat utility. The OASIS specification clearly outlines ways to create custom table-related styles. Unfortunately, the state of affairs with LibreOffice is such that such styles are ignored when used. So one has to really rely on automatic styles for formatting of tables going forward. This makes styling of tables a bit more involved for me - the developer and you - the user. Thanks, Jambunathan K. -- #+TITLE: test.org #+AUTHOR:Matt Price #+EMAIL: matt.pr...@utoronto.ca #+DATE: 2011-08-23 Tue #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t :t #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+XSLT: * heading1 ** heading2 #+ATTR_ODT: OrgTableSmall | table | 1 | 2 | | | | | ** heading2 -2 some text. * Outline | Week | Date | Topic | Description | Tech Topics | Assignments | Readings | Notes| |+--++-+--+--+---+--| | / || | ||| || | 10 | 20 | 30 | 35| 20 | 20 | 5 | 20 | | 1 | 9/12/2011| Intro:What is History For? | The uses of history; engagement and objectivity; etc | Intro to Website | -- | | | |+--++-+--+--+---+--| | 2 | 9/19/2011| History and the Public Sphere | What is the Public Sphere, what role does history play in it? | HTML Workshop| | |
[O] [PATCH 1/2] Parse and store both col align and col width spec for later use
I have worked up a patch which intends to give users more control over how tables are formatted. The patch modifies files that I don't own so the changes will take sometime to hit the repo. From 8bae4b059a3063a866260ed2958e6c1e05365901 Mon Sep 17 00:00:00 2001 From: Jambunathan K kjambunat...@gmail.com Date: Mon, 29 Aug 2011 02:00:24 +0530 Subject: [PATCH 1/2] Parse and store both col align and col width spec for later use * lisp/org-exp.el (org-store-forced-table-alignment): Parse the column cookie for both alignment and width specification. Store the resulting value in `org-col-cookies' property. Retire the previously used `org-forced-aligns' property for consistency. Renamed local variable `aligns' to `cookies'. * lisp/org-html.el (org-format-org-table-html): Use `org-col-cookies'. Renamed local variable forced-aligns to col-cookies. This is a preparatory patch. A backend can look at the colwidth specification and (at it's discretion) use it to control relative sizes of individual columns in a table. At this moment, it is unclear whether the widths used to control the display of table in Org buffer can be overloaded to also control the formatting of table in a backend. Refer following discussion with Matt Price: http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html --- lisp/org-exp.el | 17 +++-- lisp/org-html.el | 14 +++--- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index f795fbd..7d6bd38 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1995,23 +1995,28 @@ When it is nil, all comments will be removed. (defun org-store-forced-table-alignment () Find table lines which force alignment, store the results in properties. - (let (line cnt aligns) + (let (line cnt cookies) (goto-char (point-min)) -(while (re-search-forward |[ \t]*[lrc][0-9]*[ \t]*| nil t) +(while (re-search-forward |[ \t]*\\([lrc]?[0-9]+\\|[lrc]\\)[ \t]*| + nil t) ;; OK, this looks like a table line with an alignment cookie (org-if-unprotected (setq line (buffer-substring (point-at-bol) (point-at-eol))) (when (and (org-at-table-p) (org-table-cookie-line-p line)) - (setq cnt 0 aligns nil) + (setq cnt 0 cookies nil) (mapc (lambda (x) (setq cnt (1+ cnt)) - (if (string-match \\`\\([lrc]\\) x) - (push (cons cnt (downcase (match-string 1 x))) aligns))) + (when (string-match \\`\\([lrc]\\)?\\([0-9]+\\)?\\' x) + (let ((align (and (match-end 1) +(downcase (match-string 1 x + (width (and (match-end 2) +(string-to-number (match-string 2 x) + (push (cons cnt (list align width)) cookies (org-split-string line [ \t]*|[ \t]*)) (add-text-properties (org-table-begin) (org-table-end) - (list 'org-forced-aligns aligns + (list 'org-col-cookies cookies (goto-char (point-at-eol) (defun org-export-remove-special-table-lines () diff --git a/lisp/org-html.el b/lisp/org-html.el index 28a0e8f..a6e748a 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1979,8 +1979,8 @@ for formatting. This is required for the DocBook exporter. (let* ((caption (org-find-text-property-in-string 'org-caption (car lines))) (label (org-find-text-property-in-string 'org-label (car lines))) - (forced-aligns (org-find-text-property-in-string 'org-forced-aligns - (car lines))) + (col-cookies (org-find-text-property-in-string 'org-col-cookies + (car lines))) (attributes (org-find-text-property-in-string 'org-attributes (car lines))) (html-table-tag (org-export-splice-attributes @@ -1993,9 +1993,9 @@ for formatting. This is required for the DocBook exporter. tbopen line fields html gr colgropen rowstart rowend ali align aligns n) (setq caption (and caption (org-html-do-expand caption))) -(when (and forced-aligns org-table-clean-did-remove-column) -(setq forced-aligns - (mapcar (lambda (x) (cons (1- (car x)) (cdr x))) forced-aligns))) +(when (and col-cookies org-table-clean-did-remove-column) + (setq col-cookies + (mapcar (lambda (x) (cons (1- (car x)) (cdr x))) col-cookies))) (if splice (setq head nil)) (unless splice (push (if head thead tbody) html)) (setq tbopen t) @@ -2056,8 +2056,8 @@ for formatting. This is required for the DocBook exporter. (lambda (x) (setq gr (pop org-table-colgroup-info) i (1+ i) - align (if (assoc i forced-aligns) - (cdr (assoc (cdr (assoc i forced-aligns)) + align (if (nth 1 (assoc i col-cookies)) + (cdr (assoc (nth 1 (assoc i col-cookies)) '((l . left) (r . right) (c . center (if ( (/ (float x) nline) -- 1.7.2.3
[O] [PATCH 2/2] org-odt.el: Put table style and col sizes under direct user control
I have worked up a patch which intends to give users more control over how tables are formatted. The patch modifies files that I don't own so the changes will take sometime to hit the repo. From 046a2d1793c50c99b5b58b3874540632513e4562 Mon Sep 17 00:00:00 2001 From: Jambunathan K kjambunat...@gmail.com Date: Mon, 29 Aug 2011 02:33:17 +0530 Subject: [PATCH 2/2] org-odt.el: Put table style and col sizes under direct user control * contrib/lisp/org-lparse.el (org-lparse-table-get-colalign-info): Renamed `org-forced-aligns' to `org-col-cookies'. Renamed local variable `forced-aligns' to `col-cookies'. (org-lparse-format-table-row): With the introduction of `org-col-cookies' property the internal structure of `org-lparse-table-colalign-info' has changed. Do the right thing while setting up col alignment. Pass on the colwidth property as horiz-span arg of `TABLE-CELL' callback. * contrib/lisp/org-odt.el (org-odt-begin-table): Let the table style be settable throught #+ATTR_ODT line. By default tables are configured to occupy 90% of paper width. This is too big for smaller tables. For aesthetic reasons, a user might prefer that such tables of shorter width and thus specify a different style. (org-odt-end-table, org-odt-format-table-cell): Honor colwidth specification. * contrib/lisp/org-xhtml.el (org-xhtml-format-table-cell): Fix signature as mandated by changes in TABLE-CELL callback. See comments in the earlier patch. See also http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html --- contrib/lisp/org-lparse.el | 36 - contrib/lisp/org-odt.el| 75 ++- contrib/lisp/org-xhtml.el |2 +- 3 files changed, 66 insertions(+), 47 deletions(-) diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index fd0488b..b176378 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -1301,13 +1301,12 @@ version. (org-lparse-format-table-table lines (defun org-lparse-table-get-colalign-info (lines) - (let ((forced-aligns (org-find-text-property-in-string - 'org-forced-aligns (car lines -(when (and forced-aligns org-table-clean-did-remove-column) - (setq forced-aligns - (mapcar (lambda (x) (cons (1- (car x)) (cdr x))) forced-aligns))) - -forced-aligns)) + (let ((col-cookies (org-find-text-property-in-string + 'org-col-cookies (car lines +(when (and col-cookies org-table-clean-did-remove-column) + (setq col-cookies + (mapcar (lambda (x) (cons (1- (car x)) (cdr x))) col-cookies))) +col-cookies)) (defvar org-lparse-table-style) (defvar org-lparse-table-ncols) @@ -1945,12 +1944,13 @@ See `org-xhtml-entity-format-callbacks-alist' for more information. (make-vector org-lparse-table-ncols nil)) (let ((c -1)) (while ( (incf c) org-lparse-table-ncols) - (let ((cookie (cdr (assoc (1+ c) org-lparse-table-colalign-info + (let* ((col-cookie (cdr (assoc (1+ c) org-lparse-table-colalign-info))) + (align (nth 0 col-cookie))) (setf (aref org-lparse-table-colalign-vector c) (cond - ((string= cookie l) left) - ((string= cookie r) right) - ((string= cookie c) center) + ((string= align l) left) + ((string= align r) right) + ((string= align c) center) (t nil (incf org-lparse-table-rownum) (let ((i -1)) @@ -1961,11 +1961,15 @@ See `org-xhtml-entity-format-callbacks-alist' for more information. (when (and (string= x ) text-for-empty-fields) (setq x text-for-empty-fields)) (incf i) - (and org-lparse-table-is-styled - ( i org-lparse-table-ncols) - (string-match org-table-number-regexp x) - (incf (aref org-lparse-table-num-numeric-items-per-column i))) - (org-lparse-format 'TABLE-CELL x org-lparse-table-rownum i)) + (let (col-cookie horiz-span) + (when org-lparse-table-is-styled + (when (and ( i org-lparse-table-ncols) + (string-match org-table-number-regexp x)) + (incf (aref org-lparse-table-num-numeric-items-per-column i))) + (setq col-cookie (cdr (assoc (1+ i) org-lparse-table-colalign-info)) + horiz-span (nth 1 col-cookie))) + (org-lparse-format + 'TABLE-CELL x org-lparse-table-rownum i (or horiz-span 0 fields \n (defun org-lparse-get (what optional opt-plist) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index a5b2d96..491ed44 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -644,15 +644,22 @@ PUB-DIR is set, use this as the publishing directory. (org-lparse-insert-tag table:table table:name=\%s\ table:style-name=\%s\ - (or label ) OrgTable) + (or label ) (or attributes OrgTable)) (setq org-lparse-table-begin-marker (point))) (defun org-odt-end-table () (goto-char org-lparse-table-begin-marker) (loop for level from 0 below org-lparse-table-ncols - do (insert - (org-odt-format-tags - table:table-column table:style-name=\OrgTableColumn\/
[O] time-up/down in org-agenda-sorting-strategy seems to have no effect?
Hi everyone, I've just started using custom agenda views in earnest, and I would like to be able to control how several custom views are sorted. I have tried to set org-agenda-sorting-strategy to reflect what I want, but it seems to have no effect on how items are sorted. I'm wondering if I'm missing something. Specifically, I see no difference in how the items in todo, tags, and tags-todo agenda views are sorted when I set time-down or time-up as the first (or only) sorting criterion. (tag-up/down and category-up/down seem to work alright; I haven't tested the other sorting criteria.) Here's how I'm expressing the setup I want: #+BEGIN_SRC emacs-lisp (setq org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep) (todo time-down priority-down category-keep) (tags time-down priority-down category-keep) (search time-up priority-down todo-state-up))) (setq org-agenda-custom-commands '((r Reading list tags-todo +reading) (S . STUDY context searches) (Sf todo FIND) (Sp todo PRINT) (Sr todo READ) (Sn todo NOTES) (St tags-todo +STUDY) (D tags-todo +COMPUTER) (H tags-todo +HOME) (E tags-todo +ERRAND) (F tags +FREETIME))) #+END_SRC Any insight you can provide will be very much appreciated. Thanks! Best, Richard Lawrence
Re: [O] org-agenda-custom-commands clarification on filters needed
On Sun, Aug 28 2011, Thomas Wallrafen wrote: Hi org'ers, I am currently trying to figure out a way to build a composite view for an agenda containing agenda and todos, which works well but when it comes to setting filters... In the first example (agenda and todo list below) the filter +home for the agenda does not take effect. When reordering that the todo list is on top and the agenda below, it works as expected. That is, both items of the composite view are correctly filtered with tag +home. #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ( (agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) (tags-todo +home) I've been fooling with this recently, as well. The docstring for `org-agenda-filter-preset' says that it will not work reliably to filter just a single block of a multi-block custom agenda. You need to put the filter in the tail end of the whole definition, and that way it will apply to all the blocks (apparently there's no reliable way to apply different filters to different blocks, but that's probably a rare use-case). So I think you want: (setq org-agenda-custom-commands '((h Agenda and home related todos ((agenda) (tags-todo)) ((org-agenda-filter-preset '(+home)) (org-agenda-span 4) This or something very close to it should work. It only works with tags though, not more complex matches. HTH, Eric (setq org-agenda-custom-commands '((h Agenda and home related todos ( (tags-todo +home) (agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) #+end_src Having a discussion with Thumper_ on the irc channel he found out some more oddities (copied and slightly modified by courtesy of Thumper_): #+STARTUP: * This one works [2011-08-28 Sun 07:07] #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ((agenda ((org-agenda-filter-preset '(+home)) (org-agenda-span 4))) (tags-todo +home ((org-agenda-filter-preset '(+home) nil))) #+end_src * This also incorrectly filters the first agenda [2011-08-28 Sun 07:07] #+begin_src elisp (setq org-agenda-custom-commands '((h Agenda and home related todos ((agenda ((org-agenda-span 4))) (tags-todo +home ((org-agenda-filter-preset '(+home) nil))) #+end_src So, how would I set the filters properly given that I want the agenda tob be first and a list of todo items below? Any pointers to documentation or hints greatly appreciated :) bye, thomas
Re: [O] The Orgfather
Loved it. Make them *all* sign the FSF papers. On Sat, Aug 27, 2011 at 10:05 AM, Bastien b...@altern.org wrote: Hi folks, http://lumiere.ens.fr/~guerry/theorgfather.html Enjoy! -- Bastien
Re: [O] Underline ONLY the first character of a word?
I don't think the following trick has come up yet. If you are only exporting to HTML, you can do: @ue@/uvent Thanks, Carsten. That works nicely. -- Mike
Re: [O] Using Code Blocks in Org Tables
Hi Eric! 2011/8/28 Eric Schulte schulte.e...@gmail.com: #+source: last-of-stuff #+begin_src sh :var input=stuff echo $input |tail -1 #+end_src | one | | two | | 3 | #+TBLFM: @3$1='(sbe last-of-stuff) Your solution works very well. Thanks! Henri-Paul -- Henri-Paul Indiogine Curriculum Instruction Texas AM University TutorFind Learning Centre Email: hindiog...@gmail.com Skype: hindiogine Website: http://people.cehd.tamu.edu/~sindiogine