Re: [O] How do you organize a project and its related sub-tasks

2017-06-19 Thread Samuel Wales
i have long thought it would be useful to dim entries in the agenda
that are ancestors of entries in the same agenda view.  regardless of
sort order.  similar to dim blocked.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] How do you organize a project and its related sub-tasks

2017-06-19 Thread Bala Ramadurai
>
> Hello,

  Yes, having projects in the agenda is annoying. I use the philosophy from
http://doc.norang.ca/org-mode.html where any task with subtasks is a
project. Stuck projects are those with no next action.

I have several projects which have many nested sub projects in them.

Prior to org mode, I tried so many apps to get this basic feature, but not
many are this malleable and still easy to use.

Thanks and have a good day!
Bala

> --
http://balaramadurai.net


Re: [O] How to use noweb reference with argument in other languages?

2017-06-19 Thread numbch...@gmail.com
Which Org-mode version are you using? I'm using the latest Org-mode version
from source code branch `master`.

When I use your `:noweb-ref` style like this:

```org
* noweb reference with argument

#+BEGIN_SRC sh :var str="" :noweb-ref sh-print-something
echo "$str"
#+END_SRC

#+BEGIN_SRC sh :results output :noweb yes
echo "hello, "
<>
#+END_SRC

#+RESULTS:
```

Emacs reports error:

org-babel-ref-resolve: Reference ‘sh-print-something’ not found in this
buffer.

Org-mode version: Org mode version 9.0.8 (9.0.8-elpaplus @
/home/stardiviner/Code/Emacs/org-mode/lisp/)

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jun 19, 2017 at 6:21 PM, Kaushal Modi 
wrote:

