Problem in 9.3: (next-error) broken

2020-08-22 Thread Tory S. Anderson
Running 9.3 as included in emacs 27, I have found a breaking error that I am 
not sure how to debug any further. Here's my workflow:

1 or 2. Execute (find-grep) for something that brings results
1 or 2. Switch to an orgmode buffer
3. Attempt C-` (next-error)

Result: user-error: No more matches

Switch to a non-org buffer and try again -- it works properly, even without 
re-grepping.

This error DID occur in emacs -Q, so it shouldn't be the result of any 
competing packages.

Any suggestions to recover my workflow?

Thanks,

- Tory



imenu and drop-downs

2020-08-22 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


I am using 'imenu' as a drop-down for giving an easy way to jump among
different headings in an org file.

But, I'm finding that level 2 headings are not showing all of the list
of available headings once the list is bigger than the screen!

So how can I get my list of headings under control please, and to regain
its usefulness?

Thanks
  Sharon.  
- -- 
Debian 10.5, fluxbox 1.3.7, emacs 27.1, org 9.3.7
-BEGIN PGP SIGNATURE-

iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAl9BsS8bHGJvdWRpY2Nh
c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INb+2EQALZyNQxz5R0Zdx0Io4RK
3j+Ct3EcrLkhiNd4/qKuIekPBLvk6NKJd1rkA9IOU0NAD6fs6r5yHo6sWyIMzen/
oUK2y8XPPLFCNfOWoXbu7hEf+d1GDMpdEyzOLCQsayuwQuqcurxlMpy0w0Fe1OsS
/J3jaha+kL1bCXXKu6nnVcBHIcKJtimodBHCI8ewxhol6Ge69O2MdwlBxyR7FYU2
NGMgdy7YYRYPBKYvIqbL0HQJxBb1s8MZQ5dUd7wjhv09RiarCeFUPq+kFCM97t74
WP85rMYP9y+98V3Uze4/n0O9Wb/PQAphE3UxeTl7skOGrRMzJjbUbufGBg5l552C
OK8UuvKhDk0WY5OCPFW4wQsXLTimgxPGtbo8GMEN7uDxhxyT+PWjbEEkm0qXjVg9
OuDTKguLvP3zw41WMn4n+1t7GB4w0TV4lIJSmfL4dz0Qj8ozKS/aJ26jgHl1yxZ/
03F6jYr6nD1i9wAYVRnY0nrE6pLyKT8eVKkavPLQAy5nQthErVVkCEr+YccyG3gI
fcGcZGHY8ePiRK5xIcwFqcmimA1dFBKxNHSFyEjmOsd+pJspy1qVQN5s9IPiYvUi
r7UEMJ3kGVBQTHHYpw+qjnUrB4InqJsL5Cp5QVX5/UnqJIVY0OcupBx3ZtZ9GOtI
roKw23JvJqV8/vPAUP+fCm7Z
=exGt
-END PGP SIGNATURE-



patch to suppress "deprecated cl" warnings plus few others

2020-08-22 Thread Richard Kim
Attached patch suppresses byte compiler warnings.

Most changes are to replace (require 'cl) with (require 'cl-lib). Few other
changes were also made simply by following messages printed by the byte
compiler, e.g., replacing show-branches with outline-show-branches,
org-pop-to-buffer-same-window with pop-to-buffer-same-window, and declaring
new-of as a dynamic variable to prevent it from being a free variable.
From bc6e0dd7c1f3bc8c7d78c4c38eb04140d99001fc Mon Sep 17 00:00:00 2001
From: Richard Kim 
Date: Sat, 22 Aug 2020 11:05:30 -0700
Subject: [PATCH] Suppressed all "deprecated cl" warnings plus few others.

---
 contrib/lisp/ob-tcl.el |  2 +-
 contrib/lisp/org-choose.el |  6 ++
 contrib/lisp/org-depend.el | 11 +--
 contrib/lisp/org-invoice.el|  2 +-
 contrib/lisp/org-learn.el  |  6 +++---
 contrib/lisp/org-notify.el |  2 +-
 contrib/lisp/org-registry.el   |  2 +-
 contrib/lisp/org-toc.el| 18 +-
 contrib/lisp/org-wikinodes.el  |  8 
 contrib/lisp/ox-deck.el|  4 ++--
 contrib/lisp/ox-groff.el   |  2 +-
 contrib/lisp/ox-s5.el  |  2 +-
 contrib/lisp/ox-taskjuggler.el |  2 +-
 contrib/scripts/org-docco.org  |  8 
 14 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/contrib/lisp/ob-tcl.el b/contrib/lisp/ob-tcl.el
index 091eb5d09..d269ad38a 100644
--- a/contrib/lisp/ob-tcl.el
+++ b/contrib/lisp/ob-tcl.el
@@ -31,7 +31,7 @@
 ;;; Code:
 (require 'ob)
 (require 'ob-eval)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
 
 (defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("tcl" . "tcl"))
diff --git a/contrib/lisp/org-choose.el b/contrib/lisp/org-choose.el
index c1006d095..799fd917f 100644
--- a/contrib/lisp/org-choose.el
+++ b/contrib/lisp/org-choose.el
@@ -62,9 +62,7 @@
 ;;; Requires
 
 (require 'org)
-	;(eval-when-compile
-	;   (require 'cl))
-(require 'cl)
+(require 'cl-lib)
 
 ;;; Body
 ;;; The variables
@@ -357,7 +355,7 @@ setting was changed."
 (defun org-choose-get-index-in-keywords (ix all-keywords)
   "Return the index of the current entry."
   (if ix
-  (position ix all-keywords
+  (cl-position ix all-keywords
 		:test #'equal)))
 
 ;;; org-choose-get-entry-index
diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el
index 263cd7175..6d0aaba2e 100644
--- a/contrib/lisp/org-depend.el
+++ b/contrib/lisp/org-depend.el
@@ -155,8 +155,7 @@
 ;;
 
 (require 'org)
-(eval-when-compile
-  (require 'cl))
+(eval-when-compile (require 'cl-lib))
 
 (defcustom org-depend-tag-blocked t
   "Whether to indicate blocked TODO items by a special tag."
@@ -281,13 +280,13 @@ This does two different kinds of triggers:
 			  (from-bottom items)
 			  ((or from-current no-wrap)
 			   (let* ((items (nreverse items))
-  (pos (position this-item items :key #'first))
-  (items-before (subseq items 0 pos))
-  (items-after (subseq items pos)))
+  (pos (cl-position this-item items :key #'first))
+  (items-before (cl-subseq items 0 pos))
+  (items-after (cl-subseq items pos)))
  (if no-wrap items-after
    (append items-after items-before
 			  (t (nreverse items
-		  (setq items (remove-if
+		  (setq items (cl-remove-if
 			   (lambda (item)
  (or (equal (first item) this-item)
  (and (not todo-and-done-only)
diff --git a/contrib/lisp/org-invoice.el b/contrib/lisp/org-invoice.el
index 686889411..8d9f1a8ba 100644
--- a/contrib/lisp/org-invoice.el
+++ b/contrib/lisp/org-invoice.el
@@ -52,7 +52,7 @@
 ;;
 ;; git clone git://pmade.com/elisp
 (eval-when-compile
-  (require 'cl)
+  (require 'cl-lib)
   (require 'org))
 
 (declare-function org-duration-from-minutes "org-duration" (minutes  fmt fractional))
diff --git a/contrib/lisp/org-learn.el b/contrib/lisp/org-learn.el
index dfce196b1..50e9fa22c 100644
--- a/contrib/lisp/org-learn.el
+++ b/contrib/lisp/org-learn.el
@@ -35,7 +35,7 @@
 
 (require 'org)
 (eval-when-compile
-  (require 'cl))
+  (require 'cl-lib))
 
 (defgroup org-learn nil
   "Options concerning the learning code in Org-mode."
@@ -112,7 +112,7 @@ OF matrix."
 	(mod2 (/ (1- interval-used) interval-used))
 	;; the number determining how many times the OF value will
 	;; increase or decrease
-	modifier)
+	modifier new-of)
 (if (< mod5 1.05)
 	(setq mod5 1.05))
 (if (< mod2 0.75)
@@ -159,7 +159,7 @@ OF matrix."
   (let* ((learn-str (org-entry-get (point) "LEARN_DATA"))
 	 (learn-data (or (and learn-str
 			  (read learn-str))
-			 (copy-list initial-repetition-state)))
+			 (cl-copy-list initial-repetition-state)))
 	 closed-dates)
 (setq learn-data
 	  (determine-next-interval (nth 1 learn-data)
diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index 9f8677871..ce0bc07c9 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -57,7 +57,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 

Re: [SOLVED] Re: [PROBLEM] The commit "e1f09607e0" caused org-mode inline image preview try to convert PDF file link

2020-08-22 Thread Lars Ingebrigtsen
"numbch...@gmail.com"  writes:

> Thanks Lars. I will wait for new update in Emacs source code, then re-compile
> Emacs.

The fix has been pushed already.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



[SOLVED] Re: [PROBLEM] The commit "e1f09607e0" caused org-mode inline image preview try to convert PDF file link

2020-08-22 Thread numbch...@gmail.com
Thanks Lars. I will wait for new update in Emacs source code, then
re-compile Emacs.

[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Sat, Aug 22, 2020 at 9:03 PM Lars Ingebrigtsen  wrote:

> "numbch...@gmail.com"  writes:
>
> > The commit "e1f09607e0" caused this problem. I confirmed by git
> > checkout a commit before it. And re-eval source code, then the problem
> > is gone. This is because the commit added
> > ~image-converter-file-name-extensions~ in image-convert.el library
> > which includes "pdf" file extension. It uses command "gs" to convert
> > pdf to image which use 100% of CPU.
>
> I think image-converter.el should have a list of types that it shouldn't
> attempt to convert, even if the backend says that it can.  PDF/PS are
> obvious things -- they aren't images, but imagemagick will offer to
> display them anyway.
>
> I'll add that to Emacs 28.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>bloggy blog: http://lars.ingebrigtsen.no
>


Re: [BUG] babel runs bash instead of zsh when sessions are used

2020-08-22 Thread Rudi C
I tried using emacs -Q and org 9.4, and you're right, this bug is
nonexistent there. I am using Doom, so that's where the bug is coming from
most probably. Unfortunately, things don't work without that bug either.
The evaluation hangs indefinitely. I have used C-g to cancel them and take
a look at the session buffer:

```
echo $HOME $0
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo $HOME $0echo $HOME $0
echo 'org_babel_sh_eoe'
echo 'org_babel_sh_eoe'
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
~/cellar/notes/org master
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
~/cellar/notes/org master*
❯

]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯

]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯

]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯

]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo hi
echo
]2;echo hi ]1;echo hi
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo jk
echo
]2;echo jk ]1;echo jk
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ exit
exit
]2;exit ]1;exit
Process shell finished
echo $HOME $0
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
~/cellar/notes/org master
~/cellar/notes/org master*
~/cellar/notes/org master*
❯
```

On Sat, Aug 22, 2020 at 8:39 AM Kyle Meyer  wrote:

> Rudi C writes:
>
> > #+BEGIN_SRC zsh :session z1
> > echo $HOME $0
> > #+END_SRC
> >
> > #+RESULTS:
> > : /Users/evar /bin/bash
>
> What version of Org are you using?
>
> I tried with both the latest release (9.3.7) and the current master
> branch (220f2b0d9), using default configuration aside from
>
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((shell . t)))
>
> I see "/usr/bin/zsh" in both cases.
>


Re: [PROBLEM] The commit "e1f09607e0" caused org-mode inline image preview try to convert PDF file link

2020-08-22 Thread Lars Ingebrigtsen
"numbch...@gmail.com"  writes:

> The commit "e1f09607e0" caused this problem. I confirmed by git
> checkout a commit before it. And re-eval source code, then the problem
> is gone. This is because the commit added
> ~image-converter-file-name-extensions~ in image-convert.el library
> which includes "pdf" file extension. It uses command "gs" to convert
> pdf to image which use 100% of CPU.

I think image-converter.el should have a list of types that it shouldn't
attempt to convert, even if the backend says that it can.  PDF/PS are
obvious things -- they aren't images, but imagemagick will offer to
display them anyway.

I'll add that to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Re: Bug: org-set-tags-command deletes inherited tags [9.3.7 (9.3.7-18-g093b47-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20200810/)]

2020-08-22 Thread Allen Li
On Fri, Aug 21, 2020 at 8:39 AM Allen Li  wrote:
>
> Kyle Meyer  writes:
>
> > That looks good as far as fixing the misbehavior you report.  I wonder
> > though whether there's a deeper org-get-tags issue here worth
> > considering.  Its documentation says
> >
> > ... the returned list of tags contains tags in this order: file
> > tags, tags inherited from parent headlines, local tags.
> >
> > But it's not specified what happens when a tag is both local and
> > inherited.  The current implementation drops the local tag variant
> > through its delete-dups call:
> >
> > (delete-dups
> >  (append (org-remove-uninherited-tags itags) ltags))
> >
> > I would have expected the local tag to get priority here.  If that were
> > the case (e.g., something like below), that would also solve the issue
> > you describe.
> >
> > Thoughts?
>
> That sounds reasonable, let me prepare a new patch.

Attached new patch
From 24c1c9c423cd92d307033d56ca07692a23eab089 Mon Sep 17 00:00:00 2001
From: Allen Li 
Date: Tue, 18 Aug 2020 15:34:38 -0700
Subject: [PATCH] org.el: Don't exclude local tags that are also inherited

This fixes a bug in set-tags-command excluding a tag that is both set
locally and inherited from the initial minibuffer input by modifying
org-get-tags to prefer keeping the locally set tag over the inherited
tag, as this behavior is more intuitive for org-get-tags anyway.

* lisp/org.el (org-get-tags): Keep local tags over inherited
* testing/lisp/test-org.el (test-org/set-tags-command): Add test
---
 lisp/org.el  | 14 --
 testing/lisp/test-org.el | 11 +++
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index fb95590fc..71dbc611e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12290,7 +12290,8 @@ According to `org-use-tag-inheritance', tags may be inherited
 from parent headlines, and from the whole document, through
 `org-file-tags'.  In this case, the returned list of tags
 contains tags in this order: file tags, tags inherited from
-parent headlines, local tags.
+parent headlines, local tags.  If a tag appears multiple times,
+only the most local tag is returned.
 
 However, when optional argument LOCAL is non-nil, only return
 tags specified at the headline.
@@ -12306,12 +12307,13 @@ Inherited tags have the `inherited' text property."
 (let ((ltags (org--get-local-tags)) itags)
   (if (or local (not org-use-tag-inheritance)) ltags
 (while (org-up-heading-safe)
-  (setq itags (append (mapcar #'org-add-prop-inherited
-  (org--get-local-tags))
-  itags)))
+  (setq itags (nconc (mapcar #'org-add-prop-inherited
+	 (org--get-local-tags))
+ itags)))
 (setq itags (append org-file-tags itags))
-(delete-dups
- (append (org-remove-uninherited-tags itags) ltags
+(nreverse
+	 (delete-dups
+	  (nreverse (nconc (org-remove-uninherited-tags itags) ltags))
 
 (defun org-get-buffer-tags ()
   "Get a table of all tags used in the buffer, for completion."
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 4f8c74539..6144a7af1 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -6953,6 +6953,17 @@ Paragraph"
 	  (let ((org-use-fast-tag-selection nil)
 		(org-tags-column 1))
 		(org-set-tags-command)))
+	(buffer-substring (point) (line-end-position)
+  ;; Handle tags both set locally and inherited.
+  (should
+   (equal "b :foo:"
+	  (org-test-with-temp-text "* a :foo:\n** b :foo:"
+	(cl-letf (((symbol-function 'completing-read)
+		   (lambda (prompt coll  pred req initial  args)
+			 initial)))
+	  (let ((org-use-fast-tag-selection nil)
+		(org-tags-column 1))
+		(org-set-tags-command)))
 	(buffer-substring (point) (line-end-position))
 
 (ert-deftest test-org/toggle-tag ()
-- 
2.28.0



Re: Bug: Total shown clocked time of inlinetask includes the clocking of the parent task [9.3.7 (release_9.3.7-783-gd307b6 @ /home/yantar92/.emacs.d/straight/build/org/)]

2020-08-22 Thread Ihor Radchenko
> Thank you.  Please send the patch with a commit message, as described at
> .

See the attached. Let me know if anything is missing.

Best,
Ihor

>From 3f7b54f0100013c9a37be10256538f76abdd7112 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko 
Date: Sat, 15 Aug 2020 16:31:48 +0800
Subject: [PATCH] org-clock.el: Fix calculated clocking sum in inlinetasks

* lisp/org-clock.el (org-clock-sum-current-item): Do not include
clocked time from the parent when inside inlinetask.

Calling `org-narrow-to-subtree' from inside inlinetask would narrow to
the parent's subtree (correct behaviour).  However, it is not what we
want when calculating the clocking sum.  Inlinetask case should be
treated specially.
---
 lisp/org-clock.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 0dd495493..6a25f1e18 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1956,7 +1956,12 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
   "Return time, clocked on current item in total."
   (save-excursion
 (save-restriction
-  (org-narrow-to-subtree)
+  (if (and (featurep 'org-inlinetask)
+	   (or (org-inlinetask-at-task-p)
+		   (org-inlinetask-in-task-p)))
+	  (narrow-to-region (save-excursion (org-inlinetask-goto-beginning) (point))
+			(save-excursion (org-inlinetask-goto-end) (point)))
+	(org-narrow-to-subtree))
   (org-clock-sum tstart)
   org-clock-file-total-minutes)))
 
-- 
2.26.2



Kyle Meyer  writes:

> Ihor Radchenko writes:
>
>> I have noticed that total clocked time shown while clocked-in into
>> inlinetask includes the clocked time of its parent task.
>>
>> Expected behaviour: only the clocking time for the inline task itself
>> should be shown.
>>
>> This can be fixed if org-clock-sum-current-item consider the case when
>> point is at inlinetask.  The proposed fix is attached.
>
> Thank you.  Please send the patch with a commit message, as described at
> .


Re: configure separator in org-table-insert-hline

2020-08-22 Thread Vladimir Alexiev
How can I use radio tables for that?