Re: [O] org-capture-kill does not reinstantiate clocked tasks with :clock-in :clock-resume

2018-07-01 Thread Nicolas Goaziou
Hello,

Leonard Lausen  writes:

> With a capture template that includes the :clock-in :clock-resume
> arguments, aborting a capture with org-capture-kill will not resume the
> previous clock but leave it clocked out.

I cannot reproduce it. What Org version are you using? Could you try
latest one?

Also, could you provide an ECM reproducing the issue?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org-src-mode tries to cancel a nil idle timer [9.1.13 (release_9.1.13-864-g5057e3 @ /Users/asf/.emacs.d/straight/build/org/)]

2018-07-01 Thread Nicolas Goaziou
Hello,

Andreas Fuchs  writes:
> I use org-src-mode with org-src-auto-save-idle-delay (set to 1s), and
> after upgrading org to the latest master version, it's repeatedly
> causing me trouble: When I open an org-src-mode buffer and close it with
> C-c ', I repeatedly get the message "Error running timer:
> (wrong-type-argument timerp nil)". The backtrace is for a compiled
> function, but after disassembling, it's pretty clear that it's the
> routine in the lambda in org-src-mode that tries to cancel
> `org-src--auto-save-timer'.
>
> Here are the steps that will do it for me, but I haven't been very lucky
> reproducing this consistently:
>
> (setq org-edit-src-auto-save-idle-delay 1
>   org-edit-src-turn-on-auto-save nil)
>
> 1. Open an org file with elisp source code blocks
> 2. Use C-c ' on one of those blocks
> 3. Edit the buffer
> 4. Close the buffer after a while with C-c '
>
> If it reproduces correctly, emacs shows the error above whenever it has
> been idle for 1s.

Hopefully fixed in master. Could you confirm it?

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org export to html add a unnecessary empty line in "example" block [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/local/Cellar/emacs-plus/26.1/share/emacs/26.1/lisp/org/)]

2018-07-01 Thread Nicolas Goaziou
Hello,

孙振祥  writes:

> the org file like
> : abc
> : def
>
> and export to html will become
> abc
> def
>
> 

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] Bug: org export to html add a unnecessary empty line in "example" block [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/local/Cellar/emacs-plus/26.1/share/emacs/26.1/lisp/org/)]

2018-07-01 Thread 孙振祥



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

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


the org file like
: abc
: def

and export to html will become
abc
def




Emacs  : GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.6.0, NS appkit-1561.40 
Version 10.13.5 (Build 17F77))
of 2018-06-05
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
/usr/local/Cellar/emacs-plus/26.1/share/emacs/26.1/lisp/org/)

current state:
==
(setq
org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
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-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-mode-hook '(#[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-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
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-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-babel-pre-tangle-hook '(save-buffer)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
org-occur-hook '(org-first-headline-recenter)
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-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
org-confirm-shell-link-function 'yes-or-no-p
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)
   ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link :store
org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys")
   ("file+emacs") ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow
(lambda (path) (browse-url (concat "ftp:" path
   ("help" :follow org--open-help-link)
   ("http" :follow
(lambda (path) (browse-url (concat "http:" path
   ("https" :follow
(lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow
(lambda (path) (browse-url (concat "mailto:; path
   ("news" :follow
(lambda (path) (browse-url (concat "news:; path
   ("shell" :follow org--open-shell-link))
org-latex-format-headline-function 'org-latex-format-headline-default-function
org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]

Re: [O] info URL « open at point » patch

2018-07-01 Thread Vincent Belaïche
Hello Eli,
Concerning the patch, I understood that you agree with it provided that
it is upgraded to mention the change in the etc/NEWS file. So I did that
& pushed the change.
Concerning your point « Modularity doesn't mean each module must be
standalone and self-contained », I agree, and I did not say that there
would be anything wrong for e.g. browse-url.el to use a utility function
defined elsewhere. Modules are supposed to interact with each other, and
that implies that they cannot be fully standalone. However, modulary
means that one should observe some functional split: any package, to be
called a package, should have in its documentation some terms of
reference saying its purpose and listing what functions it
accomplishes. While the purpose of the info package is not primarily url
manipulation, I had suspected that this sort function was encompassed by
the package providing the browse-url function, and that is why I stated
that it would be a better modularity if info was relying on a function
provided elsewhere --- which indeed is the opposite statement as saying
that info has to be standalone and self-contain, and as such re-invent
the wheel of url manipulation by itself.
Maybe my mistake was however to assume that 'elsewhere' would be best in
the same package as that providing 'browse-url', but anyhow, I stand on
my point that keeping some URL format specific
"\\(?:f\\(?:ile\\|tp\\)\\|https?\\)://" regexp within the the
Info-follow-nearest-node is not very good from a modularity point of
view.

BTW, the 'browse-url-url-at-point' is not documented by a docstring, so
can we assume that it is usable outside browse-url ?
Anyway, looking at the code I realized that the real work of grabbing
the URL is delegated to the thingatpt package, so my suggestion would be
that info should also use thingatpt. Probably it would be even better
with something like the following construct to remove info URI from
those allowed, as they would better be handled from the info browser
itself:
(let* ((uri-schemes (copy-sequence thing-at-point-uri-schemes))
   (info-uri (car-safe (member "info:" uri-schemes)))
   (thing-at-point-uri-schemes (delq info-uri uri-schemes)))
   (thing-at-point 'url t))
OK, the info browser does not directly knows about info URL, so some
additional work is needed to catch them too. To me this is a real corner
case scenario to refer to a document inside a Texinfo docuemnt via an
info URL: that would mean the document is available only in info format,
ie has not be published in Texinfo. I am not even sure that such
document exists. Aren't info URL meant only to refer to info document
from document written with something else than Texinfo ?
  V.

De : Eli Zaretskii 
Envoyé : mardi 26 juin 2018 16:34
À : Vincent Belaïche
Cc : emacs-orgmode@gnu.org; brandel...@gmail.com; emacs-de...@gnu.org
Objet : Re: info URL « open at point » patch 
 
> From: Vincent Belaïche 
> CC: "emacs-de...@gnu.org" 
> Date: Tue, 26 Jun 2018 05:47:04 +
> 
> My point is that for a modular design, the same package that provides
> the browse-url function, should also provide some match-url-at-point-p
> predicate, e.g.
There is such a function: browse-url-url-at-point.
But in general, I don't agree with your assertion: there's nothing
wrong for, e.g., browse-url.el to use a utility function declared
somewhere else.  Modularity doesn't mean each module must be
standalone and self-contained.



[O] org-capture-kill does not reinstantiate clocked tasks with :clock-in :clock-resume

2018-07-01 Thread Leonard Lausen
With a capture template that includes the :clock-in :clock-resume
arguments, aborting a capture with org-capture-kill will not resume the
previous clock but leave it clocked out.

Is this the intended behavior? I expected the previous clock to either
be clocked in from the moment I run org-capture-kill or the clock out
done by org-capture to be removed retrospectively.

Thank you.

Best regards
Leonard



[O] Bug: org-src-mode tries to cancel a nil idle timer [9.1.13 (release_9.1.13-864-g5057e3 @ /Users/asf/.emacs.d/straight/build/org/)]

2018-07-01 Thread Andreas Fuchs
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

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


I use org-src-mode with org-src-auto-save-idle-delay (set to 1s), and
after upgrading org to the latest master version, it's repeatedly
causing me trouble: When I open an org-src-mode buffer and close it with
C-c ', I repeatedly get the message "Error running timer:
(wrong-type-argument timerp nil)". The backtrace is for a compiled
function, but after disassembling, it's pretty clear that it's the
routine in the lambda in org-src-mode that tries to cancel
`org-src--auto-save-timer'.

