[BUG] org-occur doesn't hide unmatching top-levels [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-16 Thread Carlos Pita
Hi all,

I don't see any clear reason why org-occur should hide unmatching
entries except at the top level, where it merely folds them. For files
containing lots of top-level entries this requires tree demoting in
order to hide irrelevant information, but this imposes constraints on
the tree structure that are not related to its author's goals.

It has been asked in the past:

- https://stackoverflow.com/questions/7602787

- https://emacs-orgmode.gnu.narkive.com/ogvwJnHD

I've been playing with org-show-context-detail and it doesn't seem to be
any option which actually hides top levels, though the description of
some options seem to imply that they should, I believe. This is why I'm
reporting this as a bug and not a feature request.

Best regards,
Carlos

---

Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin20.6.0, NS 
appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-11-14
Package: Org mode version 9.5 (release_9.5-225-g494c20.dirty @ 
/Users/carlos/Install/Source/org-mode/lisp/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Documents"
 org-bibtex-headline-format-function '(closure
   (org-id-locations 
org-agenda-search-view-always-boolean org-agenda-overriding-header
t)
   (entry) (cdr (assq :title entry)))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-default-notes-file "~/Documents/Capturas.org"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '((closure
  (org-agenda-skip-regexp org-table1-hline-regexp 
org-table-tab-recognizes-table\.el
   org-table-dataline-regexp org-table-any-border-regexp 
org-agenda-restriction-lock-overlay
   org-agenda-overriding-restriction org-agenda-diary-file 
org-complex-heading-regexp t)
  nil (setq imenu-create-index-function 'org-imenu-get-tree))
 (closure
  (org--rds reftex-docstruct-symbol 
org-element-greater-elements visual-fill-column-width org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def 
org-read-date-inactive org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task 
org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode 
org-end-time-was-given org-time-was-given
   org-log-note-extra org-log-note-purpose org-log-post-message 
org-last-inserted-timestamp
   org-last-changed-timestamp org-entry-property-inherited-from 
org-blocked-by-checkboxes org-state
   org-agenda-headline-snapshot-before-repeat 
org-agenda-buffer-name org-agenda-start-on-weekday
   org-agenda-buffer-tmp-name org-priority-regexp 
org-mode-abbrev-table org-mode-syntax-table
   org-element-use-cache org-element-cache-persistent 
buffer-face-mode-face org-tbl-menu org-org-menu
   org-struct-menu org-entities org-last-state 
org-id-track-globally org-clock-start-time texmathp-why
   remember-data-file org-agenda-tags-todo-honor-ignore-options 
iswitchb-temp-buflist
   calc-embedded-open-mode calc-embedded-open-formula 
calc-embedded-close-formula align-mode-rules-list
   org-emphasis-alist org-emphasis-regexp-components 
org-export-registered-backends org-modules
   crm-separator org-babel-load-languages 
org-id-overriding-file-name org-indent-indentation-per-level
   org-element-paragraph-separate org-agenda-buffer-name 
org-inlinetask-min-level t)
  nil (add-hook 'change-major-mode-hook 'org-show-all 'append 
'local))
 (closure
  (org-src-window-setup *this* 
org-babel-confirm-evaluate-answer-no org-babel-tangle-uncomment-comments
   org-src-preserve-indentation org-src-lang-modes 
org-edit-src-content-indentation
   org-babel-library-of-babel t)
  nil (add-hook 'change-major-mode-hook 
#'org-babel-show-result-all 'append 'local))
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-confirm-shell-link-function 'yes-or-no-p
 org-reveal-start-hook '(org-decrypt-entry)
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-show-context-detail '((agenda . local) (bookmark-jump . lineage) (isearch 
. lineage) (occur-tree . minimal)
   (default . ancestors))

Re: c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’

2021-11-16 Thread Samuel Wales
hmm i will have to try not setting o-e-r-c [ordinary user].  probably
a lot of users do.

might be useful to know whether a default regexp change could satisfy
everybody?  in my case i remove " and , from third re.  i also have a
note "org-set-emph-re is what you are supposed to use, but it is
undocumented".  for some reason.  that might be obsolete,


On 11/16/21, Ihor Radchenko  wrote:
> Max Nikulin  writes:
>
>> Better docs and some restriction on defcustom values were discussed
>> earlier:
>> https://list.orgmode.org/87k0oyd3pw@nicolasgoaziou.fr/
>> Nicolas Goaziou. Re: Using backticks for the inline code delimeter? Mon,
>> 19 Apr 2021 11:27:07 +0200
>>
>> Sorry, I have not prepared a patch. I am not confident with defcustom
>> fine tuning and have not experimented with it since that time.
>
> Maybe something like the attached?
>
> Best,
> Ihor
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: c47b535bb origin/main org-element: Remove dependency on ‘org-emphasis-regexp-components’

2021-11-16 Thread Samuel Wales
i should point out that my changes are old and i don't know if they
have already been done

On 11/16/21, Samuel Wales  wrote:
> hmm i will have to try not setting o-e-r-c [ordinary user].  probably
> a lot of users do.
>
> might be useful to know whether a default regexp change could satisfy
> everybody?  in my case i remove " and , from third re.  i also have a
> note "org-set-emph-re is what you are supposed to use, but it is
> undocumented".  for some reason.  that might be obsolete,
>
>
> On 11/16/21, Ihor Radchenko  wrote:
>> Max Nikulin  writes:
>>
>>> Better docs and some restriction on defcustom values were discussed
>>> earlier:
>>> https://list.orgmode.org/87k0oyd3pw@nicolasgoaziou.fr/
>>> Nicolas Goaziou. Re: Using backticks for the inline code delimeter? Mon,
>>> 19 Apr 2021 11:27:07 +0200
>>>
>>> Sorry, I have not prepared a patch. I am not confident with defcustom
>>> fine tuning and have not experimented with it since that time.
>>
>> Maybe something like the attached?
>>
>> Best,
>> Ihor
>>
>>
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



[BUG] Weird sparse tree folding [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-16 Thread Carlos Pita
Hi all,

with this content:

* a

** b1

c1

** b2

c2

** b3

c3

** b4

c4

** b5

c5

I create a sparse tree for c3: C-/ / c3

I get this:

* a...
** b3

c3

...

Expanding the three dots at the bottom:

* a...
** b3

c3

...
c4
...

The new three dots are not expandable.

Maybe I'm not getting how this is supposed to work, but it makes no
sense to me.

Best regards,
Carlos

---


Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin20.6.0, NS 
appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-11-14
Package: Org mode version 9.5 (release_9.5-225-g494c20.dirty @ 
/Users/carlos/Install/Source/org-mode/lisp/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Documents"
 org-bibtex-headline-format-function '(closure
   (org-id-locations 
org-agenda-search-view-always-boolean org-agenda-overriding-header
t)
   (entry) (cdr (assq :title entry)))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-default-notes-file "~/Documents/Capturas.org"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '((closure
  (org-agenda-skip-regexp org-table1-hline-regexp 
org-table-tab-recognizes-table\.el
   org-table-dataline-regexp org-table-any-border-regexp 
org-agenda-restriction-lock-overlay
   org-agenda-overriding-restriction org-agenda-diary-file 
org-complex-heading-regexp t)
  nil (setq imenu-create-index-function 'org-imenu-get-tree))
 (closure
  (org--rds reftex-docstruct-symbol 
org-element-greater-elements visual-fill-column-width org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def 
org-read-date-inactive org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task 
org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode 
org-end-time-was-given org-time-was-given
   org-log-note-extra org-log-note-purpose org-log-post-message 
org-last-inserted-timestamp
   org-last-changed-timestamp org-entry-property-inherited-from 
org-blocked-by-checkboxes org-state
   org-agenda-headline-snapshot-before-repeat 
org-agenda-buffer-name org-agenda-start-on-weekday
   org-agenda-buffer-tmp-name org-priority-regexp 
org-mode-abbrev-table org-mode-syntax-table
   org-element-use-cache org-element-cache-persistent 
buffer-face-mode-face org-tbl-menu org-org-menu
   org-struct-menu org-entities org-last-state 
org-id-track-globally org-clock-start-time texmathp-why
   remember-data-file org-agenda-tags-todo-honor-ignore-options 
iswitchb-temp-buflist
   calc-embedded-open-mode calc-embedded-open-formula 
calc-embedded-close-formula align-mode-rules-list
   org-emphasis-alist org-emphasis-regexp-components 
org-export-registered-backends org-modules
   crm-separator org-babel-load-languages 
org-id-overriding-file-name org-indent-indentation-per-level
   org-element-paragraph-separate org-agenda-buffer-name 
org-inlinetask-min-level t)
  nil (add-hook 'change-major-mode-hook 'org-show-all 'append 
'local))
 (closure
  (org-src-window-setup *this* 
org-babel-confirm-evaluate-answer-no org-babel-tangle-uncomment-comments
   org-src-preserve-indentation org-src-lang-modes 
org-edit-src-content-indentation
   org-babel-library-of-babel t)
  nil (add-hook 'change-major-mode-hook 
#'org-babel-show-result-all 'append 'local))
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-confirm-shell-link-function 'yes-or-no-p
 org-reveal-start-hook '(org-decrypt-entry)
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-cycle-separator-lines 1
 org-todo-keywords '((sequence "TODO" "NEXT" "|" "DONE"))
 outline-minor-mode-buttons '(("▶" "▼" outline--valid-char-p))
 org-support-shift-select t
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-preview-latex-default-process 'dvisvgm
 org-persist-

Re: Weird gap in agenda mode-line

2021-11-16 Thread Carlos Pita
> I don't see this in my agenda view.  Image attached.

This is because there is a span in your case (Day). The space is still
there but it's not an extra one.

The space in:

  " " ;; <- this is the extra space
  '(:eval (org-agenda-span-name org-agenda-current-span))

should be conditional to the expression below evaluating to something
different than the empty string.

Best regards,
Carlos



[BUG] Agenda query trailing spaces [9.5 (release_9.5-225-g494c20.dirty @ /Users/carlos/Install/Source/org-mode/lisp/)]

2021-11-16 Thread Carlos Pita
Hi all,

when I press [ or ] to add additional words to the agenda query but then
immediately abort the prompt with C-g without actually adding any new
word, a trailing extra space is added to the query. After doing the same
n times, the query includes n trailing spaces.

Best regards,
Carlos




Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin20.6.0, NS 
appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-11-14
Package: Org mode version 9.5 (release_9.5-225-g494c20.dirty @ 
/Users/carlos/Install/Source/org-mode/lisp/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Documents"
 org-bibtex-headline-format-function '(closure
   (org-id-locations 
org-agenda-search-view-always-boolean org-agenda-overriding-header
t)
   (entry) (cdr (assq :title entry)))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-default-notes-file "~/Documents/Capturas.org"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '((closure
  (org-agenda-skip-regexp org-table1-hline-regexp 
org-table-tab-recognizes-table\.el
   org-table-dataline-regexp org-table-any-border-regexp 
org-agenda-restriction-lock-overlay
   org-agenda-overriding-restriction org-agenda-diary-file 
org-complex-heading-regexp t)
  nil (setq imenu-create-index-function 'org-imenu-get-tree))
 (closure
  (org--rds reftex-docstruct-symbol 
org-element-greater-elements visual-fill-column-width org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def 
org-read-date-inactive org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task 
org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode 
org-end-time-was-given org-time-was-given
   org-log-note-extra org-log-note-purpose org-log-post-message 
org-last-inserted-timestamp
   org-last-changed-timestamp org-entry-property-inherited-from 
org-blocked-by-checkboxes org-state
   org-agenda-headline-snapshot-before-repeat 
org-agenda-buffer-name org-agenda-start-on-weekday
   org-agenda-buffer-tmp-name org-priority-regexp 
org-mode-abbrev-table org-mode-syntax-table
   org-element-use-cache org-element-cache-persistent 
buffer-face-mode-face org-tbl-menu org-org-menu
   org-struct-menu org-entities org-last-state 
org-id-track-globally org-clock-start-time texmathp-why
   remember-data-file org-agenda-tags-todo-honor-ignore-options 
iswitchb-temp-buflist
   calc-embedded-open-mode calc-embedded-open-formula 
calc-embedded-close-formula align-mode-rules-list
   org-emphasis-alist org-emphasis-regexp-components 
org-export-registered-backends org-modules
   crm-separator org-babel-load-languages 
org-id-overriding-file-name org-indent-indentation-per-level
   org-element-paragraph-separate org-agenda-buffer-name 
org-inlinetask-min-level t)
  nil (add-hook 'change-major-mode-hook 'org-show-all 'append 
'local))
 (closure
  (org-src-window-setup *this* 
org-babel-confirm-evaluate-answer-no org-babel-tangle-uncomment-comments
   org-src-preserve-indentation org-src-lang-modes 
org-edit-src-content-indentation
   org-babel-library-of-babel t)
  nil (add-hook 'change-major-mode-hook 
#'org-babel-show-result-all 'append 'local))
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-confirm-shell-link-function 'yes-or-no-p
 org-reveal-start-hook '(org-decrypt-entry)
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-cycle-separator-lines 1
 org-todo-keywords '((sequence "TODO" "NEXT" "|" "DONE"))
 outline-minor-mode-buttons '(("▶" "▼" outline--valid-char-p))
 org-support-shift-select t
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-preview-latex-default-process 'dvisvgm
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-res

Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-16 Thread Aaron Jensen
On Sun, Nov 14, 2021 at 3:10 PM Aaron Jensen  wrote:
>
> On Sun, Nov 14, 2021 at 3:00 AM Ihor Radchenko  wrote:
> >
> > Aaron Jensen  writes:
> >
> > > Another one: 
> > > https://gist.github.com/aaronjensen/5114997373008e18a6473f513f5d5da8
> > >
> > > I don't have the details of what I was doing in the time, sorry.
> > >
> > > I'm on: ded97b767 * main origin/main org-element.el: Fix regression
> > > from d3836c1a1
> >
> > I have done some related fixes recently. An update might help. Also, do
> > you happen to use polymode? If so, the warning may be related to
> > https://github.com/polymode/poly-org/issues/33
>
> I've updated. I do not use polymode.

Here's another on c47b535bb:

https://gist.github.com/aaronjensen/348d879f79099c0d9b660bad199f25af

I don't recall what I was doing at the time, it was during a meeting.



insert automatically a reference to a section header and a link

2021-11-16 Thread Uwe Brauer


Hi

In auctex+reftex it is possible that when I insert a new section header
a reference label is inserted automatically:


1. Example
   \subsection{Inverse problem}
   \label{sec:one}

2. And then using  reftex-reference 
   I can insert \ref{sec:one}  


So the equivalent of 1. in org mode would be to automatically insert

** Inverse problem
   :PROPERTIES:
   :CUSTOM_ID: sec:one
   :END:

Can this be done?

And then what would be the equivalent to 2? It is not org-insert-link,
as far as I can see.

Thanks and regards

Uwe Brauer