> On Mon, Jun 19, 2017, 12:59 AM numbch...@gmail.com 
> wrote:
>
>> I found noweb reference with argument `<>` issue.
>>
>
> It has been working fine for me for org and sh source blocks.
>
> And this does not work:
>> ```org
>> #+NAME: sh-print-something
>> #+BEGIN_SRC sh :var str=""
>> echo "$str"
>> #+END_SRC
>>
>> #+BEGIN_SRC sh :results output :noweb yes
>> echo "hello, "
>> <>
>> #+END_SRC
>>
>
> You need to use :noweb-ref option  in the source blocks header args to set
> the noweb-ref code reference; #+NAME will not work.
>
> I have to have used noweb for the very first time in this recent project:
> https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org ;
> search for ":noweb-ref" in there to get an idea.
>
>> --
>
> Kaushal Modi
>


[O] Hanging indents in paragraphs just appeared

2017-06-19 Thread William Denton
I was away on vacation last week, and when I got back I refreshed my Org source 
code and recompiled the latest version.  (I'm sure many of you do the same.)


Text paragraphs now have hanging indents.  What used to look like this (I have 
both visual-line-mode and org-startup-indented turned on):


This is a paragraph, and I will make the line length
shorter so that it looks like it would look, except
normally the line length would be much longer.

Now looks like this:

This is a paragraph, and I will make the line length
shorter so that it looks like it would look, except
normally the line length would be much longer.

I think this was introduced earlier today or yesterday in this commit:

002e2a072cc org-indent: Fix line and wrap prefixes

I can't figure out how to make it look like it used to.  How could I do this?

Thanks,

Bill
--
William Denton :: Toronto, Canada :: https://www.miskatonic.org/
Caveat lector.



[O] Bug: [Feature request] generate source blocks from filename [9.0.8 (9.0.8-elpaplus @ /Users/andreagiugliano/.emacs.d/elpa/org-plus-contrib-20170606/)]

2017-06-19 Thread Andrea

Hello everyone,

Thanks immensely for your effort in developing/maintaining org mode. I
learned to use it during my Ph.D. and now that I am working is even more
useful (and fun :).

I like literate programming, and I find really useful to work by using
source blocks (as I can swap between org mode bindings and the code mode
bindings with the easy C-c ').

So to simplify my source imports I developed this simple function in
elisp:

#+BEGIN_SRC elisp
;; in this function there is a map from file extensions to org babel identifiers
(defun org-src-from-filename (filepath)
  "Convert filename at point to org src block."
  (interactive)
  (let* (
 (ext2babelIds '(("clj" . "clojure")
("dot" . "dot")
;(gnuplot . t)
;(calc . t)
("hs" . "haskell")
("java" . "java")
("ml" . "ocaml")
("org" . "org")
;(plantuml . t)
("py" . "python")
("rb" . "ruby")
("scala" . "scala")
("sbt" . "scala")
("sh" . "sh")
("txt" . "text")
("html" . "html")
("xml" . "html")
("xhtml" . "xhtml")
("tex" . "latex")
("el" . "emacs-lisp")
("json" . "javascript")
("js" . "javascript")
("css" . "css")
("sql" . "sql")
("" . "text")
))
 (bounds (bounds-of-thing-at-point 'filename))
 (contents (with-temp-buffer
 (insert-file-contents filepath)
 (buffer-string)))
 (extension (file-name-extension filepath))
 (babel-id (cdr (assoc extension ext2babelIds)))
 (org-contents (concat "#+BEGIN_SRC " (if babel-id babel-id extension) 
" :tangle " filepath "\n"  contents "#+END_SRC"))
)
(save-excursion (when (and bounds filepath)
  (delete-region (car bounds) (cdr bounds))
  (insert org-contents)
#+END_SRC

It basically, given a filename, generates a source block with the
correct extension and the tangle path.

The cool thing is that I can use it to substitute a path at point:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun org-src-from-filename-at-point ()
  (interactive)
  (org-src-from-filename (thing-at-point 'filename)))
(bind-key "C-c s" 'org-src-from-filename-at-point)
#+END_SRC

And even integrate it with helm, by using the kill-ring list:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun org-src-from-helm-kill-ring ()
  (interactive)
  (helm-show-kill-ring)
  (org-src-from-filename-at-point))
(bind-key "C-c y" 'org-src-from-helm-kill-ring)
#+END_SRC

Which becomes so cool having a function that adds the current buffer
filename to the kill-ring:

#+BEGIN_SRC emacs-lisp :tangle yes
(defun copy-buffer-filename ()
  (interactive)
  (let ((path (buffer-file-name)))
(when path (kill-new path)))
  )
(global-set-key (kbd "C-c b")  'copy-buffer-filename)
#+END_SRC

Do you think it would make sense to add such a functionality to
org-mode? Or maybe it is already there and I missed it?

However, just thanks for your amazing work!

Best regards,

Andrea


Emacs  : GNU Emacs 25.1.2 (x86_64-apple-darwin16.0.0, Carbon Version 157 AppKit 
1504)
 of 2017-04-04
Package: Org mode version 9.0.8 (9.0.8-elpaplus @ 
/Users/andreagiugliano/.emacs.d/elpa/org-plus-contrib-20170606/)



Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-19 Thread numbch...@gmail.com
After you two's discussion, I have some understanding about lexical scope
and dynamic scope. I will add lexical binding if my code use it.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Jun 19, 2017 at 6:37 PM, Bastien Guerry  wrote:

> Hi Nicolas,
>
> I'm all for lexical-binding, and it's good to have it in Org's core.
>
> The author of ob-sclang.el used "2011-2017" for the copyright years,
> which was obviously a typo and tells that the header was simply copied
> from another file (which is 100% fine btw).
>
> From that, I inferred that the "lexical-binding:t" was also copied
> without further thinking, especially since there is no binding at all
> in this file.
>
> I think Stardiviner is the one who should make the decision, but I
> don't see what "lexical-binding:t" would add to his actual code.
>
> For the more general concern: again, I'm all for lexical binding and
> I'm well aware of its numerous advantages, but I don't think we should
> rule dynamic binding from contributed Org code.  Dynamic binding has
> it's limitations, but when used carefully, it also has the advantage
> of being easier to grok for beginners.  We want to welcome beginner's
> contributions.  So I simply recommand lexical binding for Org's core,
> and what fits developers best for Org's contributions.
>
> And I agree we can move on to something else :)
>
> --
>  Bastien
>


Re: [O] org-protocol documentation

2017-06-19 Thread Chunyang Xu
Mario Martelli  writes:

>> for what it's worth, the Emacs Mac Port supports org-protocol out of
>> box. It works without the Emacs server (emacsclient), e.g.,
>
> Good to know. I’ve listed it in the documentation.
> Do you plan to provide ready built binaries?

The author of the Emacs Mac Port is Mitsuharu Yamamoto and I don't think
there is any built binaries provided by him. I installed the built
binaries via MacPorts (a package manager for Mac) with:

  $ sudo port install emacs-mac-app

and I also heard that it is also available from Homebrew (another
package manager).

[...]





Re: [O] Org-mode table/links -> mediawiki

2017-06-19 Thread Sharon Kimble
Nicolas Goaziou  writes:

> Hello,
>
> Sharon Kimble  writes:
>
>> I'm at the stage of building an org-mode table to be exported to
>> mediawiki and its going to be the front page of my DrugFacts site.
>>
>> So far I'm here -
>>
>> | *Illegal*   | *Category's*   | *Legal* 
>>   | *Prescription only*   | *Substitute*| *Others*   |
>> |---+--+---+-+-+--|
>> | * Amphetamines| * :Category:Anaesthetics | * Alcohol | 
>> * Alprazolam| * Buprenorphine | * Flumazenil |
>> | * AMT | * Analgesics | * [[Betel 
>> nut][Betel nut]]   | * Citalopram| * [[Methadone][Methadone]] | 
>> * [[Naxolone][Naxolone]]   |
>> | * Anabolic Steroids   | * Anticonvulsants| * 
>> [[Caffeine][Caffeine]]| * Codeine   | * 
>> [[Naltrexone][Naltrexone]]|  |
>> | * Benzodiazepines | * Antidepressants| * 
>> [[Paracetamol][Paracetamol]] | * Dextroamphetamine | * 
>> [[Suboxone][Suboxone]]  |  |
>> | * BZP | * Anxiolytics‏‎| * 
>> [[Tobacco][Tobacco]] | * Diazepam  | |   
>>|
>> | * Cannabis| * Appetite suppressants‏‎  |   
>> | * Fentanyl  | |  |
>>
>> But I'm running up against problems, like these -
>>
>> - If I make it an org-mode link, like in 'Betel nut' then when I try to
>>   export it I get a message like this "(user-error "Unable to resolve
>>   link: \"Betel nut\"") in user-error".
>>   - in mediawiki the link would be [[Betel nut]].
>>
>> - In mediawiki 'Cannabis' is shown as [[Marijuana|Cannabis]], but
>>   org-mode thinks that its another column in the table.
>>
>> Using an org-mode table means that its very easy to generate/export the
>> table into mediawiki format, so I really do want to use one, but I do
>> need to have an org-mode link be able to be changed into an mediawiki
>> link.
>>
>> How can I resolve both these problems please?
>
> I guess you could use a dedicated Org -> MediaWiki export backend, e.g.,
>
>   https://github.com/tomalexander/orgmode-mediawiki/

Thanks Nicolas.

I already am using everything mediawiki-related from ELPA, and my google
search for 'org-mode & mediawiki' only showed me what I already have, so
I think I've reached the end of the road there, unfortunately.

But with regard to moving forward with my bullet-points -

1. If the links are exported as [Betel nut] then under mediawiki they
   could have the extra '[' and ']' placed by using 'global replace'. This
   works in my test cases.
2. If this is used [Marijuana!Cannabis] it is possible to use 'global
   replace' to change '!' to '|' and works very well. Then you can use (1).

Both of these solutions work well, although you do have to do a bit more
work on a mediawiki buffer, but its all a lot better than trying to
build a mediawiki table for the front page.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7


signature.asc
Description: PGP signature


Re: [O] org-protocol documentation

2017-06-19 Thread Mario Martelli

> for what it's worth, the Emacs Mac Port supports org-protocol out of
> box. It works without the Emacs server (emacsclient), e.g.,

Good to know. I’ve listed it in the documentation.
Do you plan to provide ready built binaries?

>> - if not, I would update the documentation in general and for macOS
>> and would leave the linux and windows parts untouched (don’t know if
>> they need to be updated), if that’s ok.
> 
> This is fine as a first step IMO.

Please find my attempt at: https://github.com/mgmart/org-mode 


Kind regards
Mario
— 








Re: [O] org-protocol documentation

2017-06-19 Thread Chunyang Xu
Mario Martelli  writes:

> Hi,
>
> recently I’ve updated my macOS - Org mode setup. I had some pain setting up 
> org-protocol properly

for what it's worth, the Emacs Mac Port supports org-protocol out of
box. It works without the Emacs server (emacsclient), e.g.,

  $ open 
'org-protocol://store-link?url=http%3A%2F%2Forgmode.org&title=Org%20mode'

Thus for Emacs Mac Port users, no setup is needed.

[Emacs Mac Port] https://bitbucket.org/mituharu/emacs-mac

[...]






Re: [O] org-protocol documentation

2017-06-19 Thread Nicolas Goaziou
Hello,

Mario Martelli  writes:

> recently I’ve updated my macOS - Org mode setup. I had some pain
> setting up org-protocol properly which was mainly because the
> documentation (http://orgmode.org/worg/org-contrib/org-protocol.html
> ) is outdated.
> Especially for macOS. I thought about updating the documentation. But
> I’m unsure wether that is still the correct place. To me it seems that
> org-protocol is no longer in org-contrib but in org-mode. I could not
> verify that because I could not clone the repo (fatal: unable to
> connect to orgmode.org: orgmode.org[0: 104.239.132.130]:
> errno=Operation timed out ).
>
> - is the task of documenting org-protocol already scheduled?

I don't think so.

Besides, org-protocol in indeed in core and should be documented in the
manual. The latter merely points to the Worg page.

> - if not, I would update the documentation in general and for macOS
> and would leave the linux and windows parts untouched (don’t know if
> they need to be updated), if that’s ok.

This is fine as a first step IMO.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-19 Thread Bastien Guerry
Hi Nicolas,

I'm all for lexical-binding, and it's good to have it in Org's core.

The author of ob-sclang.el used "2011-2017" for the copyright years,
which was obviously a typo and tells that the header was simply copied
from another file (which is 100% fine btw).

>From that, I inferred that the "lexical-binding:t" was also copied
without further thinking, especially since there is no binding at all
in this file.

I think Stardiviner is the one who should make the decision, but I
don't see what "lexical-binding:t" would add to his actual code.

For the more general concern: again, I'm all for lexical binding and
I'm well aware of its numerous advantages, but I don't think we should
rule dynamic binding from contributed Org code.  Dynamic binding has
it's limitations, but when used carefully, it also has the advantage
of being easier to grok for beginners.  We want to welcome beginner's
contributions.  So I simply recommand lexical binding for Org's core,
and what fits developers best for Org's contributions.

And I agree we can move on to something else :)

-- 
 Bastien



Re: [O] org-indent-mode shows "noise" in the left-hand margin when using some themes

2017-06-19 Thread Nicolas Goaziou
Hello,

Forrest Sedgwick  writes:

> Hello,
>
> 1. Open the attached org file using emacs -Q org-indent-text.org
> I have emacs version "GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+
> Version 3.22.10) of 2017-04-22" and thus org version 8.2.10
>
> 2. Change to a built-in dark theme: (load-theme 'tsdh-dark)
>
> 3. SHIFT-TAB a bit, everything looks fine.
>
> 4. Open another emacs using:
> emacs -Q -l minimal-org.el org-indent-text.org
>
> 5. Now it is org-version 9.0.8.
>
> 6. Change to built-in dark theme: (load-theme 'tsdh-dark)
>
> 7. SHIFT-TAB a bit, notice that there is subtle "noise" on the left
> side in the line-prefix. I've attached a screenshot to show what I'm
> talking about. I haven't tried different versions of org to see where
> this behavior begins. This also happens on some other themes with dark
> backgrounds, but so far it doesn't happen with light backgrounds. Or
> if it does it's completely invisible.

This is now fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] How to use noweb reference with argument in other languages?

2017-06-19 Thread Kaushal Modi
On Mon, Jun 19, 2017, 12:59 AM numbch...@gmail.com 
wrote:

> I found noweb reference with argument `<>` issue.
>

It has been working fine for me for org and sh source blocks.

And this does not work:
> ```org
> #+NAME: sh-print-something
> #+BEGIN_SRC sh :var str=""
> echo "$str"
> #+END_SRC
>
> #+BEGIN_SRC sh :results output :noweb yes
> echo "hello, "
> <>
> #+END_SRC
>

