Leu Zhe | 24 Apr 08:23 2014
Picon

Using font-lock-add-keywords to display caption than various table and images headers

According to the http://stackoverflow.com/questions/22937393/emacs-lisp-prettify-symbols-mode-for-latex by using font-lock-add-keywords, I can display the latin symbols instead of the English word like \alpha without changing the real contents. It is pretty great. 

Then a good idea came to my brain, which is: Can i use this feature to display the caption and label of the table and image rather than headers which holds at least three lines? If it can be accomplished, which will make the article very compact and easier to read:

Before re-display : 

#+CAPTION: caption
#+ATTR_LaTeX: :align |c|c|
#+LABEL: table:label
| name | value |
|------+-------|
| tony |    30 |

After re-display:

table:label caption
| name | value |
|------+-------|
| tony |    30 |

I tried to alter some part of the code using regexp search to find the headers and capture the caption and label contents, and test to re-display the matched contents to test:

(defvar pretty-alist
  (cl-pairlis '("#\\+CAPTION: \\(.+$\\)\n#\\+ATTR_LaTeX.+\n#\\+LABEL: \\(.+$\\)")
              ("test")))
(defun pretty-things()
  (mapc
   (lambda (x)
     (let ((word (car x))
           (char (cdr x)))
       (font-lock-add-keywords
        nil
        `((,(concat "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[a-zA-Z]")
            (0 (progn
                 (decompose-region (match-beginning 2) (match-end 2))
                 nil)))))
       (font-lock-add-keywords
        nil
        `((,(concat "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[^a-zA-Z]")
            (0 (progn
                 (compose-region (1- (match-beginning 2)) (match-end 2)
                  ,char)
                 nil)))))))
   pretty-alist))


the results are below:

test
| name | value |
|------+-------|
| tony |    30 |

Then i tried to change the "test" to "\\2 \\1", error of 'no function \\2 \\1' appeared. It seems like that the the second parameter of cl-pairlis must be a function. 

I am a pretty beginner to elisp, so it is very hard for me to solve this problem, then i decide to ask for help here.
If it can be accomplished, it will be really a progress to read and write articles.

Thanks very much. Any help will be very appreciated. 

Best regard!
Sharon Kimble | 24 Apr 05:47 2014
Picon

auto-roll-over of org-todo's?

In my agenda I have several items I call my "weeklies" because they repeat
weekly, this is one of them -
--8<---------------cut here---------------start------------->8---
Desert island discs - radio 2  <at>  1100
SCHEDULED: <2014-04-27 Sun +7d>
--8<---------------cut here---------------end--------------->8---

Is there any way in which it can be auto-rolled-over every Sunday without
intervention from myself please?

Thanks
Sharon.
--

-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, Fluxbox 1.3.5, emacs 24.4.50.10
Brady Trainor | 24 Apr 02:47 2014

Trying to separate clocked time /ranges/ from scheduled times in a clean-ish view.


I can't see how to get a clean view of clocked time ranges. Not just the 
length of time, but the actual start and end times. I would like to 
share my attempts to give you an idea.

