Re: [O] Org should follow SemVer conventions [Was: Automatically save the archive file after org-archive-subtree]

2018-10-08 Thread Nicolas Goaziou
Hello,

Adam Porter  writes:

> According to that bug report, the behavior changed when upgrading from
> 9.1.2 to 9.1.5.
>
> I think this shouldn't happen.  "Patch"-level releases (incrementing the
> third number) should only contain bug fixes.  Changes which change
> default behavior belong in, at minimum, "minor" releases (incrementing
> the second number).

[...]

> Could Org start doing this and call it Org 10.0?

We already do this. It just happens that this particular commit had
deeper repercussions than intended. It was then considered as a bugfix
and applied on the stable branch.

Moreover, next release will be Org 9.2. Not Org 10. I think Org 10 will
happen when some major part of Org changes, or when we drop support for
older Emacsen, e.g., Emacs 24.

Regards,

-- 
Nicolas Goaziou



Re: [O] How to make agenda generation faster

2018-10-08 Thread Adam Porter
Hi Marcin,

My feedback is: there be dragons.  ;)  The Agenda code is very
complicated and hard to follow, and it's hard to optimize something that
is hard to understand.

In the long run, to get significant speed improvements, I think it may
be necessary to reimplement the Agenda.  However, due to the nature of
it (i.e. regexp searches through buffers to find entries), I don't know
how much faster it can be made.  I don't mean that I doubt it can be--I
mean that, truly, I don't know, because it's hard to understand the flow
of the code.

I think that it is already fairly well optimized, given its limitations.
However, an example of a potential improvement would be to refactor it
to work with lexical-binding enabled (which didn't exist when it was
first created); I can't say how much of an improvement it would make,
but my understanding is that code that runs with lexical-binding enabled
is generally faster.  But doing that would be a non-trivial project, I
think, requiring the fixing of many inevitable regressions in the
process.

If you haven't seen them already, you may find my org-ql and
org-ql-agenda code useful.  org-ql-agenda presents an Agenda-like
buffer.  N.B. It does *not* implement most of the Agenda features, but
it does emulate an Org Agenda buffer by setting the appropriate text
properties on entries and formatting them in a similar way.

It's built on org-ql, which provides per-buffer query caching, which
means that generating an org-ql-agenda view for Org buffers that haven't
changed since the last view was generated is very fast.  It's also
written in a more functional way, which I think is easier to follow and
modify.  Performance of uncached queries/buffers depends on the
query--some are relatively fast, while others are slower than the "real"
Org Agenda.  I think there is significant potential for optimizations,
and I'm hoping to implement some in the future.  Your feedback would be
appreciated!

https://github.com/alphapapa/org-ql




Re: [O] exporting to latex and docx not honouring carriage returns to tabbing

2018-10-08 Thread Robert Klein
On Mon, 08 Oct 2018 16:54:39 +0100
Eric S Fraga  wrote:

> On Monday,  8 Oct 2018 at 10:56, Sharon Kimble wrote:
> > My finished output in the pdf will have every line indented/tabbed
> > to 4 spaces and have a carriage-return at the end of each
> > paragraph, with no spacings in between paragraphs.
> >
> > I can get it how I want in org-mode, but when its exported to latex
> > and converted into a pdf file, the whole section comes out in one
> > block of text!  
> 
> Both LaTeX and org define new paragraphs by a blank line.   Spaces at
> the start of a line only have meaning, in org, if the lines are part
> of a list (and never mean anything in LaTeX).
> 
> I am not sure exactly what you want to achieve so it is difficult to
> suggest anything.  Try separating your paragraphs with empty lines to
> see how much closer this gets you to what you want.
> 

What Eric says.

Then try to add to the org-file a line

#+LaTeX_Header: \parskip=0pt

so the spacing between paragraphs is 0.  Then add

#+LaTeX_Header: \parindent=0pt

so the first line of a paragraph isn't indented.

If you want to get /all/ the text indented by “4 spaces”, put a line

#+LaTeX: \setlength{\leftskip}{2em}

at the top of your document.


