[O] org-mode export behavior change in 9.2?

2019-01-11 Thread Haider Rizvi
I've been using literate programming approach with org-babel for a
while. I just noticed that with 9.2, when I try to export (c-c c-e h
o) an org doc / section, any shell blocks with a named session are
executed as it is exporting to html!

I don't think it was this way before?  Is there a way to not have it
execute each shell block when trying to export.

I just tested it with this small .org document. On osx, /usr/bin/say
speaks out the arguments.

-
#+begin_src shell :session sh-pcnw3
/usr/bin/say something # say it out loud!
#+end_src
-

Without the :session, it doesn't!

-- 




Re: [O] Bug: Capture Template With Link Returns Error [9.2 (9.2-elpaplus @ /home/dwrz/.emacs.d/elpa/org-plus-contrib-20181230/)]

2019-01-11 Thread david wen riccardi-zhu
Hello and thank you. This behavior did appear to be fixed, but 
it's surfaced once again today.


Nicolas Goaziou  writes:

Hello, 

David Wen Riccardi-Zhu  writes: 

I use the following capture template to store bookmarks: 

* %^L :PROPERTIES: :NOTES: %^{NOTES} :END: :LOGBOOK: - Added 
%U. :END: 

It was working fine until I updated my packages today. If I try 
to use the template now, the following is displayed in the 
minibuffer: 

org-capture: Capture abort: Wrong type argument: stringp, nil 


Fixed. Thank you. 

Regards, 

-- Nicolas Goaziou 


--
dwrz|朱为文



Re: [O] open link in source code block

2019-01-11 Thread Berry, Charles


> On Jan 5, 2019, at 7:41 AM, Win Treese  wrote:
> 
> 
> 
>> On Jan 5, 2019, at 5:25 AM, Eric S Fraga  wrote:
>> 
>> On Friday,  4 Jan 2019 at 19:38, Win Treese wrote:
>>> Suppose I have the following Org file contents:
>>> 
>>> * test
>>> 
>>> #+BEGIN_SRC emacs-lisp
>>> (setq yyy 3)
>>> ;; See https://www.gnu.org
>>> #+END_SRC
>>> 
>>> The URL for gnu.org is highlighted as a clickable link. But if I click
>>> it, the source block is evaluated. This seems rather unexpected,
>>> especially since my intention was to open the link.
>> 
>> Probably expected albeit maybe not your preferred behaviour; all about
>> precedence.  In any case, I would suggest that the easy solution would
>> be to move such links out of the src block.  I usually put these as org
>> comments, along the lines of
>> 
>> # See https://www.gnu.org
>> #+BEGIN_SRC emacs-lisp
>> (setq yyy 3)
>> #+END_SRC
>> 
>> My approach to literate programming is to have no (significant) comments
>> in the code segments themselves.  Each code block is small and has all
>> commentary in the text, not the code.
> 
> Thanks for the note, Eric.
> 
> I think the style you describe is good in most cases. I stumbled over this in 
> a
> more complicated situation in which rearranging things doesn’t work.
> 
> This seems like a slightly bigger problem, though: clicking on a highlighted
> link doesn’t just fail to open the link, it executes the source block, which 
> can
> have very unintended side effects.
> 
> I wonder if the issue is an artifact of implementation rather than intentional
> design: org-open-at-mouse sets point to the location of the click and then
> calls org-open-at-point. The documentation at points says that C-c C-o in 
> a source block opens the results of evaluation (fair enough, although the
> docstring does not).
> 
> So the problem seems to be about the mouse click behavior, not the basic
> function of org-open-at-point.

AFAICS, the issue is with org-open-at-point.

If you really want to `fix' this, there is a hook that allows customization of 
the behavior of org-open-at-point.

This snippet will add a function to that hook that will attempt to follow a 
link, when you click on a link in a src-block:

#+begin_src emacs-lisp
  (defun org-follow-link-in-src-block-hook ()
(and
 (eq 'src-block (org-element-type (org-element-context)))
 (let ((link-be (org-in-regexp org-any-link-re)))
   (if link-be
   (org-open-link-from-string
(buffer-substring-no-properties (car link-be)
(cdr link-be
   link-be)))
  (add-hook 'org-open-at-point-functions 'org-follow-link-in-src-block-hook)
#+end_src

Beware that this might not be what is wanted if you have code that matches 
`org-any-link-re' and you happen to click on it.  

For example, if you have code that uses double brackets to denote subscripts 
(like R), this can cause havoc when you try to edit a subscript in the org 
buffer (rather than in an edit buffer) by clicking on it.  Without this hook 
function, clicking on a bracket subscript will prompt for evaluation which is 
annoying, but maybe less so than interpreting the subscript as a link.