You need to use :noweb-ref option  in the source blocks header args to set
the noweb-ref code reference; #+NAME will not work.

I have to have used noweb for the very first time in this recent project:
https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org ;
search for ":noweb-ref" in there to get an idea.

> --

Kaushal Modi


[O] org-protocol documentation

2017-06-19 Thread Mario Martelli
Hi,

recently I’ve updated my macOS - Org mode setup. I had some pain setting up 
org-protocol properly which was mainly because the documentation 
(http://orgmode.org/worg/org-contrib/org-protocol.html 
) is outdated. 
Especially for macOS. I thought about updating the documentation. But I’m 
unsure wether that is still the correct place. To me it seems that org-protocol 
is no longer in org-contrib but in org-mode. I could not verify that because I 
could not clone the repo (fatal: unable to connect to orgmode.org: 
orgmode.org[0: 104.239.132.130]: errno=Operation timed out ).

- is the task of documenting org-protocol already scheduled?
- if not, I would update the documentation in general and for macOS and would 
leave the linux and windows parts untouched (don’t know if they need to be 
updated), if that’s ok.

Kind regards
Mario

— 
🌍http://www.schnuddelhuddel.de 






Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-19 Thread Kaushal Modi
On Mon, Jun 19, 2017, 5:21 AM Nicolas Goaziou 
wrote:

>   There is absolutely no drawback in using lexical binding. Since Org
>   9.0, it _is_ the default for Org core: almost every Org library
>   activates it nowadays.
>
> Again, lexical binding has _no_ drawback and makes life of developers
> easier (e.g., code is more readable, compiler reports more errors).
> I moved almost every library in Org to lexical binding, some changes
> being trivial, some painful, for a reason. I don't want to do a step
> backward in that area without a very strong reason–to tell the truth,
> even a strong reason wouldn't convince me.
>

Here are some of my observations on the topic of lexical-binding by
following emacs-devel closely for the past few years.

It has become a norm to write new elisp code that is lexical-binding
friendly.

I have seen this movement started on emacs master for a long time now
(since 2011), and still there is a continuous effort to enable
lexical-binding on more and more emacs core files:
http://git.savannah.gnu.org/cgit/emacs.git/log/?qt=grep&q=lexical-binding

The same applies to Magit and many other external emacs packages (
https://github.com/search?q=lexical-binding+language%3A"Emacs+Lisp"&type=commits
).

The idea is that once almost all the elisp code out there is
lexical-binding compatible, the default of emacs can be changed to that and
dynamic binding can be obsoleted.

I have also seen how a lexically bound package is more portable as there is
no implicit reliance on global variables from multiple other packages.