If you want only parts indented, put the line before the beginning of
the part to be indented and put this line after it:

#+LaTeX: \setlength{\leftskip}{0em}


Does this help?

Best regards
Robert




[O] Org should follow SemVer conventions [Was: Automatically save the archive file after org-archive-subtree]

2018-10-08 Thread Adam Porter
Kodi Arfer  writes:

> As of
>
> https://code.orgmode.org/bzg/org-mode/commit/b186d1d7236c0dc397eadeb004c9a17eaffd3aab
>
> archiving a subtree no longer automatically saves the archive
> file. How can I get this behavior back?
>
> A Debian bug was also opened for this issue:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=887332

According to that bug report, the behavior changed when upgrading from
9.1.2 to 9.1.5.

I think this shouldn't happen.  "Patch"-level releases (incrementing the
third number) should only contain bug fixes.  Changes which change
default behavior belong in, at minimum, "minor" releases (incrementing
the second number).

Users should be able to freely upgrade from 9.1.x to 9.1.x+1 without
having to worry about reading a changelog and adjusting their config to
avoid changes in behavior which could lead to data loss.

In my own (much smaller) projects, I follow this practice, which is
basically SemVer.  When I fix bugs, I apply the fixes to the latest
stable branch, make a new stable patch-level release, and then merge the
fixes into the master branch (in some projects, by rebasing the master
branch on top of the stable branch, and in others, by a non-fast-forward
merge of the stable branch into the master branch).  The master branch
becomes the next stable branch when its new features and other changes
have been merged for long enough and have no known bugs.

New features and refactorings are generally developed in a feature
branch and then merged into the master branch when ready, eventually
being released in the next stable branch.

The master branch is intended to be always usable, but only recommended
to users who are willing to potentially encounter bugs in new features
or as a result of other significant changes.  (In practice, this ends up
being the branch used by 99.9% of MELPA users, but that's a
MELPA-specific issue.)  Most users should use the latest stable branch.

This practice also makes it much easier for downstream packagers, like
Debian, because changes to the stable branch are ONLY bug fixes.

Could Org start doing this and call it Org 10.0?




Re: [O] Complexity of using spreadsheet functionality

2018-10-08 Thread Eric S Fraga
On Monday,  8 Oct 2018 at 18:16, Karl Voit wrote:
> You have to use Org for a while in order to be able to grasp the
> large universe of possibilities. It's really not that easy to
> explain or show. It's something you have to experience IMHO. And
> after you had this epiphany, you accept even hard to do things like
> complex calc references.

I think that's definitely the case.  There are things in org that should
be easier.  However, the one really good feature of org is that it is
easy to start with the simple outline and task management capabilities
and then slowly discover the other very powerful features.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4



[O] Bug: org-goto buffer not honouring org-cycle-separator-lines [9.1.9 (release_9.1.9-65-g5e4542 @ /home/carlos/local/stow/emacs-26/share/emacs/26.1.50/lisp/org/)]

2018-10-08 Thread Carlos Pita
Say I set org-cycle-separator-lines to 1. Now in an org buffer that has
nodes separated by one line, I do C-c C-j to open the org-goto
buffer. Then in the org-goto buffer:

1. Every node is suffixed by an ellipsis, even if the only content there
   is an empty line.

2. Nodes are not separated by an empty line anymore.

That is, the nodes are "swallowing" the empty lines between them as
their contents, which is exactly what org-cycle-separator-lines = 1 is
intended to avoid.

---