If I include

     (org-agenda-start-with-log-mode '(closed clock state))

in my agenda block, then I can see them, but unfortunately I am clocking 
on items I've scheduled for myself, so they mix in and it is hard to 
read quickly. That is, I have

#+BEGIN_SRC
** example
*** circus act                                                    :routine:
**** backflips
CLOCK: [2014-04-23 Wed 07:45]--[2014-04-23 Wed 07:48] =>  0:03
SCHEDULED: <2014-04-23 Wed 07:45-07:50>
:PROPERTIES:
:Effort:   0:05
:END:
**** somersaults
SCHEDULED: <2014-04-23 Wed 07:50-08:00>
CLOCK: [2014-04-23 Wed 07:48]--[2014-04-23 Wed 07:52] =>  0:04
:PROPERTIES:
:Effort:   0:10
:END:
**** front flips
:PROPERTIES:
:Effort:   0:10
:END:
*** feed elephant                                                 :routine:
SCHEDULED: <2014-04-23 Wed 21:10-21:30>
:PROPERTIES:
:Effort:   0:20
:END:
*** tell fortune                                                  :routine:
SCHEDULED: <2014-04-23 Wed 08:00-08:20>
CLOCK: [2014-04-23 Wed 07:52]--[2014-04-23 Wed 08:10] =>  0:18
:PROPERTIES:
:Effort:   0:20
:END:
#+END_SRC

In an `agenda' block, I have tried to filter the scheduled lines out, 
and keep the clock lines, but filters seem to work before deciding to 
include the clocking, so the pair, scheduled and clocked will vanish 
together. (If I could get a view of just clock time ranges, I might use 
a sticky buffer to see one agenda block with scheduled time ranges, and 
another agenda block with clocked time ranges.)

I tried using a clock report table, but I can't see how to get the 
actual clocked time, instead of the timestamp range. Via

     (org-agenda-start-with-clockreport-mode t)

I've looked at column view as a possibility, but again, the clock time 
does not seem to be available.

I tried to use the `search' block, but did not think of a way to display 
only clock times there.

Here are the results of my best tries at an agenda view. (I found it a 
little awkward to compare clocked times to scheduled times as they are 
mixed in here.)

  _________________
/ ________________
/

Day-agenda (W17):
Wednesday  23 April 2014
   agendatest:  7:45- 7:48 Clocked:   (0:03) backflips    :routine::
   agendatest:  7:45- 7:50 Scheduled:  backflips          :routine::
   agendatest:  7:48- 7:52 Clocked:   (0:04) somersaults  :routine::
   agendatest:  7:50- 8:00 Scheduled:  somersaults        :routine::
   agendatest:  7:52- 8:10 Clocked:   (0:18) tell fortune  :routine:
   agendatest:  8:00- 8:20 Scheduled:  tell fortune        :routine:
                8:00...... ----------------
               10:00...... ----------------
               12:00...... ----------------
               14:00...... ----------------
               16:00...... ----------------
               17:15...... now - - - - - - - - - - - - - - - - - - - - -
               18:00...... ----------------
               20:00...... ----------------
   agendatest: 21:10-21:30 Scheduled:  feed elephant       :routine:
| Timestamp                  | Effort | Headline        | Time   |
|----------------------------+--------+-----------------+--------+------
| ALL                        |        | *Total time*    | *0:25* |
|----------------------------+--------+-----------------+--------+------
|                            |        | *File time*     | *0:25* |
|                            |        | circus act      | 0:07   |
| 2014-04-23 Wed 07:45-07:50 |   0:05 | \__ backflips   |        | 0:03
| 2014-04-23 Wed 07:50-08:00 |   0:10 | \__ somersaults |        | 0:04
| 2014-04-23 Wed 08:00-08:20 |   0:20 | tell fortune    | 0:18   |

=====================================================================================================================================================
Search words: CLOCK
   agendatest: backflips                                  :routine::
   agendatest: somersaults                                :routine::
   agendatest: tell fortune                                :routine:

\________________
\________________

Finally, here is my custom-command that I have been working on:

#+BEGIN_SRC emacs-lisp

(org-add-agenda-custom-command
  '("r" "routine"
    ((agenda ""
             (
              (org-clocktable-defaults
               '(
                 :timestamp t
                 :properties ("Effort")
                 :indent t
                 ))
              )
             )
     (search "CLOCK")
     )
    (
     (org-agenda-files '("/e/org/agendatest.org"))
     (org-agenda-span 'day)
     (org-agenda-start-with-clockreport-mode t)
     (org-agenda-start-with-log-mode '(closed clock state))
     (org-agenda-tag-filter-preset '("+routine"))
     )
    ))

#+END_SRC

To give a visual of what I am trying to do,

Day-agenda (W17):
Wednesday  23 April 2014
   agendatest:  7:45- 7:48 Clocked:   (0:03) backflips    :routine::
   agendatest:  7:48- 7:52 Clocked:   (0:04) somersaults  :routine::
   agendatest:  7:52- 8:10 Clocked:   (0:18) tell fortune  :routine:
                8:00...... ----------------
               10:00...... ----------------
               12:00...... ----------------
               14:00...... ----------------
               16:00...... ----------------
               17:15...... now - - - - - - - - - - - - - - - - - - - - -
               18:00...... ----------------
               20:00...... ----------------

which would be nice to compare against:

Day-agenda (W17):
Wednesday  23 April 2014
   agendatest:  7:45- 7:50 Scheduled:  backflips          :routine::
   agendatest:  7:50- 8:00 Scheduled:  somersaults        :routine::
   agendatest:  8:00- 8:20 Scheduled:  tell fortune        :routine:
                8:00...... ----------------
               10:00...... ----------------
               12:00...... ----------------
               14:00...... ----------------
               16:00...... ----------------
               17:15...... now - - - - - - - - - - - - - - - - - - - - -
               18:00...... ----------------
               20:00...... ----------------
   agendatest: 21:10-21:30 Scheduled:  feed elephant       :routine:

Maybe if I just added a face to the clocked items?

Any ideas and alternative strategies are appreciated. My system is not 
at all fixed in place.

Thank you,

Brady

J. David Boyd | 23 Apr 16:48 2014

setting left margin in PDF output of ORG file


I can export an org file to a PDF no problem, looks great.

However, how do I get rid of the huge left and right and top and bottom
margins?  I like my PDFs to have no more than .75" top, bottom, left and
right.

I've looked through all the latex, org-latex, org-beamer variables I can find
with customize-apropos, but not having any luck.

Thanks,

Dave

Supriya Sawant | 23 Apr 08:08 2014
Picon

how to get "org-version" using emacs batch mode.

How can I get the org-version on my command line?

I think using batch mode it is possible.

I tried :

emacs --batch --eval '(org-version)'


but it doesn't work. It gives me blank result.


--

Thanks & Regards,
Supriya Pravin Sawant
Elasady, Summer | 23 Apr 01:28 2014

Exporting Code Blocks to PDF

Hello Emacs World-

I’m using LaTex to export documents to PDF, but the code blocks are not fitting to the page properly and the code is being cutoff. Is there a way to turn on word-wrapping for export to PDF, or to resize code blocks? 

Also, does anyone have a good system for dealing with exporting large tables? Right now I’m just linking to a file, but I’m curious if anyone else is doing anything clever. 

Thanks in advance! 

Summer 

Brady Trainor | 23 Apr 00:39 2014

My first union in an agenda block


I struggled to get union of cases in an agenda block. I was able to work 
from examples by Bernt Hansen at

     http://doc.norang.ca/org-mode.html#CustomAgendaViewSetup

and

     http://doc.norang.ca/org-mode.html#Projects,

and make the following small example, which may be useful to folks just 
getting into Org-mode and Emacs, and want to be aware of how you can 
combine cases into your agenda block. (Union as opposed to intersection, 
OR vs AND.)

It should be straightforward to make various cases, or even finally get 
familiar with the agenda filtering commands at

     http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html.

#+BEGIN_SRC emacs-lisp
(defun appts-nil-not-appt-next-headline ()
   (let ((next-headline (save-excursion (outline-next-heading))))
     (if (or ;; (string= "circus-act" (org-get-org-file))
             (string= "circus-act" (org-get-category))
             (member "appt" (org-get-tags-at))
             (member "plans" (org-get-tags-at))
             (member "social" (org-get-tags-at)))
         nil
       next-headline)))
#+END_SRC

(You may need this so that function org-add-agenda-custom-commands does 
not create error.)
#+BEGIN_SRC emacs-lisp
(require 'org-agenda)
#+END_SRC

#+BEGIN_SRC emacs-lisp
(org-add-agenda-custom-command
  '("c" "calendar"
    agenda ""
    ((org-agenda-skip-function 'appts-nil-not-appt-next-headline)
     )))
#+END_SRC

Please let me know if you see any changes I should make in my strategy 
or code. (I've not made it a priority, but I think I shouldn't have the 
three occurrences of `(member "<a tag>" (org-get-tags-at))'.)

Also, no telling when I'll get the chance to understand the examples at

 
http://stackoverflow.com/questions/20715106/org-agenda-regexp-search-categories

Brady

Brady Trainor | 22 Apr 23:46 2014

Tried to use `org-agenda-top-headline-filter' in agenda block


Org-mode version 8.2.5h (8.2.5h-137-gc7812f-elpa  <at>  
/home/iam/.emacs.d/elpa/org-20140421/)

I tried to use `org-agenda-top-headline-filter'.

I have a tree as follows:
   ____
  /
|   * diary-sunrise, diary-sunset
|   %%(diary-sunrise)
|   %%(diary-sunset)
  \____

The syntax I tried was:

     (org-agenda-top-headline-filter "diary-sunrise, diary-sunset")

That is, in the following: (might need `(require 'org-agenda)'.)

#+BEGIN_SRC emacs-lisp
(org-add-agenda-custom-command
  '("zs" "sunrise, sunset"
    agenda ""
    ((org-agenda-files '("/e/org/zeus.org"))
     (org-agenda-prefix-format "%t %s")
     (org-agenda-span 'week)
     (org-agenda-start-on-weekday nil)
     (org-agenda-use-time-grid 'nil)
     (org-agenda-top-headline-filter '("diary-sunrise, diary-sunset"))
     )
    ))
#+END_SRC

I'm sure I could easily use a tag, category etc, but I like being able 
to consider all the possibilities as I develop my agenda-views.

%%(Thank you always),

Brady

Aaron Ecay | 22 Apr 21:54 2014
Picon

[RFC] [PATCH] ob-core.el: allow the auto-generation of output file names for src blocks.

* lisp/ob-core.el (org-babel-generate-file-param): New function.
(org-babel-get-src-block-info): Use it.
---
 lisp/ob-core.el | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

This patch allows the autogeneration of result file names from source
block names.  Thus, instead of:

#+name: one
#+begin_src R :results file graphics :file one.png
  ...
#+end_src

One can write (with the same result, that one.png is generated):

#+name: one
#+begin_src R :results file graphics :file png
  ...
#+end_src

The benefit comes from the reduced duplication of information in the
file.  It also becomes possible to use the usual property inheritance
mechanisms (via #+PROPERTY lines or :PROPERTY: drawers) to specify
result file types for multiple source blocks at once.

This patch also introduces the :output-dir property, which can be used
to redirect all the output from blocks in a (file/subtree) to a subdirectory.

The patch treats any :file args containing a period as before, so
backwards compatibility with old files should in most cases be maintained.

If this patch looks good, I can provide tests and documentation.

Aaron

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 1348f04..2defabf 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
 <at>  <at>  -282,7 +282,9  <at>  <at>  Returns a list
 	(setq info (org-babel-parse-inline-src-block-match))))
     ;; resolve variable references and add summary parameters
     (when (and info (not light))
-      (setf (nth 2 info) (org-babel-process-params (nth 2 info))))
+      (setf (nth 2 info) (org-babel-generate-file-param
+			  name
+			  (org-babel-process-params (nth 2 info)))))
     (when info (append info (list name indent head)))))

 (defvar org-babel-exp-reference-buffer nil
 <at>  <at>  -2890,6 +2892,35  <at>  <at>  For the format of SAFE-LIST, see `org-babel-safe-header-args'."
 		      (member (cdr pair) (cdr entry)))
 		     (t nil)))))))

+(defun org-babel-generate-file-param (src-name params)
+  "Calculate the filename for source block results.
+
+The directory is calculated from the :output-dir property of the
+source block; if not specified, use the current directory.
+
+If the source block has a #+NAME and the :file parameter does not
+contain any period characters, then the :file parameter is
+treated as an extension, and the output file name is the
+concatenation of the directory (as calculated above), the block
+name, a period, and the parameter value as a file extension.
+Otherwise, the :file parameter is treated as a full file name,
+and the output file name is the directory (as calculated above)
+plus the parameter value."
+  (let* ((file-cons (assq :file params))
+	 (file (cdr-safe file-cons))
+	 (dir (or (cdr-safe (assq :output-dir params)) "")))
+    (when (and file (not (string= dir "")))
+      (make-directory dir t)
+      (unless (string-match "/\\'" dir)
+	(setq dir (concat dir "/"))))
+    (cond
+     ((not file) nil)
+     ((or (string-match "\\." file) (not src-name))
+      ;; Either the file name already has an extension, or there is no
+      ;; name for this source block -> we cannot do anything
+      (setcdr file-cons (concat dir file)))
+     (t (setcdr file-cons (concat dir src-name "." file))))
+    params))

 ;;; Used by backends: R, Maxima, Octave.
 (defun org-babel-graphical-output-file (params)
--
1.9.2

Greg Troxel | 22 Apr 19:43 2014
Picon

observations on updating to recent org


I use org for the usual notes-to-self and TODO - nothing super fancy.  I
had been running from master of the git repo, but in 2013-01 stopped
updating, probably because I had some issue.  The recent release
provoked me to try again, and this note reports some issues.

I had been running (for no really good reason)
  commit 3a1c27060792fc095435efcaf270a6207d5d8d27
  Author: Bastien Guerry <bzg <at> altern.org>
  Date:   Mon Jan 7 00:25:58 2013 +0100
and just updated to the head of maint:
  commit 1fa6ccab10c9f97dc9317f9c3eedea82c4cdc357
  Author: Bastien Guerry <bzg <at> altern.org>
  Date:   Tue Apr 22 15:24:14 2014 +0200
which is just a docstring fix past release_8.2.6.

I then did an org-mobile-push, and that was as fast as I remembered.

I noticed two things:

  Exporting to ical as a single file took a really long time, perhaps a
  whole minute, whereas it used to take a second to a few seconds.  The
  resulting export did seem ok.

  I used to get an ID PROPERTIES entries for nodes that were exported to the
  calendar, which was basically nodes that had an active timestamp.
  But now I had a huge number of changes, adding ID to every node, even
  those with no real content and just children.  Is this a feature?

Neal Becker | 22 Apr 18:55 2014
Picon

export latex align to html?

I have an align environment:

#+begin_latex
\begin{align*}
\Lambda= & \max_{k,l}\left|
\sum_{i=0}^{M-1}r_{i+l}x_{i}^{*}e^{j2\pi\Delta_{f}ki}+\sum_{i=M}^{2M-1}r_{i+l}x_{i}^{*}e^{j2\pi\Delta_{f}ki}+\cdots\right|
\\
\approx & \max_{k,l}\left|
\sum_{m}e^{j2\pi\Delta_{f}kmM}\sum_{i=mM}^{(m+1)M-1}r_{i+l}x_{i}^{*}\right|
\end{align*}
#+end_latex

That exports fine to latex, but not html.  Is there a way to do this?


Gmane