Re: [O] bug#24073: 25.1-rc2

2016-09-02 Thread Paul Rankin
Eli Zaretskii  on Wed, 31 Aug 2016 17:25 +0300:
> > From: Paul Rankin 
> > Date: Wed, 31 Aug 2016 12:56:13 +1000
> > Cc: 24...@debbugs.gnu.org
> > 
> > >> The fix seems trivial to me so I'm wondering if there is anything 
> > >> holding it 
> > >> up from being included in 25?
> > > 
> > > Yes, the fact that Emacs 25 is for all practical purposes already
> > > released.
> > 
> > Okay. 25.2?
> 
> I don't see why not, provided that Org developers give us their
> blessing.  Please bring this to their attention on the Org list, or
> ask them to speak up here.  I don't want us to make any changes that
> could adversely affect Org without consulting them first.

Dear Org Mode maintainers,

Looping you in on a proposed bug fix for `outline-invisible-p'.

Briefly, the problem is the function returns non-nil for any invisible
text property when it should only do so for the outline property. As a
defsubst, it is difficult to patch for other affected programs.

Diff pasted:

--- /usr/local/Cellar/emacs/25.1-rc2/share/emacs/25.1/lisp/outline.el.gz
+++ #
@@ -388,9 +388,9 @@
  nil 'move))
 
 (defsubst outline-invisible-p (&optional pos)
-  "Non-nil if the character after POS is invisible.
+  "Non-nil if the character after POS has outline invisible property.
 If POS is nil, use `point' instead."