Emacs  : GNU Emacs 26.1.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.24.1)
 of 2018-09-26
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
/home/carlos/local/stow/emacs-26/share/emacs/26.1.50/lisp/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-fontify-whole-heading-line t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '((nil :maxlevel . 5))
 org-agenda-files '("~/notes/gtd.org")
 org-mode-hook '((lambda nil
  (let
   ((in-notes (string-prefix-p (expand-file-name "~/notes/") 
buffer-file-name))
(in-inbox (string= buffer-file-name (expand-file-name 
"~/notes/inbox.org")))
(in-goto (string= (buffer-name) "*org-goto*")))
   (if in-notes
(progn (org-indent-mode)
 (if in-inbox (progn (my-fill-mode -1) (auto-revert-mode
)
   (if (or in-inbox in-goto)
(progn
 (let
  ((--dolist-tail--
(quote (org-level-1 org-level-2 org-level-3 org-level-4 
org-level-5)))
   face)
  (while --dolist-tail-- (setq face (car --dolist-tail--))
   (face-remap-add-relative face :inherit nil)
   (setq --dolist-tail-- (cdr --dolist-tail--)))
  )
 )
)
   (add-hook (quote completion-at-point-functions)
(quote pcomplete-completions-at-point) nil t)
   )
  )
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append 
local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-agenda-deadline-faces '((1.001 . error) (1.0 . org-warning) (0.5 . 
org-upcoming-deadline)
 (0.0 . org-upcoming-distant-deadline))
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-babel-load-languages '((emacs-lisp . t) (python . t))
 org-link-abbrev-alist '(("google" . "https://www.google.com/#q=";) ("docs" . 
my-find-in-docs))
 org-export-backends '(ascii beamer html latex md)
 org-babel-python-command "ipython -i --simple-prompt --matplotlib=agg"
 org-fontify-quote-and-verse-blocks t
 org-fontify-done-headline t
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-separator-lines 1
 org-footnote-auto-adjust t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el") ("elisp" 
. "el"))
 org-format-latex-options '(:foreground default :background default :scale 1.3 
:html-foreground
"Black" :html-background "Transparent" :html-scale 
1.0 :matchers
("begin" "$1" "$" "$$" "\\(" "\\["))
 org-refile-use-outline-path t
 org-font-lock-set-keywords-hook '(doom-org-custom-fontification)
 org-confirm-shell-link-function 'yes-or-no-p
 org-stuck-projects '("-someday+LEVEL=2/-DONE" ("TODO") nil "")
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store 
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export 
:store
org-info-store-link)
   

[O] Complexity of using spreadsheet functionality (was: Calculate differences of remote table numbers)

2018-10-08 Thread Karl Voit
* Eric S Fraga  wrote:
> On Monday,  8 Oct 2018 at 17:19, Karl Voit wrote:
>> Unfortunately, I have to admit that spreadsheets in Org are not
>> something I can recommend to somebody who needs "something that just
>> works" (like Excel-switcher). :-(
>
> Maybe not but the combination of "It's all text", Emacs calc, and
> LaTeX export is unbeatable for me.  I've not used any other
> spreadsheet in years!

I do think that we all agree on that.

But it's more "I accept the nasty issues I have while creating
complex spreadsheet stuff because I got tons of advantages elsewhere
in this tool" instead of "hey, you're using Excel. Wanna switch to
Org/calc because it offers equivalent spreadsheet functionality on
top of many other advantages".

You have to use Org for a while in order to be able to grasp the
large universe of possibilities. It's really not that easy to
explain or show. It's something you have to experience IMHO. And
after you had this epiphany, you accept even hard to do things like
complex calc references.

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




Re: [O] Calculate differences of remote table numbers

2018-10-08 Thread Eric S Fraga
On Monday,  8 Oct 2018 at 17:19, Karl Voit wrote:
> Unfortunately, I have to admit that spreadsheets in Org are not
> something I can recommend to somebody who needs "something that just
> works" (like Excel-switcher). :-(

Maybe not but the combination of "It's all text", Emacs calc, and LaTeX export 
is unbeatable for me.  I've not used any other spreadsheet in years!

-- 

Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545



