Re: [O] Inserted Heading Starts on Prior Heading's Fold Mark

2015-04-07 Thread John Hendy
On Mon, Apr 6, 2015 at 6:41 PM, Nicolas Goaziou m...@nicolasgoaziou.fr wrote:

 Fixed in edeb7fd8e17733cc516fbb6620a21092bac0d765. Thank you.


Awesome! Just confirmed that re-enabling =(setq
org-blank-before-new-entry nil)= now works perfectly for me.

Thanks,
John

 Regards,

 --
 Nicolas Goaziou




Re: [O] pdf screen reader accessibility?

2015-04-07 Thread Rasmus
Hi,

Jude DaShiell jdash...@panix.com writes:

 Let's try this with a slightly better url.
 http://webstandards.sonoma-county.org/content.aspx?sid=1014id=1123#Content

From the above url

Title field: Enter a meaningful name for the document.

Use #+TITLE.


 Author field

Use #+AUTHOR.

 Subject field

Use #+DESCRIPTION

 Set the appropriate language

Use #+LANGUAGE

 Add Tags to Document tool 

Use #+KEYWORDS, I guess?

 Correct All Issues from Add Tags Report – All issues listed in the
 Accessibility section of the Add Tags Report must be corrected to make
 the file accessible.

I don't know what this is.

 Manually Tag – If you need to manually tag a section of a PDF page, use
 the TouchUp Reading Order Tool.

Not possible.

 Tagging PDF Content as a Table

I don't know what this is, and there's no text

 [More stuff about manual stuff]

 Step 5 - The Accessibility Statement

Feel free to do so.  You could customize org-latex-title-command.

 Step 6 - Add Descriptive Text to Images

Not possible ATM but you can add captions.  If a LaTeX package exists for
this, alttext could be added to images.

 Verify and Correct the Reading Order
 Verify Accessibility

I don't know how to do this.

 Optimization and Compatibility

There's a LaTeX options for optimization, I think, but it is not on by
default, but you could add it to org-latex-default-packages.

 Redact Personal and Private Information

See how to add metadata in the top of the file.

Hope it helps,
Rasmus


-- 
Send from my Emacs




Re: [O] Hiding blocked TODO items

2015-04-07 Thread Samuel Loury
Dear Nikolaus,

Nikolaus Rath nikol...@rath.org writes:

 Is there a way to have TODO items blocking each other?

 For example, if I have this document:

 * TODO Pay water
   :PROPERTIES:
:blocked-on: checks
   :END:
 * TODO Pay electricity
   :PROPERTIES:
:blocked-on: checks
   :END:
 * TODO Get new checks
   :PROPERTIES:
:id: checks
   :END:

 Then I'd like the first two TODO items not to show up in the agenda
 until the third one is DONE (but I don't much care if the items can be
 manually switched to DONE or not).

 I looked at org-depend.el but as far as I can tell, it only allows to
 set up chains of dependencies, i.e. I could have Pay Water and Pay
 electricity in state NEXT, and have a trigger in Get new checks that
 would switch one, but not both, of the NEXT items to TODO.

 Do I understand that correctly? Is there some other way to achieve what
 I want?

I think that the dependency could be declared using org-depend but with
the BLOCKER keyword instead of the TRIGGER one. To allow the elements to
still be set to DONE, you could use the NOBLOCKING keyword.

Then, in the agenda view, you could use the org-agenda-skip-function
variable and put something like org-depend-block-todo that would
indicate to skip the blocked items. Sorry to be to lazy to write the
code here...

The outline would look like this:
--8---cut here---start-8---
* TODO Pay water
  :PROPERTIES:
  :BLOCKER: checks
  :NOBLOCKING: t
  :END:
* TODO Pay electricity
  :PROPERTIES:
  :BLOCKER: checks
  :NOBLOCKING: t
  :END:
* TODO Get new checks
  :PROPERTIES:
  :id: checks
  :END:
--8---cut here---end---8---

Having at the same time BLOCKER and NOBLOCKING appears a bit confusing
to me. May be it is not a so good solution and an org-mode guru will
probably correct me :-).