You might use a more limited regex or add a query in 
`org-follow-link-in-src-block-hook' to be sure following a link is really  what 
you want.

HTH,

Chuck

[O] recent org-mode changes: completion of repeated tasks reports "10 repeater intervals were not enough to shift date past today"

2019-01-11 Thread Daniel Ortmann
I have a weekly scheduled task with ...
  DEADLINE: <2019-01-18 Fri ++1w -0d>

Recently, when I complete the task it reports the following:

Clock stopped at [2019-01-11 Fri 17:03] after 0:05
10 repeater intervals were not enough to shift date past today. 
Continue? (y or n) n

Thoughts?




[O] Binding org-insert-todo-heading to M-S-RET

2019-01-11 Thread Kévin Le Gouguec
Hello!

Here is a very minor gripe I have with org-mode: is there a reason why
org-insert-todo-heading should be bound to (kbd "M-S-"), rather
than (kbd "M-S-RET")?

AFAIU, using "" limits the key binding to the actual "⏎"
function key, while using "RET" makes any key chord that sends the
"carriage return" character ("⏎" and "C-m") work transparently.

I admit that Alt-Shift-Control-M sounds unwieldy, but my muscle memory
has become so accustomed to using "C-m" instead of "" that I
would welcome a change allowing this alternative.

(
From my understanding of (emacs)Keymaps and (emacs)Named ASCII
Chars, using "RET" also has the advantage that bindings can work in
terminals; IIUC terminals translate presses to "⏎" into the "RET"
control character, so Emacs never knows that "" was pressed.

However in this particular case I don't believe that the argument
applies, since AFAIK terminals cannot transmit "S-RET" to Emacs.
"M-RET" works though, precisely because it uses "RET" and not
"".
)

Thank you for your time.


PS: I found a relatively recent thread discussing this issue:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00580.html

I am happy that there exist alternative key bindings for terminal
environments; however, I don't think this thread explains why org-mode
uses "" rather than "RET".



Re: [O] recent org-mode changes: completion of repeated tasks cause rewriting of LOGBOOK 'Rescheduled from' entries

2019-01-11 Thread cesar mena

sorry. forgot to do a wide reply. fwd'ing the list.

-cm

--- Begin Message ---
hello daniel,

Daniel Ortmann  writes:

> I have a daily scheduled task with ...
>   SCHEDULED: <2019-01-11 Fri 07:50 .+1d>
>
> Recently, when I complete the task it not only moves the schedule to the next 
> day
> ... but it also rewrites all of the "Rescheduled from ..." entries in the 
> LOGBOOK.
>
> For example,
>   - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2019-01-02 Wed 10:54]
>   - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-31 Mon 11:50]
>   - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-16 Sun 19:29]
>   - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-03 Mon 10:49]
>  etc.

see this thread for the details:
http://lists.gnu.org/archive/html/emacs-orgmode/2019-01/msg00095.html

the short of it is that as of commit af81211fdc *any* inactive timestamp
within your "headline" that has a repeater will update when you mark the
task as DONE. it doesn't matter where that timestamp is.

> Those previous LOGBOOK entries no longer are available; they are wiped out by 
> new
> task completions.

i feel your pain. i hope you source control your org files. in the
meantime move the HEAD of your tree to some parent of af81211fdc or go
back to release_9.1.14.

good luck!

best,
-cm
--- End Message ---


[O] PATCH: Possibility to yank target of link at point to kill ring

2019-01-11 Thread Ivan Necas
Hi,

I often need to copy target of a link to kill ring, so I decided to
write a small function to do that.
Would it make sense to pull this into org-mode directly?

Thanks for consideration and potential review.

-- Ivan
From 1f38afd4c26d2a8c6238040c6a40eb7dbd1f32ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ivan=20Ne=C4=8Das?= 
Date: Thu, 10 Jan 2019 22:21:38 +0100
Subject: [PATCH] org: Add org-yank-link-at-point

* lisp/org.el (org-yank-link-at-point): New function to yank the
  target of a link at point to kill ring.

TINYCHANGE
---
 lisp/org.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index ea1607d85..6d13d8c92 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9791,6 +9791,15 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 ;; Redisplay so as the new link has proper invisible characters.
 (sit-for 0)))
 
+(defun org-yank-link-at-point ()
+  "Yank target of a link at point"
+  (interactive)
+  (if (org-in-regexp org-bracket-link-regexp 1)
+  (let ((link (match-string-no-properties 1)))
+(kill-new link)
+(message "Link '%s' yanked" link))
+(user-error "No link found")))
+
 (defun org-link-try-special-completion (type)
   "If there is completion support for link type TYPE, offer it."
   (let ((fun (org-link-get-parameter type :complete)))
-- 
2.20.1



[O] recent org-mode changes: completion of repeated tasks cause rewriting of LOGBOOK 'Rescheduled from' entries

2019-01-11 Thread Daniel Ortmann
I have a daily scheduled task with ...
  SCHEDULED: <2019-01-11 Fri 07:50 .+1d>

Recently, when I complete the task it not only moves the schedule to the
next day
... but it also /_rewrites_/ all of the "Rescheduled from ..." entries
in the LOGBOOK.

For example,
  - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2019-01-02 Wed 10:54]
  - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-31 Mon 11:50]
  - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-16 Sun 19:29]
  - Rescheduled from "[2019-01-11 Fri 07:50 .+1d]" on [2018-12-03 Mon 10:49]
 etc.

Those previous LOGBOOK entries no longer are available; they are wiped
out by new task completions.




[O] org-table-align function changed, where is the old behavior?

2019-01-11 Thread Craig Luthy
Hello,
I create lots of tables in org-mode, many with lots of information and long
cells. The C-c C-c was heaven because it prettied up my table in one
action. If I understand what I have read and am seeing, whenever I TAB or
RET all the cells are expanded which creates a scrambled mess that is
impossible to navigate because all the rows wrap. Shrinking 1 column at a
time with C-c TAB is a regretful step backwards. Why did you change the
existing functionality. I would have rather seen that retained and a new
option to do narrowing one column at a time.

I have played with '#+STARTUP: align shrink' but it does not seem to work
when I open the buffer. It may work if I open the file for the first time,
but that is not what I normally do. I hit many files and just leave the
buffers around.

Now that you have changed the way org-table-align works, could you also add
a "new" feature that works like the originall C-c C-c did and format the
column widths in one motion.

This is the first time I have interacted with your team so apologize if I
have followed the right process.

Thanks for your help,
Craig Luthy
309-798-4441


[O] Bug: clicking on a schedule item no longer pops up org-agenda [9.2 (9.2-elpaplus @ /home/bhepple/.emacs.d/elpa/org-plus-contrib-20181230/)]

2019-01-11 Thread Bob Hepple
In a prior version, when I clicked on a SCHEDULED: <...> link, it would
popup the org-agenda view. Now (after a M-x package-list-packages U x)
it does nothing and displays No link found. Is there a way to restore
the old behaviour?

Sorry - I don't know what the version was that had this feature but
probably no more than 6 months old, more likely less than 3 months old.

Emacs  : GNU Emacs 26.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
3.23.2)
 of 2018-08-13
Package: Org mode version 9.2 (9.2-elpaplus @
/home/bhepple/.emacs.d/elpa/org-plus-contrib-20181230/)

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-checklist 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-agenda-files '("~/Sync/tamborine.org" "~/Sync/test.org")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-reveal-start-hook '(org-decrypt-entry)
 org-mode-hook '((closure (t) nil (visual-line-mode 1)
(set-visual-wrap-column 0))
 #[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-show-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
 #[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2] org-eldoc-load)
 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-checklist-export-function 'org-export-as-ascii
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" . php)
("C" . c) ("C++" . c++)
  ("asymptote" . asy) ("bash" . sh) ("beamer" . latex)
("calc" . fundamental) ("cpp" . c++)
  ("ditaa" . artist) ("dot" . fundamental) ("elisp" .
emacs-lisp) ("ocaml" . tuareg)
  ("screen" . shell-script) ("shell" . sh) ("sqlite" .
sql))
 org-occur-hook '(org-first-headline-recenter)
 outline-minor-mode-hook '((lambda nil (define-key outline-minor-mode-map
(kbd "C-") (quote outline-cycle))
(define-key outline-minor-mode-map (kbd
"S-")
 (quote
  (lambda nil (interactive)
   (save-excursion (goto-char (point-min))
(outline-show-all) (outline-hide-leaves)))
  )
 )
)
   (lambda nil (local-set-key " "
outline-mode-prefix-map)))
 org-cycle-hook '(org-cycle-hide-archived-subtrees
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-replace-disputed-keys t
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-font-lock-set-keywords-hook '(org-drill-add-cloze-fontification)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open) ("message" :follow
org-mac-message-open)
   ("x-devonthink-item" :follow
org-devonthink-item-open)
   ("mac-evernote" :follow org-mac-evernote-note-open)
   ("mac-outlook" :follow org-mac-outlook-message-open)
   ("acrobat" :follow org-mac-acrobat-open) ("skim"
:follow org-mac-skim-open)
   ("addressbook" :follow org-mac-addressbook-item-open)
   ("x-together-item" :follow
org-mac-together-item-open)
   ("mairix" :follow org-mairix-open :store
org-mairix-store-gnus-link)
   ("eww" :follow eww :store org-eww-store-link)
   ("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 :export org-irc-export)
   ("info" :follow org-info-open :export
org-info-export :s

Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-01-11 Thread stardiviner


Kyle Meyer  writes:

> Hello,
>
> 34b71a0ca (Add a dispatcher command for inserting dynamic blocks,
> 2018-12-23) removed the key bindings of org-clock-report and
> org-columns-insert-dblock, but these bindings are still listed in
> org-manual.org.  stardiviner, could you please have a look at updating
> the manual to fully capture the changes from 34b71a0ca?  I think it'd
> also be good to mention these removed key bindings in ORG-NEWS.
>
> Thanks.

You're right, I have not noticed them. I will add a patch to submit
soon. Thanks for your mention, Kyle.

-- 
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3