[O] [bug] in org-table.el: setq: Symbol's value as variable is void: repl

2014-07-29 Thread Thomas Holst
Hi list,

after a recent update I get the following error when I try to
recalculate formulas in a table:

  setq: Symbol's value as variable is void: repl

Searching for 'repl' in the lisp directory reveales only one hit in
org-table.el. repl was intoduced in commit:

  d4799eb * | org-table.el (org-table-eval-formula): Better error
  throwing

Reverting this commit fixed the problem for me. My lisp is not prfound
enough to provide a patch.

GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN
Org-mode version 8.3beta (release_8.3beta-134-gcb51b4 @
   c:/daten/users/DE_hts2fe/git-emacs/org-mode/lisp/)
on Win7

Thanks for looking into this.
-- 
Bis neulich ...
  Thomas



[O] broken links in org-html publishing

2014-07-29 Thread Matt Lundin
Commit c9ca0b6df86de13a5302b5a3c955fb2fb1023d36 broke html links in my
publishing setup. 

The links on my website point to file.org rather than file.html. The
problem is a mismatch between line 145 and 2695.

The attached patch fixes the issue.

>From c23658146426d4780d7aa842f0bbd61e1356baf9 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 23:31:50 -0500
Subject: [PATCH] Fix broken links in html publishing

* lisp/ox-html.el: Fix incorrect property name in :options-alist of
  html backend definition.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 1b00c38..af4232c 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -142,7 +142,7 @@
 (:html-infojs-options nil nil org-html-infojs-options)
 (:html-infojs-template nil nil org-html-infojs-template)
 (:html-inline-image-rules nil nil org-html-inline-image-rules)
-(:html-link-org-as-html nil nil org-html-link-org-files-as-html)
+(:html-link-org-files-as-html nil nil org-html-link-org-files-as-html)
 (:html-mathjax-options nil nil org-html-mathjax-options)
 (:html-mathjax-template nil nil org-html-mathjax-template)
 (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format)
-- 
2.0.3



Re: [O] make slim auto-complete work in Org-mode (delete some ac-source in Org-mode).

2014-07-29 Thread Drew Adams
> But this code will use =delq= to delete *global default* =ac-sources= too.
> But I only want to delete in Org-mode.
> So is there some other ways to do it?

`remq' is like `delq' but non-destructive - it modifies a copy.

(And `remove' is like `delete' but non-destructive.)



[O] make slim auto-complete work in Org-mode (delete some ac-source in Org-mode).

2014-07-29 Thread stardiviner
I setup default =ac-sources= for auto-complete like this:

#+BEGIN_SRC emacs-lisp
(setq-default ac-sources
  '(ac-source-yasnippet
ac-source-abbrev
ac-source-filename
ac-source-files-in-current-dir
ac-source-dictionary
ac-source-words-in-same-mode-buffers
))
#+END_SRC

And I found =ac-source-dictionary= and =ac-source-words-in-same-mode-buffers= is
heavy for Org-mode, So I try to remove them only in Org-mode.

This is my try:

#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook
  (lambda ()
;; use `delq' in a loop.
(mapc (lambda (x) (setq-local ac-sources (delq x ac-sources)))
  '(ac-source-dictionary 
ac-source-words-in-same-mode-buffers
#+END_SRC

But this code will use =delq= to delete *global default* =ac-sources= too. But 
I only
want to delete in Org-mode.
So is there some other ways to do it?



[O] How to make Org-mode support file completion for file+sys: prefix?

2014-07-29 Thread stardiviner

I found Org-mode support file completion in `file:` prefix. But not `file+sys:`,
Why?

- [ ] If it is not enabled by default. Then how to enable it?
- [ ] If Org-mode does not support it, then how can I enable it?

Why do I need it?
When I add a link to a PDF file, I need to use filename completion, so I have to
use `file:` completion, then use =[C-c C-l]= to edit the link again to add 
`+sys`
for `file:`, this is painful.



Re: [O] Writing .el files for org in org?

2014-07-29 Thread John Kitchin
Ok, I am giving it a shot. Here is my setup:

;;; org path
(defvar org-load-path
  (list (file-name-as-directory
 (expand-file-name "org" starter-kit-dir)))
  "List of directories to find org-files that
  `org-babel-load-file' can load code from")

(defun org-require (feature)
  "Load a FEATURE from an org-file.
FEATURE is a symbol, and it is loaded from an org-file by the name of
FEATURE.org, that is in the `org-load-path'. The FEATURE is loaded from
`org-babel-load-file'."
  (let ((org-file (concat (symbol-name feature) ".org"))
(path))

;; find the org-file
(catch 'result
  (loop for dir in org-load-path do
(when (file-exists-p
   (setq path
 (expand-file-name
  org-file
  dir)))
  (throw 'result path
(let ((default-directory (file-name-directory path)))
  (org-babel-load-file path

(org-require 'org-ref)
(org-require 'doi-utils)
(org-require 'org-show)


In the only directory I define in org-load-path, I put org-show.org,
org-ref.org, and doi-utils.org, and the code above is in an init file. When
I load emacs, for these files, so far, it works great. They are simple
files that only tangle to one .el file so far.



John

---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Sun, Jul 27, 2014 at 5:50 PM, Bastien  wrote:

> Hi John and Rainer,
>
> Rainer M Krug  writes:
>
> >> What if we created a new directory in the repository called "org" which
> >> contains these kinds of files?  It would be analogous to the "lisp"
> >> directory. I don't think we need to have both ob-R.org and ob-R.el in
> the
> >> repository.
> >
> > I think that would be a very good idea for certain modules like your
> > org-ref and ob-R I am working on.
>
> Maybe you could use such a "load-flow" for a while, see if it is
> robust enough, and if so, we could move on and have it in the repo?
>
> My gut feeling is that it will bring some issues, so experimenting
> before would be nice.
>
> --
>  Bastien
>


Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Malcolm Purvis
> "Achim" == Achim Gratz  writes:

Achim> I think that "^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\)"
Achim> would be a better regex, assuming that the original regex was
Achim> doing the right thing.

Thanks.  Things are just as fast with this regexp.

Malcolm

-- 
   Malcolm Purvis 



Re: [O] What is the best in-Emacs presentation mode for org-files today?

2014-07-29 Thread Jorge A. Alfaro-Murillo

Grant Rettke  writes:

el-get might be a nice option for you. 


There is also doc-present, but you would need to export to beamer 
first: https://github.com/dengste/doc-present/


Some people create there own, for example watch the first 3min of:
http://www.youtube.com/watch?v=p3Te_a-AGqM

Best,

Jorge.





Re: [O] [PATH] Speedups to org-table-recalculate

2014-07-29 Thread Bastien
Hi Nathaniel,

Nathaniel Flath  writes:

> I believe I did that a long time ago, juste been inactive.   I've
> definitely contributed to org before, although searching through my
> email I can only find a copyright assignment for Emacs itself (dated
> 8/23/09), do I have to re-do this?

Of course you don't have to redo this -- sorry I forgot.

I'll have a look at the patch when I'm back from holidays in three
weeks.

Thanks,

-- 
 Bastien



Re: [O] [PATH] Speedups to org-table-recalculate

2014-07-29 Thread Nathaniel Flath
Hi Bastien,

I believe I did that a long time ago, juste been inactive.   I've
definitely contributed to org before, although searching through my email I
can only find a copyright assignment for Emacs itself (dated 8/23/09), do I
have to re-do this?

Thanks,
Nathaniel Flath


On Tue, Jul 29, 2014 at 2:30 PM, Bastien  wrote:

> Hi Nathaniel,
>
> Nathaniel Flath  writes:
>
> > This patch speeds up org-table-recalculate by removing all 'message'
> > function calls.  Additionally adds an early check for whether there
> > are any formulas and only executes the rest of the function if so.
>
> The patch is bigger than what can be accepted without requiring a
> copyright assignment.  Here is the form you would need to send if
> you agree:
>
> http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt
>
> It can take a month, especially since this is summer time.
>
> Thanks in advance!
>
> --
>  Bastien
>


Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Bastien
Matt Lundin  writes:

>> Please go ahead for this too.
>
> Gladly!

Applied, thanks!

-- 
 Bastien



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Bastien
Hi Matt,

Matt Lundin  writes:

> Please *do not apply* the previous patch. Instead, I've attached an
> optimized version.

Applied, thanks.

> All in all this patch + commit 507244d56b055e7595ba94fe89d45c7ddb2559df
> modestly improves the performance of org-publish-org-sitemap. On a
> directory of 104 files, it used to take this long...
>
>  org-publish-org-sitemap  1   10.508871433  10.508871433
>
> ...to generate a sitemap. With this patch and commit 507244d, it takes
> this long...
>
>  org-publish-org-sitemap  1   7.700290794   7.700290794
>
> Clearly, this is still very inadequate, but it is an improvement. I
> would love to use the built in site-map functions, but they are simply
> to slow for any larger projects.
>
> Could we do something like this to speed it up?
>
> (with-temp-buffer 
>   (insert-file-contents file)
>   (goto-char (point-min))
>   (when (re-search-forward "^#\\+TITLE:" nil t)
> (org-element-at-point)))

I guess so.  But I'm in a rush and can't really check carefully.

In the meantime, thanks for the recent patches!

-- 
 Bastien



Re: [O] if we operate on a subtree, perhaps we could adjust levels

2014-07-29 Thread Bastien
Hi Achim,

Achim Gratz  writes:

> FWIW, I prefer the other solution since it is more general.  Again, the
> content from the decryption process can be treated like an include
> (except for display rather than during export) or rather an "inline
> file", which might be worth having independently of encrypted subtree as
> well.

If you think you can have a look in the next weeks, that'd be great.
I'll try following your directions when I'm back.

Thanks,

-- 
 Bastien



Re: [O] [PATH] Speedups to org-table-recalculate

2014-07-29 Thread Bastien
Hi Nathaniel,

Nathaniel Flath  writes:

> This patch speeds up org-table-recalculate by removing all 'message'
> function calls.  Additionally adds an early check for whether there
> are any formulas and only executes the rest of the function if so.

The patch is bigger than what can be accepted without requiring a
copyright assignment.  Here is the form you would need to send if
you agree:

http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

It can take a month, especially since this is summer time.

Thanks in advance!

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Achim Gratz  writes:

> I think that "^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\)" would be a
> better regex, assuming that the original regex was doing the right thing.

Applied, thanks,

-- 
 Bastien



Re: [O] Agenda/report of all headlines with clocked time

2014-07-29 Thread Bastien
Hi Subhan,

Subhan Michael Tindall  writes:

> I'm not entirely sure what you mean by 'the time of the master
> branch', but I can't get any prompt for a time range with this command
> anywhere in the file.

"from the tip of the master branch" -- I meant: If you clone org-mode
and get the most recent version, the command I mentioned with prompt
for a time range.

See http://orgmode.org/org.html#Installation on how to install Org
from Git.

Best,

-- 
 Bastien



[O] Bug: pdf page numbers in links are ignored when exporting to latex [8.2.7b (8.2.7b-13-gd8a0ee-elpa @ /home/moritz/.emacs.d/elpa/org-20140728/)]

2014-07-29 Thread Moritz Kiefer

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 have lots of links to specific pages in a pdf like
[[filename.pdf::24]] which works fine (with a correctly configured
org-file-apps) but when I export to latex the page number is ignored and
the includegraphics directive includes the first page. This can
obviously manually be changed using #+ATTR_LATEX: :options page=42 but
as the page number is already there it would be nice if orgmode would
automatically use that when exporting.

Emacs  : GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
 of 2014-06-27 on tuxedo-arch
Package: Org-mode version 8.2.7b (8.2.7b-13-gd8a0ee-elpa @ 
/home/moritz/.emacs.d/elpa/org-20140728/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-log-done 'time
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-clock-idle-time 5
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . system) ("\\.x?html?\\'" . 
"firefox-nightly %s")
 ("\\.pdf::\\([0-9]+\\)\\'" . "zathura \"%s\" -P %1") 
("\\.pdf\\'" . "zathura \"%s\""))
 org-agenda-custom-commands '(("h" agenda "120 days"
   ((org-agenda-show-all-dates nil) 
(org-agenda-span 120)))
  )
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "~/org/notes.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-from-is-user-regexp nil
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(org-clock-load
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
turn-on-org-cdlatex)
 org-refile-targets '((org-agenda-files :maxlevel . 2))
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-clock-persist 'history
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-hide-inline-tasks
  org-cycle-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-agenda-span 'month
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function 'ignore
 org-mobile-directory "~/org/mobile"
 org-babel-load-languages '((R . t))
 org-html-format-inlinetask-function 'ignore
 org-agenda-files '("~/org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] A gentle introduction to Emacs & Org-mode?

2014-07-29 Thread John Kitchin
jorge.a.alf...@gmail.com (Jorge A. Alfaro-Murillo) writes:

thanks for point that out, I have fixed them now I think. That must be
from some link escaping in the translation of org to html I guess. 


> Thanks John,
>
> The links to the other videos are broken. I think that the addresses
> have %3D instead of an equal sign (=).
>
> Best,
>
> Jorge.
>
>
>
>

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] Preset filter sometimes persistent

2014-07-29 Thread Thomas Morgan
Hi, Bastien,

Bastien  writes:

> Thomas Morgan  writes:
>
>> Here is a recipe for a bug on the maint branch that causes a preset tag
>> filter to be carried over to another agenda view in some cases.
>
> This should now be fixed in maint.

It's fixed; thanks!

Best regards,
Thomas



Re: [O] How to analyze clocking reports (e. g. with spreadsheet application)?

2014-07-29 Thread Monroe, Will

Christoph,

Thanks for sharing this.  I'm just now beginning to explore the ability 
of org to provide weekly and monthly reports.  I've gotten as far as 
implementing the elisp that Sacha Chua shared here: 
http://pages.sachachua.com/.emacs.d/Sacha.html#monthly-reviews  It works 
great but at this early stage, I'd like to explore the features of org 
further to develop an approach that works for me.


So I'd love to see a mini-tutorial on worg about what you've developed.

All the best,

Will

On 7/29/14, 10:19 AM, Christoph LANGE-BEVER wrote:

Hi all,

I thought I'd share with you one nice thing I figured out recently.

It seemed appropriate to post it as a belated answer to this thread:

On 2013-04-27 23:50, Martin wrote:
> I'm using the org-mode clocking features (in org-mode 7.9.4) 
extensively

> to document how much time I spent with which task and when.
>
> I wonder how I can export the data (e. g. to MS Excel) for further 
analysis;

> * time consumed by different projects
> * interruptions and "jumping" from task to task
> * time consumed by tasks with a special tag
> etc.

So I was interested in doing some of this analytics right inside Org 
spreadsheets.  At 
https://github.com/clange/org-mode/tree/master/clocktable-spreadsheet 
please find a self-documenting solution for computing my weekly 
overtime balance from working hours logged using the clocking 
features.  The key to this solution is accessing entries of a clock 
table from a spreadsheet table.


I would be happy to contribute this mini-tutorial to Worg.  It is 
already available under GPL, and I'll be happy to make it available 
under any other license you may need.  However I have little time and 
would prefer not having to learn any complex procedures before being 
able to contribute.


Cheers,

Christoph






Re: [O] org-envolve?

2014-07-29 Thread David Arroyo Menendez
Nick Dokos  writes:

>>> Then I mark the region of this ítems, apply the function and obtain:
>>>
>>> + [ ] mapcar
>>> + [ ] defun
>>> + [ ] apply
>>> + [ ] cons
>>
>> FWIW, I use rectangular insertion for this :
>> 1. select region (mark on the first 'm', point on the last 'c', or 
>> conversely)
>> 2. add string "- [ ] " using C-x r t (string-rectangle).
>
> Another way is to
>
>  - mark the region, C-x C-x if necessary to put point on the first item.
>  - C-c - repeatedly until you get the bullets you want.
>  - C-u C-c C-c to add the boxes.
>
> Nick

What will we do with davidam-org-envolve-src and davidam-org-src? Must
we use another way or make sense store it in a function?

Thanks.



[O] [PATH] Speedups to org-table-recalculate

2014-07-29 Thread Nathaniel Flath
This patch speeds up org-table-recalculate by removing all 'message'
function calls.  Additionally adds an early check for whether there are any
formulas and only executes the rest of the function if so.


org-table-speedup.patch
Description: Binary data


Re: [O] org-envolve?

2014-07-29 Thread David Arroyo Menendez
Nicolas Richard  writes:

> David Arroyo Menendez  writes:
>> Yes, I have some ítems
>>
>> mapcar
>> defun
>> apply
>> cons
>>
>> Then I mark the region of this ítems, apply the function and obtain:
>>
>> + [ ] mapcar
>> + [ ] defun
>> + [ ] apply
>> + [ ] cons
>
> FWIW, I use rectangular insertion for this :
> 1. select region (mark on the first 'm', point on the last 'c', or conversely)
> 2. add string "- [ ] " using C-x r t (string-rectangle).

Thanks for the tip.



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Matt Lundin  writes:
>>
>>> So to be safe, we could do the following in org-publish-find-date and
>>> org-publish-find-title... 
>>>
>>> (org-export-with-buffer-copy (org-export-get-environment))
>>>
>>> What do you think?
>>
>> Yes, this sounds right, please go ahead.
>>
>> I applied your fix in the maint branch, so if you need to revert it
>> please do the revert from there first.
>
> Here's the patch. There's no need to revert anything, as this builds
> upon my previous commit.
>
> From 72217e53103a82e0397d1435331e3eed10f0fbd5 Mon Sep 17 00:00:00 2001
> From: Matt Lundin 
> Date: Tue, 29 Jul 2014 10:39:57 -0500
> Subject: [PATCH 1/2] Call org-export-get-environment in buffer copy
>
> * lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
>   Make sure to call org-export-get-environment in copy of
>   buffer. Otherwise, #+bind variables meant for export can be set in
>   live buffers.

Please *do not apply* the previous patch. Instead, I've attached an
optimized version.

All in all this patch + commit 507244d56b055e7595ba94fe89d45c7ddb2559df
modestly improves the performance of org-publish-org-sitemap. On a
directory of 104 files, it used to take this long...

 org-publish-org-sitemap  1   10.508871433  10.508871433

...to generate a sitemap. With this patch and commit 507244d, it takes
this long...

 org-publish-org-sitemap  1   7.700290794   7.700290794

Clearly, this is still very inadequate, but it is an improvement. I
would love to use the built in site-map functions, but they are simply
to slow for any larger projects.

Could we do something like this to speed it up?

--8<---cut here---start->8---
(with-temp-buffer 
  (insert-file-contents file)
  (goto-char (point-min))
  (when (re-search-forward "^#\\+TITLE:" nil t)
(org-element-at-point)))
--8<---cut here---end--->8---

Until then, here's the patch.

>From 9260e6d4c5537994ffb6df2f2cc48c62ad4ffb63 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 13:35:41 -0500
Subject: [PATCH] Protect open buffers when publishing sitemap

* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
  Make sure to call org-export-get-environment in copy of buffer if
  emacs is already visiting. Otherwise, #+bind variables meant for
  export can be set in live buffers.

This patch also optimizes the above functions by inhibiting
org-startup on buffers emacs visits temporarily.
---
 lisp/ox-publish.el | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 94f12e9..df40572 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -806,11 +806,18 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
   "Find the title of FILE in project."
   (or
(and (not reset) (org-publish-cache-get-file-property file :title nil t))
-   (let* ((visiting (find-buffer-visiting file))
+   (let* ((org-inhibit-startup t)
+	  (visiting (find-buffer-visiting file))
 	  (buffer (or visiting (find-file-noselect file
  (with-current-buffer buffer
(let ((title
-	  (let ((property (plist-get (org-export-get-environment) :title)))
+	  (let ((property
+		 (plist-get
+		  ;; protect local variables in open buffers
+		  (if visiting
+			  (org-export-with-buffer-copy (org-export-get-environment))
+			(org-export-get-environment))
+		  :title)))
 		(if property
 		(org-no-properties (org-element-interpret-data property))
 		  (file-name-nondirectory (file-name-sans-extension file))
@@ -825,11 +832,14 @@ If FILE is an Org file and provides a DATE keyword use it.  In
 any other case use the file system's modification time.  Return
 time in `current-time' format."
   (if (file-directory-p file) (nth 5 (file-attributes file))
-(let* ((visiting (find-buffer-visiting file))
+(let* ((org-inhibit-startup t)
+	   (visiting (find-buffer-visiting file))
 	   (file-buf (or visiting (find-file-noselect file nil)))
 	   (date (plist-get
 		  (with-current-buffer file-buf
-		(org-export-get-environment))
+		(if visiting
+			(org-export-with-buffer-copy (org-export-get-environment))
+		  (org-export-get-environment)))
 		  :date)))
   (unless visiting (kill-buffer file-buf))
   ;; DATE is either a timestamp object or a secondary string.  If it
-- 
2.0.3



Re: [O] What is the best in-Emacs presentation mode for org-files today?

2014-07-29 Thread Grant Rettke
el-get might be a nice option for you.

el-get-sources lets you set up any source and you might use an 'after'
action to tangle the file.

I didn't do that, because my system won't tangle org-show for some
reason only my system knows.

The recipe is really basic but good enough for me:

#+begin_src emacs-lisp
(add-to-list
 'el-get-sources
 '(:name org-show
  :type http
  :url 
"https://raw.githubusercontent.com/jkitchin/jmax/master/org-show.org";
  :website "https://github.com/jkitchin/jmax/blob/master/org-show.org";
  :description "simple presentations in org-mode"))
(add-to-list 'gcr/el-get-packages 'org-show)
#+end_src
Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
g...@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Tue, Jul 29, 2014 at 10:45 AM, Thorsten Jolitz  wrote:
> John Kitchin  writes:
>
>> yes, you should be able to use org-babel-tangle to extract the .el
>> file. Sorry for leaving that detail out!
>
> since I always work the other way around (from elisp to org-mode via
> outorg) I don't have the tangling option very present, otherwise it
> would (and should) be quite obvious.
>
> Thx for the nice library!
>
> --
> cheers,
> Thorsten
>
>



[O] org-element - canonical way to parse only headline at point?

2014-07-29 Thread Thorsten Jolitz

Hi List,

with the new parser, how do I parse only the headline at point?  There
are ARGS in the parser/mapper functions that restrict parsing, but I
suspect that still the whole buffer is parsed for the genealogy - right?

With my current knowledge I would either narrow the buffer to the subtree at
point or copy this subtree to a temp-buffer before parsing/mapping it,
but maybe there is a better way?

Would this be a valid template (a simple and fast solution)?

#+begin_src emacs-lisp
  (save-restriction
   (org-narrow-to-subtree
(org-element-map (org-element-parse-buffer 'headline t) 'headline
  (lambda () ...)
  nil t t)))
#+end_src

-- 
cheers,
Thorsten




Re: [O] remapping C-c ' to another key

2014-07-29 Thread Thorsten Jolitz
Alan Schmitt  writes:

> Hello,
>
> I'm trying to remap ~C-c '~ to ~ '~ and I'm having some
> trouble. More specifically, I'm able to initiate the editing part using
> a global binding to `org-edit-special', but I don't know how to bind the
> same key to `org-edit-src-exit' when I'm editing a source block. As
> I suspect I will also need to change the binding for other special edit
> buffers, I'm wondering if there is a way to do it all at once.

you are in org-mode when you call `org-edit-special', thus you could do

,
| (org-defkey org-mode-map "KEY" `org-edit-special)
`


then you are in some major-mode with minor-mode 'org-src-mode' active,
thus

,
| (org-defkey org-src-mode-map "KEY" `org-edit-src-exit)
`

should work (completely untested though ...)

-- 
cheers,
Thorsten




Re: [O] processing lines before display to agenda

2014-07-29 Thread Joe Corneli

Bastien  writes:

> I would simply hack the agenda display through a function in
> `org-agenda-finalize-hook'.
>
> You'd rather hide 10 priority cookies from there instead of letting
> `org-agenda-format-item' process possibly thousands of entries.

Thanks for the tip!  I already use that for something else similar, it's
funny that it didn't occur to me here.  Will copy and modify my own
code:

~~

;; Right-justifying tags in the agenda buffer
(add-hook 'org-finalize-agenda-hook 'place-agenda-tags)
(defun place-agenda-tags ()
  "Put the agenda tags by the right border of the agenda window."
  (let ((org-agenda-tags-column (- 4 (window-width
(org-agenda-align-tags)))

~~

Cheers,
Joe



Re: [O] Fontification of org code block not printed

2014-07-29 Thread Stefan-W. Hahn
Mail von Bastien, Mon, 28 Jul 2014 at 18:57:37 +0200:

Hello Bastian,

> This is the fault of Org.
> 
> I fixed this in master by removing `org-block-background'.
> 
> This is radical but I think this is really better:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8

I tested and it works as I expect.

Thanks for your fast reply.

With kind regards,
Stefan

-- 
Stefan-W. Hahn  It is easy to make things.
It is hard to make things simple.



[O] remapping C-c ' to another key

2014-07-29 Thread Alan Schmitt
Hello,

I'm trying to remap ~C-c '~ to ~ '~ and I'm having some
trouble. More specifically, I'm able to initiate the editing part using
a global binding to `org-edit-special', but I don't know how to bind the
same key to `org-edit-src-exit' when I'm editing a source block. As
I suspect I will also need to change the binding for other special edit
buffers, I'm wondering if there is a way to do it all at once.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpKzRZAQzJox.pgp
Description: PGP signature


Re: [O] How to analyze clocking reports (e. g. with spreadsheet application)?

2014-07-29 Thread Christoph LANGE-BEVER

Hi all,

I thought I'd share with you one nice thing I figured out recently.

It seemed appropriate to post it as a belated answer to this thread:

On 2013-04-27 23:50, Martin wrote:
> I'm using the org-mode clocking features (in org-mode 7.9.4) extensively
> to document how much time I spent with which task and when.
>
> I wonder how I can export the data (e. g. to MS Excel) for further 
analysis;

> * time consumed by different projects
> * interruptions and "jumping" from task to task
> * time consumed by tasks with a special tag
> etc.

So I was interested in doing some of this analytics right inside Org 
spreadsheets.  At 
https://github.com/clange/org-mode/tree/master/clocktable-spreadsheet 
please find a self-documenting solution for computing my weekly overtime 
balance from working hours logged using the clocking features.  The key 
to this solution is accessing entries of a clock table from a 
spreadsheet table.


I would be happy to contribute this mini-tutorial to Worg.  It is 
already available under GPL, and I'll be happy to make it available 
under any other license you may need.  However I have little time and 
would prefer not having to learn any complex procedures before being 
able to contribute.


Cheers,

Christoph

--
Christoph Lange-Bever, http://www.facebook.com/ch.lange, Skype duke4701



Re: [O] [PATCH] org-capture, :default-time and <...>

2014-07-29 Thread Erik Hetzner
Hi Bastien,

At Tue, 29 Jul 2014 17:10:51 +0200,
Bastien wrote:
> 
> Hi Erik,
> 
> Erik Hetzner  writes:
> 
> > What I would like to do is have something a capture template string
> > similar to %^t, but with a custom date format string, e.g.
> > %^<%Y/%m/%d>. Is this possible in some way?
> 
> I'd use this in the capture template:
> 
> %(format-time-string "%Y/%m/%d" (org-time-string-to-time (org-read-date)))
> 
> but %^<...> would make sense to, I'll add it to the requested features.

Of course! Thank you so much, again, for your help.

best, Erik

-- 
Sent from my free software system .



Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Thorsten Jolitz
Xebar Saram  writes:

> ok ignore above email, i just saw the previous email..damm gmail..grrr

RFC is just 'request for comments':

,
| http://en.wikipedia.org/wiki/Request_for_Comments
`

PS

I know that feeling, a (too) quick C-c C-c in gnus and that damned email
is out ... ;)

-- 
cheers,
Thorsten




Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Xebar Saram
Thorsten, thats amazing!

thanks so much , really appreciate this

i hope other people will also find it useful

kind regards

Z


On Tue, Jul 29, 2014 at 7:23 PM, Xebar Saram  wrote:

> ok ignore above email, i just saw the previous email..damm gmail..grrr
>
> z
>
>
> On Tue, Jul 29, 2014 at 7:21 PM, Xebar Saram  wrote:
>
>> hi i fell like an idiot but what is RFC, is that a repo of some sorts,
>> would you mind pasting a link?
>>
>> sorry about that
>>
>> Z
>>
>>
>> On Tue, Jul 29, 2014 at 5:48 PM, Xebar Saram  wrote:
>>
>>> Hi again
>>>
>>> looks great but i think there may be a bug. if there is 1 line then
>>> issues the function works perfect (although no prompt, which for 1 line is
>>> ideal). but using C-u before the M-x dosent seem to do anything at all, it
>>> just wraps the current line. do i need any dependencies or doing something
>>> wrong?
>>>
>>> thx alot again, i hope other people will find it as useful as i do (i
>>> literally use it 20-30 times a day)
>>>
>>>
>>> On Tue, Jul 29, 2014 at 4:52 PM, Thorsten Jolitz 
>>> wrote:
>>>
 Thorsten Jolitz  writes:

 > Xebar Saram  writes:

 This is what I got in my init.el now (improved version with global
 keybindings). And I like, will probably become one of those commands I
 use all the time.

 I already used it to wrap the following code in 3 src-blocks:

 #+begin_src emacs-lisp
 (defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
   "Wrap sexp at point or region (point +-lines) in src block"
   (interactive
(when current-prefix-arg
  (list
   (ido-completing-read "Org-Babel language: "
(mapcar
 (lambda (--lang)
   (symbol-name (car --lang)))
 org-babel-load-languages)
nil nil nil nil "emacs-lisp")
   (read-number "Number of lines to wrap: " 1
   (let* ((language (or lang "emacs-lisp"))
  (marker (point-marker))
  (beg (point))
  (bol (bolp))
  (end (if lines
   (save-excursion
 (forward-line lines) (point))
 (save-excursion
   (forward-sexp) (point
  (cut-strg (buffer-substring beg end)))
 (delete-region beg end)
 (goto-char (marker-position marker))
 (insert
  (format
   "%s#+begin_src %s\n%s%s#+end_src\n"
   (if bol "" "\n")
   language
   cut-strg
   (if lines "" "\n")))
 (set-marker marker nil)))
 #+end_src

 #+begin_src emacs-lisp
 (global-set-key (kbd "C-c w l")
 (lambda ()
   (interactive)
   (let ((current-prefix-arg '(4)))
  (call-interactively
   'tj/wrap-sexp-or-reg-in-src-block
 #+end_src


 #+begin_src emacs-lisp
 (global-set-key (kbd "C-c w w")
 'tj/wrap-sexp-or-reg-in-src-block)
 #+end_src

 --
 cheers,
 Thorsten



>>>
>>
>


Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Xebar Saram
ok ignore above email, i just saw the previous email..damm gmail..grrr

z


On Tue, Jul 29, 2014 at 7:21 PM, Xebar Saram  wrote:

> hi i fell like an idiot but what is RFC, is that a repo of some sorts,
> would you mind pasting a link?
>
> sorry about that
>
> Z
>
>
> On Tue, Jul 29, 2014 at 5:48 PM, Xebar Saram  wrote:
>
>> Hi again
>>
>> looks great but i think there may be a bug. if there is 1 line then
>> issues the function works perfect (although no prompt, which for 1 line is
>> ideal). but using C-u before the M-x dosent seem to do anything at all, it
>> just wraps the current line. do i need any dependencies or doing something
>> wrong?
>>
>> thx alot again, i hope other people will find it as useful as i do (i
>> literally use it 20-30 times a day)
>>
>>
>> On Tue, Jul 29, 2014 at 4:52 PM, Thorsten Jolitz 
>> wrote:
>>
>>> Thorsten Jolitz  writes:
>>>
>>> > Xebar Saram  writes:
>>>
>>> This is what I got in my init.el now (improved version with global
>>> keybindings). And I like, will probably become one of those commands I
>>> use all the time.
>>>
>>> I already used it to wrap the following code in 3 src-blocks:
>>>
>>> #+begin_src emacs-lisp
>>> (defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
>>>   "Wrap sexp at point or region (point +-lines) in src block"
>>>   (interactive
>>>(when current-prefix-arg
>>>  (list
>>>   (ido-completing-read "Org-Babel language: "
>>>(mapcar
>>> (lambda (--lang)
>>>   (symbol-name (car --lang)))
>>> org-babel-load-languages)
>>>nil nil nil nil "emacs-lisp")
>>>   (read-number "Number of lines to wrap: " 1
>>>   (let* ((language (or lang "emacs-lisp"))
>>>  (marker (point-marker))
>>>  (beg (point))
>>>  (bol (bolp))
>>>  (end (if lines
>>>   (save-excursion
>>> (forward-line lines) (point))
>>> (save-excursion
>>>   (forward-sexp) (point
>>>  (cut-strg (buffer-substring beg end)))
>>> (delete-region beg end)
>>> (goto-char (marker-position marker))
>>> (insert
>>>  (format
>>>   "%s#+begin_src %s\n%s%s#+end_src\n"
>>>   (if bol "" "\n")
>>>   language
>>>   cut-strg
>>>   (if lines "" "\n")))
>>> (set-marker marker nil)))
>>> #+end_src
>>>
>>> #+begin_src emacs-lisp
>>> (global-set-key (kbd "C-c w l")
>>> (lambda ()
>>>   (interactive)
>>>   (let ((current-prefix-arg '(4)))
>>>  (call-interactively
>>>   'tj/wrap-sexp-or-reg-in-src-block
>>> #+end_src
>>>
>>>
>>> #+begin_src emacs-lisp
>>> (global-set-key (kbd "C-c w w")
>>> 'tj/wrap-sexp-or-reg-in-src-block)
>>> #+end_src
>>>
>>> --
>>> cheers,
>>> Thorsten
>>>
>>>
>>>
>>
>


Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Xebar Saram
hi i fell like an idiot but what is RFC, is that a repo of some sorts,
would you mind pasting a link?

sorry about that

Z


On Tue, Jul 29, 2014 at 5:48 PM, Xebar Saram  wrote:

> Hi again
>
> looks great but i think there may be a bug. if there is 1 line then issues
> the function works perfect (although no prompt, which for 1 line is ideal).
> but using C-u before the M-x dosent seem to do anything at all, it just
> wraps the current line. do i need any dependencies or doing something wrong?
>
> thx alot again, i hope other people will find it as useful as i do (i
> literally use it 20-30 times a day)
>
>
> On Tue, Jul 29, 2014 at 4:52 PM, Thorsten Jolitz 
> wrote:
>
>> Thorsten Jolitz  writes:
>>
>> > Xebar Saram  writes:
>>
>> This is what I got in my init.el now (improved version with global
>> keybindings). And I like, will probably become one of those commands I
>> use all the time.
>>
>> I already used it to wrap the following code in 3 src-blocks:
>>
>> #+begin_src emacs-lisp
>> (defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
>>   "Wrap sexp at point or region (point +-lines) in src block"
>>   (interactive
>>(when current-prefix-arg
>>  (list
>>   (ido-completing-read "Org-Babel language: "
>>(mapcar
>> (lambda (--lang)
>>   (symbol-name (car --lang)))
>> org-babel-load-languages)
>>nil nil nil nil "emacs-lisp")
>>   (read-number "Number of lines to wrap: " 1
>>   (let* ((language (or lang "emacs-lisp"))
>>  (marker (point-marker))
>>  (beg (point))
>>  (bol (bolp))
>>  (end (if lines
>>   (save-excursion
>> (forward-line lines) (point))
>> (save-excursion
>>   (forward-sexp) (point
>>  (cut-strg (buffer-substring beg end)))
>> (delete-region beg end)
>> (goto-char (marker-position marker))
>> (insert
>>  (format
>>   "%s#+begin_src %s\n%s%s#+end_src\n"
>>   (if bol "" "\n")
>>   language
>>   cut-strg
>>   (if lines "" "\n")))
>> (set-marker marker nil)))
>> #+end_src
>>
>> #+begin_src emacs-lisp
>> (global-set-key (kbd "C-c w l")
>> (lambda ()
>>   (interactive)
>>   (let ((current-prefix-arg '(4)))
>>  (call-interactively
>>   'tj/wrap-sexp-or-reg-in-src-block
>> #+end_src
>>
>>
>> #+begin_src emacs-lisp
>> (global-set-key (kbd "C-c w w")
>> 'tj/wrap-sexp-or-reg-in-src-block)
>> #+end_src
>>
>> --
>> cheers,
>> Thorsten
>>
>>
>>
>


Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Achim Gratz
Malcolm Purvis writes:
> I use the master version of org, and some months ago the time required
> to generate my custom agenda view sky rocketed.  I've found that 90% of
> the time was being spent in the call to re-search-forward in
> org-refresh-category-properties.  The patch below speeds up the regular
> expression search and makes the generation of my agenda as fast as
> before.

I agree that this is faster, but it doesn't look right.  Specifically I
don't think you are matching CATEGORY drawers any longer.

> -  "^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t)
> +  "^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\)" nil t)

I think that "^[ \t]*\\(\\(?:#\\+\\|:\\)CATEGORY:\\)\\(.*\\)" would be a
better regex, assuming that the original regex was doing the right thing.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Repeated tasks repeats even if the time stamp is commented

2014-07-29 Thread Samuel Loury
Hi,
Bastien  writes:

> Nicolas Goaziou  writes:
>
>> Samuel Loury  writes:
>>
>>> Thank you for the answer, do you know where I should look at to start
>>> investigating to fix the issue?
>>
>> I think `org-add-planning-info' may be a good candidate, though I didn't
>> look closely into it.
>
> Is anyone having a closer look at this?
>
> Otherwise I will, but at the end of august.
I don't think I will look at this soon. I added an entry in my todo.org
but I couldn't find any time to schedule it yet...

If I work on it, I'll let you know.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp_0Jc029obO.pgp
Description: PGP signature


Re: [O] What is the best in-Emacs presentation mode for org-files today?

2014-07-29 Thread Thorsten Jolitz
John Kitchin  writes:

> yes, you should be able to use org-babel-tangle to extract the .el
> file. Sorry for leaving that detail out!

since I always work the other way around (from elisp to org-mode via
outorg) I don't have the tangling option very present, otherwise it
would (and should) be quite obvious. 

Thx for the nice library!

-- 
cheers,
Thorsten




Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> The documentation for org-agenda-inhibit-startup says that the default
>> is t. However, the default is nil.
>>
>> ,
>> | Inhibit startup when preparing agenda buffers.
>> | When this variable is `t' (the default), the initialization of
>> | the Org agenda buffers is inhibited: e.g. the visibility state
>> | is not set, the tables are not re-aligned, etc.
>> `
>
> Please go ahead for this too.

Gladly!

>From 5b2ef2c660d8163199f45d4dbf58d33f3ec1f918 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 10:59:19 -0500
Subject: [PATCH] Fix docstring of org-agenda-inhibit-startup

* lisp/org.el: org-agenda-inhibit-startup: fix docstring to reflect
  default value
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5c4b211..df13fff 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17961,9 +17961,9 @@ This requires Emacs >= 24.1, build with imagemagick support."
 
 (defcustom org-agenda-inhibit-startup nil
   "Inhibit startup when preparing agenda buffers.
-When this variable is `t' (the default), the initialization of
-the Org agenda buffers is inhibited: e.g. the visibility state
-is not set, the tables are not re-aligned, etc."
+When this variable is `t', the initialization of the Org agenda
+buffers is inhibited: e.g. the visibility state is not set, the
+tables are not re-aligned, etc."
   :type 'boolean
   :version "24.3"
   :group 'org-agenda)
-- 
2.0.3



Re: [O] if we operate on a subtree, perhaps we could adjust levels

2014-07-29 Thread Achim Gratz
Bastien writes:
>> 2. Demote the whole subtree to toplevel before encryption and promote
>> into the correct level on decryption, (much in the same way that
>> includes are handled).
>
> By "correct level on decryption" you mean toplevel?  This would really
> circumvent the problem.

Not sure what you mean by toplevel, but the way includes are handled is
to check at what level the include is happening and promote the included
content to that level.  That would also make the encrypted subtree
independent of any movements in the hierarchy, which is IMHO desirable.

> Maybe we can store the level in a property on encryption and simply
> throw a warning on decryption, letting the user decide whether she
> wants to continue decrypting even when it may break the hierarchy.

FWIW, I prefer the other solution since it is more general.  Again, the
content from the decryption process can be treated like an include
(except for display rather than during export) or rather an "inline
file", which might be worth having independently of encrypted subtree as
well.


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




Re: [O] [patch] [babel] Patches to fix tangling and variable transfer of tables in R

2014-07-29 Thread Rainer M Krug
Bastien  writes:

> Hi Rainer,
>
> Rainer M Krug  writes:
>
>> Amended patches attached.
>
> Applied, thanks,

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpaSMV6WtrTp.pgp
Description: PGP signature


Re: [O] [FeatReq] New option for `org-entry-properties' WHICH argument?

2014-07-29 Thread Thorsten Jolitz
Bastien  writes:

> Hi Thorsten,
>
> Thorsten Jolitz  writes:
>
>>  - ask the maintainer for a hint towards a smarter less intrusive
>>solution?
>
> Well, the maintainer will be on holiday starting from tonight until
> August, 18th, so let's wait by then?
>
> If you happen to make progress in the meantime, that'd be good too.

Have fun - and lets see ...

-- 
cheers,
Thorsten




Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> So to be safe, we could do the following in org-publish-find-date and
>> org-publish-find-title... 
>>
>> (org-export-with-buffer-copy (org-export-get-environment))
>>
>> What do you think?
>
> Yes, this sounds right, please go ahead.
>
> I applied your fix in the maint branch, so if you need to revert it
> please do the revert from there first.

Here's the patch. There's no need to revert anything, as this builds
upon my previous commit.

>From 72217e53103a82e0397d1435331e3eed10f0fbd5 Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Tue, 29 Jul 2014 10:39:57 -0500
Subject: [PATCH 1/2] Call org-export-get-environment in buffer copy

* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date)
  Make sure to call org-export-get-environment in copy of
  buffer. Otherwise, #+bind variables meant for export can be set in
  live buffers.
---
 lisp/ox-publish.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 94f12e9..26d4be7 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -810,7 +810,10 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
 	  (buffer (or visiting (find-file-noselect file
  (with-current-buffer buffer
(let ((title
-	  (let ((property (plist-get (org-export-get-environment) :title)))
+	  (let ((property
+		 (plist-get
+		  (org-export-with-buffer-copy (org-export-get-environment))
+		  :title)))
 		(if property
 		(org-no-properties (org-element-interpret-data property))
 		  (file-name-nondirectory (file-name-sans-extension file))
@@ -829,7 +832,7 @@ time in `current-time' format."
 	   (file-buf (or visiting (find-file-noselect file nil)))
 	   (date (plist-get
 		  (with-current-buffer file-buf
-		(org-export-get-environment))
+		(org-export-with-buffer-copy (org-export-get-environment)))
 		  :date)))
   (unless visiting (kill-buffer file-buf))
   ;; DATE is either a timestamp object or a secondary string.  If it
-- 
2.0.3



Re: [O] Agenda/report of all headlines with clocked time

2014-07-29 Thread Subhan Michael Tindall
-Original Message-
> From: bzg=gnu@bzg.fr [mailto:bzg=gnu@bzg.fr] On Behalf Of Bastien
> Sent: Tuesday, July 29, 2014 7:14 AM
> To: Subhan Michael Tindall
> Subject: Re: Agenda/report of all headlines with clocked time
>
> (You forgot to CC the list.)
Sorry!

> Subhan Michael Tindall  writes:
>
> > I'm running Org-mode version 8.2.7b (8.2.7b-2-g798733-elpa This does 
> > not give me any prompt, just the overlay (which is fairly helpful, 
> > actually, but a time range would be better) Do I need to upgrade to a 
> > development version to get this functionality?
>
> From the tip of the master branch, you can do
>
> C-u C-u C-c C-x C-d and get a prompt for a time range, clocked entries from 
> this time range will be overlayed with the time spend.
>
> HTH,
>
> --
>  Bastien

I'm not entirely sure what you mean by 'the time of the master branch', but I 
can't get any prompt for a time range with this command anywhere in the file. 
Subhan

This message is intended for the sole use of the individual and entity to which 
it is addressed and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If you are not the intended 
addressee, nor authorized to receive for the intended addressee, you are hereby 
notified that you may not use, copy, disclose or distribute to anyone the 
message or any information contained in the message. If you have received this 
message in error, please immediately advise the sender by reply email and 
delete the message.  Thank you.




Re: [O] File name with space

2014-07-29 Thread Marcin Borkowski
Dnia 2014-07-26, o godz. 06:50:40
Chris Henderson  napisał(a):

> How do I link a local file or folder that has space? Looks like the
> link goes broken.

Slightly off topic: using spaces in filenames is asking for trouble.
(Personally, I stick (almost exclusively) to [a-z0-9-].)

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Thorsten Jolitz
Xebar Saram  writes:

Hi,

> looks great but i think there may be a bug. 

can you try the new version in my RFC please and let me know if it works
as expected. 

I invested a bit of time into this function because I actually need this
quite often too, and I'm happy you pushed me to finally write it, thx
for that.

-- 
cheers,
Thorsten




[O] [RFC] Add commmand for wrapping sexp/region in src-blocks to Org?

2014-07-29 Thread Thorsten Jolitz

Hi List, 

I often missed the following command for wrapping existing content into
src-blocks in the past, besides knowing about
`org-babel-demarcate-block' and easy template insertion. Would it make
sense to add it to Org-mode?

I made it cover several use cases:

  - Wrap sexp at point - perfect when on first paren of a nested list,
or when a string should be wrapped in a programming-mode, or a
word in a text-mode.

  - Wrap region between point and +/- N lines forward/backward (very
fast because no point movement is involved).

  - Wrap active region.

Usage:

1. wrap active region or (if none) sexp-at-point in emacs-lisp src-block

,
| M-x org-wrap-in-src-block   
`

2. wrap active region or (if none) sexp-at-point in src-block, prompt
   user for Org-Babel language

,
| C-u M-x org-wrap-in-src-block   
`

3. prompt user for Org-Babel language and number of lines to wrap
(forward or backward)

,
| C-u C-u M-x org-wrap-in-src-block   
`


#+begin_src emacs-lisp
(defun org-wrap-in-src-block (&optional lang lines)
  "Wrap sexp-at-point or region in src-block.

Use Org-Babel LANGuage for the src-block if given, Emacs-Lisp
otherwise. A region instead of the sexp-at-point is wrapped if
either

   - optional argument LINES is an (positive or negative) integer
   - or the region is active

In the first case the region is determined by moving +/- LINES
forward/backward from point using `forward-line', in the second
case the active region is used. 

When called with prefix argument 'C-u', prompt the user for the
Org-Babel language to use. When called with two prefix arguments
'C-u C-u', prompt the user for both the Org-Babel language to use
and the number of lines to be wrapped."
  (interactive
   (cond
((equal current-prefix-arg nil) nil)
((equal current-prefix-arg '(4))
 (list
  (ido-completing-read "Org-Babel language: "
   (mapcar
(lambda (--lang)
  (symbol-name (car --lang)))
org-babel-load-languages)
   nil nil nil nil "emacs-lisp")))
((equal current-prefix-arg '(16))
 (list
  (ido-completing-read "Org-Babel language: "
   (mapcar
(lambda (--lang)
  (symbol-name (car --lang)))
org-babel-load-languages)
   nil nil nil nil "emacs-lisp")
  (read-number "Number of lines to wrap: " 1)
  (let* ((language (or lang "emacs-lisp"))
 (beg (or (and (not lines)
   (region-active-p)
   (region-beginning))
  (point)))
 (marker (save-excursion (goto-char beg) (point-marker)))
 (bol (save-excursion (goto-char beg) (bolp)))
 (end (cond
   (lines (save-excursion
(forward-line lines) (point)))
   ((region-active-p)(region-end))
   (t (save-excursion
(forward-sexp) (point)
 (cut-strg (buffer-substring beg end)))
(delete-region beg end)
(goto-char (marker-position marker))
(insert
 (format
  "%s#+begin_src %s\n%s%s#+end_src\n"
  (if (or (and lines (< lines 0)) bol) "" "\n")
  language
  cut-strg
  (if lines "" "\n")))
(set-marker marker nil)))
#+end_src

-- 
cheers,
Thorsten




Re: [O] hiding intrusive target-markups-brackets ++ Re: org-special-keyword face not showing in sublevels anymore since commit 69700e1

2014-07-29 Thread Bastien
Hi,

mc  writes:

> Please allow me to shortly direct your attention to an open, 
> still uncommented 'feature request’ addressing an optional
> ‘fontification' or ‘hiding' of the some kind of intrusive 
> target-markups-brackets ( <<  >> ), 
> just like this is done with the org-link brackets ( [[ ]] ).

I agree this would be useful, I gave it a try at the time but could
not finish the code.  I will have a look again at the end of august.

Don't hesitate to raise this up again in september if nothing happens.

Thanks,

-- 
 Bastien



Re: [O] What is the best in-Emacs presentation mode for org-files today?

2014-07-29 Thread John Kitchin
Thorsten Jolitz  writes:
yes, you should be able to use org-babel-tangle to extract the .el
file. Sorry for leaving that detail out!

> Nicolas Richard  writes:
>
>> Thorsten Jolitz  writes:
>>
>>> John Kitchin  writes:
>>>
>>> Hi John, 
>>>
 I agree with org-mode. Check out
 https://www.youtube.com/watch?v=JZ8RK-R9O_g, which is an illustration of
 some code I adapted from Sacha Chua. At the top of
 https://github.com/jkitchin/jmax/blob/master/org-show.org you can find
 some links to other presentation tools in Emacs.
>>>
>>> this looks very nice, but how do I get it?
>>
>> Just from the name of the files (org-show.org and org-show.el) and the
>> fact that this is Org mode, I would say you should tangle the org file
>> to get the .el file !
>
> Ah yes, there is actually a final node in this file containing the
> org-show source-code (with a :tangle yes header), did not see that,
> looked like just the presentation. Thx for the hint.

-- 
---
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



Re: [O] processing lines before display to agenda

2014-07-29 Thread Bastien
Hi Joe,

Joe Corneli  writes:

> But what if, for example, I would like to remove priorities cookies as
> well?

I would simply hack the agenda display through a function in
`org-agenda-finalize-hook'.

You'd rather hide 10 priority cookies from there instead of letting
`org-agenda-format-item' process possibly thousands of entries.

In any case, `org-agenda-format-item' should be made lighter, not
heavier...

2 cents,

-- 
 Bastien



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Bastien
Hi Matt,

Matt Lundin  writes:

> The documentation for org-agenda-inhibit-startup says that the default
> is t. However, the default is nil.
>
> ,
> | Inhibit startup when preparing agenda buffers.
> | When this variable is `t' (the default), the initialization of
> | the Org agenda buffers is inhibited: e.g. the visibility state
> | is not set, the tables are not re-aligned, etc.
> `

Please go ahead for this too.

Thanks,

-- 
 Bastien



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Bastien
Hi Matt,

Matt Lundin  writes:

> So to be safe, we could do the following in org-publish-find-date and
> org-publish-find-title... 
>
> (org-export-with-buffer-copy (org-export-get-environment))
>
> What do you think?

Yes, this sounds right, please go ahead.

I applied your fix in the maint branch, so if you need to revert it
please do the revert from there first.

Thanks in advance,

-- 
 Bastien



[O] processing lines before display to agenda

2014-07-29 Thread Joe Corneli
I would find it quite useful to have a variable similar to
`org-agenda-prefix-format' that would apply changes to the *contents*,
rather than to the *prefix* of agenda items.

The nice thing about `org-agenda-prefix-format' is that it allows
different formatting for different agenda buffers.  Similarly, it would
be useful to be able to supply different functions to alter the agenda
items themselves, depending on the context.

I was thinking that in theory this could be done by advising
`org-agenda-format-item', but I'm not sure how to get the advice to
apply in a conditional way depending on the agenda.

There was a similar discussion related to the specific case of removing
TODO keywords from certain agendas,
https://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00810.html

So, for example: to hide TODO keywords from the agenda:

(setq org-agenda-custom-commands
  '(("a" agenda ""
 ((org-agenda-todo-keyword-format "")

But what if, for example, I would like to remove priorities cookies as
well?



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Hi Matt,
>>
>> Matt Lundin  writes:
>>
>>> This patch fixes a bug in which org-publish makes the following call...
>>> (let ((org-inhibit-startup t) (org-mode)))
>>
>> Applied, thanks!
>
> This could be solved by wrapping org-export-get-environment withing
> those functions with (let ((buffer-read-only nil)) ...).

Correction... this should be...

(let ((inhibit-read-only t)) ...)

Correction is for the record only, as this is moot given the rest of the
email.

Matt



Re: [O] [PATCH] org-capture, :default-time and <...>

2014-07-29 Thread Bastien
Hi Erik,

Erik Hetzner  writes:

> What I would like to do is have something a capture template string
> similar to %^t, but with a custom date format string, e.g.
> %^<%Y/%m/%d>. Is this possible in some way?

I'd use this in the capture template:

%(format-time-string "%Y/%m/%d" (org-time-string-to-time (org-read-date)))

but %^<...> would make sense to, I'll add it to the requested features.

HTH,

-- 
 Bastien



Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Matt Lundin  writes:

> Bastien  writes:
>
>> Hi Matt,
>>
>> Matt Lundin  writes:
>>
>>> This patch fixes a bug in which org-publish makes the following call...
>>> (let ((org-inhibit-startup t) (org-mode)))
>>
>> Applied, thanks!
>
> Oops... I see now that org-publish-find-date and org-publish-find-title
> call org-export-get-environment. This in turn relies on org-set-local to
> set #+BIND: variables, which requires the buffer to be writable. I have
> an org-mode-hook that sets some of my web publishing files read-only (so
> as to prevent accidental editing). Without org-inhibit-startup, these
> buffers remain read-only, causing the following error message:

[...continuing the previous post.]

I think I've found a more general problem here. When called in an org
buffer...

(let ((org-inhibit-startup t)) (org-mode))

...either wipes out dir-locals variables or prevents them from loading.
I have looked at the org-mode code and am not entirely sure why this
would be the case. 

However, this causes problems, for instance, when
org-agenda-inhibit-startup is t or when calling org-toggle-tags-groups.

And one more minor thing...

The documentation for org-agenda-inhibit-startup says that the default
is t. However, the default is nil.

,
| Inhibit startup when preparing agenda buffers.
| When this variable is `t' (the default), the initialization of
| the Org agenda buffers is inhibited: e.g. the visibility state
| is not set, the tables are not re-aligned, etc.
`

Thanks,
Matt





Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Matt Lundin
Bastien  writes:

> Hi Matt,
>
> Matt Lundin  writes:
>
>> This patch fixes a bug in which org-publish makes the following call...
>> (let ((org-inhibit-startup t) (org-mode)))
>
> Applied, thanks!

Oops... I see now that org-publish-find-date and org-publish-find-title
call org-export-get-environment. This in turn relies on org-set-local to
set #+BIND: variables, which requires the buffer to be writable. I have
an org-mode-hook that sets some of my web publishing files read-only (so
as to prevent accidental editing). Without org-inhibit-startup, these
buffers remain read-only, causing the following error message:

--8<---cut here---start->8---
org-export--get-global-options: Buffer is read-only: #
--8<---cut here---end--->8---

This could be solved by wrapping org-export-get-environment withing
those functions with (let ((buffer-read-only nil)) ...).

However, I think the fundamental problem is that
org-export-get-environment should be called on a copy of the buffer.
That, at least, is how it is used in org-export-as (see lines 3084 -
3107 of ox.el). When org-publish-find-title and org-publish-call-date
calls it in a buffer that is already open, it does so on the original
copy of the buffer. This has the effect of setting the #+BIND variables
within the live buffer, which could (theoretically) be dangerous, since,
AFAICT, they should only be set in a temporary copy of the buffer.

So to be safe, we could do the following in org-publish-find-date and
org-publish-find-title... 

(org-export-with-buffer-copy (org-export-get-environment))

What do you think?

Best,
Matt



Re: [O] Bug: org table updates [8.2.7 (8.2.7-elpaplus @ /Users/ctanis/.emacs.d/elpa/org-plus-contrib-20140613/)]

2014-07-29 Thread Bastien
Hi Craig,

Craig Tanis  writes:

> How about org-table-cell-blank-triggers ?

Sounds good.  Can you make a patch for this?

The variable needs to be in org-table.el and org.el needs
to use (defvar org-table-cell-blank-triggers) before it's
first use.

Thanks in advance,

-- 
 Bastien



Re: [O] bug: isearch puts ellipses at top of window

2014-07-29 Thread Nicolas Richard
Samuel Wales  writes:

> in maint, isearch very often puts ... at the top of the window.  is
> this related to recent ellipsis bugs?

If you have a reproducible recipe, it would be very nice !

TIA,

-- 
Nico.



Re: [O] [FeatReq] New option for `org-entry-properties' WHICH argument?

2014-07-29 Thread Bastien
Hi Thorsten,

Thorsten Jolitz  writes:

>  - ask the maintainer for a hint towards a smarter less intrusive
>solution?

Well, the maintainer will be on holiday starting from tonight until
August, 18th, so let's wait by then?

If you happen to make progress in the meantime, that'd be good too.

Thanks,

-- 
 Bastien



Re: [O] bug: isearch puts ellipses at top of window

2014-07-29 Thread Bastien
Samuel Wales  writes:

> is this fixed in master?

No.  I can't make this a priority now, because there are more
important issues than this one, although I understand why it's
important for you.

On my watch list,

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Hi Nick,

Nick Dokos  writes:

>What does the asterisk do?

I think this is simply a code typo, fixed in master.

-- 
 Bastien



Re: [O] proposal for improved integration of cdlatex

2014-07-29 Thread Bastien
Federico Beffa  writes:

> To be honest, I do not know. But, the original cdlatex-tab function
> takes those parameters and I thought it would be a good idea to pass
> on the same parameters, just in case someone uses them.

Ah okay, I didn't check that.  Please go ahead with the patch then,

-- 
 Bastien



Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Xebar Saram
Hi again

looks great but i think there may be a bug. if there is 1 line then issues
the function works perfect (although no prompt, which for 1 line is ideal).
but using C-u before the M-x dosent seem to do anything at all, it just
wraps the current line. do i need any dependencies or doing something wrong?

thx alot again, i hope other people will find it as useful as i do (i
literally use it 20-30 times a day)


On Tue, Jul 29, 2014 at 4:52 PM, Thorsten Jolitz  wrote:

> Thorsten Jolitz  writes:
>
> > Xebar Saram  writes:
>
> This is what I got in my init.el now (improved version with global
> keybindings). And I like, will probably become one of those commands I
> use all the time.
>
> I already used it to wrap the following code in 3 src-blocks:
>
> #+begin_src emacs-lisp
> (defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
>   "Wrap sexp at point or region (point +-lines) in src block"
>   (interactive
>(when current-prefix-arg
>  (list
>   (ido-completing-read "Org-Babel language: "
>(mapcar
> (lambda (--lang)
>   (symbol-name (car --lang)))
> org-babel-load-languages)
>nil nil nil nil "emacs-lisp")
>   (read-number "Number of lines to wrap: " 1
>   (let* ((language (or lang "emacs-lisp"))
>  (marker (point-marker))
>  (beg (point))
>  (bol (bolp))
>  (end (if lines
>   (save-excursion
> (forward-line lines) (point))
> (save-excursion
>   (forward-sexp) (point
>  (cut-strg (buffer-substring beg end)))
> (delete-region beg end)
> (goto-char (marker-position marker))
> (insert
>  (format
>   "%s#+begin_src %s\n%s%s#+end_src\n"
>   (if bol "" "\n")
>   language
>   cut-strg
>   (if lines "" "\n")))
> (set-marker marker nil)))
> #+end_src
>
> #+begin_src emacs-lisp
> (global-set-key (kbd "C-c w l")
> (lambda ()
>   (interactive)
>   (let ((current-prefix-arg '(4)))
>  (call-interactively
>   'tj/wrap-sexp-or-reg-in-src-block
> #+end_src
>
>
> #+begin_src emacs-lisp
> (global-set-key (kbd "C-c w w")
> 'tj/wrap-sexp-or-reg-in-src-block)
> #+end_src
>
> --
> cheers,
> Thorsten
>
>
>


Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Nick Dokos
Malcolm Purvis  writes:

> I use the master version of org, and some months ago the time required
> to generate my custom agenda view sky rocketed.  I've found that 90% of
> the time was being spent in the call to re-search-forward in
> org-refresh-category-properties.  The patch below speeds up the regular
> expression search and makes the generation of my agenda as fast as
> before.
>
> Malcolm
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 7e30061..2fc6854 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -9474,7 +9474,7 @@ The refresh happens only for the current tree (not 
> subtree)."
>(goto-char (point-min))
>(put-text-property (point) (point-max) 'org-category def-cat)
>(while (re-search-forward
> -  "^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t)
> +  "^[ \t]*\\(#\\+CATEGORY:\\|*:CATEGORY:\\)\\(.*\\)" nil t)
^
^
   What does the asterisk do?

Can you explain what this regexp is supposed to match?

Thanks,
Nick





Re: [O] proposal for improved integration of cdlatex

2014-07-29 Thread Federico Beffa
>> the parameters are just in case you want to use this function
>> non-interactively in place of cdlatex-tab.
>
> Is there a real use-case for non-interactive use?

To be honest, I do not know. But, the original cdlatex-tab function
takes those parameters and I thought it would be a good idea to pass
on the same parameters, just in case someone uses them.

Regards,
Fede



Re: [O] LaTeX export and org-add-link-type

2014-07-29 Thread Fabrice Niessen
Leonard Avery Randall wrote:
> Serge Cohen writes:
>> Is this normal, if so is there another way to obtain the same results
>> as what is proposed in the documentation ?
>
> The behaviour you are explaining is not normal.  The setup you described
> should work.
>
>> To complete the post : I am using Aquamacs (MacOSX gui-version), based
>> on GNU emacs 23.4.1 The included version of org.el is Version: 6.33x
>
> Herein lies your problem.  6.33 is a very old version of org. I tested
> the old Aquamacs 2.5 with org 6.33 and it does not work.  You should
> update your org version and probably your emacs as well.  I tested your
> code on the newer Aquamacs 3.0 release and it works.  If you like the
> Aquamacs key commands then 3.0 is a reasonable bet. It comes with org
> 7.9.3. Other good distros for OSX can be acquired through macports,
> homebrew, or emacsforosx.  All of these are fairly integrated into the
> osx environment (the homebrew distro comes with a few config options so
> you may want to look to see which one is best for you).
>
> Regarding org mode version, I would recommend the most recent version
> which is available through melpa.  If you have a lot of stuff in your
> org configuration file, updating to org version 8.x requires a bit of
> work, but the new backend should be stable, so you want have to fiddle
> too much with your init file in the future.
>
> Once you upgrade to emacs 24, adding new packages is fairly easy through
> package.el. Just add this snippet to your init file.
>
> (when (>= emacs-major-version 24)
>   (require 'package)
>   (package-initialize)
>   (add-to-list 'package-archives 
>   '("melpa" . "http://melpa.milkbox.net/packages/";) t))
>
> Then to upgrade to the latest version of org-mode just press `M-x package
> install RET org-plus-contrib RET'. 

Note that using custom link types is -- in my opinion -- outperformed by
the Org macros. For example, because custom link types limit you to
2 arguments, no more.

With macros, you can have as many as you want (or at least 9?), and you
can also easily convert the macro code per back-end; for example:

  #+MACRO: cite @@latex:\cite{$1}odt:\cite{$1}@@

Note that I'm planning to write a set of default (useful) Org macros,
and publish them.

My project is currently on GitHub: https://github.com/fniessen/org-macros.

See documentation on
http://htmlpreview.github.io/?https://github.com/fniessen/org-macros/blob/master/README.html.

Best regards,
Fabrice

-- 
Fabrice Niessen
Leuven, Belgium
http://www.pirilampo.org/




Re: [O] Enabling another language in org-babel

2014-07-29 Thread Bastien
Hi Ista,

some comments on the code below.

Ista Zahn  writes:

> ;; Copyright (C) 2014 Ista Zahn
> ;; Author: Ista Zahn, based on ob-julia.el by G. Jay Kerns, and ob-R.el
> ;; by Eric Schulte and Dan Davison

You need to reformat this -- see files with multiple authors in Org or
in Emacs.

> ;; This file is not part of GNU Emacs.

We plan to add this to Org's core, so this will be part of Emacs.

> ;; Stata and ESS are required.

Maybe add some links for the requirements.

> (defcustom org-babel-stata-command inferior-STA-program-name
>   "Name of command to use for executing stata code."
>   :group 'org-babel
>   :version "24.4"
>   :package-version '(Org . "8.0")
  ^^^

This needs to be 8.3

> ;; The following was a very complicated write object command
> ;; The replacement needs to add error catching
> ;(defvar org-babel-stata-write-object-command 
> "{function(object,transfer.file){object;invisible(if(inherits(try({tfile<-tempfile();write.table(object,file=tfile,sep=\"\\t\",na=\"nil\",row.names=%s,col.names=%s,quote=FALSE);file.rename(tfile,transfer.file)},silent=TRUE),\"try-error\")){if(!file.exists(transfer.file))file.create(transfer.file)})}}(object=%s,transfer.file=\"%s\")")

Maybe simply remove this, or make it more readable.

Thanks in advance for this contribution!

-- 
 Bastien



Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-07-29 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> It is "good enough", but the default value (without TITLE) is still
> dubious. Anyway, this is a minor issue, if at all.

Yes.  But I know see your point about the default title being useless
most of the times.  So I'm fine with the proposed change in master.

-- 
 Bastien



Re: [O] proposal to have ignoreheading tags/properties

2014-07-29 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> Filters are _not_ meant to be in core since they are hardly a generic
> solution for a class of problem. They are entry points for user-level
> hacking. Generic patches should operate at the parse tree level, not
> using regexps.
>
> Eric's filter, like any other filter, has flaws that cannot be fixed.
> Useful filters ought to be published in Worg, not included in core.

Fair enough.

Still, can someone add Eric's solution to contrib/lisp/ox-extra.el?

Thanks,

-- 
 Bastien



Re: [O] if we operate on a subtree, perhaps we could adjust levels

2014-07-29 Thread Bastien
Hi Samuel,

Samuel Wales  writes:

> org-yank-adjusted-subtrees?

I think this would work if the yank contains only one subtree,
which will not be the case most of the times.

Still worth exploring, I'll keep this in my todo list,

-- 
 Bastien



Re: [O] proposal for improved integration of cdlatex

2014-07-29 Thread Bastien
Hi Federico,

Federico Beffa  writes:

> the parameters are just in case you want to use this function
> non-interactively in place of cdlatex-tab.

Is there a real use-case for non-interactive use?

>> I'm not sure it's worth it.  You can indent the element with M-h C-\
>> easily enough, no?
>
> Because typing one key combination is faster than typing 3 and there
> are no disadvantages.

Fair enough.  Please provide a patch against the master branch.
See http://orgmode.org/worg/org-contribute.html for details on
how to format the changelog entry properly.

Thanks,

-- 
 Bastien



Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-07-29 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Nicolas Goaziou  writes:
>
>> The benefit is that it becomes less clumsy to get rid of the title, when
>> you don't want any.
>
> You often want a title, you more rarely want no title.

That's true in my case. However, the title I want is never the file or
buffer name, although I sometimes want no title.

> AFAIU, using an empty #+TITLE: is the way to go right now,
> which seems good enough to me.
>
> What do you think?

It is "good enough", but the default value (without TITLE) is still
dubious. Anyway, this is a minor issue, if at all.


Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] [RFC] Deprecate `org-list-empty-line-terminates-plain-lists'

2014-07-29 Thread Bastien
Nicolas Goaziou  writes:

> Done. I'll write the patch once 8.3 is released.

Thanks a lot,

-- 
 Bastien



Re: [O] [bug, beamer] Frame parameters taken from example code block

2014-07-29 Thread Sebastien Vauban


Bastien wrote:
> Nicolas Goaziou  writes:
>
>> As a side note, "forbidding" blank lines between headlines and the
>> properties drawer (or better just after the planning line, if any) would
>> make parsing easier and faster in a lot of cases. Unfortunately, I think
>> this would break a lot of files, too.
>
> Well, we can poll users and see how inconvenient this change would be.
>
> (I'm certainly biased here, as I never use blank lines between the
> headline and the properties drawer.)
>
> If it's not too inconvenient, we can plan this for Org 9.0.

Sorry for taking too much time to answer, but I'm under constant flood
here, because of holiday times and the such.

First, please note I wouldn't flag the bug as being caused by a property
drawer detached from the headline. For me, the problem (in the ECM
I gave) is interpreting the contents of the Org code block (in the given
case: an headline with a property drawer following it).

I regard that "interpretation" of what's inside the Org code block as
the real cause of the problem. Maybe interpretation is not the right
term, but the code block should never be allowed to be scanned when
searching properties of the current headline IMHO.

Second, I neither never ever have property drawers separated from
headlines. I think that could be safely enforce, anyway, as all the
tools in Org (C-c C-x p, C-c C-x C-i, C-c C-s, C-c C-d, etc.) never make
such a case appear.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-07-29 Thread Nicolas Richard
Bastien  writes:
> Nicolas Goaziou  writes:
>> The benefit is that it becomes less clumsy to get rid of the title, when
>> you don't want any.
>
> You often want a title, you more rarely want no title.
>
> AFAIU, using an empty #+TITLE: is the way to go right now,
> which seems good enough to me.

I remember, I struggled with that problem. I don't know why though,
because it seems rather natural indeed.

Ah, I know : I was trying to export a subtree without a title, and I'm
not sure I managed to do it ! But perhaps that isn't related to the
issue at hand.

-- 
Nico.



[O] using .rtf on emacs

2014-07-29 Thread Renato Pontefice
Hi,
I need to handle .rtf (made by MS office)
Each time I try to handle them, I receive some errors.
Then, I need to export from MS Office and Open it from Libreoffice.
each time, I found that i.e. :
- I lost
- highlighted text
- bullet list
- if I set Arial text (in MS office) I have Times New Roman in LO

In conclusion: the two version are different.
so, I'm Thinking to handle those file, with a very low level sw (as emacs
is)

but, I don't know, how to handle .rtf on emacs.

Do exists a way to do that?

TIA

Renato


Re: [O] [bug, beamer] Frame parameters taken from example code block

2014-07-29 Thread Bastien


Hi Nicolas,

Nicolas Goaziou  writes:

> As a side note, "forbidding" blank lines between headlines and the
> properties drawer (or better just after the planning line, if any) would
> make parsing easier and faster in a lot of cases. Unfortunately, I think
> this would break a lot of files, too.

Well, we can poll users and see how inconvenient this change would be.

(I'm certainly biased here, as I never use blank lines between the
headline and the properties drawer.)

If it's not too inconvenient, we can plan this for Org 9.0.

-- 
 Bastien




Re: [O] Installing Org 8

2014-07-29 Thread SabreWolfy
This was a network/proxy issue. Emacs was also unable to contact GNU, but
displayed a default/cached (?) list of packages.




Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-07-29 Thread Rasmus
Bastien  writes:

> Hi Nicolas,
>
> Nicolas Goaziou  writes:
>
>> The benefit is that it becomes less clumsy to get rid of the title, when
>> you don't want any.
>
> You often want a title, you more rarely want no title.

I disagree.  If I want a title I'll be sure to type it out and the
file name is almost surely uninformative of this desired title.

> AFAIU, using an empty #+TITLE: is the way to go right now,
> which seems good enough to me.

I prefer the original ox.el behavior where no title in .org meant no
title in the exported document.  Together with good booktabs support,
it was one of my favorite features moving from the old exporter to ox.

—Rasmus

-- 
I feel emotional landscapes they puzzle me




Re: [O] [bug, beamer] Frame parameters taken from example code block

2014-07-29 Thread Nicolas Goaziou


Hello,

Bastien  writes:

> Nicolas Goaziou  writes:
>
>>> Maybe it's time to forbid blank lines between headlines and the
>>> properties drawer?  Or at least to discourage separating them in
>>> the manual?  Otherwise I don't have a steady solution at hand.
>>
>> I think this is fixed already.
>
> Okay, I didn't see any confirmation on the mailing list.

I probably forgot to confirm it. See
ab145f0df553e0bb77795c946ff158d8c069f6e4

As a side note, "forbidding" blank lines between headlines and the
properties drawer (or better just after the planning line, if any) would
make parsing easier and faster in a lot of cases. Unfortunately, I think
this would break a lot of files, too.


Regards,

-- 
Nicolas Goaziou0x80A93738




Re: [O] [RFC] Deprecate `org-list-empty-line-terminates-plain-lists'

2014-07-29 Thread Nicolas Goaziou
Bastien  writes:

> Nicolas Goaziou  writes:
>
>> Therefore, I suggest to mark it as deprecated in Org 8.3 release notes,
>> and remove it altogether in Org 8.4.
>>
>> WDYT?
>
> Fine for me, please go ahead,

Done. I'll write the patch once 8.3 is released.


Regards,

-- 
Nicolas Goaziou



Re: [O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Thorsten Jolitz
Thorsten Jolitz  writes:

> Xebar Saram  writes:

This is what I got in my init.el now (improved version with global
keybindings). And I like, will probably become one of those commands I
use all the time. 

I already used it to wrap the following code in 3 src-blocks:

#+begin_src emacs-lisp
(defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
  "Wrap sexp at point or region (point +-lines) in src block"
  (interactive
   (when current-prefix-arg
 (list
  (ido-completing-read "Org-Babel language: "
   (mapcar
(lambda (--lang)
  (symbol-name (car --lang)))
org-babel-load-languages)
   nil nil nil nil "emacs-lisp")
  (read-number "Number of lines to wrap: " 1
  (let* ((language (or lang "emacs-lisp"))
 (marker (point-marker))
 (beg (point))
 (bol (bolp))
 (end (if lines
  (save-excursion
(forward-line lines) (point))
(save-excursion
  (forward-sexp) (point
 (cut-strg (buffer-substring beg end)))
(delete-region beg end)
(goto-char (marker-position marker))
(insert
 (format
  "%s#+begin_src %s\n%s%s#+end_src\n"
  (if bol "" "\n")
  language
  cut-strg
  (if lines "" "\n")))
(set-marker marker nil)))
#+end_src

#+begin_src emacs-lisp
(global-set-key (kbd "C-c w l")
(lambda ()
  (interactive)
  (let ((current-prefix-arg '(4)))
 (call-interactively
  'tj/wrap-sexp-or-reg-in-src-block
#+end_src


#+begin_src emacs-lisp
(global-set-key (kbd "C-c w w")
'tj/wrap-sexp-or-reg-in-src-block)
#+end_src

-- 
cheers,
Thorsten




Re: [O] [Mac OS X] - Capture items not clocking-out upon refile

2014-07-29 Thread Bastien
Hi Hassan,

Hassan Dar  writes:

> When adding a task via org-capture (C-c c), as per Brent's system the
> capture item is clocked-in. Once the capture item is amended, if I do
> a 'C-c C-c' to save the task to the inbox, it clocks-out of the task
> as intended.
>
> However, if I choose instead to immediately refile the capture item
> (C-c C-w), the task is not clocked-out automatically upon choosing a
> refile destination, and instead remains clocked in until I manually
> clock-out (not intended behaviour).

This behavior seems normal to me.  Can you share the relevant parts
of your configuration and, ideally, provide a minimal recipe?

-- 
 Bastien



[O] Elisp function for wrapping sexp or region in src-block (was Re: some lisp help)

2014-07-29 Thread Thorsten Jolitz
Xebar Saram  writes:

> Thx and sorry about not posting to the list, was a gmail mistake (i
> really *need* to start with gnus..just to intimidating :))
>
> wrapping in parens by marking the region kinda defeats the purpose
> sine the original function i posted (in the original post) already
> wraps the marked text in an orgmode block :)
>
> thanks and sorry for PM

no problem since I really want this function too and was a bit
frustrated often enough that it does not exist in Org-mode, I made it
more flexible and generic now, for daily use:

#+begin_src emacs-lisp
(defun tj/wrap-sexp-or-reg-in-src-block (&optional lang lines)
  "Wrap sexp at point or region in src block"
  (interactive
   (when current-prefix-arg
 (list
  (ido-completing-read "Org-Babel language: "
   (mapcar
(lambda (--lang)
  (symbol-name (car --lang)))
org-babel-load-languages)
   nil nil nil nil "emacs-lisp")
  (read-number "Number of lines to wrap: " 1
  (let* ((language (or lang "emacs-lisp"))
 (marker (point-marker))
 (beg (point))
 (end (if lines
  (save-excursion
(forward-line lines) (point))
(save-excursion
  (forward-sexp) (point
 (cut-strg (buffer-substring beg end)))
(delete-region beg end)
(goto-char (marker-position marker))
(insert
 (format
  "\n#+begin_src %s\n%s\n#+end_src\n"
  language cut-strg))
(set-marker marker nil)))
#+end_src

try it with 

,
| C-u M-x tj/wrap-sexp-or-reg-in-src-block
`

and you get what you want (negative line-number wrap backwards).

> On Tue, Jul 29, 2014 at 3:42 PM, Thorsten Jolitz 
> wrote:
>
> Xebar Saram  writes:
> 
> why a PM???
> 
> 
> > Thx Thorsten
> >
> > this works very well for code blocks. it seems though that for
> normal
> > text paragraphs it dosent work that well. may i suggest an idea?
> can
> > the function perhaps prompt the user (when you launch the
> function)
> > for number of lines to wrap and then issue the wrap based on
> that?
> > that could perhaps be the most accurate way to do that? or maybe
> > perhaps have a separate function to just wrap current line?
> >
> > thx alot, appreciate as always your excellent help
> 
> 
> just wrap your paragraph in parens and call the command with point
> on
> the beginning paren, and it will work - for any number of lines.
> easy to do with package smartparens.el:
> 
> mark region and type '(', region is wrapped automatically.
> 
> 
> 
> > On Tue, Jul 29, 2014 at 3:21 PM, Thorsten Jolitz
> 
> > wrote:
> >
> >
> > Xebar Saram  writes:
> >
> > > Hi list
> > >
> > > so i know i should start to really learn lisp but real life
> (uni
> > work,
> > > family etc) doesn't really allow me so im marking my 1st year
> > > anniversary of using emacs without grasping lisp (plus i am in
> > > generally coding inept :))
> > >
> > > in any case :) i have this handy lisp snippet that i find
> > very
> > > useful and maybe some others in the list will find as well. it
> > allows
> > > to quick convert lines of text into org src/example blocks:
> > >
> > > (defun z-wrap-cblock-lisp ()
> > > "Wrap region in quote block"
> > > (interactive)
> > > (save-excursion
> > > (save-restriction
> > > (and
> > > (region-active-p)
> > > (use-region-p)
> > > (narrow-to-region (region-beginning) (region-end)))
> > > (goto-char (point-min))
> > > (insert "#+BEGIN_SRC emacs-lisp :results none\n")
> > > (goto-char (point-max))
> > > (insert "#+END_SRC\n")
> > > (deactivate-mark
> > >
> > > this works well but has some annoying flaws like you have to
> > first
> > > manually mark the region you want to convert etc
> > >
> > > i was wondering:
> > >
> > > a)can some lisp coding master show me how to make this
> function
> > auto
> > > select the line//X user defined lines/smart paragraph
> selection
> > before
> > > it wraps it in the org block
> > > b)any improvement ideas from the community?
> >
> >
> > Try this:
> >
> > #+begin_src emacs-lisp
> > (defun tj/wrap-sexp-in-elisp-src-block ()
> > "Wrap sexp at point in elisp src block"
> > (interactive)
> > (let* ((marker (point-marker))
> > (beg (point))
> > (end (save-excursion
> > (forward-sexp) (point)))
> > (cut-strg (buffer-substring beg end)))
> > (delete-region beg end)
> > (goto-char (marker-position marker))
> > (insert
> > (format
> > "\n#+begin_src emacs-lisp\n%s\n#+end_src\n"
> > cut-strg))
> > (set-marker marker nil)))
>  

Re: [O] org-table-edit-formulas misbehaving in 8.2.7b

2014-07-29 Thread Bastien
Hi Nick,

Nick Dokos  writes:

> I think this was another instance of the bug that was fixed with
> commit c9613c0cad40c9d901609abcb8e9527c85cb9eb3. At least, I assumed
> so and I haven't heard anything to contradict that.

I guess you're right, thanks for following up,

-- 
 Bastien



Re: [O] Regex Speedup for org-refresh-category-properties.

2014-07-29 Thread Bastien
Hi Malcolm,

Malcolm Purvis  writes:

> I use the master version of org, and some months ago the time required
> to generate my custom agenda view sky rocketed.  I've found that 90% of
> the time was being spent in the call to re-search-forward in
> org-refresh-category-properties.  The patch below speeds up the regular
> expression search and makes the generation of my agenda as fast as
> before.

Applied, thanks!

-- 
 Bastien



Re: [O] A gentle introduction to Emacs & Org-mode?

2014-07-29 Thread Jorge A. Alfaro-Murillo

Thanks John,

The links to the other videos are broken. I think that the 
addresses have %3D instead of an equal sign (=).


Best,

Jorge.





Re: [O] [PATCH] Remove unecesssary invocations of org-mode in ox-publish

2014-07-29 Thread Bastien
Hi Matt,

Matt Lundin  writes:

> This patch fixes a bug in which org-publish makes the following
> call...

Applied, thanks!

-- 
 Bastien



Re: [O] Babel-R TBLFM example

2014-07-29 Thread Bastien
Hi Shiyuan,

Shiyuan  writes:

> Thanks Bastien. I see ob-R.el from org-mode repos has been updated.
> So is the org-R from git-repos ready to use? Could you suggest  a
> good place to start learning the new org-R? The source file ob-R.el?

The recent committers to ob-R.el we be more in a position to help here
but yes, reading the source is certainly a good start.

I hope we will have a clear picture of what changed in ob-R.el in 8.3,
together with updated tutorials.

Best,

-- 
 Bastien



Re: [O] Bug: org table updates [8.2.7 (8.2.7-elpaplus @ /Users/ctanis/.emacs.d/elpa/org-plus-contrib-20140613/)]

2014-07-29 Thread Craig Tanis
Great news!
How about org-table-cell-blank-triggers ?
On Jul 28, 2014 1:25 PM, "Bastien"  wrote:

> Hi Craig,
>
> Craig Tanis  writes:
>
> > Specifically, there's a line in `org-self-insert-command' that checks
> > `last-command' against a list of table movement functions to see if
> > auto-blank-field should occur.  This list includes
> > `yas/expand' -- obsolesced in yasnippet 0.8, in favor of
> > `yas-expand'.
>
> It uses yas-expand now.
>
> > In my opinion, this list should be a configurable variable, as other
> > minor modes may introduce functions that should also trigger auto-blank
> > behavior.  I also check for `autopair-newline' here, since this is the
> > binding for RET when autopair-mode is active.
>
> I could not come up with a good name for an option, which should
> probably start with "org-table-" -- if you have an idea, please let
> me know.
>
> Thanks,
>
> --
>  Bastien
>


Re: [O] [babel][PATCHES] exporting inline source code

2014-07-29 Thread Bastien
Hi Nicolas,

Nicolas Berthier  writes:

> I will investigate on this ASAP, and notice you when I receive
> a confirmation that the FSF signed it.

Thanks, we should expect longer delays during the summer I guess.

-- 
 Bastien



Re: [O] [bug, beamer] Frame parameters taken from example code block

2014-07-29 Thread Bastien


Hi Nicolas,

Nicolas Goaziou  writes:

>> Maybe it's time to forbid blank lines between headlines and the
>> properties drawer?  Or at least to discourage separating them in
>> the manual?  Otherwise I don't have a steady solution at hand.
>
> I think this is fixed already.

Okay, I didn't see any confirmation on the mailing list.

Thanks,

-- 
 Bastien




Re: [O] [Mac OS X] - Capture items not clocking-out upon refile

2014-07-29 Thread Hassan Dar
Hello Bastien, 

org-version returns:

Org-mode version 8.2.6 (8.2.6-6-gfc37d1-elpa 


On Sunday, 27 July 2014 at 12:29, Bastien wrote:

> Hi Hassan,
> 
> > I am running Mac OS X 10.8 (Mountain Lion) and emacs 24.3.
> 
> What is your Org version?
> 
> Please report what M-x org-version RET says.
> 
> Thanks,
> 
> -- 
> Bastien




Re: [O] how to use :options-alist in org-export-define-derived-backend ?

2014-07-29 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> The benefit is that it becomes less clumsy to get rid of the title, when
> you don't want any.

You often want a title, you more rarely want no title.

AFAIU, using an empty #+TITLE: is the way to go right now,
which seems good enough to me.

What do you think?

-- 
 Bastien



Re: [O] some lisp help (for complete 0-knowledge lisp emacs user :))

2014-07-29 Thread Xebar Saram
Thx and sorry about not posting to the list, was a gmail mistake (i really
*need* to start with gnus..just to intimidating :))

wrapping in parens by marking the region kinda defeats the purpose sine the
original function i posted (in the original post) already wraps the marked
text in an orgmode block :)

thanks and sorry for PM

Z




On Tue, Jul 29, 2014 at 3:42 PM, Thorsten Jolitz  wrote:

> Xebar Saram  writes:
>
> why a PM???
>
> > Thx Thorsten
> >
> > this works very well for code blocks. it seems though that for normal
> > text paragraphs it dosent work that well. may i suggest an idea? can
> > the function perhaps prompt the user (when you launch the function)
> > for number of lines to wrap and then issue the wrap based on that?
> > that could perhaps be the most accurate way to do that? or maybe
> > perhaps have a separate function to just wrap current line?
> >
> > thx alot, appreciate as always your excellent help
>
> just wrap your paragraph in parens and call the command with point on
> the beginning paren, and it will work - for any number of lines.
> easy to do with package smartparens.el:
>
> mark region and type '(', region is wrapped automatically.
>
> > On Tue, Jul 29, 2014 at 3:21 PM, Thorsten Jolitz 
> > wrote:
> >
> >
> > Xebar Saram  writes:
> >
> > > Hi list
> > >
> > > so i know i should start to really learn lisp but real life (uni
> > work,
> > > family etc) doesn't really allow me so im marking my 1st year
> > > anniversary of using emacs without grasping lisp (plus i am in
> > > generally coding inept :))
> > >
> > > in any case :) i have this handy lisp snippet that i find
> > very
> > > useful and maybe some others in the list will find as well. it
> > allows
> > > to quick convert lines of text into org src/example blocks:
> > >
> > > (defun z-wrap-cblock-lisp ()
> > > "Wrap region in quote block"
> > > (interactive)
> > > (save-excursion
> > > (save-restriction
> > > (and
> > > (region-active-p)
> > > (use-region-p)
> > > (narrow-to-region (region-beginning) (region-end)))
> > > (goto-char (point-min))
> > > (insert "#+BEGIN_SRC emacs-lisp :results none\n")
> > > (goto-char (point-max))
> > > (insert "#+END_SRC\n")
> > > (deactivate-mark
> > >
> > > this works well but has some annoying flaws like you have to
> > first
> > > manually mark the region you want to convert etc
> > >
> > > i was wondering:
> > >
> > > a)can some lisp coding master show me how to make this function
> > auto
> > > select the line//X user defined lines/smart paragraph selection
> > before
> > > it wraps it in the org block
> > > b)any improvement ideas from the community?
> >
> >
> > Try this:
> >
> > #+begin_src emacs-lisp
> > (defun tj/wrap-sexp-in-elisp-src-block ()
> > "Wrap sexp at point in elisp src block"
> > (interactive)
> > (let* ((marker (point-marker))
> > (beg (point))
> > (end (save-excursion
> > (forward-sexp) (point)))
> > (cut-strg (buffer-substring beg end)))
> > (delete-region beg end)
> > (goto-char (marker-position marker))
> > (insert
> > (format
> > "\n#+begin_src emacs-lisp\n%s\n#+end_src\n"
> > cut-strg))
> > (set-marker marker nil)))
> > #+end_src
> >
> > #+results:
> > : tj/wrap-sexp-in-elisp-src-block
> >
> > MWE:
> >
> > (defun foo ()
> > "do foo"
> > (message "foo"))
> >
> > 1. with point at the opening paren:
> >
> >
> > #+begin_src emacs-lisp
> > (defun foo ()
> > "do foo"
> > (message "foo"))
> > #+end_src
> >
> > 2. with point at the 'd' of defun:
> >
> > (
> > #+begin_src emacs-lisp
> > defun
> > #+end_src
> > foo ()
> > "do foo"
> > (message "foo"))
> >
> > 3. with point between 'do foo':
> >
> > (defun foo ()
> > "do
> > #+begin_src emacs-lisp
> > foo
> > #+end_src
> > "
> > (message "foo"))
> >
> >
> > This is actually quite useful, will add it to my init file (since
> > I
> > frequently get 'org-babel-demarcate-block: Args out of range'
> > errors
> > when trying to wrap a region).
> >
> > Note that the behaviour depends a bit on the major-mode. In
> > emacs-lisp
> > mode, a string is seen as one sexp, thus with point at the first
> > double-quote of
> >
> > "hello world"
> >
> > I get
> >
> > #+begin_src emacs-lisp
> > "hello world"
> > #+end_src
> >
> > while in this message-mode buffer I get
> >
> > #+begin_src emacs-lisp
> > "hello
> > #+end_src
> > world"
> >
> > --
> > cheers,
> > Thorsten
> >
> >
> >
> >
>
> --
> cheers,
> Thorsten
>


Re: [O] some lisp help (for complete 0-knowledge lisp emacs user :))

2014-07-29 Thread Thorsten Jolitz
Xebar Saram  writes:

> Hi list
>
> so i know i should start to really learn lisp but real life (uni work,
> family etc) doesn't really allow me so im marking my 1st year
> anniversary of using emacs without grasping lisp (plus i am in
> generally coding inept :))
>
> in any case :) i have this handy lisp snippet that i find very
> useful and maybe some others in the list will find as well. it allows
> to quick convert lines of text into org src/example blocks:
>
> (defun z-wrap-cblock-lisp ()
> "Wrap region in quote block"
> (interactive)
> (save-excursion
> (save-restriction
> (and
> (region-active-p)
> (use-region-p)
> (narrow-to-region (region-beginning) (region-end)))
> (goto-char (point-min))
> (insert "#+BEGIN_SRC emacs-lisp :results none\n")
> (goto-char (point-max))
> (insert "#+END_SRC\n")
> (deactivate-mark
>
> this works well but has some annoying flaws like you have to first
> manually mark the region you want to convert etc
>
> i was wondering:
>
> a)can some lisp coding master show me how to make this function auto
> select the line//X user defined lines/smart paragraph selection before
> it wraps it in the org block
> b)any improvement ideas from the community?

Try this:

#+begin_src emacs-lisp
  (defun tj/wrap-sexp-in-elisp-src-block ()
"Wrap sexp at point in elisp src block"
(interactive)
(let* ((marker (point-marker))
   (beg (point))
   (end (save-excursion
  (forward-sexp) (point)))
   (cut-strg (buffer-substring beg end)))
  (delete-region beg end)
  (goto-char (marker-position marker))
  (insert
   (format
"\n#+begin_src emacs-lisp\n%s\n#+end_src\n"
cut-strg))
  (set-marker marker nil)))
#+end_src

#+results:
: tj/wrap-sexp-in-elisp-src-block

MWE:

(defun foo ()
  "do foo"
   (message "foo"))

1. with point at the opening paren:


#+begin_src emacs-lisp
(defun foo ()
  "do foo"
   (message "foo"))
#+end_src

2. with point at the 'd' of defun:

(
#+begin_src emacs-lisp
defun
#+end_src
 foo ()
  "do foo"
   (message "foo"))

3. with point between 'do foo':

(defun foo ()
  "do
#+begin_src emacs-lisp
 foo
#+end_src
"
   (message "foo"))


This is actually quite useful, will add it to my init file (since I
frequently get 'org-babel-demarcate-block: Args out of range' errors
when trying to wrap a region).

Note that the behaviour depends a bit on the major-mode. In emacs-lisp
mode, a string is seen as one sexp, thus with point at the first
double-quote of 

"hello world"

I get

#+begin_src emacs-lisp
"hello world"
#+end_src

while in this message-mode buffer I get

#+begin_src emacs-lisp
"hello
#+end_src
 world"

-- 
cheers,
Thorsten




[O] hiding intrusive target-markups-brackets ++ Re: org-special-keyword face not showing in sublevels anymore since commit 69700e1

2014-07-29 Thread mc
Hello again Bastien,

thanx for the fix!

Please allow me to shortly direct your attention to an open, 
still uncommented 'feature request’ addressing an optional
‘fontification' or ‘hiding' of the some kind of intrusive 
target-markups-brackets ( <<  >> ), 
just like this is done with the org-link brackets ( [[ ]] ).

The first reference that was expressing this desire, I found here:

http://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00379.html

Or could there be posted some hint how to best hack this as a private solution?

All best,
mc

On 28 Jul 2014, at 17:04, Bastien  wrote:

> Hi Martin,
> 
> mc  writes:
> 
>> 2nd screenshot 
>> org-special-keyword_face_example_after_commit_69700e1.png
>> shows all ‘COMMENT’ keywords as grey only at the top outline level. 
>> 
>> I hope this clarifies the case.
> 
> Yes it does!  This is now fixed, thanks,
> 
> -- 
> Bastien




[O] some lisp help (for complete 0-knowledge lisp emacs user :))

2014-07-29 Thread Xebar Saram
Hi list

so i know i should start to really learn lisp but real life (uni work,
family etc) doesn't really allow me so im marking my 1st year anniversary
of using emacs without grasping lisp (plus i am in generally coding inept
:))

in any case :) i have this handy lisp snippet that i find very useful
and maybe some others in the list will find as well. it allows to quick
convert lines of text into org src/example blocks:

(defun z-wrap-cblock-lisp ()
   "Wrap region in quote block"
   (interactive)
   (save-excursion
 (save-restriction
   (and
(region-active-p)
(use-region-p)
(narrow-to-region (region-beginning) (region-end)))
(goto-char (point-min))
(insert "#+BEGIN_SRC emacs-lisp :results none\n")
(goto-char (point-max))
(insert "#+END_SRC\n")
(deactivate-mark


this works well but has some annoying flaws like you have to first manually
mark the region you want to convert etc

i was wondering:

a)can some lisp coding master show me how to make this function auto select
the line//X user defined lines/smart paragraph selection before it wraps it
in the org block
b)any improvement ideas from the community?

thx alot in advance

Z


  1   2   >