Hoping this was useful.

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


signature.asc
Description: PGP signature


[O] pdf screen reader accessibility?

2015-04-07 Thread Jude DaShiell

Let's try this with a slightly better url.
http://webstandards.sonoma-county.org/content.aspx?sid=1014id=1123#Content
My point is blind people that go down the emacs route when learning linux 
get introduced to org-mode as part of that process.  If they colaborate 
with other blind emacs users on a job that requires them to use pdf files 
as colaboration documents, are those blind emacs and org-mode users going 
to be able to read each other's official documents and have management 
that required the use of pdf documents in the first place also able to 
read those documents?
I take it there's no problem using adobe reader on windows to read an 
org-exported pdf file.  I may have to use windows and adobe reader on 
windows and find an org-mode pdf-export file and do a full accessibility 
check on it with windows before this question gets answered.  Thanks for 
your time and interest.




-- Twitter: JudeDaShiell




Re: [O] [PATCH] lisp/ob-sql.el: add support for :dbport parameter

2015-04-07 Thread Nicolas Goaziou
Hello,

Saulius Menkevičius saulius.menkevic...@gmail.com writes:

 This (tiny) patch implements ability to set dbport for org-babel sql
 functionality. I often use ssh port forwarding to connect to remote
 mysql servers where port is mapped to non-standard one on local
 machine.

Thank you.

 This is my first patch, below the 15 line threshold.

 From ca3f85877bdf406deefaf66cbac3483a7e41f134 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= saulius.menkevic...@gmail.com
 Date: Mon, 6 Apr 2015 23:13:06 +0300
 Subject: [PATCH] ob-sql: Add possibility to set dbport

  * lisp/ob-sql.el: will now recognize dbport parameter. Currently it
is supported for mysql engine only.

You need to also specify what functions are modified, e.g.,

