[O] [PATCH] ox-html.el: Add exporting of priority
* list/ox-html.el (org-html--priority): New function. (org-html-format-headline-default-function): Call `org-html--priority'. (org-html-style-default): Add `.priority'. HTML export previously did not support exporting of priority simply by setting `org-export-with-priority' to `t'. TINYCHANGE --- lisp/ox-html.el | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 3c3b444..a1c33ac 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -278,6 +278,7 @@ defconst org-html-style-default .done { color: green; } .tag{ background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal; } + .priority { font-family: monospace; color: orange; } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .right { margin-left: auto; margin-right: 0px; text-align: right; } @@ -1885,6 +1886,14 @@ defun org-html--todo (todo info) (org-html-fix-class-name todo) todo))) + Priority + +(defun org-html--priority (priority info) + Format a priority into HTML. +PRIORITY is the character code of the priority or nil. +INFO is a plist containing export options. + (and priority (format span class=\priority\[%c]/span priority))) + Tags (defun org-html--tags (tags info) @@ -2396,8 +2405,9 @@ defun org-html-format-headline-default-function Default format function for a headline. See `org-html-format-headline-function' for details. (let ((todo (org-html--todo todo info)) +(priority (org-html--priority priority info)) (tags (org-html--tags tags info))) -(concat todo (and todo ) text (and tags #xa0;#xa0;#xa0;) tags))) +(concat todo (and todo ) priority (and priority ) text (and tags #xa0;#xa0;#xa0;) tags))) (defun org-html--container (headline info) (or (org-element-property :HTML_CONTAINER headline) -- 1.9.2.msysgit.0
Re: [O] Fwd: demoting a heading inserts spaces in column-0 text
Two proposed solutions: 1. Another option would be to have another option to indent only planning info, properties drawer, and every drawer located right after it, à la `org-log-state-notes-insert-after-drawers'. At least, it couldn't break structure. Is this possible? This indents drawers located at the top, which I think is good enough because it's where org puts the common ones by default. Your examples are more complex, with drawers in the middle of the text or in the middle of lists. In those cases you might need full indentation, but people who only use :CLOCK: and SCHEDULED at the top (and that's the default) could use this option. This is not about „indenting by type“, but about „indenting until point X“, and the trick is to find the right X. 2. I'd rather have org-adapt-indentation = 'initial-only which works like like org-adapt-indentation = nil with the extra that „Property drawers and planning information is inserted indented“. That is, new things appear with the same indentation as the element above. And demoting doesn't indent anything. Example: ** something You press C-c C-s and you get: ** something SCHEDULED: 2051-01-09 Mon You press S-M-right and you get: *** something SCHEDULED: 2051-01-09 Mon The user can then manually decide whether he wants to correct indentations for each line. Or maybe both options are interesting? -- Daniel El Mon, 22 Dec 2014 12:34:28 +0100 Nicolas Goaziou va escriure: Daniel Clemente n142...@gmail.com writes: El Sat, 13 Dec 2014 15:10:32 +0100 Nicolas Goaziou va escriure: You are free to make any distinction you want. Unfortunately, Org does a different one. In particular, as you noticed, there are some areas where things are not as clear. For example, Org cannot be sure that a given drawer wasn't inserted manually, so altering its indentation may or may not be a good choice. Does it matter in practice? If the user manually inserts things that are normally handled by org, they can be also handled by org. Lckily you don't need to remember whether it was manually inputted or not. It matters here. You want to control indentation of what is handled by Org. So, what's wrong with `org-adapt-indentation' set to nil? This. By default (tested on emacs -Q), when you have this tree: Some text Hi ...and you clock in, you get: Some text CLOCK: [2014-12-14 Sun 18:55]--[2014-12-14 Sun 18:57] = 0:02 Hi Same with properties: e :PROPERTIES: :ou: 22 :END: Text That is 1) uglier than the default. This is subjective. 2) violating the rule you said: new lines should be indented at the same level as the element above. It doesn't. Headline has level 0 indentation (per `org-adapt-indentation'), so are properties drawer and paragraph. I want no change at all? No, my proposal is to move planning info in the top and not move the things below it. As explained already in this thread, the problem is not about planning info, but about regular drawers. I'll try again. An underscore means a space: Before demoting: ** some ___:CLOCK: ___CLOCK: [2013-11-12 Sel 10:45]--[2013-11-12 Sel 11:40] = 0:55 ___:END: Text What I expect after demoting: *** some :CLOCK: CLOCK: [2013-11-12 Sel 10:45]--[2013-11-12 Sel 11:40] = 0:55 :END: Text See: this is not about planning info. Again, it is not desirable to decide to move an element by its type because it could alter structure of the document. In the following example, demoting headline would move the clock drawer within the list, which was not intended initially. * Headline - something :CLOCK: ... :END: Elements can only be moved by their location. Hence, planning info and properties drawer can be freely indented, not because of their type, but because their location prevent them from altering the structure of the section. Some lines moved and others not makes sense for a partial indentation. You can call it 'only-top so that it's clear which lines are updated. I don't mind the name, but I need to find a proper definition for it. I think the default behaviour should be not to change indentation, because org-mode can be used in combination with other modes. E.g. I'm using org-mode in beancount files (a ledger program), and lines need to start in column 0. I think the default is fine. Your use-case doesn't look like a default one. Another option would be to have another option to indent only planning info, properties drawer, and every drawer located right after it, à la `org-log-state-notes-insert-after-drawers'. At least, it couldn't break structure. Interesting. Yes, you could indent until (org-log-beginning). That would exclude notes, which are more akin to text than to drawers. Users who want to force indent
Re: [O] [PATCH] ox-html.el: add exporting of priority
Hello, Zane D. Purvis zane.pur...@gmail.com writes: Thanks for the patch. The summary line should be capitalized, i.e., ox-html: Add exporting of priority * list/ox-html.el (org-html--priority): new function Capitalize, too. (org-html-format-headline-default-function): call `org-html--priority' Ditto. (org-html-style-default): add `.priority' Ditto. +(defun org-html--priority (priority info) + Format a priority into HTML. +PRIORITY is the character code of the priority or nil. +INFO is a plist containing export options. + (when priority +(format span class=\priority\[%s]/span +(byte-to-string priority Shorter: (and priority (format span class=\priority\[%c]/span priority)) Could you fix these issues before I apply your patch? Regards, -- Nicolas Goaziou
Re: [O] Lentic.0.6 and org mode
On 2015-01-09 17:12, phillip.l...@newcastle.ac.uk (Phillip Lord) writes: It's configurable, though. By default, the two windows share the same text (which is nearly the same behaviour as indirect buffers). But they can also be different (but related). I use a file or dir-local variable for this. So, the lentic source code uses: ((emacs-lisp-mode . ((lentic-init . lentic-orgel-org-init) (eval . (require 'm-buffer-macro) I've used a similar configuration #+begin_src emacs-lisp (add-hook 'emacs-lisp-mode-hook (lambda () (setq lentic-init 'lentic-orgel-org-init))) #+end_src but it's not as nice as in the demo. For instance, the following: #+begin_src emacs-lisp ;;; Code: ;; ** Startup ;; #+begin_src emacs-lisp ;; Turn off mouse interface early in startup to avoid momentary display (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) #+end_src becomes #+begin_src org * Code ;; ** Startup ;; #+begin_src emacs-lisp ;; Turn off mouse interface early in startup to avoid momentary display (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) #+end_src Why the Startup is not promoted at the org level? Thanks, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 signature.asc Description: PGP signature
Re: [O] Lentic.0.6 and org mode
I normally do (global-lentic-start-mode) which just adds some keybindings for you. Then, do one of lentic-mode-create-in-selected-window, (C-c,h) lentic-mode-split-window-below, (C-c,b) lentic-mode-split-window-right (C-c,r) Or there are menu items which does the same. All of these create the lentic view, and put in a window as you might guess. By default, it does indeed come up in fundamental mode (probably that's not sensible, and I should set it to the same mode as the starting buffer. It's configurable, though. By default, the two windows share the same text (which is nearly the same behaviour as indirect buffers). But they can also be different (but related). I use a file or dir-local variable for this. So, the lentic source code uses: ((emacs-lisp-mode . ((lentic-init . lentic-orgel-org-init) (eval . (require 'm-buffer-macro) This gives the behaviour shown in this screen cast. https://vimeo.com/116078853 The eval thing is just to make sure some macros are loaded, so that that they indent properly, which is an orthogonal issue. None of this is org or Emacs-lisp specific. I just added that because I could, and it wasn't that much effort (okay, so it was more effort than I expected, but there you go). I wrote it in the first place for Clojure and asciidoc, but am actually using it with clojure and latex. Phil Nice! I spent some time figuring out how to use it. This is what I did eventually: M-xlentic-mode M-xlentic-mode ;; twice M-x lentic-mode-split-window-below Then change the new buffer to the desired mode (Java mode, C++ mode, whatever). (I was created in fundamental mode). Is this the standard way to use it? Thierry Le 08/01/2015 14:55, Phillip Lord a écrit : I thought some of you might be interested in the new release of my package, lentic. One of the things that it now does is allow multi-modal of editing of Emacs source, using org mode for the documentation. I realise that it's already possible to use ELPA org-babel to write literate el files, or to use outorg.el, but lentic provides a different form of interaction. You can edit the org form or the emacs-lisp form as you choose. The source code of lentic is, itself, written in this way. There is a screen cast linked below which shows what the interaction looks like. Available on MELPA-stable, MELPA and Marmalade https://github.com/phillord/lentic http://www.russet.org.uk/blog/3035 https://vimeo.com/116078853
Re: [O] Lentic.0.6 and org mode
On 2015-01-09 17:12, address@hidden (Phillip Lord) writes: It's configurable, though. By default, the two windows share the same text (which is nearly the same behaviour as indirect buffers). But they can also be different (but related). I use a file or dir-local variable for this. So, the lentic source code uses: ((emacs-lisp-mode . ((lentic-init . lentic-orgel-org-init) (eval . (require 'm-buffer-macro) I've used a similar configuration #+begin_src emacs-lisp (add-hook 'emacs-lisp-mode-hook (lambda () (setq lentic-init 'lentic-orgel-org-init))) #+end_src Personally, I wouldn't do that! At the moment, my transformation doesn't work nicely for all el files. At a minimum, you need code markers at the before the first line of lisp and the after the last. Otherwise, all the code gets treated by org as text; if you run, say, fill-paragraph in the org-mode lentic view then it will do bad things when all the code gets refilled. but it's not as nice as in the demo. For instance, the following: #+begin_src emacs-lisp ;;; Code: ;; ** Startup ;; #+begin_src emacs-lisp ;; Turn off mouse interface early in startup to avoid momentary display (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) #+end_src becomes #+begin_src org * Code ;; ** Startup ;; #+begin_src emacs-lisp ;; Turn off mouse interface early in startup to avoid momentary display (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) #+end_src Why the Startup is not promoted at the org level? If your example is complete, I think it's because your code markers are unbalanced. Look in the *lentic-log* buffer and you should see lots of delimiters do not match. Put a ;; #+end_src in place and it should fix itself. This should probably be smoothed over in the user interface. I could tell the user when the lentic buffer is created. You've also uncovered a bug -- when the delimiters do not match, it's should be doing the safest transformation of all which is a direct copy; so the * Code line should have been left alone also. Phil
[O] [ANN] orgtbl-aggregate version 2
Hi The List I am glad to announce the second version of the Org Aggregate package. It comes with more flexibility and performance, while being simpler. This new version is based on a clever idea of Michael Brand. Thanks Michael for your reviews and suggestions. * What is it? An aggregated Org table is derived from a source table by grouping rows and computing aggregations like sums and averages. Example: #+NAME: sourcetbl | Day | Color | Level | Quantity | |-+---+---+--| | Mon | Red |30 | 11 | | Mon | Blue |25 |3 | | Thu | Red |51 | 12 | | Thu | Red |45 | 15 | | Thu | Blue |33 | 18 | | Wed | Red |27 | 23 | | Wed | Blue |12 | 16 | | Wed | Blue |15 | 15 | | Tur | Red |39 | 24 | | Tur | Red |41 | 29 | | Tur | Red |49 | 30 | | Fri | Blue | 7 |5 | | Fri | Blue | 6 |8 | | Fri | Blue |11 |9 | #+BEGIN: aggregate :table sourcetbl :cols Day vmean(Level);%.1f vsum(Quantity) | Day | vmean(Level);%.1f | vsum(Quantity) | |-+---+| | Mon | 27.5 | 14 | | Thu | 43.0 | 45 | | Wed | 18.0 | 54 | | Tur | 43.0 | 83 | | Fri | 8.0 | 22 | #+END * What is new? The new version of Aggregate is designed to be seamless with the Org spreadsheet. - Aggregations formulas are now general Calc expressions, they can be as complex as: sqrt(vsum((X-vmean(X))^2)) - The modifiers are those of the spreadsheet, with exactly the same meaning (f3, NE, p24, %.6f and so on). - Spreadsheet formulas can further enrich an aggregation table, with the #+TBLFM line surviving refreshes. - Performance on large data sets has dramatically improved. Documentation here: https://github.com/tbanel/orgaggregate/blob/master/README.org * Install it! -- The easiest way to install it is through Melpa. Add those lines to your .emacs: (require 'package) (add-to-list 'package-archives '(melpa . http://melpa.milkbox.net/packages/;) t) (package-initialize) Type M-x package-list-packages Install orgtbl-aggregate * Happy new year! -- Comments etc. welcome Happy new year, have fun, and stay tunned for more to come Thierry Banel
Re: [O] 63 failures for org-test-run-all-tests in an Emacs GUI
Nicolas Goaziou wrote: Sebastien Vauban writes: Did I misunderstand the change of last year (Dec '13) or should `sh' language be abandoned in favor of `shell'? I think you're right. IIUC, then, those blocks should be updated: ... And those inline calls as well: ... I am willing to make the patch. Great. Please do. Here it is. Best regards, Seb -- Sebastien Vauban From: Sebastien Vauban sva-n...@mygooglest.com Date: Fri, 9 Jan 2015 11:10:25 +0100 Subject: [PATCH] Replace `sh' language by `shell' * README, babel.org, ob-shell-test.org, test-ob-exp.el, test-ob.el: Replace `sh' language by `shell'. --- testing/README | 2 +- testing/examples/babel.org | 54 +++--- testing/examples/ob-shell-test.org | 11 testing/lisp/test-ob-exp.el| 12 - testing/lisp/test-ob.el| 28 ++-- 5 files changed, 53 insertions(+), 54 deletions(-) diff --git a/testing/README b/testing/README index 34f6fcd..d8a31ac 100644 --- a/testing/README +++ b/testing/README @@ -17,7 +17,7 @@ relative to the base of the Org-mode directory. Also note that many of the current tests uses babel evaluation... -#+BEGIN_SRC sh :dir (expand-file-name ..) +#+BEGIN_SRC shell :dir (expand-file-name ..) # For Emacs earlier than 24, add -L /path/to/ert emacs -Q --batch \ -L lisp/ -L testing/ -L testing/lisp -l lisp/org.el \ diff --git a/testing/examples/babel.org b/testing/examples/babel.org index 8bae65b..978df7a 100644 --- a/testing/examples/babel.org +++ b/testing/examples/babel.org @@ -125,7 +125,7 @@ (list (my-map 'list #'+ (append prev-row '(0)) (append '(0) prev-row))) - + (pascals-triangle n) #+end_src @@ -196,9 +196,9 @@ an = sign. :results: silent :ID: 54cb8dc3-298c-4883-a933-029b3c9d4b18 :END: -Here is one in the middle src_sh{echo 1} of a line. -Here is one at the end of a line. src_sh{echo 2} -src_sh{echo 3} Here is one at the beginning of a line. +Here is one in the middle src_shell{echo 1} of a line. +Here is one at the end of a line. src_shell{echo 2} +src_shell{echo 3} Here is one at the beginning of a line. * exported inline source block :PROPERTIES: @@ -206,10 +206,10 @@ src_sh{echo 3} Here is one at the beginning of a line. :results: silent :exports: code :END: -Here is one in the middle src_sh{echo 1} of a line. -Here is one at the end of a line. src_sh{echo 2} -src_sh{echo 3} Here is one at the beginning of a line. -Here is one that is also evaluated: src_sh[:exports both]{echo 4} +Here is one in the middle src_shell{echo 1} of a line. +Here is one at the end of a line. src_shell{echo 2} +src_shell{echo 3} Here is one at the beginning of a line. +Here is one that is also evaluated: src_shell[:exports both]{echo 4} * mixed blocks with exports both :PROPERTIES: @@ -235,27 +235,27 @@ Here is one that is also evaluated: src_sh[:exports both]{echo 4} :noweb-sep: :END: -#+begin_src sh :tangle yes :noweb yes :shebang #!/bin/sh +#+begin_src shell :tangle yes :noweb yes :shebang #!/bin/sh fullest-disk #+end_src ** query all mounted disks -#+begin_src sh :noweb-ref fullest-disk +#+begin_src shell :noweb-ref fullest-disk df #+end_src ** strip the header row -#+begin_src sh :noweb-ref fullest-disk +#+begin_src shell :noweb-ref fullest-disk |sed '1d' #+end_src ** sort by the percent full -#+begin_src sh :noweb-ref fullest-disk +#+begin_src shell :noweb-ref fullest-disk |awk '{print $5 $6}'|sort -n |tail -1 #+end_src ** extract the mount point -#+begin_src sh :noweb-ref fullest-disk +#+begin_src shell :noweb-ref fullest-disk |awk '{print $2}' #+end_src * resolving sub-trees as references @@ -290,20 +290,20 @@ has length 14 :results: silent :ID: 0D0983D4-DE33-400A-8A05-A225A567BC74 :END: -src_sh{echo One} block at start of line - One spaced block in src_sh{ echo middle } of line -src_sh{echo 2} blocks on the src_emacs-lisp{same} line - Inline block with src_sh[:results silent]{ echo parameters }. +src_shell{echo One} block at start of line + One spaced block in src_shell{ echo middle } of line +src_shell{echo 2} blocks on the src_emacs-lisp{same} line + Inline block with src_shell[:results silent]{ echo parameters }. * org-babel-get-inline-src-block-matches (with empty args) :PROPERTIES: :results: silent :ID: d55dada7-de0e-4340-8061-787cccbedee5 :END: -src_sh[]{echo One} block at start of line - One spaced block in src_sh[]{ echo middle } of line -src_sh[]{echo 2} blocks on the src_emacs-lisp[]{same} line - Inline block with src_sh[:results silent]{ echo parameters }. +src_shell[]{echo One} block at start of line + One spaced block in src_shell[]{ echo middle } of line +src_shell[]{echo 2} blocks on the src_emacs-lisp[]{same} line + Inline block with src_shell[:results silent]{ echo parameters }.
Re: [O] [PATCH] ox-html.el: DONE is monospace for consistency
Hello, Zane D. Purvis zane.pur...@gmail.com writes: * lisp/ox-html.el (org-html-style-default): `.done' gets `font-family: monospace;' Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] ox-html.el: add exporting of priority
Sure thing. Expect a new patch momentarily. Thanks. On Fri, Jan 9, 2015 at 3:20 AM, Nicolas Goaziou m...@nicolasgoaziou.fr wrote: Hello, Zane D. Purvis zane.pur...@gmail.com writes: Thanks for the patch. The summary line should be capitalized, i.e., ox-html: Add exporting of priority * list/ox-html.el (org-html--priority): new function Capitalize, too. (org-html-format-headline-default-function): call `org-html--priority' Ditto. (org-html-style-default): add `.priority' Ditto. +(defun org-html--priority (priority info) + Format a priority into HTML. +PRIORITY is the character code of the priority or nil. +INFO is a plist containing export options. + (when priority +(format span class=\priority\[%s]/span +(byte-to-string priority Shorter: (and priority (format span class=\priority\[%c]/span priority)) Could you fix these issues before I apply your patch? Regards, -- Nicolas Goaziou