-  (get-char-property (or pos (point)) 'invisible))
+  (eq (get-char-property (or pos (point)) 'invisible) 'outline))
 
 (defun outline-back-to-heading (&optional invisible-ok)
   "Move to previous heading line, or beg of this line if it's a heading.

Diff finished.  Sat Sep  3 14:35:22 2016



[O] Something happened in git server

2016-09-02 Thread Takaaki Ishikawa
Hi all,

I've received an error message like `fatal: read error: Connection reset by 
peer` from the git server of orgmode when I ran fetch and also pull command. 
Does anybody have the same problem now?

Best,
Takaaki


signature.asc
Description: Message signed with OpenPGP using GPGMail


[O] Feedback on changes to org-id

2016-09-02 Thread Aaron Ecay
Hello all,

It’s an occasional project of mine to try to improve and refactor
aspects of org’s code.  I’ve been going through org-id recently.  The
following issues came up that I would appreciate feedback on:

1. org-id is not loaded by default; it is supposed to be selected by the
   user (see footnote 2 of (info "(org) Handling links")).  Yet, other
   org libraries rely on it, without requiring it (e.g. ox-icalendar).
   Also, at least one library (org-bibtex) reimplements bits of org-id’s
   internals to avoid requiring it explicitly.  Is there a good reason
   not to make org-id a core library, that is to require it
   unconditionally from org.el?

2. I would like to deprecate the org-id-method variable.  This allows
   choosing different methods of generating random IDs.  But one method
   is as good as another (they are random*...), so we can just always use
   a single method (powered by the elisp ‘random’ function).  Choosing
   this allows deprecating several other variables and functions, along
   with a soft dependency on the external uuidgen binary.  Any
   objections to this course of action?

(* Not all the values of org-id-method lead to IDs that are random in
the statistical sense.  But they are not meaningful from the user’s
point of view in any case.)

3. I would like to change the API of the org-id-get function.  The
   current signature is (&optional pom create prefix).  POM
   (i.e. position or marker) is a useless argument, because in the
   (relatively uncommon) case that callers are interested in a location
   other than (point) they can wrap the call in (org-with-point-at ...).
   PREFIX is similarly useless (and in fact unused in org’s code base)
   because a caller could let-bind org-id-prefix around the call.  The
   new signature would be (&optional create reset), which are both
   boolean arguments.  The question arises of how to make this change.
   Options I see:
   a. Hard breakage; code using the old calling convention will break.
   b. Introduce a new function under a new name, deprecate the old name
   c. Try to detect which calling convention is in use.
   Options (a) and (b) have drawbacks.  I would like to implement
   (c) by requiring the create and reset arguments, if given, to have
   values 'create and 'reset respectively.  The old and new calling
   conventions have identical semantics when both arguments are nil, so
   that case is not a problem.  With the new code, any other value for
   these arguments (besides nil and a same-named symbol) would indicate
   use of the old convention, and signal an error.  Comments?

4. A similar issue arises for org-id-find.  I would like it to always
   return a marker, rather than having an argument switch between a
   marker and a cons of filename and position.  (There are functions
   which return the filename or position individually, so returning both
   as a cons is useless from an API point of view).  There’s no good way
   to detect the old calling convention, however, so I think I have to
   introduce a new name.  (My draft patch is written instead with hard
   breakage, but stability of API is important so I will change that...)

There are other deprecations and renamings as well, but none of them
should break third-party code.  The resultant patch shrinks the codebase
by 60-ish lines and eliminates 3 defcustoms...baby steps.  A draft patch
is attached to this message; I expect to make further changes based on
feedback I receive, so detailed code review (while certainly always
appreciated!) can be postponed until the conceptual issues are
resolved.

Thanks,

-- 
Aaron Ecay
>From 925c6f4e920555c402be271443d167d60dff Mon Sep 17 00:00:00 2001
From: Aaron Ecay 
Date: Fri, 2 Sep 2016 23:30:10 +0100
Subject: [PATCH] Draft changes to org-id

---
 contrib/lisp/org-drill.el |   2 +-
 contrib/lisp/org-index.el |  18 +-
 etc/ORG-NEWS  |  37 +++-
 lisp/ob-ref.el|  15 +-
 lisp/org-attach.el|   2 +-
 lisp/org-capture.el   |   4 +-
 lisp/org-colview.el   |   4 +-
 lisp/org-id.el| 468 +++---
 lisp/org-mobile.el|   6 +-
 lisp/org-table.el |   2 +-
 lisp/org.el   |  11 +-
 lisp/ox-html.el   |   1 -
 lisp/ox-icalendar.el  |   2 +-
 lisp/ox.el|   2 +-
 testing/org-test.el   |   5 +-
 15 files changed, 259 insertions(+), 320 deletions(-)

diff --git a/contrib/lisp/org-drill.el b/contrib/lisp/org-drill.el
index a78b806..b5ce306 100644
--- a/contrib/lisp/org-drill.el
+++ b/contrib/lisp/org-drill.el
@@ -2614,7 +2614,7 @@ STATUS is one of the following values:
"(slow, but only happens once)"))
   (sit-for 0.5)
   (setq warned-about-id-creation t))
-(org-id-get-create) ; ensure drill entry has unique ID
+(org-id-get 'create) ; ensure drill entry has unique ID
 (destructuring-bind (status due age)
 (org-drill-entry-status)
   (case 

Re: [O] Accessing the communication channel from a link exporter

2016-09-02 Thread John Kitchin
then the preprocessing hook sounds better. You can just replace the
links with generated html, and then export the buffer.

For example, here is a function that goes through an org file and
replaces links that are file times with image or urls, and copies the
file contents to a media-directory.

(defun bf-process-links (backend)
  "Modify links to change paths and copy files to `media-dir'.
Argument BACKEND the export backend."
  (org-mode)
  (let* ((links (nreverse (org-element-map (org-element-parse-buffer) 'link 
#'identity
(loop for link in links
  do
  (let* ((type (org-element-property :type link))
 (path (org-element-property :path link))
 (beg (org-element-property :begin link))
 (end (org-element-property :end link))
 (fname (car (last (split-string path "/")

(cond
 ((string= type "file")
  (copy-file path (concat bf-media-directory fname) t)
  (setf (buffer-substring beg end)
(if (string-match "png\\|svg" (or (file-name-extension
   (org-element-property 
:path link))
  ""))
(format
 "@@html:@@ "
 bf-media-url-base fname)
  (format
   "@@html:%s@@ "
   bf-media-url-base fname fname)


This function just wraps an export with a temporary definition of the
before processing hook, which runs the function on a copy of the
org-buffer you are creating.

(defun bf-get-HTML ()
  "Return the body html of the headline at point."
  (let ((org-export-before-processing-hook '(bf-process-links))
(async nil)
(subtreep t)
(visible-only nil)
(body-only t)
(ext-plist '())
;; (bf-link-counter 0)
;; (url-list (bf-get-link-urls))
(html))
(org-html-export-as-html async subtreep visible-only body-only ext-plist)
;; now get the output into the org output
(switch-to-buffer "*Org HTML Export*")
(end-of-buffer)
(setq html (buffer-string))
(kill-buffer "*Org HTML Export*")
html))

No doubt you could make more complicated ;)

Arun Isaac writes:

>> I think this is the kind of thing you can use a filter for
>
> But, it gets more complicated than that. I have XMP metadata (license,
> caption, etc.)  stored in the image files as well. And, in order to
> export that, I need the path to the source image file. So, my image link
> exporter needs the :base-directory to find the source image file. If I
> try to get the XMP metadata from the published image file, then I
> introduce a race condition with the export of the org file becoming
> dependent on the image file already being published.
>
> Perhaps, filters could be useful. I need to think about it. So far, I
> have generally stayed away from filters because they can only get the
> HTML as text, and have to use some kind of regex to operate on it. HTML
> is structured data, and it would have been good if it was available in
> some kind of S-form tree structure. It would have saved me the trouble
> of parsing the HTML, and I could have used a library like xmlgen to
> generate it.
>
> Regards,
> Arun Isaac


-- 
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] There is no line to end here at LaTeX org-ref export

2016-09-02 Thread Nick Dokos
Eric S Fraga  writes:

> Can you post an actual org test file as an attachment?  And also the
> resulting LaTeX file on export?

My thoughts exactly.

The version that I posted works fine here, so there must be something
else going on.

-- 
Nick




Re: [O] Accessing the communication channel from a link exporter

2016-09-02 Thread Arun Isaac

> I think this is the kind of thing you can use a filter for

But, it gets more complicated than that. I have XMP metadata (license,
caption, etc.)  stored in the image files as well. And, in order to
export that, I need the path to the source image file. So, my image link
exporter needs the :base-directory to find the source image file. If I
try to get the XMP metadata from the published image file, then I
introduce a race condition with the export of the org file becoming
dependent on the image file already being published.

Perhaps, filters could be useful. I need to think about it. So far, I
have generally stayed away from filters because they can only get the
HTML as text, and have to use some kind of regex to operate on it. HTML
is structured data, and it would have been good if it was available in
some kind of S-form tree structure. It would have saved me the trouble
of parsing the HTML, and I could have used a library like xmlgen to
generate it.

Regards,
Arun Isaac


signature.asc
Description: PGP signature


Re: [O] org-entities.el bug in "Delta"

2016-09-02 Thread Aaron Ecay
Hi Nicolas,

2016ko irailak 1an, Nicolas Goaziou-ek idatzi zuen:
> 
> Hello,
> 
> Aaron Ecay  writes:
> 
>> This is fixed in commit ab5e100 on the maint branch.  Thanks for the
>> report.
> 
> Thank you for taking care of that.
> 
> After every commit, maint needs to be merged within master so that
> master is always strict superset of maint. I did that for the commit
> above.

Thank you for the reminder and for fixing it this time.

-- 
Aaron Ecay



Re: [O] There is no line to end here at LaTeX org-ref export

2016-09-02 Thread Eric S Fraga
Can you post an actual org test file as an attachment?  And also the
resulting LaTeX file on export?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.5-1070-g190476



Re: [O] There is no line to end here at LaTeX org-ref export

2016-09-02 Thread Florian Lindner
Am 01.09.2016 um 08:02 schrieb Nick Dokos:

> Try this:
> 
> --8<---cut here---start->8---
> An example without org-ref that produces this error:
> 
> #+NAME: fig:org_fig
> #+BEGIN_SRC python :exports results :results file
>   import matplotlib.pyplot as plt, numpy as np
>   x = np.linspace(-2, 2, 1000)
>   plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
>   plt.savefig('rbf-gaussian-4.pdf')
>   return "rbf-gaussian-4.pdf"
> #+END_SRC
> 
> #+CAPTION: Org Fig
> #+RESULTS: fig:org_fig
> [[file:rbf-gaussian-4.pdf]]
> 
> 
> Some text
> --8<---cut here---end--->8---
> 

Some story, nothing changed. Still no line to end here.

Best,
Florian




Re: [O] Accessing the communication channel from a link exporter

2016-09-02 Thread John Kitchin
I think this is the kind of thing you can use a filter for, or a
function in the org-export-before-processing-hook to change the paths
prior to export.

Arun Isaac writes:

>> Out of curiosity, what kind of link are you using, that is dependant
>> about context ?
>
> Actually, I don't need the context of the link in the org document. I
> need some properties defined in the plist of the component in
> org-publish-project-alist. So, I use the info communication channel to
> access these properties.
>
> I maintain a few websites with org mode. When I publish an image link
> with org, the exported HTML contains the full filesystem path of the
> image. The page wouldn't work if I published it on the web. My link type
> needs to know the path of the web server's docroot to remove that
> component from the full filesystem path. This path is defined in one of
> the properties in org-publish-project-alist, and I need the info
> communication channel to access it.


-- 
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] org-link-set-parameters missing in ELPA version

2016-09-02 Thread Heikki Lehvaslaiho
I've been experiencing similar problems with increasing annoyance level for
over a month. Thanks to these comments I think I got to the bottom of it!

The MELPA package org-mac-link (latest is org-mac-link-20160808.220) has
clearly continued being updated with new code that include calls to
org-link-set-parameters. The org-mac-link.el in package org-plus-contrib
has the code that works with org v8. Everyone who has been using MELPA,
especially with use-package, to load org-mac-link.el has not been using the
code in org-plus-contrib.

I removed the downloaded org-mac-link package files and the corresponding
depends-on line from my Cask file, and reverted to old require syntax to
load org-mac-link . Problem solved.


 -Heikki

Heikki Lehväslaiho - skype:heikki_lehvaslaiho cell: +358 40 850 6640
http://about.me/heikki

On 26 August 2016 at 04:31, Rob Duncan  wrote:
>
> Hi John,
>
> I deleted my existing packages and installed org-plus-contrib-20160822
and everything works again.
>
> Thanks very much!
>
> Rob.
>
> > On Aug 25, 2016, at 6:15 PM, John Kitchin 
wrote:
> >
> > I haven't been able to reproduce this in org-plus-contrib-20160822.
> >
> > Rob Duncan writes:
> >
> >> Hi John,
> >>
> >> My org is claiming to be version 8.3.5:
> >>
> >> Org-mode version 8.3.5 (8.3.5-elpa @
/Users/rduncan/.emacs.d/elpa/org-20160815/)
> >>
> >> Rob.
> >>
> >> On Aug 20, 2016, at 11:56 AM, John Kitchin mailto:jkitc...@andrew.cmu.edu>> wrote:
> >>
> >> that seems weird, I thought that should only be in org 9. Is that on
ELPA somehow?
> >>
> >> John
> >>
> >> ---
> >> 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
> >>
> >>
> >> On Sat, Aug 20, 2016 at 2:45 PM, Rob Duncan > wrote:
> >> I just installed org-mac-link version 20160808.220 from ELPA and I’m
no longer able to insert links from Mail.app and other applications.  It
used to work…
> >>
> >> When I try to manually load org-mac-link.el I get this error message:
> >>
> >> eval-buffer: Symbol’s function definition is void:
org-link-set-parameters
> >>
> >> Did I mess up the install, or is the package broken somehow?
> >>
> >> Thanks,
> >>
> >> Rob.
> >
> >
> > --
> > 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
>