* lisp/ob-sql.el (org-babel-sql-dbstring-mysql): Change signature.

 +(defun org-babel-sql-dbstring-mysql (host port user password database)
Make MySQL cmd line args for database connection.  Pass nil to omit that 
 arg.
(combine-and-quote-strings
 (delq nil
(list (when host (concat -h host))
 +(when port (concat -P (number-to-string port)))

Isn't PORT a string already?

   (dbhost (cdr (assoc :dbhost params)))
 + (dbport (cdr (assoc :dbport params)))

Nitpick: `assoc' - `assq'


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] Improve org-table-convert-region in order to use any string as separator

2015-04-07 Thread Francesco Pizzolante
Hi,

European CSV files may use semi-colon as separator. As it was missing in
`org-table-convert-region', I improved it in order to define any string
as separator.

Best regards,
 Francesco

From: Francesco Pizzolante f...@missioncriticalit.com
Date: Tue, 7 Apr 2015 11:53:45 +0200
Subject: [PATCH] Improve org-table-convert-region in order to use any string
 as separator

* org-table.el (org-table-convert-region): Improve
`org-table-convert-region' in order to use any string as
separator. Remove useless line of code.

---
 lisp/org-table.el | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 30a66c9..985a877 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1,6 +1,6 @@
 ;;; org-table.el --- The table editor for Org-mode
 
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik carsten at orgmode dot org
 ;; Keywords: outlines, hypermedia, calendar, wp
@@ -548,6 +548,7 @@ following values:
 '(4) Use the comma as a field separator
 '(16)Use a TAB as field separator
 integer  When a number, use that many spaces as field separator
+string   When a string, use that string as field separator
 nil  When nil, the command tries to be smart and figure out the
  separator in the following way:
  - when each line contains a TAB, assume TAB-separated material
@@ -585,15 +586,17 @@ nil  When nil, the command tries to be smart and 
figure out the
   ((looking-at [ \t]*,) (replace-match  | ))
   (t (beginning-of-line 2
   (setq re (cond
-   ((equal separator '(4)) ^\\|\?[ \t]*,[ \t]*\?)
((equal separator '(16)) ^\\|\t)
((integerp separator)
 (if ( separator 1)
 (user-error Number of spaces in separator must be = 1)
   (format ^ *\\| *\t *\\| \\{%d,\\} separator)))
+((stringp separator)
+ (format ^\\|%s separator))
(t (error This should not happen
-  (while (re-search-forward re end t)
-   (replace-match |  t t)))
+  (let (case-fold-search)
+(while (re-search-forward re end t)
+  (replace-match |  t t
 (goto-char beg)
 (org-table-align)))
 
-- 
2.1.4



Re: [O] [PATCH] Improve org-table-convert-region in order to use any string as separator

2015-04-07 Thread Nicolas Goaziou


Hello,

Francesco Pizzolante
fpz-djc/ipccudyqhejpep6iedvlejwur...@public.gmane.org writes:

 European CSV files may use semi-colon as separator. As it was missing in
 `org-table-convert-region', I improved it in order to define any string
 as separator.

Thank you. 

However `org-table-convert-region' already supports regexp as
a parameter in development version, so your patch is not needed.

Regards,

-- 
Nicolas Goaziou




Re: [O] Best practices to get reminders?

2015-04-07 Thread Marcin Borkowski

On 2015-04-07, at 06:09, Eric Abrahamsen e...@ericabrahamsen.net wrote:

 At this point I have so much of my life (personal and professional) in
 Org files that yes, checking the Agenda isn't an issue anymore. It's the
 first thing I do in the morning, and the last thing I do before knocking
 off at the end of the day.

I second that, with the exception that I use something else this way (I
cannot tell what on this list;-)), and one of the reminders in
that-other-thing is check the agenda for today before 12:00 am (and
I usually do it much earlier).  As soon as I find some time to integrate
this-other-thing with Org-mode, I might as well go the
check-the-agenda-every-hour route.

 If you're someone who restarts Emacs each morning, you could put a call
 to `org-agenda' in your init file. The others have mentioned
 `org-agenda-to-appt', but I find that if you're really using Org to
 manage your time (checking where you are in the midst of longer
 projects, clocking, surveying the week ahead, etc) then you'll want to
 be looking at the Agenda every day.

I used to do that, too, but (1) sometimes I started Emacs when
e.g. making a presentation and having my laptop attached to an overhead
projector and (2) some time ago I almost stopped restarting Emacs,
I just have it open all the time (well, I /did/ restart it sometimes,
say, once a week or two).

 Eric

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



[O] batch export one file to ics

2015-04-07 Thread OSiUX
Hi!

In the past, I used this command for export ICS:

  /usr/bin/emacs --batch -q --directory=/home/osiris/org \
--visit=/home/osiris/org/print3d.org \
--eval '(org-export-icalendar-this-file)'

Now does not work, even changing to function
org-icalendar-export-to-ics:

  /usr/bin/emacs --batch -q --directory=/home/osiris/org \
--visit=/home/osiris/org/print3d.org \
--eval '(org-icalendar-export-to-ics)'

How should I?
Thanks!

-- 

::

  Osiris Alejandro Gomez (OSiUX) os...@osiux.com.ar
  DC44 95D2 0D5D D544 FC1A F00F B308 A671 9237 D36C
  http://www.osiux.com.ar http://www.altermundi.net


signature.asc
Description: Digital signature


Re: [O] Define Keyboard Shortcut for Open in Emacs

2015-04-07 Thread Rainer M Krug
jorge.alfaro-muri...@yale.edu (Jorge A. Alfaro-Murillo) writes:

 Rainer M Krug writes:

 I would like to open pdfs in emacs (using pdf-viewer) but there 
 is only a shortcut (C-c C-o) to open a pdf externally, and no 
 shortcut for the menu item below Open in Emacs in the context 
 menu. 
 
 How can I define a shortcut for this command (or re-use C-c 
 C-o)?

 If you want C-c C-o to open in emacs, you can configure your 
 org-file-apps:

 #+BEGIN_SRC emacs-lisp
   (eval-after-load org
 '(if (assoc \\.pdf\\' org-file-apps)
  (setcdr (assoc \\.pdf\\' org-file-apps) 'emacs)
(add-to-list 'org-file-apps '(\\.pdf\\' . 'emacs) t)))
 #+END_SRC

Good idea - I will keep this in mind and see.


 Alternatively, if you are on Linux, you could make your 
 emacsclient your default pdf-viewer:

Nope - Mac.

Thanks,

Rainer


 #+BEGIN_SRC shell
   xdg-mime default emacsclient.desktop application/pdf
 #+END_SRC

 Then the external program called by C-c C-o would also be emacs =)

 Best,

-- 
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


signature.asc
Description: PGP signature


Re: [O] Define Keyboard Shortcut for Open in Emacs

2015-04-07 Thread Rainer M Krug
John Kitchin jkitc...@andrew.cmu.edu writes:

 I find C-u RET on a link will open a pdf in emacs. or C-u C-c C-o

Thanks - C-u C-c C-o works for me

Rainer


 Rainer M Krug writes:

 Hi

 I would like to open pdfs in emacs (using pdf-viewer) but there is only
 a shortcut (C-c C-o) to open a pdf externally, and no shortcut for the
 menu item below Open in Emacs in the context menu.

 How can I define a shortcut for this command (or re-use C-c C-o)?
 Thanks

 Rainer

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

-- 
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


signature.asc
Description: PGP signature


Re: [O] Best practices to get reminders?

2015-04-07 Thread Melleus
If you have an android phone, then you can use mobile-org for that. You
would have all your org information available even on the road.




[O] Problems with Hyperlinks containing backslashes

2015-04-07 Thread Elwood151
Im working with Emacs 24.4.1 and org-mode 8.2.10 on Windows 7.

I have to use hyperlinks to our network servers like servernamedir1dir2 and unfortunately I can not use them in hyperlinks in Emacs org-mode, I then get the error:



Debugger entered--Lisp error: (error ShellExecute failed: Das System kann die angegebene Datei nicht finden.)
 w32-shell-execute(open servernamedir1dir2)
 eval((w32-shell-execute open file))



It seems that Emacs automatically replaces each backslash with a double backslash.

How can I change that so that it is working?



Kind regards



Martin





Re: [O] Best practices to get reminders?

2015-04-07 Thread Giuseppe Lipari
I use mobile org, and I synchronize it with google agenda.
It works fine because I can look at my phone for appointments when I am not
in front on my PC.
Once the appointment is in google agenda, I can set reminders, but I could
not find out how to do that directly from org-mode in emacs.
Any suggestion for this last one thing is welcome.

Giuseppe

2015-04-07 16:19 GMT+02:00 Melleus mell...@openmailbox.org:

 If you have an android phone, then you can use mobile-org for that. You
 would have all your org information available even on the road.





-- 
Giuseppe Lipari
LIFL
Université de Lille 1
blogs: http://scacciamennule.blogspot.com  (Italian)
http://scacciamennule.blogspot.com
  http://okpanico,wordpress.com  (Italian)
  http://algoland.wordpress.com   (English)


Re: [O] Function that splits a CLOCK interval

2015-04-07 Thread Christoph LANGE

Hi Peter,

Peter Frings on 2015-04-01 12:37:

The following function now automates the task of splitting:
…


Fantastic, just what I needed!


thanks for your feedback!

I have now made a few improvements but not yet found time to get started 
with contributing the code to Worg, so one more email with the 
improvements.



One little thing, though. When I interrupt the function with C-g at the prompt, 
the current line is already duplicated. It would by nice that C-g left the 
buffer unchanged.


Done, see code below.  Plus, the function now accepts a prefix argument 
and works with active time stamps.  When a prefix argument is given, the 
interactive editing of the timestamp uses C as a default before changing 
A--C into A--B B--C.


Cheers,

Christoph

--- % --- % --- % --- % --- % --- % --- % --- % --- % --- % ---

  (defun org-clock-split-current-interval (end-as-default)
If this is a CLOCK line, split its clock time interval into two.
Let the current time interval be A--C.  By default, this function 
interactively prompts for a time B (suggesting A as a default), and then 
replaces A--C by B--C and A--B.  When called with a prefix argument, the 
function uses C as a default for B.  The point is left on the later 
interval, so that this line can, e.g., be moved to another entry.

(interactive P)
(save-excursion
  ;; Part of the following code is copied from 
org-clock-update-time-maybe.
  ;; If this function becomes part of org-clock.el, some 
refactoring would be in order.

  (beginning-of-line nil)
  (skip-chars-forward  \t)
  (when (looking-at org-clock-string)
(beginning-of-line nil)
(let ((re (concat \\([ \t]* org-clock-string  *\\)

\\([[][^]]+[]]\\)\\(-+\\)\\([[][^]]+[]]\\)
  \\(?:[ \t]*=.*\\)?)))
  (when (looking-at re)
(let ((indentation (match-string 1))
  (start (match-string 2))
  (to (match-string 3))
  (end (match-string 4))
  (use-start-as-default (equal end-as-default nil)))
  ;; interactively change A--C to B--C,
  ;; or (given prefix argument) to A--B, …
  (re-search-forward (concat org-clock-string  \\([[]\\)))
  (when (not use-start-as-default) (re-search-forward 
\\([[]\\)))
  ;; … respecting whether A or C is an active or an 
inactive timestamp

  (call-interactively (if (equal (match-string 1) )
'org-time-stamp
  'org-time-stamp-inactive))
  ;; If there were a function that implemented the actual 
body of org-clock-update-time-maybe, we could call that function, as in 
this context we _know_ that we are on a CLOCK line.

  (org-clock-update-time-maybe)
  ;; copy changed time B
  (re-search-backward org-ts-regexp-both)
  (let ((middle (match-string 0)))
;; insert A--B below, or (given prefix argument) insert 
B--C above

(end-of-line (if use-start-as-default 1 0))
(insert \n indentation
(if use-start-as-default start middle)
to
(if use-start-as-default middle end))
(org-clock-update-time-maybe

--
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

→ Semantic Publishing Challenge: Assessing the Quality of Scientific Output
  ESWC, 31 May–4 June 2014, Portorož, Slovenia. 
https://tinyurl.com/SPChallenge15

  Submission deadline 27 March (abstracts: 20 March)



Re: [O] Best practices to get reminders?

2015-04-07 Thread Melleus
Then I do not quite understand you, sorry for noise.

I have my phone with me even when I'm working on my PC and reminders
only from the phone are enough for me. And more likely I get the phone
with me rather then a PC, when going out for a coffee.




[O] How to avoid figure numbering in html export

2015-04-07 Thread Simon W. Jones
Hello there,

I suspect this is straight forward, but I don't seem to be able to work
it out on my own.

I use Org to to make a large html document that contains a number of
images. I export the document and under each image I get something like:

Figure 6: Name of image.

How can I have simply Name of image without the prefix Figure n:?

Many thanks.

Simon.

-- 
  Simon W. Jones



Re: [O] How to avoid figure numbering in html export

2015-04-07 Thread Rasmus
Hi,

Simon W. Jones swjo...@fastmail.fm writes:

 I suspect this is straight forward, but I don't seem to be able to work
 it out on my own.

 I use Org to to make a large html document that contains a number of
 images. I export the document and under each image I get something like:

 Figure 6: Name of image.

 How can I have simply Name of image without the prefix Figure n:?

You could use a filter, probably org-export-filter-link-functions(?).
Alternatively you could mess with org-export-dictionary for the language
you are concerned about.

Perhaps, the dictionary should be amendable via ox-publish for such cases.

Cheers,
Rasmus

-- 
Send from my Emacs




Re: [O] How to avoid figure numbering in html export

2015-04-07 Thread Simon Jones
Thanks for the prompt reply Rasmus. 

I thought it might be easier than this :-(. I don't really understand enough to 
fix it.

All the best,
Simon.

---

 On 7 Apr 2015, at 17:12, Rasmus ras...@gmx.us wrote:
 
 Hi,
 
 Simon W. Jones swjo...@fastmail.fm writes:
 
 I suspect this is straight forward, but I don't seem to be able to work
 it out on my own.
 
 I use Org to to make a large html document that contains a number of
 images. I export the document and under each image I get something like:
 
 Figure 6: Name of image.
 
 How can I have simply Name of image without the prefix Figure n:?
 
 You could use a filter, probably org-export-filter-link-functions(?).
 Alternatively you could mess with org-export-dictionary for the language
 you are concerned about.
 
 Perhaps, the dictionary should be amendable via ox-publish for such cases.
 
 Cheers,
 Rasmus
 
 -- 
 Send from my Emacs
 
 



Re: [O] [PATCH] lisp/ob-sql.el: add support for :dbport parameter

2015-04-07 Thread Saulius Menkevičius

Xavier Maillard writes:

 Saulius Menkevičius saulius.menkevic...@gmail.com writes:

 This (tiny) patch implements ability to set dbport for org-babel sql
 functionality. I often use ssh port forwarding to connect to remote
 mysql servers where port is mapped to non-standard one on local machine.

 This is my first patch, below the 15 line threshold.

 Seems good AFAICS.

 Do you often use orgmode, BABEL and sql all together ? (just curious
 as I am a DBA in real life).

I am not a DBA by trade, it is just that I found out that
developing web app features this way is more structured than keeping
SQL plus the rest of the code all over the filesystem when prototyping.

But then I use it to do a 'show processlist' on my SQL servers with a
C-c C-c which is always pleasant, but it is probably not what real DBAs
for monitoring..


 -- Xavier.

-- 
Saulius Menkevičius (saulius.menkevic...@gmail.com)



Re: [O] [PATCH] lisp/ob-sql.el: add support for :dbport parameter

2015-04-07 Thread Saulius Menkevičius

Nicolas Goaziou writes:

 Hello,

 Saulius Menkevičius saulius.menkevic...@gmail.com writes:

 This (tiny) patch implements ability to set dbport for org-babel sql
 functionality. I often use ssh port forwarding to connect to remote
 mysql servers where port is mapped to non-standard one on local
 machine.

 Thank you.

 This is my first patch, below the 15 line threshold.

 From ca3f85877bdf406deefaf66cbac3483a7e41f134 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= saulius.menkevic...@gmail.com
 Date: Mon, 6 Apr 2015 23:13:06 +0300
 Subject: [PATCH] ob-sql: Add possibility to set dbport

  * lisp/ob-sql.el: will now recognize dbport parameter. Currently it
is supported for mysql engine only.

 You need to also specify what functions are modified, e.g.,

 * lisp/ob-sql.el (org-babel-sql-dbstring-mysql): Change signature.

Done.


 +(defun org-babel-sql-dbstring-mysql (host port user password database)
Make MySQL cmd line args for database connection.  Pass nil to omit that 
 arg.
(combine-and-quote-strings
 (delq nil
   (list (when host (concat -h host))
 +   (when port (concat -P (number-to-string port)))

 Isn't PORT a string already?

Apparently it is not a string. I don't know the internal machinery for
#+header parameters in org-mode/babel, but apparently number-to-string
is required, otherwise I get the progn: Wrong type argument: sequencep,
33060 error. Where 33060 is my port number from the :dbport param.


   (dbhost (cdr (assoc :dbhost params)))
 + (dbport (cdr (assoc :dbport params)))

 Nitpick: `assoc' - `assq'

Ok. I did not know much of elisp to decide on which one to. This was
copy-paste code from previous line, sorry.

Updated patch is attached to this mail.

From e6d7585c4eaba775a370d40135ae8725c04751c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Saulius=20Menkevi=C4=8Dius?= saulius.menkevic...@gmail.com
Date: Mon, 6 Apr 2015 23:13:06 +0300
Subject: [PATCH] ob-sql: Add possibility to set dbport

 * lisp/ob-sql.el (org-babel-sql-dbstring-mysql): Change type
   signature to accept server port number too.
   (org-babel-execute:sql) Will now recognize the dbport
   parameter. Passed to org-babel-sql-dbstring-mysql only for now.

TINYCHANGE
---
 lisp/ob-sql.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 493b3dc..110a34d 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -36,6 +36,7 @@
 ;; - engine
 ;; - cmdline
 ;; - dbhost
+;; - dbport
 ;; - dbuser
 ;; - dbpassword
 ;; - database
@@ -68,6 +69,7 @@
   '((engine	   . :any)
 (out-file	   . :any)
 (dbhost	   . :any)
+(dbport	   . :any)
 (dbuser	   . :any)
 (dbpassword	   . :any)
 (database	   . :any))
@@ -78,11 +80,12 @@
   (org-babel-sql-expand-vars
body (mapcar #'cdr (org-babel-get-header params :var
 
-(defun org-babel-sql-dbstring-mysql (host user password database)
+(defun org-babel-sql-dbstring-mysql (host port user password database)
   Make MySQL cmd line args for database connection.  Pass nil to omit that arg.
   (combine-and-quote-strings
(delq nil
 	 (list (when host (concat -h host))
+	   (when port (concat -P (number-to-string port)))
 	   (when user (concat -u user))
 	   (when password (concat -p password))
 	   (when database (concat -D database))
@@ -102,6 +105,7 @@ This function is called by `org-babel-execute-src-block'.
   (let* ((result-params (cdr (assoc :result-params params)))
  (cmdline (cdr (assoc :cmdline params)))
  (dbhost (cdr (assoc :dbhost params)))
+ (dbport (cdr (assq :dbport params)))
  (dbuser (cdr (assoc :dbuser params)))
  (dbpassword (cdr (assoc :dbpassword params)))
  (database (cdr (assoc :database params)))
@@ -126,7 +130,7 @@ This function is called by `org-babel-execute-src-block'.
  (org-babel-process-file-name in-file)
  (org-babel-process-file-name out-file)))
 ('mysql (format mysql %s %s %s  %s  %s
-(org-babel-sql-dbstring-mysql dbhost dbuser dbpassword database)
+(org-babel-sql-dbstring-mysql dbhost dbport dbuser dbpassword database)
 (if colnames-p  -N)
 (or cmdline )
 (org-babel-process-file-name in-file)
-- 
2.3.3



-- 
Saulius Menkevičius (saulius.menkevic...@gmail.com)


Re: [O] Problems with Hyperlinks containing backslashes

2015-04-07 Thread Nicolas Goaziou
Hello,

elwood...@web.de writes:

 I'm working with Emacs 24.4.1 and org-mode 8.2.10 on Windows 7.
 I have to use hyperlinks to our network servers like
 \\servername\dir1\dir2 and unfortunately I can not use them in
 hyperlinks in Emacs org-mode, I then get the error:
 Debugger entered--Lisp error: (error ShellExecute failed: Das System
 kann die angegebene Datei nicht finden.)
 w32-shell-execute(open servername\\dir1\\dir2)
 eval((w32-shell-execute open file))
 It seems that Emacs automatically replaces each backslash with a
 double backslash.
 How can I change that so that it is working?

IIRC it is fixed in development branch of Org. You may want to use it or
wait for Org 8.3 to be released.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] lisp/ob-sql.el: add support for :dbport parameter

2015-04-07 Thread Nicolas Goaziou
Saulius Menkevičius saulius.menkevic...@gmail.com writes:

 Apparently it is not a string. I don't know the internal machinery for
 #+header parameters in org-mode/babel, but apparently number-to-string
 is required, otherwise I get the progn: Wrong type argument: sequencep,
 33060 error. Where 33060 is my port number from the :dbport param.

OK. I slightly changed this line.

 Nitpick: `assoc' - `assq'

 Ok. I did not know much of elisp to decide on which one to. This was
 copy-paste code from previous line, sorry.

The previous lines should use `assq', but that's not very important.

 Updated patch is attached to this mail.

Applied. Thank you.


Regards,



Re: [O] Function that splits a CLOCK interval

2015-04-07 Thread Xavier Maillard

Christoph LANGE math.semantic@gmail.com writes:

 Hi Peter,

 Peter Frings on 2015-04-01 12:37:
 The following function now automates the task of splitting:
 …

 Fantastic, just what I needed!

 thanks for your feedback!

 I have now made a few improvements but not yet found time to get started
 with contributing the code to Worg, so one more email with the
 improvements.

This is really useful for me too. Thank you.

-- Xavier.