Here are the steps that will do it for me, but I haven't been very lucky
reproducing this consistently:

(setq org-edit-src-auto-save-idle-delay 1
  org-edit-src-turn-on-auto-save nil)

1. Open an org file with elisp source code blocks
2. Use C-c ' on one of those blocks
3. Edit the buffer
4. Close the buffer after a while with C-c '

If it reproduces correctly, emacs shows the error above whenever it has
been idle for 1s.

The backtrace that I got is this:
Debugger entered--Lisp error: (wrong-type-argument timerp nil)
  signal(wrong-type-argument (timerp nil))
  cancel-timer(nil)
  #f(compiled-function () #)()
  apply(#f(compiled-function () #) nil)
  timer-event-handler([t 0 1 0 t #f(compiled-function () #) nil idle 0])

And here's the bottom of the disassembly for #:
42:4discard
43  dup
44  not
45  goto-if-nil-else-pop 5
48  constant  cancel-timer
49  varreforg-src--auto-save-timer
50  call  1
51  discard
52  constant  nil
53  dup
54  varsetorg-src--auto-save-timer
55:5stack-set 1
57  unbind1
58  return

I'm not sure how better to debug this, so please let me know if I can
provide more / better data. Thanks in advance!

Emacs  : GNU Emacs 26.1 (build 1, x86_64-apple-darwin13.4.0, Carbon Version
157 AppKit 1265.21)
 of 2018-04-15
Package: Org mode version 9.1.13 (release_9.1.13-864-g5057e3 @
/Users/asf/.emacs.d/straight/build/org/)
-- 
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs


Re: [O] globbing file links

2018-07-01 Thread John Kitchin
This could be useful. Here is something close. It does not use
dired-virtual. I couldn't figure out how to generate the ls -lR like
listing for each file, but if you know how to do that it should be
straightforward to modify.

#+BEGIN_SRC emacs-lisp
(defun glob-follow (path)
  (interactive)
  (let ((files (directory-files-recursively "." path)))
(if (= 1 (length files))
(find-file (car files))
  (pop-to-buffer (get-buffer-create "*org-glob*"))
  (erase-buffer)
  (org-mode)
  (insert
   (cl-loop for file in files concat
(format "[[./%s]]\n" (file-relative-name file ".")))


(org-link-set-parameters
 "glob"
 :follow 'glob-follow)
#+END_SRC

Here is an example usage:

[[glob:.org$]]


Samuel Wales  writes:

> i frequently have broken file: links.  this might reduce their occurrence.
>
> i'd like to be able to do this:
>
>   file:.../**/myfile
>
> which would use bash's globbing mechanism or an elisp equivalent.
>
> also perhaps this:
>
>   file:.../**/*myfile*
>
> if one file results, i would like it to open as normal.  if more than
> one file results, i would like all of them to open in a dired-virtual
> buffer.  i think dired-virtual is in core.
>
> the first case would prevent broken links by allowing myfile to be
> moved as long as it is under 
>
> the second case would allow you to select a bunch of files that have a
> common substring.  it would also prevent broken links by allowing
> myfile to be renamed slightly [such as compressed or uncompressed].
>
> i think broken links are likely a common problem for org users.  maybe
> this can help prevent it.
>
> does this sound like a good idea as an optional feature?
>
> if no, then what would be a good implementation of a glob: link?


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