Re: [O] Special alignment in org-mode

2016-04-28 Thread David Cao
Alright, I will try this solution out. Thanks for the advice!

On Thu, Apr 28, 2016 at 10:40 AM John Kitchin 
wrote:

> In this case though you probably want to specify a fixed
> column, and consider using something like indent-rigidly on the heading
> body so you don't have an overlay on every single line.
>
>
> David Cao writes:
>
> > Hi!
> >
> > This solution works fairly well with the headers themselves, but the
> actual
> > content beneath the headers stays to the side of the buffer (as pictured:
> > http://i.imgur.com/nGv8XBI.png).
> > Would there be any way to fix this?
> >
> > David
> >
> > On Wed, Apr 27, 2016 at 9:47 AM John Kitchin 
> > wrote:
> >
> >> I think this does approximately what you want:
> >>
> >> #+BEGIN_SRC emacs-lisp :results none
> >> (require 'ov)
> >>
> >> (defun org-max-heading-depth ()
> >>   "Get maximum depth of a heading."
> >>   (let ((max-depth 0)
> >> depth)
> >> (org-map-entries (lambda ()
> >>(when (> (setq depth (car
> >> (org-heading-components))) max-depth)
> >>  (setq max-depth depth
> >> max-depth))
> >>
> >>
> >> (defun org-right-align-overlay ()
> >>   "Put an overlay on headline * to right align to maximum depth.
> >> Should be run while on the headline."
> >>   (interactive)
> >>   (let* ((diff (- (org-max-heading-depth) (car
> (org-heading-components
> >>  ov)
> >> (while (and (setq ov (ov-at (match-beginning 1)))
> >>(overlay-get ov 'right-align))
> >>   (delete-overlay ov))
> >>
> >> ;; (setq ov (make-overlay (line-beginning-position) (+ 1
> >> (line-beginning-position
> >> (setq ov (make-overlay (match-beginning 1) (+ 1 (match-beginning
> 1
> >> (overlay-put ov 'before-string (make-string diff ? ))
> >> (overlay-put ov 'right-align t)))
> >>
> >> (defun org-right-align-clear ()
> >>   (interactive)
> >>   (ov-clear 'right-align))
> >>
> >> (defun align-matcher ( limit)
> >>   (while (re-search-forward org-heading-regexp limit t)
> >> (org-right-align-overlay)))
> >>
> >> (add-to-list 'org-font-lock-hook 'align-matcher)
> >> #+END_SRC
> >>
> >> Its only light tested, and may be slow on a long document because it is
> >> checking the maximum depth each time. You could set this to a constant,
> >> e.g. 8 if it is too slow.
> >>
> >> David Cao writes:
> >>
> >> > Hello,
> >> >
> >> > I was wondering if there is any way to right-align the header
> indicators
> >> > while left-aligning the actual content. Unfortunately I haven't been
> able
> >> > to find any mention of such a feature online.
> >> >
> >> > For example:
> >> >
> >> >   * My fancy org file
> >> >  ** Header 2
> >> > Some content here
> >> > *** Header 3
> >> >
> >> > Thanks in advance!
> >> > David
> >>
> >>
> >> --
> >> 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
> >>
>
>
> --
> 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
>


Re: [O] How to reorder a footnote list?

2016-04-28 Thread Adam Porter
Sharon Kimble  writes:

> I now have '#+STARTUP: fnadjust' in the preamble immediately below the
> title, author and date fields and this reorders the footnote list so it
> is now going [fn:1] [fn:2] [fn:3] etc, and adds the new footnote at the
> end of the list. There is a slight pause whilst its reordering but then
> it works just fine.

Hm, I see that that is a per-file setting for the global variable
org-footnote-auto-adjust, which I have set to t.  Apparently its default
value is nil.  That might be why I've never seen them in reverse order,
since I guess I've had this enabled for as long as I can remember.




Re: [O] New Beamer environment selection problem

2016-04-28 Thread Nicolas Goaziou
Hello,

Jarmo Hurri  writes:

> Debugger entered--Lisp error: (wrong-number-of-arguments max 0)
>   max()
>   apply(max nil)
>   org-fast-tag-selection(nil nil nil nil)
>   org-set-tags()
>   org-beamer-select-environment()
>   call-interactively(org-beamer-select-environment nil nil)
>   command-execute(org-beamer-select-environment)

Would the following patch solve the issue?

Regards,

-- 
Nicolas Goaziou
>From 39cbbca8b6599d4701c243b0eb016b1c7793abba Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Thu, 28 Apr 2016 23:29:17 +0200
Subject: [PATCH] ox-beamer: Fix "apply: Wrong number of arguments: max, 0"

* lisp/ox-beamer.el (org-beamer-select-environment): Use variable
  introduced in 4743d43.

Reported-by: Jarmo Hurri 

---
 lisp/ox-beamer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 4790d5f..65304f4 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -1107,7 +1107,7 @@ aid, but the tag does not have any semantic meaning."
   (let* ((envs (append org-beamer-environments-special
 		   org-beamer-environments-extra
 		   org-beamer-environments-default))
-	 (org-tag-alist
+	 (org-current-tag-alist
 	  (append '((:startgroup))
 		  (mapcar (lambda (e) (cons (concat "B_" (car e))
    (string-to-char (nth 1 e
-- 
2.7.4



Re: [O] Bug: Inconsistency with C-S-a and C-S-e [8.2.10 (release_8.2.10 @ /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)]

2016-04-28 Thread Mathieu Marques
Awesome, thanks!

On Thu, Apr 28, 2016, 23:30 Nicolas Goaziou  wrote:

> Hello,
>
> Mathieu Marques  writes:
>
> > In other modes, C-S-a and C-S-e behave as expected that is, move cursor
> > to the beginning/end of line while marking region. In other words, it
> > does what C-SPC C-a and C-SPC C-e would do.
> >
> > However in org-mode, C-a and C-e are bound to org-beginning-of-line and
> > org-end-of-line respectively.
> > In org-mode, C-S-e works as expected. But C-S-a does not.
> >
> > I have had these details over a discussion about my issue on /r/emacs:
> >
> > The interactive arg for both org-beginning-of-line and
> > org-end-of-line is "P". So it carries over the raw arguments
> > received by the command. So ^ is not needed. The reason C-S-e still
> > works as expected is because of (call-interactively 'end-of-line) in
> > org-end-of-line, and so the raw args are passed to end-of-line
> > without any modification.
> >
> > ~~Whereas we do not have (call-interactively 'beginning-of-line) in
> > org-beginning-of-line~~.
> > *Well, we do have (call-interactively 'move-beginning-of-line)*.
> > Instead we have goto-char calls to place the point before/after the
> > stars.
>
> Fixed in master. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] bug#23365: 25.0.93; org-mode fails on export with include

2016-04-28 Thread Kaushal Modi
On Thu, Apr 28, 2016 at 5:16 PM Phillip Lord 
wrote:

> I've checked this a little further -- the current org mode on ELPA does
> not fail in the same way -- org-map-entries has changed the call from:
>
> (org-agenda-prepare-buffers
>   (list (buffer-file-name (current-buffer
>
> to:
>
> (org-agenda-prepare-buffers
>  (and buffer-file-name (list buffer-file-name)))
>
> which fixes the problem.
>

That's what I said :)

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23365#8



> Is org-mode in core going to be updated before 25.1?


 Copying the org-mode ML for this.
-- 

-- 
Kaushal Modi


Re: [O] Bug: Inconsistency with C-S-a and C-S-e [8.2.10 (release_8.2.10 @ /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)]

2016-04-28 Thread Nicolas Goaziou
Hello,

Mathieu Marques  writes:

> In other modes, C-S-a and C-S-e behave as expected that is, move cursor
> to the beginning/end of line while marking region. In other words, it
> does what C-SPC C-a and C-SPC C-e would do.
>
> However in org-mode, C-a and C-e are bound to org-beginning-of-line and
> org-end-of-line respectively.
> In org-mode, C-S-e works as expected. But C-S-a does not.
>
> I have had these details over a discussion about my issue on /r/emacs:
>
> The interactive arg for both org-beginning-of-line and
> org-end-of-line is "P". So it carries over the raw arguments
> received by the command. So ^ is not needed. The reason C-S-e still
> works as expected is because of (call-interactively 'end-of-line) in
> org-end-of-line, and so the raw args are passed to end-of-line
> without any modification.
>
> ~~Whereas we do not have (call-interactively 'beginning-of-line) in
> org-beginning-of-line~~.
> *Well, we do have (call-interactively 'move-beginning-of-line)*.
> Instead we have goto-char calls to place the point before/after the
> stars.

Fixed in master. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] bug#23365: 25.0.93; org-mode fails on export with include

2016-04-28 Thread Phillip Lord


phillip.l...@russet.org.uk (Phillip Lord) writes:

> Emacs fails in org-mode when exporting; testing from current head.
>


I've checked this a little further -- the current org mode on ELPA does
not fail in the same way -- org-map-entries has changed the call from:

(org-agenda-prepare-buffers
  (list (buffer-file-name (current-buffer

to:

(org-agenda-prepare-buffers
 (and buffer-file-name (list buffer-file-name)))

which fixes the problem.

Is org-mode in core going to be updated before 25.1?

Phil





Re: [O] org-passwords.el and encryption

2016-04-28 Thread Julien Cubizolles
Eric S Fraga  writes:

> On Wednesday, 27 Apr 2016 at 19:23, Julien Cubizolles wrote:
>> also, running:
>>
>> keychain --eval --agents ssh,gpg id_rsa MYGPGKEY
>>
>> in a non login shell.
>
> The only thing I can think of is that maybe you have not installed all
> the relevant packages for the agents or that the permissions on the
> various directories (.ssh, .gnupg) are incorrectly set?

Actually I noticed another weird behaviour: the problem disappears when
I log onto the machine via ssh from another one. The keychain commands
in the .bash_profile correctly activates ssh-agent and gpg-agent. I have
the same setup on two machines and login into 2 via ssh from 1 works
whereas login into 2 from 2 doesn't (and vice-versa). Maybe something
different in the environment variables. I'll investigate.

> Maybe ask on the bug system for keychain mentioned in the man page?

I will.

Regards,

Julien.



Re: [O] exported table has text overflowing off the pdf page

2016-04-28 Thread Eduardo Mercovich
Hi Sharon.

> I'm running into problems exporting tables into latex with a 2-column
> 3-row table with a large amount of text to go into the cells, but when
> its exported the text is taking over and overflowing off the pdf page.

>> I'm a newbie and confronted to this same situation found this latex
>> options [...]

> Thanks Eduardo, as I said I'm converting a latex document into org-mode,
> so I've already got quite complex tables working in latex, so I'm just
> pasting them into my org document and then having a '#+begin_latex'
> before the latexed table and a '#+end_latex' after the table,

Ah, sorry, didn't understood that. :)

> and its working quite well except I am, so far, unable to have a 'list
> of tables' which isn't a real problem.

Do you have a #+CAPTION and #+NAME: before the latex block? I believe
this should work with Thomas suggestion to make a LoT... 

-- 
eduardo mercovich 

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación.



Re: [O] feature proposal. Kill and yank columns

2016-04-28 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> I know that I can delete columns but I miss a function which would
> *kill* a column,  put it in the some ring (or register) and paste it.
>
> I do this my marking the content of a column and use kill-rectangle and
> yank-rectangle but I find such a solution which needs the mark,
> cumbersome.
>
> I goggled around and found for example proposals as in
>
> https://stackoverflow.com/questions/22002374/how-to-select-a-column-of-a-table-in-emacs-org-mode
>
> Which is basically the same I do. 
>
> Or in
>
> http://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas
>
> Which seems complicated.
>
> It also seems a subject which comes up regularly. Is this so difficult
> to implement?

There are `org-table-cut-region', `org-table-copy-region' and
`org-table-paste-rectangle'. In any case, you'll need the mark.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Multiple groups of mutually exclusive tags no longer working [8.3.4 (8.3.4-42-gae73c7-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20160425/)]

2016-04-28 Thread Nicolas Goaziou
Hello,

Christoph LANGE  writes:

> using the setup given below (started using emacs -q) I can no longer
> have multiple groups of mutually exclusive tags.  Only the first group
> is recognised as mutually exclusive.
>
> Here is my example file:
>
> #+TAGS: { Bfoo(b) Bbar(B) Cat(c) SO(s) PlanB(P) } { FIX(X) Tentative(T)
> NotBusy(Y) OtherPeople(p) }
>
> * Foo
>
> Using org-set-tags-command, it is possible to assign, say, both the tags
> FIX and Tentative to the headline Foo.  I would expect this to be
> impossible.  Starting the second group on a new #+TAGS: line does not
> make a difference.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Inconsistency with C-S-a and C-S-e [8.2.10 (release_8.2.10 @ /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)]

2016-04-28 Thread Kaushal Modi
Here's the thread and comment for context (the reddit markdown formatting
of crossed-out text is lost in the above plain text):
https://www.reddit.com/r/emacs/comments/4gcjep/cant_movebeginningofline_while_marking_region_in/d2hyxt6

On Thu, Apr 28, 2016 at 3:50 PM Mathieu Marques 
wrote:

> 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.
> 
>
> In other modes, C-S-a and C-S-e behave as expected that is, move cursor
> to the beginning/end of line while marking region. In other words, it
> does what C-SPC C-a and C-SPC C-e would do.
>
> However in org-mode, C-a and C-e are bound to org-beginning-of-line and
> org-end-of-line respectively.
> In org-mode, C-S-e works as expected. But C-S-a does not.
>
> I have had these details over a discussion about my issue on /r/emacs:
>
> The interactive arg for both org-beginning-of-line and
> org-end-of-line is "P". So it carries over the raw arguments
> received by the command. So ^ is not needed. The reason C-S-e still
> works as expected is because of (call-interactively 'end-of-line) in
> org-end-of-line, and so the raw args are passed to end-of-line
> without any modification.
>
> ~~Whereas we do not have (call-interactively 'beginning-of-line) in
> org-beginning-of-line~~.
> *Well, we do have (call-interactively 'move-beginning-of-line)*.
> Instead we have goto-char calls to place the point before/after the
> stars.
>
> Let me know if I can be of further help.
>
>
> Emacs  : GNU Emacs 24.5.1 (x86_64-apple-darwin15.2.0, Carbon Version 157
> AppKit 1404.34)
>  of 2015-12-28 on sandman.local
> Package: Org-mode version 8.2.10 (release_8.2.10 @
> /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)
>
> 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-src-window-setup 'current-window
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-startup-folded nil
>  org-support-shift-select 'always
>  org-after-todo-state-change-hook '(org-clock-out-if-current)
>  org-from-is-user-regexp "\\"
>  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 '(er/add-org-mode-expansions whitespace-turn-on
> turn-on-auto-fill yas-minor-mode
>  #[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)
>  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-confirm-elisp-link-function 'yes-or-no-p
>  org-edit-src-content-indentation 0
>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-startup-truncated nil
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-src-fontify-natively t
>  )
>
> --

-- 
Kaushal Modi


[O] Bug: Inconsistency with C-S-a and C-S-e [8.2.10 (release_8.2.10 @ /usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)]

2016-04-28 Thread Mathieu Marques
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.


In other modes, C-S-a and C-S-e behave as expected that is, move cursor
to the beginning/end of line while marking region. In other words, it
does what C-SPC C-a and C-SPC C-e would do.

However in org-mode, C-a and C-e are bound to org-beginning-of-line and
org-end-of-line respectively.
In org-mode, C-S-e works as expected. But C-S-a does not.

I have had these details over a discussion about my issue on /r/emacs:

The interactive arg for both org-beginning-of-line and
org-end-of-line is "P". So it carries over the raw arguments
received by the command. So ^ is not needed. The reason C-S-e still
works as expected is because of (call-interactively 'end-of-line) in
org-end-of-line, and so the raw args are passed to end-of-line
without any modification.

~~Whereas we do not have (call-interactively 'beginning-of-line) in
org-beginning-of-line~~.
*Well, we do have (call-interactively 'move-beginning-of-line)*.
Instead we have goto-char calls to place the point before/after the
stars.

Let me know if I can be of further help.


Emacs  : GNU Emacs 24.5.1 (x86_64-apple-darwin15.2.0, Carbon Version 157
AppKit 1404.34)
 of 2015-12-28 on sandman.local
Package: Org-mode version 8.2.10 (release_8.2.10 @
/usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.15/share/emacs/24.5/lisp/org/)

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-src-window-setup 'current-window
 org-confirm-shell-link-function 'yes-or-no-p
 org-startup-folded nil
 org-support-shift-select 'always
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp "\\"
 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 '(er/add-org-mode-expansions whitespace-turn-on
turn-on-auto-fill yas-minor-mode
 #[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)
 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-confirm-elisp-link-function 'yes-or-no-p
 org-edit-src-content-indentation 0
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-startup-truncated nil
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-src-fontify-natively t
 )


[O] undo-tree and org-visibility (was: Re: whether in drawer?)

2016-04-28 Thread Samuel Wales
just changing the subject header.

On 4/28/16, Samuel Wales  wrote:
> On 4/28/16, Adam Porter  wrote:
>> Do you have any other posts talking about this?  I'm interested in
>> fixing this too.  I've run into situations occasionally where undo-tree
>> seems to try to operate on a region or a hidden/folded area, and it just
>> kind of goes bonkers, and I end up having to revert the buffer.  It
>> would be nice to fix this.
>
> i proposed org visibility to the author of undo-tree, who
> did not use org at the time (but might be on this list).
>
> one suggestion i made was that undo-tree could undo and redo
> visibility changes as it goes about its normal operation.
> he thought this would require an emacs change.
>
> we cross-posted it.  stefan said it wouldn't require an
> emacs change, but org could put visibility state information
> into the undo list.
>
> this is intriguing.  dunno if it is feasible.
>
> ===
>
> an alternative is to do what i did, kludge
> undo-tree with hideous, grotesque, misshapen defadvice that
> looks like something your cat dragged in.
>
> the following is unsightly, horror-filled code written over many years
> a few minutes at a time, which works for most cases.
>
> undo-tree still shows too much and confuses me after sorting, and
> closes drawers when undoing, and sometimes does not show the change if
> you do an undo and then a redo (it is supposed to because it is
> supposed to be asymmetric in point placement).
>
> btw, possibly outside the scope of undo-tree and org visibility, org
> has a few glitches where no change shows up as a change.  there are
> also a few slightly disconcerting but pretty harmless cases where
> undo-boundary is set for compound operations like checkbox cookie
> updating.
>
> again probably in org, but maybe in undo-tree, and probably outside
> the scope of visibility, there are also cases, at least with logbook
> entries, in which you can make two separate changes to separate tasks,
> and cannot undo only one of them because there is no undo boundary
> between them.  this violates the hoary old principle of "user
> expectation that you can undo what you did without undoing anything
> else".  i have turned off agenda undo features, so i think it occurs
> with normal operation in org.  perhaps logbook updating has
> post-command-hook fanciness that changes undo behavior?  just a guess.
>
> those i did not attempt to fix.  i am not capable of it.
>
> i include the following monstrous insult to programmer-kind (i am a
> mere user, as if /that's/ an excuse) with glorious comments for your
> amusement.
>
> (defadvice undo-tree-undo (after org-undo-reveal activate compile)
>   "Make point and context visible after an undo command in org-mode."
>   (alpha-org-reveal-for-undo))
> ;; ;; ;;might be nec, perhaps because undo tree moves point to
> ;; ;; ;;other change
> (defadvice undo-tree-redo (after org-redo-reveal activate compile)
>   "Make point and context visible after an undo command in org-mode."
>   (alpha-org-reveal-for-undo))
> (defun alpha-org-reveal-for-undo ()
>   ;; maybe we want seiza canonical if on header, else canonical
>   (save-excursion
> (when (eq major-mode 'org-mode)
>   (unless (eq last-command this-command)
> ;; '(undo-tree-undo
> ;;   undo-tree-redo
> ;;   ;; self-insert-command
> ;;   ;; org-self-insert-command
> ;;   ;; org-shiftmetadown
> ;;   ;; org-shiftmetaup
> ;;   ))
>
> (unless (or (org-at-heading-p)
> ;; in drawer
> )
>   (alpha-hide-parent))
> ;; (org-show-entry)
>
> ;; (org-overview)
> ;; (recenter)
> ;; (if (org-at-heading-p)
> ;; (save-excursion
> ;;   (forward-line 1)
> ;;   (org-show-set-visibility 'canonical))
> ;;   ;; this creates ellipsis if on headline
> (org-show-set-visibility 'canonical)
> ;; (when (org-in-drawer-p) org-flag-drawer nil
> ;; get rid of that !@#$!@#$ ellipsis at top of window
> ;;   fixme still need to do this after org-cycle
> (scroll-lock-previous-line)
> (scroll-lock-next-line)
> ))
> (when (org-truely-invisible-p)
>   (org-show-set-visibility 'canonical))
> ;; notwork
> ;; (save-excursion
> ;;   (move-to-window-line 1)
> ;;   (redisplay))
> ))
> ;; (when (org-at-heading-p)
> ;;   ;; (when (outline-invisible-p)
> ;;   '(org-reveal t)
> ;;   (org-show-set-visibility 'canonical))
> ;;   ;; (when (eq last-command 'alpha-org-sort-siblings)
> ;;   (alpha-org-show-children-and-entry
> ;;(ad-unadvise 'undo)
> ;; elsewhere (setq org-self-insert-cluster-for-undo nil)
>


-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

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

Denmark: free Karina Hansen NOW.



Re: [O] whether in drawer?

2016-04-28 Thread Samuel Wales
On 4/28/16, Adam Porter  wrote:
> Do you have any other posts talking about this?  I'm interested in
> fixing this too.  I've run into situations occasionally where undo-tree
> seems to try to operate on a region or a hidden/folded area, and it just
> kind of goes bonkers, and I end up having to revert the buffer.  It
> would be nice to fix this.

i proposed org visibility to the author of undo-tree, who
did not use org at the time (but might be on this list).

one suggestion i made was that undo-tree could undo and redo
visibility changes as it goes about its normal operation.
he thought this would require an emacs change.

we cross-posted it.  stefan said it wouldn't require an
emacs change, but org could put visibility state information
into the undo list.

this is intriguing.  dunno if it is feasible.

===

an alternative is to do what i did, kludge
undo-tree with hideous, grotesque, misshapen defadvice that
looks like something your cat dragged in.

the following is unsightly, horror-filled code written over many years
a few minutes at a time, which works for most cases.

undo-tree still shows too much and confuses me after sorting, and
closes drawers when undoing, and sometimes does not show the change if
you do an undo and then a redo (it is supposed to because it is
supposed to be asymmetric in point placement).

btw, possibly outside the scope of undo-tree and org visibility, org
has a few glitches where no change shows up as a change.  there are
also a few slightly disconcerting but pretty harmless cases where
undo-boundary is set for compound operations like checkbox cookie
updating.

again probably in org, but maybe in undo-tree, and probably outside
the scope of visibility, there are also cases, at least with logbook
entries, in which you can make two separate changes to separate tasks,
and cannot undo only one of them because there is no undo boundary
between them.  this violates the hoary old principle of "user
expectation that you can undo what you did without undoing anything
else".  i have turned off agenda undo features, so i think it occurs
with normal operation in org.  perhaps logbook updating has
post-command-hook fanciness that changes undo behavior?  just a guess.

those i did not attempt to fix.  i am not capable of it.

i include the following monstrous insult to programmer-kind (i am a
mere user, as if /that's/ an excuse) with glorious comments for your
amusement.

(defadvice undo-tree-undo (after org-undo-reveal activate compile)
  "Make point and context visible after an undo command in org-mode."
  (alpha-org-reveal-for-undo))
;; ;; ;;might be nec, perhaps because undo tree moves point to
;; ;; ;;other change
(defadvice undo-tree-redo (after org-redo-reveal activate compile)
  "Make point and context visible after an undo command in org-mode."
  (alpha-org-reveal-for-undo))
(defun alpha-org-reveal-for-undo ()
  ;; maybe we want seiza canonical if on header, else canonical
  (save-excursion
(when (eq major-mode 'org-mode)
  (unless (eq last-command this-command)
;; '(undo-tree-undo
;;   undo-tree-redo
;;   ;; self-insert-command
;;   ;; org-self-insert-command
;;   ;; org-shiftmetadown
;;   ;; org-shiftmetaup
;;   ))

(unless (or (org-at-heading-p)
;; in drawer
)
  (alpha-hide-parent))
;; (org-show-entry)

;; (org-overview)
;; (recenter)
;; (if (org-at-heading-p)
;; (save-excursion
;;   (forward-line 1)
;;   (org-show-set-visibility 'canonical))
;;   ;; this creates ellipsis if on headline
(org-show-set-visibility 'canonical)
;; (when (org-in-drawer-p) org-flag-drawer nil
;; get rid of that !@#$!@#$ ellipsis at top of window
;;   fixme still need to do this after org-cycle
(scroll-lock-previous-line)
(scroll-lock-next-line)
))
(when (org-truely-invisible-p)
  (org-show-set-visibility 'canonical))
;; notwork
;; (save-excursion
;;   (move-to-window-line 1)
;;   (redisplay))
))
;; (when (org-at-heading-p)
;;   ;; (when (outline-invisible-p)
;;   '(org-reveal t)
;;   (org-show-set-visibility 'canonical))
;;   ;; (when (eq last-command 'alpha-org-sort-siblings)
;;   (alpha-org-show-children-and-entry
;;(ad-unadvise 'undo)
;; elsewhere (setq org-self-insert-cluster-for-undo nil)



Re: [O] How to reorder a footnote list?

2016-04-28 Thread Nick Dokos
Sharon Kimble  writes:

> Adam Porter  writes:
>
>> I don't understand: you want the footnotes to be in reverse order?  I
>> know very little about latex, so I'm sorry if this is just noise.
>
> Thanks Adam. Org-mode likes to set the footnotes in its 'reference'
> section in reverse order, i.e. [fn:60] [fn:59] etc. But in my case it
> was going [fn:1] [fn:2] etc.

FWIW, I have never seen org-mode order footnotes in reverse order.

-- 
Nick




Re: [O] Special alignment in org-mode

2016-04-28 Thread John Kitchin
In this case though you probably want to specify a fixed
column, and consider using something like indent-rigidly on the heading
body so you don't have an overlay on every single line.


David Cao writes:

> Hi!
>
> This solution works fairly well with the headers themselves, but the actual
> content beneath the headers stays to the side of the buffer (as pictured:
> http://i.imgur.com/nGv8XBI.png).
> Would there be any way to fix this?
>
> David
>
> On Wed, Apr 27, 2016 at 9:47 AM John Kitchin 
> wrote:
>
>> I think this does approximately what you want:
>>
>> #+BEGIN_SRC emacs-lisp :results none
>> (require 'ov)
>>
>> (defun org-max-heading-depth ()
>>   "Get maximum depth of a heading."
>>   (let ((max-depth 0)
>> depth)
>> (org-map-entries (lambda ()
>>(when (> (setq depth (car
>> (org-heading-components))) max-depth)
>>  (setq max-depth depth
>> max-depth))
>>
>>
>> (defun org-right-align-overlay ()
>>   "Put an overlay on headline * to right align to maximum depth.
>> Should be run while on the headline."
>>   (interactive)
>>   (let* ((diff (- (org-max-heading-depth) (car (org-heading-components
>>  ov)
>> (while (and (setq ov (ov-at (match-beginning 1)))
>>(overlay-get ov 'right-align))
>>   (delete-overlay ov))
>>
>> ;; (setq ov (make-overlay (line-beginning-position) (+ 1
>> (line-beginning-position
>> (setq ov (make-overlay (match-beginning 1) (+ 1 (match-beginning 1
>> (overlay-put ov 'before-string (make-string diff ? ))
>> (overlay-put ov 'right-align t)))
>>
>> (defun org-right-align-clear ()
>>   (interactive)
>>   (ov-clear 'right-align))
>>
>> (defun align-matcher ( limit)
>>   (while (re-search-forward org-heading-regexp limit t)
>> (org-right-align-overlay)))
>>
>> (add-to-list 'org-font-lock-hook 'align-matcher)
>> #+END_SRC
>>
>> Its only light tested, and may be slow on a long document because it is
>> checking the maximum depth each time. You could set this to a constant,
>> e.g. 8 if it is too slow.
>>
>> David Cao writes:
>>
>> > Hello,
>> >
>> > I was wondering if there is any way to right-align the header indicators
>> > while left-aligning the actual content. Unfortunately I haven't been able
>> > to find any mention of such a feature online.
>> >
>> > For example:
>> >
>> >   * My fancy org file
>> >  ** Header 2
>> > Some content here
>> > *** Header 3
>> >
>> > Thanks in advance!
>> > David
>>
>>
>> --
>> 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
>>


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



Re: [O] Special alignment in org-mode

2016-04-28 Thread Georgiy Tugai
I believe that org-indent-mode (#+STARTUP: indent) might do what you
want with the content, although I expect that it will interfere with the
specialized overlays for right-aligning the *'s.

On 28 Apr, David Cao wrote:
> Hi!
> 
> This solution works fairly well with the headers themselves, but the actual
> content beneath the headers stays to the side of the buffer (as pictured:
> http://i.imgur.com/nGv8XBI.png).
> Would there be any way to fix this?
> 
> David
> 
> On Wed, Apr 27, 2016 at 9:47 AM John Kitchin 
> wrote:
> 
> > I think this does approximately what you want:
> >
> > #+BEGIN_SRC emacs-lisp :results none
> > (require 'ov)
> >
> > (defun org-max-heading-depth ()
> >   "Get maximum depth of a heading."
> >   (let ((max-depth 0)
> > depth)
> > (org-map-entries (lambda ()
> >(when (> (setq depth (car
> > (org-heading-components))) max-depth)
> >  (setq max-depth depth
> > max-depth))
> >
> >
> > (defun org-right-align-overlay ()
> >   "Put an overlay on headline * to right align to maximum depth.
> > Should be run while on the headline."
> >   (interactive)
> >   (let* ((diff (- (org-max-heading-depth) (car (org-heading-components
> >  ov)
> > (while (and (setq ov (ov-at (match-beginning 1)))
> >(overlay-get ov 'right-align))
> >   (delete-overlay ov))
> >
> > ;; (setq ov (make-overlay (line-beginning-position) (+ 1
> > (line-beginning-position
> > (setq ov (make-overlay (match-beginning 1) (+ 1 (match-beginning 1
> > (overlay-put ov 'before-string (make-string diff ? ))
> > (overlay-put ov 'right-align t)))
> >
> > (defun org-right-align-clear ()
> >   (interactive)
> >   (ov-clear 'right-align))
> >
> > (defun align-matcher ( limit)
> >   (while (re-search-forward org-heading-regexp limit t)
> > (org-right-align-overlay)))
> >
> > (add-to-list 'org-font-lock-hook 'align-matcher)
> > #+END_SRC
> >
> > Its only light tested, and may be slow on a long document because it is
> > checking the maximum depth each time. You could set this to a constant,
> > e.g. 8 if it is too slow.
> >
> > David Cao writes:
> >
> > > Hello,
> > >
> > > I was wondering if there is any way to right-align the header indicators
> > > while left-aligning the actual content. Unfortunately I haven't been able
> > > to find any mention of such a feature online.
> > >
> > > For example:
> > >
> > >   * My fancy org file
> > >  ** Header 2
> > > Some content here
> > > *** Header 3
> > >
> > > Thanks in advance!
> > > David
> >
> >
> > --
> > 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
> >


signature.asc
Description: PGP signature


Re: [O] How to reorder a footnote list?

2016-04-28 Thread Sharon Kimble
Adam Porter  writes:

> Sharon Kimble  writes:
>
>> Org-mode likes to set the footnotes in its 'reference'
>> section in reverse order, i.e. [fn:60] [fn:59] etc. But in my case it
>> was going [fn:1] [fn:2] etc.
>
> Hmm, this seems strange to me.  It hasn't worked that way for me in the
> past, and I just tested this on a new org file and it didn't put them in
> reverse order.  Currently on Org 8.2.4.  Could this be something to do
> with latex support?

I now have '#+STARTUP: fnadjust' in the preamble immediately below the
title, author and date fields and this reorders the footnote list so it
is now going [fn:1] [fn:2] [fn:3] etc, and adds the new footnote at the
end of the list. There is a slight pause whilst its reordering but then
it works just fine.

No, its not the latex support, its what is happening with a new org-mode
footnote. But please see my previous paragraph. 

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.93


signature.asc
Description: PGP signature


Re: [O] Bug: various short questions about column view, code blocks and export [8.3.4 (release_8.3.4-759-g9508dc @ /home/youngfrog/sources/org-mode/lisp/)]

2016-04-28 Thread Nicolas Goaziou
Hello,

Nicolas Richard  writes:

> The inlined file below contains both the material needed to reproduce
> the problems I have and a description of those.
>
> * a tree with some info for column view
>   :PROPERTIES:
>   :ID:   monid
>   :COLUMNS:  %25ITEM %PROP
>   :END:
> ** foo
>:PROPERTIES:
>:PROP: yow
>:END:
> ** bar
>:PROPERTIES:
>:PROP: bow
>:END:
> ** baz
>:PROPERTIES:
>:PROP: low
>:END:
> * show the column view here
> #+BEGIN: columnview :hlines 1 :id monid :skip-empty-rows t
> | ITEM | PROP |
> |--+--|
> | foo  | yow  |
> | bar  | bow  |
> | baz  | low  |
> #+END:
> * use the data from the column view in a src block
> #+BEGIN_SRC elisp :var chap = mytable :exports results
>   'anything
> #+END_SRC
>
> * discussion
> I open this org file with :
> : emacs -q -L ~/sources/org-mode/lisp -l org.el --eval '(setq 
> org-export-babel-evaluate nil)' tmp/mytest.org
> where tmp/mytest.org is the name of the file.
>
> First, I notice that adding the :ARCHIVE: tag to the first headline
> and trying to show column view doesn't work. it seems to do
> nothing. Ok so let's remove that tag again.

This is a feature. Archived subtrees are ignored when calling column
view. As you noticed, in this case, removing the tag is the way to go.

> Now, hitting =C-c C-c= in the code block gives ~Reference not
> found~. Which reference is it ? IDK.

There is no #+NAME: mytable in your example.

> Removing the TBLNAME line and hitting =C-c C-c= on the code block
> again now gives ~Reference `mytable' not found in this buffer~. I
> guess it's a better error ?

OK, so I guess there wase a TBLNAME line somewhere within the file. Be
sure it is located above the table, not above the dynamic block.

> Now when I'm trying to export, I get the same errors as above, even
> though I have =org-export-babel-evaluate= set to =nil=.

This is fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] [patch] get modification-time from vc

2016-04-28 Thread Rasmus
Hi,

The file system modification time as accessed by {{{modification-time}}}
is often wrong, e.g. when a project is newly cloned or if the file has
been copied in a sloppy manner.  At least if modification time suggest the
time that the file was edited by an author.

Sometimes vc can provide a better answer.  The attached patch tries to get
a sensible time from vc.

Caveats:
- There’s no customization.  I think that’s fine.  If someone feels
  strongly against this behavior a defcustom could be added or we could
  add another a macro, {{{vc-modification-time}}}.
- org-macs will depend on vc.  I don’t really see why this would be an
  issue as vc is bundled with Emacs.

I have only tested this with git, but it should work with other vc
backends to the extend that ‘parse-time-string’ can handle the way they
format dates.

WDYT?

Rasmus

-- 
Even a three-legged dog has three good legs to lose
>From a3298310fe5f399dacd5ab13b725a95d9c626a21 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Thu, 28 Apr 2016 17:15:29 +0200
Subject: [PATCH 1/3] org-macro: Maybe get modification-time from vc.el

* org-macro.el (org-macro-initialize-templates): Check modification-time
  in version control via vc.
* doc/org.texi (Macro replacement): Document new behavior.
* etc/ORG-NEWS: Mention new behavior.
---
 doc/org.texi  |  6 +++---
 etc/ORG-NEWS  |  4 +++-
 lisp/org-macro.el | 27 ++-
 3 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 17b01c2..bc08277 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10251,9 +10251,9 @@ understood by @code{format-time-string}.
 @cindex time, macro
 @cindex modification time, macro
 These macros refer to the date and time when the document is exported and to
-the modification date and time of the file being exported, respectively.
-@var{FORMAT} should be a format string understood by
-@code{format-time-string}.
+the modification date, potentially found via version control, and time of the
+file being exported, respectively.  @var{FORMAT} should be a format string
+understood by @code{format-time-string}.
 
 @item @{@{@{input-file@}@}@}
 @cindex input file, macro
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 99241e2..c8b1627 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -104,7 +104,9 @@ is straightforward.  For example
 becomes
 
 : ("pdf" . (lambda (file link) (foo)))
-
+*** ~{{{modification-time}}}~ tries to obtain time via =vc=
+As a fallback, the modification time will be found via the file
+system.
 ** New features
 *** New org-protocol key=value syntax
 
diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 5e9be98..debe6b0 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -59,6 +59,9 @@
 (declare-function org-mode "org" ())
 (declare-function org-remove-double-quotes "org" (s))
 (declare-function org-with-wide-buffer "org-macs" ( body))
+(declare-function vc-backend "vc-hooks" (f))
+(declare-function vc-call "vc-hooks" ( args))
+(declare-function vc-exec-after "vc-dispatcher" (code))
 
 ;;; Variables
 
@@ -148,7 +151,29 @@ function installs the following ones: \"property\",
 		(cons "modification-time"
 			  (format "(eval (format-time-string \"$1\" '%s))"
   (prin1-to-string
-   (nth 5 (file-attributes visited-file)
+   (or
+;; First, check if file has a VC modification time.
+(save-window-excursion
+  (when (vc-backend visited-file)
+	(let ((buf (get-buffer-create " *org-vc*"))
+	  date)
+	  (vc-call print-log visited-file buf nil nil 1)
+	  (with-current-buffer buf
+	(vc-exec-after
+	 (lambda ()
+	   (goto-char (point-min))
+	   (when (search-forward-regexp "Date:?[ \t]*" nil t)
+		 (let ((time (parse-time-string
+			  (buffer-substring
+			   (point) (point-at-eol)
+		   (when (org-some 'identity time)
+		 (setq date (apply 'encode-time time
+	  (let ((proc (get-buffer-process buf)))
+	(while (and proc (accept-process-output proc .5 nil t
+	  (kill-buffer " *org-vc*")
+	  date)))
+;; Otherwise use the time registered by the file system.
+(nth 5 (file-attributes visited-file))
 (setq org-macro-templates templates)))
 
 (defun org-macro-expand (macro templates)
-- 
2.8.0



Re: [O] pandoc-style citations

2016-04-28 Thread Richard Lawrence
Hi Alex,

Alex Fenton  writes:

>> Export is where efforts stalled last year.
>
> That's understandable, given that, as you say, it's a complex problem 
> given the range of citation styles and output formats. It's still a 
> shame given the work that you (pl.) have put into integrating citations 
> into the org parser & element tree so they are first class objects.
>
> I don't know whether it's conceivable that the data structures and 
> parsing could be integrated into org, with the (presumably) relatively 
> easy latex output, which I suspect is the commonest use case, and then 
> with some kind of "adequate" output for other targets (html, text, odt) 
> - perhaps an output that would require further post-processing by a 
> third-party tool such as citeproc or pandoc.
>
> Latex-outputters would be better off and other targets no worse off than 
> present, and it might act as a spur to solve the other target formats 
> one by one way. But I can see that this has been to some extent 
> considered and can also see the arguments against.

Unfortunately, even the LaTeX case is not so easy unless you assume
users are managing the bibliography database, and the mapping of
citation keys into that database, themselves.  It's easy to map the Org
syntax to the LaTeX syntax if you can just pass the keys through, but
that isn't a great assumption to make.  And things are a lot more
complicated once you have to worry about looking up the keys somewhere,
generating an appropriate .bib file, etc. We will have to do this stuff
for other backends anyway, so it seems sensible to do it for LaTeX too,
but that's what makes the project so big (especially if we can't just
pick one database format to support).

Maybe you're right that a good first step would just be to generate
LaTeX syntax, and just let users manage the bibliography database in
whatever way works for them, without trying to interface with it.  This
could be done quickly -- indeed, I think it is already most of the way
done.  And as you say, that would go a long way toward meeting many
people's needs.

I hope I will have some time next week to look at this.  I'll report
back!

Best,
Richard



Re: [O] Bug: various short questions about column view, code blocks and export [8.3.4 (release_8.3.4-759-g9508dc @ /home/youngfrog/sources/org-mode/lisp/)]

2016-04-28 Thread Nicolas Richard
Nicolas Goaziou  writes:
> This is a feature. Archived subtrees are ignored when calling column
> view. As you noticed, in this case, removing the tag is the way to go.

ok

> There is no #+NAME: mytable in your example.
> OK, so I guess there wase a TBLNAME line somewhere within the file.

Indeed, sorry, it was lost during the testing.

> Be sure it is located above the table, not above the dynamic block.

thanks, I did not realize this was the way to go :

#+BEGIN: columnview :hlines 1 :id monid :skip-empty-rows t
#+TBLNAME: mytable
...
#+END:

(I thought anything between BEGIN and END would be removed on the next
update -- but the TBLNAME line is kept.)

>> Now when I'm trying to export, I get the same errors as above, even
>> though I have =org-export-babel-evaluate= set to =nil=.
>
> This is fixed.

Indeed, thanks!

-- 
Nicolas



Re: [O] How to reorder a footnote list?

2016-04-28 Thread Adam Porter
Sharon Kimble  writes:

> Org-mode likes to set the footnotes in its 'reference'
> section in reverse order, i.e. [fn:60] [fn:59] etc. But in my case it
> was going [fn:1] [fn:2] etc.

Hmm, this seems strange to me.  It hasn't worked that way for me in the
past, and I just tested this on a new org file and it didn't put them in
reverse order.  Currently on Org 8.2.4.  Could this be something to do
with latex support?




Re: [O] whether in drawer?

2016-04-28 Thread Adam Porter
Samuel Wales  writes:

> thank you.  for years i have been trying to advise undo-tree to deal
> with visibility properly.  namely, to not try to undo or redo
> invisibly, but also not to leave too much stuff visible.  maybe if i
> can get it to do canonical visibility except in drawers (where it
> should keep the drawer open if point is in it) it will work properly.

Do you have any other posts talking about this?  I'm interested in
fixing this too.  I've run into situations occasionally where undo-tree
seems to try to operate on a region or a hidden/folded area, and it just
kind of goes bonkers, and I end up having to revert the buffer.  It
would be nice to fix this.




Re: [O] No plot with org-plot

2016-04-28 Thread Loris Bennett
Michael Welle  writes:

> Hi,
>
> "Loris Bennett"  writes:
>> Hi,
>>
>> Following
>>
>> http://orgmode.org/manual/Org_002dPlot.html#Org_002dPlot
>>
>> I tried to do
>>
>> #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange 
>> [0:]"
>> | Sede  | Max cites | H-index |
>>
>> |---+---+-|
>> | Chile |257.72 |   21.39 |
>> | Leeds |165.77 |   19.68 |
>> | Sao Paolo | 71.00 |   11.50 |
>> | Stockholm |134.19 |   14.33 |
>> | Morelia   |257.56 |   17.67 |
>>
>> but nothing happens: no error, no plot.  In the *Messages* buffer, I
>> just get
>>
>> gnuplot-mode 0.7-beta (gnuplot 4.6) -- report bugs with "C-c C-u"
>>
>> Any ideas?
> start with removing the empty line in your table. Then the plot should
> show up.
>
> Regards
> hmw

My original message didn't contain that empty line, so it seems to be
yours, not mine.  Anyway, the answer is to install 'gnuplot-x11' (on
Debian).

Cheers,

Loris

-- 
This signature is currently under construction.




[O] Bug: various short questions about column view, code blocks and export [8.3.4 (release_8.3.4-759-g9508dc @ /home/youngfrog/sources/org-mode/lisp/)]

2016-04-28 Thread Nicolas Richard
Hi all,

The inlined file below contains both the material needed to reproduce
the problems I have and a description of those.

* a tree with some info for column view
  :PROPERTIES:
  :ID:   monid
  :COLUMNS:  %25ITEM %PROP
  :END:
** foo
   :PROPERTIES:
   :PROP: yow
   :END:
** bar
   :PROPERTIES:
   :PROP: bow
   :END:
** baz
   :PROPERTIES:
   :PROP: low
   :END:
* show the column view here
#+BEGIN: columnview :hlines 1 :id monid :skip-empty-rows t
| ITEM | PROP |
|--+--|
| foo  | yow  |
| bar  | bow  |
| baz  | low  |
#+END:
* use the data from the column view in a src block
#+BEGIN_SRC elisp :var chap = mytable :exports results
  'anything
#+END_SRC

* discussion
I open this org file with :
: emacs -q -L ~/sources/org-mode/lisp -l org.el --eval '(setq 
org-export-babel-evaluate nil)' tmp/mytest.org
where tmp/mytest.org is the name of the file.

First, I notice that adding the :ARCHIVE: tag to the first headline
and trying to show column view doesn't work. it seems to do
nothing. Ok so let's remove that tag again.

Now, hitting =C-c C-c= in the code block gives ~Reference not
found~. Which reference is it ? IDK.

Removing the TBLNAME line and hitting =C-c C-c= on the code block
again now gives ~Reference `mytable' not found in this buffer~. I
guess it's a better error ?

Now when I'm trying to export, I get the same errors as above, even
though I have =org-export-babel-evaluate= set to =nil=.

I honestly don't know if I'm doing it wrong or if it's org acting weird.

I have Org-mode version 8.3.4 (release_8.3.4-759-g9508dc @ 
/home/youngfrog/sources/org-mode/lisp/) 
I have GNU Emacs 24.5.50.1 (i686-pc-linux-gnu, GTK+ Version 3.14.10) of 
2015-05-18 on localhost

-- 
Nicolas Richard


Re: [O] new rule to capitalise the first word in a sentence? but how?

2016-04-28 Thread Uwe Brauer
>>> "Marcin" == Marcin Borkowski  writes:

   > On 2016-04-27, at 19:36, Sharon Kimble  wrote:

   >> How can I have a rule that will capitalise the first word of a new
   >> sentence, with the previous sentence concluding with a full stop and
   >> then one space please? This would be extremely useful for me as I tend
   >> to forget to capitalise the first word, but how can it be done please?

   > Would this help?

   > https://www.emacswiki.org/emacs/auto-capitalize.el

This is even in MELPA!

Uwe Brauer 




Re: [O] How to reorder a footnote list?

2016-04-28 Thread Sharon Kimble
Stig Brautaset  writes:

> Sharon Kimble  writes:
>
>> [...] I looked at the footnote references *in* the document and found
>> that they were all [1] [2] etc. Somehow it had lost 'fn:*' before each
>> reference number
>
> Could it be that you at some point did `C-u C-c C-x n'? This removes the
> fn: from the footnotes. I have been bitten by doing exactly that in the
> past. The manual has more: http://orgmode.org/manual/Footnotes.html 
>
Thanks Stig.

Could be, I've set 'org-export-to-latex' to "s-#" which I've found is
far quicker and easier than 'C-c C-e l l', but its perfectly possible
that I'd mangled it at some point. And yes, I had looked at that page
but didn't find any easy way of sorting it out, so it just had to be
done manually. Its thrown my writing schedule off but it should catch up
over the weekend, I hope?! :)

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.93


signature.asc
Description: PGP signature


Re: [O] No plot with org-plot

2016-04-28 Thread Loris Bennett
Eric S Fraga  writes:

> On Thursday, 28 Apr 2016 at 10:20, Loris Bennett wrote:
>> Does the file in /tmp stay there until you close the Gnuplot window?
>
> No, it seems to disappear right away.

OK.  Everything was working as it should.  My Debian system had

  gnuplot-nox

instead of

  gnuplot-x11

installed and that was what I got: no X.

I have now installed gnuplot-x11 and, o Wunder, get X windows.

Cheers,

Loris
-- 
This signature is currently under construction.




[O] Bug: Multiple groups of mutually exclusive tags no longer working [8.3.4 (8.3.4-42-gae73c7-elpaplus @ c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20160425/)]

2016-04-28 Thread Christoph LANGE
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.


Dear Org developers,

using the setup given below (started using emacs -q) I can no longer
have multiple groups of mutually exclusive tags.  Only the first group
is recognised as mutually exclusive.

Here is my example file:

#+TAGS: { Bfoo(b) Bbar(B) Cat(c) SO(s) PlanB(P) } { FIX(X) Tentative(T)
NotBusy(Y) OtherPeople(p) }

* Foo

Using org-set-tags-command, it is possible to assign, say, both the tags
FIX and Tentative to the headline Foo.  I would expect this to be
impossible.  Starting the second group on a new #+TAGS: line does not
make a difference.

I tested the same with Org 8.2.10, i.e. the version bundled with my
Emacs, and it worked.

Cheers,

Christoph

Emacs  : GNU Emacs 25.0.92.1 (x86_64-w64-mingw32)
 of 2016-03-03
Package: Org-mode version 8.3.4 (8.3.4-42-gae73c7-elpaplus @
c:/Users/clange/.emacs.d/elpa/org-plus-contrib-20160425/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-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-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 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 '(#[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 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 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-show-empty-lines 
org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )

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

→ CSCUBS Computer Science Conference for University of Bonn Students
  25 May 2016; submission deadline 28 April – http://cscubs.cs.uni-bonn.de



Re: [O] How to reorder a footnote list?

2016-04-28 Thread Stig Brautaset

Sharon Kimble  writes:

> [...] I looked at the footnote references *in* the document and found
> that they were all [1] [2] etc. Somehow it had lost 'fn:*' before each
> reference number

Could it be that you at some point did `C-u C-c C-x n'? This removes the
fn: from the footnotes. I have been bitten by doing exactly that in the
past. The manual has more: http://orgmode.org/manual/Footnotes.html 

Stig




Re: [O] How to reorder a footnote list?

2016-04-28 Thread Sharon Kimble
Adam Porter  writes:

> I don't understand: you want the footnotes to be in reverse order?  I
> know very little about latex, so I'm sorry if this is just noise.

Thanks Adam. Org-mode likes to set the footnotes in its 'reference'
section in reverse order, i.e. [fn:60] [fn:59] etc. But in my case it
was going [fn:1] [fn:2] etc. So I manually reordered them but I still
wasn't able to export my file, so I looked at the footnote references
*in* the document and found that they were all [1] [2] etc. Somehow it
had lost 'fn:*' before each reference number, so I went through the
document just reinstating the missing 'fn:' and now it all works again.

>
> BTW, this won't help now, and is not meant to be snarky, but keeping
> your org files in a git repo would help with a situation like this,
> because you could find the commit where the change happened and get the
> old text back.  I use a combination of real-auto-save-mode, a cron job,
> and a "raise-or-run" script that automatically commits my org file
> changes to git either every 15 minutes or every time I hide Emacs with
> the script.  It has saved me a few times when I accidentally deleted
> subtrees without realizing it until days later (probably had a region
> marked by accident and then typed over it or something like that).

I do have git set up to auto-commit in certain working files to every 4
hours, so I did look at the git log but wasn't able to find when the
error had occurred, so I sorted it all out manually. But I have now set
the cron job to work every 15 minutes between 0600 and 2200, I don't see
the sense of doing it when I'm in bed! But thanks for the idea.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.93


signature.asc
Description: PGP signature


Re: [O] new rule to capitalise the first word in a sentence? but how?

2016-04-28 Thread Sharon Kimble
Samuel Wales  writes:

> very old code, maybe can be adjusted slightly to do what you want.
>
> (defun alpha-capitalize-sentences ()
>   (interactive)
>   (let ((b (region-beginning))
> (e (region-end))
> ;;i always use double spaces but i want sentence movement
> ;;to be liberal -- that is to count more things as
> ;;sentences.
> (sentence-end-double-space nil)
> ;;need to make it understand org headlines etc. also.
> ;;don't know if this will help.  will fail on *bold*.
> ;;non-idempotent.  use a vector function.
> (sentence-end-without-space
>  (concat sentence-end-without-space "*")))
> (save-excursion
>   (goto-char b)
>   (loop
> while (< (point) (max b e))
> do
> (when (y-or-n-p "capitalize this sentence?")
>   (capitalize-word 1))
> ;;forward-sentence-incl-org (headlines, items, other)
> do
> (let ((sentence-end-without-period t))
>   (forward-sentence
> ;;;(replace-regexp "i" "I" t (region-beginning) (region-end))
> (save-excursion
>   (perform-replace "i" "I"
>nil t t nil nil
>b e

Thanks for this Samuel, it does work, but I'm trying to find a way of
auto-capitalising my sentences as I write, whereas this only does it
when its called 'after' the event. But thanks anyway.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.93


signature.asc
Description: PGP signature


Re: [O] new rule to capitalise the first word in a sentence? but how?

2016-04-28 Thread Sharon Kimble
Marcin Borkowski  writes:

> On 2016-04-27, at 19:36, Sharon Kimble  wrote:
>
>> How can I have a rule that will capitalise the first word of a new
>> sentence, with the previous sentence concluding with a full stop and
>> then one space please? This would be extremely useful for me as I tend
>> to forget to capitalise the first word, but how can it be done please?
>
> Would this help?
>
> https://www.emacswiki.org/emacs/auto-capitalize.el
>

Thanks Marcin, this *did* work, on first start of emacs it worked
everywhere, but on a subsequent start of emacs it started complaining
about the 'emacs.desktop' files and played merry hell with them! So I
then set it up to just work in org-mode, and again it did work on first
start. But when I tried a second start it started playing hell with my
emacs.desktop files again. So I've disabled it from working until I can
find a work-around.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.93


signature.asc
Description: PGP signature


Re: [O] No plot with org-plot

2016-04-28 Thread Eric S Fraga
On Thursday, 28 Apr 2016 at 10:20, Loris Bennett wrote:
> Does the file in /tmp stay there until you close the Gnuplot window?

No, it seems to disappear right away.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-655-g9fb077



Re: [O] feature proposal. Kill and yank columns

2016-04-28 Thread Uwe Brauer

   > Hi!


   > Some time ago I wrote this function:

   > (defun mw-org-table-mark-column ()
   >   "Mark the column containing point.
   > This works only in org tables.

   > For tables with horizontal lines this function can fail."
   >   (interactive)
   >   (unless (org-at-table-p) (user-error "Not at a table"))
   >   (org-table-find-dataline)
   >   (org-table-check-inside-data-field)
   >   (let* ((col (org-table-current-column))
   >  (beg (org-table-begin))
   > (end (org-table-end)))
   > (goto-char beg)
   > (org-table-goto-column col)
   > (re-search-backward "|" nil t)
   > (push-mark)
   > (goto-char (1- end))
   > (org-table-goto-column (1+ col))
   > (re-search-backward "|" nil t)
   > (exchange-point-and-mark)))

   > If you do M-x mw-org-table-mark-column followed by C-x SPACE in a
   > table-cell you (hopefully) the column gets marked.

   > This might be a start.

That is cool, thanks, unfortunately some of my tables contain horizontal
lines, but this is not really very essential for me.

   > HTH,




Re: [O] feature proposal. Kill and yank columns

2016-04-28 Thread Uwe Brauer
>>> "Stig" == Stig Brautaset  writes:

   > Uwe Brauer  writes:
   >> Hi
   >> 
   >> I know that I can delete columns but I miss a function which would
   >> *kill* a column,  put it in the some ring (or register) and paste it.

   > Does `org-table-move-column' help,

no

   > or do you mean to move the column to a different table?


yes

Uwe 




Re: [O] feature proposal. Kill and yank columns

2016-04-28 Thread Stig Brautaset
Uwe Brauer  writes:

> Hi
>
> I know that I can delete columns but I miss a function which would
> *kill* a column,  put it in the some ring (or register) and paste it.

Does `org-table-move-column' help, or do you mean to move the column to
a different table?

Stig




Re: [O] feature proposal. Kill and yank columns

2016-04-28 Thread Marco Wahl
Hi!

> I know that I can delete columns but I miss a function which would
> *kill* a column,  put it in the some ring (or register) and paste it.
>
> I do this my marking the content of a column and use kill-rectangle and
> yank-rectangle but I find such a solution which needs the mark,
> cumbersome.

> It also seems a subject which comes up regularly. Is this so difficult
> to implement?

Some time ago I wrote this function:

(defun mw-org-table-mark-column ()
  "Mark the column containing point.
This works only in org tables.

For tables with horizontal lines this function can fail."
  (interactive)
  (unless (org-at-table-p) (user-error "Not at a table"))
  (org-table-find-dataline)
  (org-table-check-inside-data-field)
  (let* ((col (org-table-current-column))
 (beg (org-table-begin))
 (end (org-table-end)))
(goto-char beg)
(org-table-goto-column col)
(re-search-backward "|" nil t)
(push-mark)
(goto-char (1- end))
(org-table-goto-column (1+ col))
(re-search-backward "|" nil t)
(exchange-point-and-mark)))

If you do M-x mw-org-table-mark-column followed by C-x SPACE in a
table-cell you (hopefully) the column gets marked.

This might be a start.


HTH,
-- 
Marco Wahl
GPG: 0x49010A040A3AE6F2




Re: [O] No plot with org-plot

2016-04-28 Thread Loris Bennett
Eric S Fraga  writes:

> On Thursday, 28 Apr 2016 at 09:18, Loris Bennett wrote:
>> gnuplot> plot '/tmp/org-plot1999bqI' using 3:xticlabel(1) with
>> gnuplot> histograms title 'H-index'
>>
>> So no error here and also no org-plot files in /tmp.
>
> Does it split the line as you have it above?  In my case, the *gnuplot*
> buffer looks like this:
>
> gnuplot> set datafile separator "\t"
> gnuplot> plot '/tmp/org-plot10749hZi' using 3:xticlabel(1) with histograms 
> title 'H-index'
> gnuplot> 
>
> and the plot appears in a separate window.

No, doesn't split.  I must have been at the end of the last line when I
pasted, so when I hit 'return' the text got auto-filled.

Does the file in /tmp stay there until you close the Gnuplot window?

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] No plot with org-plot

2016-04-28 Thread Eric S Fraga
On Thursday, 28 Apr 2016 at 09:18, Loris Bennett wrote:
> gnuplot> plot '/tmp/org-plot1999bqI' using 3:xticlabel(1) with
> gnuplot> histograms title 'H-index'
>
> So no error here and also no org-plot files in /tmp.

Does it split the line as you have it above?  In my case, the *gnuplot*
buffer looks like this:

gnuplot> set datafile separator "\t"
gnuplot> plot '/tmp/org-plot10749hZi' using 3:xticlabel(1) with histograms 
title 'H-index'
gnuplot> 

and the plot appears in a separate window.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-655-g9fb077



[O] feature proposal. Kill and yank columns

2016-04-28 Thread Uwe Brauer
Hi

I know that I can delete columns but I miss a function which would
*kill* a column,  put it in the some ring (or register) and paste it.

I do this my marking the content of a column and use kill-rectangle and
yank-rectangle but I find such a solution which needs the mark,
cumbersome.

I goggled around and found for example proposals as in

https://stackoverflow.com/questions/22002374/how-to-select-a-column-of-a-table-in-emacs-org-mode

Which is basically the same I do. 

Or in

http://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas

Which seems complicated.

It also seems a subject which comes up regularly. Is this so difficult
to implement?

Thanks and regards

Uwe Brauer 



Re: [O] No plot with org-plot

2016-04-28 Thread Loris Bennett
Eric S Fraga  writes:

> On Thursday, 28 Apr 2016 at 08:24, Loris Bennett wrote:
>> I tried to do
>>
>> #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange 
>> [0:]"
>> | Sede  | Max cites | H-index |
>> |---+---+-|
>> | Chile |257.72 |   21.39 |
>> | Leeds |165.77 |   19.68 |
>> | Sao Paolo | 71.00 |   11.50 |
>> | Stockholm |134.19 |   14.33 |
>> | Morelia   |257.56 |   17.67 |
>>
>> but nothing happens: no error, no plot.  In the *Messages* buffer, I
>> just get
>
> Works for me.  Check the *gnuplot* buffer.

In the *gnuplot* buffer I get:

gnuplot> set title 'Citas'
gnuplot> set yrange [0:]
gnuplot> set datafile separator "\t"
gnuplot> plot '/tmp/org-plot1999bqI' using 3:xticlabel(1) with histograms title 
'H-index'

So no error here and also no org-plot files in /tmp.

It looks a bit as if everything is working correctly, but just getting
tidied away before I get a chance to see anything.

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] No plot with org-plot

2016-04-28 Thread Eric S Fraga
On Thursday, 28 Apr 2016 at 08:24, Loris Bennett wrote:
> I tried to do
>
> #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
> | Sede  | Max cites | H-index |
> |---+---+-|
> | Chile |257.72 |   21.39 |
> | Leeds |165.77 |   19.68 |
> | Sao Paolo | 71.00 |   11.50 |
> | Stockholm |134.19 |   14.33 |
> | Morelia   |257.56 |   17.67 |
>
> but nothing happens: no error, no plot.  In the *Messages* buffer, I
> just get

Works for me.  Check the *gnuplot* buffer.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-655-g9fb077



Re: [O] org-passwords.el and encryption

2016-04-28 Thread Eric S Fraga
On Wednesday, 27 Apr 2016 at 19:23, Julien Cubizolles wrote:
> also, running:
>
> keychain --eval --agents ssh,gpg id_rsa MYGPGKEY
>
> in a non login shell.

The only thing I can think of is that maybe you have not installed all
the relevant packages for the agents or that the permissions on the
various directories (.ssh, .gnupg) are incorrectly set?

Maybe ask on the bug system for keychain mentioned in the man page?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



[O] No plot with org-plot

2016-04-28 Thread Loris Bennett
Hi,

Following

http://orgmode.org/manual/Org_002dPlot.html#Org_002dPlot

I tried to do

#+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
| Sede  | Max cites | H-index |
|---+---+-|
| Chile |257.72 |   21.39 |
| Leeds |165.77 |   19.68 |
| Sao Paolo | 71.00 |   11.50 |
| Stockholm |134.19 |   14.33 |
| Morelia   |257.56 |   17.67 |

but nothing happens: no error, no plot.  In the *Messages* buffer, I
just get

gnuplot-mode 0.7-beta (gnuplot 4.6) -- report bugs with "C-c C-u"

Any ideas?

Cheers,

Loris

Org-mode version 8.3.4 (8.3.4-31-gcb683e-elpaplus), GNU Emacs 24.4.1
-- 
This signature is currently under construction.




Re: [O] whether in drawer?

2016-04-28 Thread Samuel Wales
thank you.  for years i have been trying to advise undo-tree to deal
with visibility properly.  namely, to not try to undo or redo
invisibly, but also not to leave too much stuff visible.  maybe if i
can get it to do canonical visibility except in drawers (where it
should keep the drawer open if point is in it) it will work properly.


On 4/27/16, Derek Feichtinger  wrote:
> Hi
>
> Samuel Wales  gmail.com> writes:
>
>>
>> can one tell whether point is in a drawer?
>>
>>
> By coincidence just posted a patch request which contains the functionality
> you desire. I use org-element-at-point and then test for drawer/property
> drawer:
>
> (defun org-open-if-in-drawer ()
>   (let ((element (org-element-at-point)))
> (while (and element
>   (not (memq (org-element-type element)
>  '(drawer property-drawer
>   (setq element (org-element-property :parent element)))
> (when element
>   (let ((pos (point)))
>   (goto-char (org-element-property :begin element))
>   (org-flag-drawer nil)
>   (goto-char pos)
>
>
> Cheers,
> Derek
>
>
>


-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

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

Denmark: free Karina Hansen NOW.