[O] [BUG] Duplicate characters in help string when filtering by tag

2018-08-10 Thread Matt Lundin
I'm finding that when I call org-agenda-filter-by-tag, the string of
character hints is long, with lots of duplicates. E.g.,

Filter by tag [hpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcw ]:tag-char, [TAB]:tag, 
[/]:off, [+/-]:filter/exclude, [q]:quit [3 times]

A git bisect reveals that this bug began with commit
2056b60aae528d0ba663d8b3804dc69e98993f1c. After a bit of investigating,
I've found the cause: org--tag-add-to-alist no longer removes duplicate
tags if they belong in a tag group. 

Let me provide a minimal example to illustrate. Take the following
setting:

(setq org-tag-alist
  '((:startgroup)
("home" . ?h)
("phone" . ?p)
("computer" . ?c)
("work" . ?w)
(:endgroup)))

If one has 10 agenda files (none of which has a local #+TAGS
declaration), org-tag-alist-for-agenda will end up containing those tags
multiple times:

--8<---cut here---start->8---
org-tag-alist-for-agenda is a variable defined in ‘org.el’.
Its value is
(#1=(:startgroup)
#2=("home" . 104)
#3=("phone" . 112)
#4=("computer" . 99)
#5=("work" . 119)
#6=(:endgroup)
#1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# 
#2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# 
#4# #5# #6# #1# #2# #3# #4# #5# #6# #1# #2# #3# #4# #5# #6#)
--8<---cut here---end--->8---

As a result, the help prompt for org-filter-tags-for-agenda looks like
this (notice the duplicate characters):

Filter by tag [hpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcwhpcw ]:tag-char, [TAB]:tag, 
[/]:off, [+/-]:filter/exclude, [q]:quit [3 times]

Best,
Matt





Re: [O] Bug: Archiving items with org-attach-archive-delete set to 'query' always asks for confirmation

2018-08-10 Thread Kyle Meyer
Luciano Passuello  writes:

> When I set org-attach-archive-delete to query, Org is supposed to ask
> me for confirmation when archiving entries with attachments. However,
> I am always asked for confirmation,  regardless if the item has
> attachments in the first place. This is to me clearly undesirable
> behavior.

I agree, that doesn't sound desirable (though I've never used this
feature, so perhaps I'm missing something).

> Looking at the source code for org-attach, at line 573, that's indeed
> what code tells us.
> https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-attach.el
>
> My uninformed suggestion is to call org-attach-delete-all without the
> force parameter, using the confirmation code already in
> org-attach-delete-all.

That would cover the org-attach-archive-delete=query case, but it'd also
ask for confirmation in the org-attach-archive-delete=t case.

How about this?

-- >8 --
Subject: [PATCH] org-attach: Don't query unnecessarily about archiving

* lisp/org-attach.el (org-attach-archive-delete-maybe): Don't query
about deleting attachments if the entry doesn't have any attachments.
---
 lisp/org-attach.el | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 192815f4f..53389f782 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -574,10 +574,8 @@ (defun org-attach-archive-delete-maybe ()
   "Maybe delete subtree attachments when archiving.
 This function is called by `org-archive-hook'.  The option
 `org-attach-archive-delete' controls its behavior."
-  (when (if (eq org-attach-archive-delete 'query)
-   (yes-or-no-p "Delete all attachments? ")
- org-attach-archive-delete)
-(org-attach-delete-all t)))
+  (when org-attach-archive-delete
+(org-attach-delete-all (not (eq org-attach-archive-delete 'query)
 
 
 ;; Attach from dired.
-- 
2.18.0




[O] Bug: Archiving items with org-attach-archive-delete set to 'query' always asks for confirmation

2018-08-10 Thread Luciano Passuello
Hello,

When I set org-attach-archive-delete to query, Org is supposed to ask
me for confirmation when archiving entries with attachments. However,
I am always asked for confirmation,  regardless if the item has
attachments in the first place. This is to me clearly undesirable
behavior.

Looking at the source code for org-attach, at line 573, that's indeed
what code tells us.
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-attach.el

My uninformed suggestion is to call org-attach-delete-all without the
force parameter, using the confirmation code already in
org-attach-delete-all.

Unfortunately, I'm not skilled enough in Elisp or knowledgeable in Org
source code to provide a reasonable patch.

Thanks!



[O] Feature request: Numeric prefix argument for org-move-item-up/down

2018-08-10 Thread N. Jackson
It would be nice if org-move-item-up (and org-move-item-down) took
a numeric prefix argument to specify how many times to move the
item up (or down).

I was surprised that this is missing and I'm guessing there might
be a good reason for that? Otherwise, I think this would be a
useful addition.

Thanks,
N.




Re: [O] Hyperlink to Table in Other Org file

2018-08-10 Thread stardiviner


You can use #+NAME:. It works for me.

Robert Love  writes:

> All my attempts to create an org mode link to a table in another org file 
> fails to find the table.   Instead I’m offered to create a new heading, which 
> is not what I want.
>
> In Section 4.3 External Links I see this format:
>
> file:projects.org::some wordstext search in Org file(31)
>
> so my link looks like 
>
> This is how to find error codes [[file:rst.org::tbl:luaerrors][Errors]]
>
> And I have this entry in the org file with the table
>
> #+LABEL: tbl:luaerrors
>
> I’ve also tried the absolute path.   All advice appreciated.


-- 
[ stardiviner ] don't need to convince with trends.
   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3