Re: [O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-08 Thread Eric S Fraga
On Monday,  8 Oct 2018 at 17:26, Marcin Borkowski wrote:
> Hi all,
>
> I found these two commands.  They seem to do the same thing.  What is
> the difference?

These will only do the same thing if your element (where point is) happens to 
be the sub-tree and nothing else.  Try it within a list element in a sub-tree 
and you should notice a difference in behaviour.

--

Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545



Re: [O] exporting to latex and docx not honouring carriage returns to tabbing

2018-10-08 Thread Eric S Fraga
On Monday,  8 Oct 2018 at 10:56, Sharon Kimble wrote:
> My finished output in the pdf will have every line indented/tabbed to 4
> spaces and have a carriage-return at the end of each paragraph, with no
> spacings in between paragraphs.
>
> I can get it how I want in org-mode, but when its exported to latex and
> converted into a pdf file, the whole section comes out in one block of
> text!

Both LaTeX and org define new paragraphs by a blank line.   Spaces at the start 
of a line only have meaning, in org, if the lines are part of a list (and never 
mean anything in LaTeX).

I am not sure exactly what you want to achieve so it is difficult to suggest 
anything.  Try separating your paragraphs with empty lines to see how much 
closer this gets you to what you want.

-- 

Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545



Re: [O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-08 Thread Marco Wahl
Hi!

> I found these two commands.  They seem to do the same thing.  What is
> the difference?

This is an example illustrating the difference.

- Have point on the *table* of the following subtree.


--8<---cut here---start->8---
* foo

| foo | foo |
| foo | foo |

* bar
--8<---cut here---end--->8---


- Use command `org-narrow-to-subtree'.  See the effect.
- Use command `widen' to get rid of the restriction.
- Make sure to have point on the table of the subtree again.
- Use command `org-narrow-to-element.  See the effect.
- Compare!


HTH,
Marco





[O] What is the difference between `org-narrow-to-subtree' and `org-narrow-to-element'?

2018-10-08 Thread Marcin Borkowski
Hi all,

I found these two commands.  They seem to do the same thing.  What is
the difference?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Calculate differences of remote table numbers

2018-10-08 Thread Karl Voit
* Michael Brand  wrote:
> Hi Karl

Hi Michael,

> On Mon, Oct 1, 2018 at 5:02 PM Karl Voit  wrote:
>
>> I'd like to calculate the differences between rows of numbers of a
>> different table.
>
> For this kind of shifting row or column indexes I use Calc vector
> subscript. In your case:
>
> #+NAME: my-table
>| Numbers |
>|-|
>|   1 |
>|   5 |
>|   8 |
>|  12 |
>|  15 |
>
>| Line | Difference |
>|--+|
>|1 ||
>|2 |  4 |
>|3 |  3 |
>|4 |  4 |
>|5 |  3 |
> #+TBLFM: $2 = if($1 == 1, string(""), subscr(remote(my-table,
> @I$1..@II$1), @# - 1) - subscr(remote(my-table, @I$1..@II$1), @# - 2))
>
> or, avoiding @# completely in the formula for $2:
>
> #+TBLFM: $2 = if($1 == 1, string(""), subscr(remote(my-table,
> @I$1..@II$1), $1) - subscr(remote(my-table, @I$1..@II$1), $1 - 1))
>
> See also a similar example of subscr in the subsection "Dynamic
> variation of ranges" here:
> https://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas

Thanks for your post - it is working as expected! \o/

Also thanks for the URL - I added it to my knowledge base.

Unfortunately, I have to admit that spreadsheets in Org are not
something I can recommend to somebody who needs "something that just
works" (like Excel-switcher). :-(

However, when a table is finally working as expected, I really do
appreciate having this table (and its derived data) within my notes
and not locked away in a separate file.

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




Re: [O] PATH question for gnus

2018-10-08 Thread Joseph Vidal-Rosset
Le lun.  08 oct. 2018 à  02:59:11 , Robert Klein   a
envoyé ce message:

> PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
> MANPATH=/usr/local/texlive/2018/texmf/doc/man:$MANPATH
> INFOPATH=/usr/local/texlive/2018/texmf/doc/info:$INFOPATH
> export PATH MANPATH INFOPATH
>
> in your .profile/.bashrc, (and .xsessionrc if your're using lightdm for
> login)
>
> Best regards
> Robert

Many thanks Robert, it works now !

The last line export PAHT MANPATH INFOPATH was not correctly written in my 
setup. I had now .xsessionrc
and its add was strangely a problem for the replying function in gnus.

Anyway, now \(\LaTeX\) in my Gnus works thanks to you.


Best regards, and thanks again ! 

-- 
Joseph 