> --

Kaushal Modi


Re: [O] Org-mode table/links -> mediawiki

2017-06-19 Thread Nicolas Goaziou
Hello,

Sharon Kimble  writes:

> I'm at the stage of building an org-mode table to be exported to
> mediawiki and its going to be the front page of my DrugFacts site.
>
> So far I'm here -
>
> | *Illegal*   | *Category's*   |  *Legal* 
>   | *Prescription only*   | *Substitute*| *Others*   |
> |---+--+---+-+-+--|
> | * Amphetamines| * :Category:Anaesthetics | * Alcohol | 
> * Alprazolam| * Buprenorphine | * Flumazenil |
> | * AMT | * Analgesics | * [[Betel 
> nut][Betel nut]]   | * Citalopram| * [[Methadone][Methadone]] | * 
> [[Naxolone][Naxolone]]   |
> | * Anabolic Steroids   | * Anticonvulsants| * 
> [[Caffeine][Caffeine]]| * Codeine   | * 
> [[Naltrexone][Naltrexone]]|  |
> | * Benzodiazepines | * Antidepressants| * 
> [[Paracetamol][Paracetamol]] | * Dextroamphetamine | * [[Suboxone][Suboxone]] 
>  |  |
> | * BZP | * Anxiolytics‏‎| * 
> [[Tobacco][Tobacco]] | * Diazepam  | |
>   |
> | * Cannabis| * Appetite suppressants‏‎  |   
> | * Fentanyl  | |  |
>
> But I'm running up against problems, like these -
>
> - If I make it an org-mode link, like in 'Betel nut' then when I try to
>   export it I get a message like this "(user-error "Unable to resolve
>   link: \"Betel nut\"") in user-error".
>   - in mediawiki the link would be [[Betel nut]].
>
> - In mediawiki 'Cannabis' is shown as [[Marijuana|Cannabis]], but
>   org-mode thinks that its another column in the table.
>
> Using an org-mode table means that its very easy to generate/export the
> table into mediawiki format, so I really do want to use one, but I do
> need to have an org-mode link be able to be changed into an mediawiki
> link.
>
> How can I resolve both these problems please?