Re: [O] PATH question for gnus

2018-10-08 Thread Robert Klein
Hi,

On Mon, 8 Oct 2018 14:15:17 +0200
Joseph Vidal-Rosset  wrote:

> Hello,
> 
> I am a Debian GNU/Linux user, but, contrarily that I did, I have
> recently decided to install texlive via the sources in /usr/local/ .
> I put in my init.el (user.el in scimax) : (setenv "PATH" (concat
> "/usr/local/texlive/2018/bin/x86_64-linux/:" (getenv "PATH")))
> (setenv "PATH" (concat
> "/usr/texbin:/usr/local/bin/:" (getenv "PATH")))
> 
> and the export in LaTeX works.  But in Gnus, org-mime  does not work
> and I cannot create pgn images:  neither latex nor dvipng exist for
> Gnus. It is a problem of PATH configuration that I do not succeed to
> solve.

put something like

PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
MANPATH=/usr/local/texlive/2018/texmf/doc/man:$MANPATH
INFOPATH=/usr/local/texlive/2018/texmf/doc/info:$INFOPATH
export PATH MANPATH INFOPATH

in your .profile/.bashrc, (and .xsessionrc if your're using lightdm for
login)

Best regards
Robert


> 
> Your help is welcome.
> 
> Best wishes,
> 
> Jo.




[O] PATH question for gnus

2018-10-08 Thread Joseph Vidal-Rosset
Hello,

I am a Debian GNU/Linux user, but, contrarily that I did, I have recently
decided to install texlive via the sources in /usr/local/ . I put in my
init.el (user.el in scimax) : (setenv "PATH" (concat
"/usr/local/texlive/2018/bin/x86_64-linux/:" (getenv "PATH")))
(setenv "PATH" (concat "/usr/texbin:/usr/local/bin/:"
(getenv "PATH")))

and the export in LaTeX works.  But in Gnus, org-mime  does not work and I
cannot create pgn images:  neither latex nor dvipng exist for Gnus. It is a
problem of PATH configuration that I do not succeed to solve.

Your help is welcome.

Best wishes,

Jo.


[O] exporting to latex and docx not honouring carriage returns to tabbing

2018-10-08 Thread Sharon Kimble

I have a problem in an org-mode file which is then exported to latex and
then converted into a pdf. And the file is the draft of my fiction book.

My finished output in the pdf will have every line indented/tabbed to 4
spaces and have a carriage-return at the end of each paragraph, with no
spacings in between paragraphs.

I can get it how I want in org-mode, but when its exported to latex and
converted into a pdf file, the whole section comes out in one block of
text!

Its as if something isn't honouring a carriage return and neither
recognising the 4 spaces!

So how can I achieve my goal please?

I've tried manually doing a return and then deleting the space it
creates for the next line to then have its obligatory 4 spaces of
indentation but its not working as I want, so how can I do it please?

I've also tried exporting the file to docx using pandoc, and its not
recognising any carriage-returns in its output either.

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.4, fluxbox 1.3.7, emacs 25.3.4, org 9.1.14


signature.asc
Description: PGP signature


Re: [O] How to make agenda generation faster

2018-10-08 Thread Michael Welle
Hello,

Marcin Borkowski  writes:

> Hi Orgers,
>
> my agenda takes almost 10 seconds to show up.  Are there any ideas for
> profiling that?
>
> I suspect that archiving a lot of old entries I don't use anymore might
> help, but is there any way to e.g. display some stats on which
> file/headline took how much time?
since no one answered yet, there are some similar threads. IIRC the way
to go is to use elp for profiling.

Well, on my laptop the initial agenda run takes about 7s or so (150
agenda files) using the current day/week agenda ("a"). All subsequent
(after loading the files) agenda runs are fast (split second I would
say). I had some performance issues in the past caused by SCM. Emacs
tried to check if every file is checked out in the latest version. That
slowed down the process a lot (starting 150 mercurial processes in
sequential order, checking results, etc.). The initial run doesn't
bother me much. I bound the initial agenda run to an idle timer at Emacs
start. 

Regards
hmw