I guess you could use a dedicated Org -> MediaWiki export backend, e.g.,

  https://github.com/tomalexander/orgmode-mediawiki/

Regards,

-- 
Nicolas Goaziou



Re: [O] Add ob-sclang.el for sclang Org-mode babel support in contrib/

2017-06-19 Thread Nicolas Goaziou
Hello,

Bastien Guerry  writes:

> Maybe I miss something: when I create a file with C-x C-f whatever.el RET
> it does not use a template or does not get created with lexical
> binding on.
> What are you referring to when you say "every Elisp file created
> activates it"?

It requires to activate `autoinsert' feature, which is bundled with
Emacs.

>   * Dynamic Binding:: The default for binding local variables in 
> Emacs.

OK. I stand corrected. Let me rephrase this then:

  There is absolutely no drawback in using lexical binding. Since Org
  9.0, it _is_ the default for Org core: almost every Org library
  activates it nowadays. Please, pretty please, don't suggest it is
  different.

> Whether lexical binding is a good default or not is another question,
> and whether lexical-binding:t makes sense in a file with no binding
> yet another, third one.

Let's consider this a non-starter. 

Again, lexical binding has _no_ drawback and makes life of developers
easier (e.g., code is more readable, compiler reports more errors).
I moved almost every library in Org to lexical binding, some changes
being trivial, some painful, for a reason. I don't want to do a step
backward in that area without a very strong reason–to tell the truth,
even a strong reason wouldn't convince me.

In particular, I don't want to introduce scoping bugs in a library
because, at its creation, lexical binding wasn't activated and nobody
cared to check the first line of the file before introducing a dubious
binding.

I sincerely hope we can agree on the topic, hic et nunc, and move on to
actual coding.


Regards,

-- 
Nicolas Goaziou