Re: Documentation request

2024-07-22 Thread Peter Mao
ah, I failed to mention my version number -- 9.6.15 (which ships with Emacs
29.3).

If it's complete in the latest version, then that's great -- I can wait for
the future to come to me.

Peter

On Mon, Jul 22, 2024 at 6:43 AM Ihor Radchenko  wrote:

> Peter Mao  writes:
>
> > The docstrings for org-metadown and org-metaup (and maybe other
> > context-dependent commands) should reference the corresponding hooks,
> > org-metadown-hook and org-metaup-hook.
>
> But they do?
>
> org-metadown is an interactive and natively compiled function defined
> in org-edit-special.el.
>
> Signature
> (org-metadown  ARG)
>
> Documentation
> ...
>
> This function runs the functions in org-metadown-hook one by
> one as a first step, and exits immediately if a function from the
> hook returns non-nil.  In the absence of a specific context, the
> function runs org-metadown-final-hook using the same logic.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


Documentation request

2024-07-20 Thread Peter Mao
The docstrings for org-metadown and org-metaup (and maybe other
context-dependent commands) should reference the corresponding hooks,
org-metadown-hook and org-metaup-hook.

I recently ran into the (happy) situation where M- popped me from an
org-babel code block into the corresponding session, but took a while to
figure out exactly how that was happening.

Peter


Re: [BUG] subheadings disappear from buffer [9.6.6 (release_9.6.6 @ /opt/local/share/emacs/29.1/lisp/org/)]

2023-12-05 Thread Peter Mao
On Tue, Dec 5, 2023 at 4:27 AM Ihor Radchenko  wrote:

> Peter Mao  writes:
>
> > This is an incomplete initial bug report.  I don't have time right now to
> > chase down all the details.
> >
> > A couple of times in the past month, the subheadings in the org file I'm
> > working on (with lots of org-babel code blocks) disappear.   does
> not
> > fold or unfold those headings, although the indicator (...) still shows.
> > ...
> > summary:
> > 1. subheading text disappears from org file, even in fundamental
> > 2. saving the buffer shows that the disappearance is cosmetic only
> > 3. I have not established reproducible conditions for this yet.
>
> Might be yet another problem with isearch + folding via text properties.
> You may try to set `org-fold-core-style' to 'overlays.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

Thanks, Ihor.  I was suspecting isearch, but I can't chase reproducibility
yet.  I'll try out your suggestion.

Peter


[BUG] subheadings disappear from buffer [9.6.6 (release_9.6.6 @ /opt/local/share/emacs/29.1/lisp/org/)]

2023-12-04 Thread Peter Mao
This is an incomplete initial bug report.  I don't have time right now to
chase down all the details.

A couple of times in the past month, the subheadings in the org file I'm
working on (with lots of org-babel code blocks) disappear.   does not
fold or unfold those headings, although the indicator (...) still shows.
In desperation, I switch to fundamental-mode, but the text is still not in
the buffer.  I save the buffer under a different filename to find that all
the missing text is in the file.

Has anyone else seen this?

summary:
1. subheading text disappears from org file, even in fundamental
2. saving the buffer shows that the disappearance is cosmetic only
3. I have not established reproducible conditions for this yet.


Emacs  : GNU Emacs 29.1 (build 2, x86_64-apple-darwin22.5.0, GTK+ Version
3.24.38, cairo version 1.17.6)
 of 2023-08-07
Package: Org mode version 9.6.6 (release_9.6.6 @
/opt/local/share/emacs/29.1/lisp/org/)

current state:
==
(setq
 org-noter--doc-goto-location-hook '(org-noter-pdf--goto-location)
 org-link-elisp-confirm-function 'yes-or-no-p
 org-ditaa-jar-path "/opt/local/share/java/ditaa-0.11.0-standalone.jar"
 org-noter-supported-modes '(doc-view-mode pdf-view-mode nov-mode)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-download-file-format-function 'org-download-file-format-default
 org-agenda-files '("~/Syncbox/files/gtd.org")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-noter-arrow-horizontal-offset -30
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-noter-doc-split-fraction '(0.67 . 0.9)
 org-default-notes-file "~/Syncbox/files/.notes"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-file-apps '((auto-mode . emacs) ("\\.x?html?\\'" . default)
("\\.pdf\\'" . default) ("\\.jpe?g\\'" . "gqview -t %s &"))
 org-noter--pretty-print-location-for-title-hook
'(org-noter-pdf--pretty-print-location-for-title)
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
 org-noter-auto-save-last-location t
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-noter--pretty-print-highlight-location-hook
'(org-noter-pdf--pretty-print-highlight)
 org-mode-hook '(#[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2] er/add-org-mode-expansions org-appear-mode
 #[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-fold-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)
 org-babel-load-languages '((emacs-lisp . t) (ditaa . t) (perl . t) (python
. t) (octave . t) (shell . t) (matlab . t))
 org-appear-autoentities t
 org-noter--pretty-print-location-hook
'(org-noter-pdf--pretty-print-location)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-ellipsis " ↧"
 org-download-abbreviate-filename-function 'file-relative-name
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-download-annotate-function 'org-download-annotate-default
 org-appear-autosubmarkers t
 org-adapt-indentation t
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-download-screenshot-method "screencapture -i %s"
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-appear-inside-latex t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("python" . "py") ("perl" . "pl")
("emacs-lisp" . "el") ("elisp" . "el"))
 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-ditaa-eps-jar-path
"/opt/local/share/emacs/29.1/lisp/contrib/scripts/DitaaEps.jar"
 org-id-link-to-org-use-id t
 org-noter-headline-title-decoration "/"
 org-appear-autoemphasis nil
 org-noter--show-arrow-hook '(org-noter-pdf--show-arrow)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-noter-arrow-background-color "cyan"
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-noter--add-highlight-hook '(org-noter-pdf--highlight-location)
 

Re: [BUG] ob-python hangs on second start [9.5.4 (release_9.5.4-763-g06373a @ ~/emacs/org-mode/lisp/)]

2023-08-27 Thread Peter Mao
On Sun, Aug 27, 2023 at 2:26 PM Jack Kamm  wrote:

> Ihor Radchenko  writes:
>
> > Confirmed.
> >
> > It looks like `python-shell-first-prompt-hook' does not get triggered
> > in the described scenario with exit() and we enter infinite loop in the
> > code below.
>
> I think `python-shell-first-prompt-hook' is actually still triggered,
> but rather it is `org-babel-comint-wait-for-output' that is hanging
> while waiting for startup. However, we can just replace it with a
> `sleep-for' instead, because we now wait for
> `org-babel-python--initialized' anyways.
>
> See the attached patch. Please let me know if it fixes the problem for
> you.
>

Yes, this fixes the problem for me.  I made the change locally to
release_9.6.6 on emacs 29.1.  I have the expected behavior back. thank you!

Peter


[BUG] ob-python hangs on second start [9.5.4 (release_9.5.4-763-g06373a @ ~/emacs/org-mode/lisp/)]

2023-08-24 Thread Peter Mao
Expectation:  When running ob-python code blocks, I should be able to
kill the python session in the *Python* buffer and run another code
block (or the same one).

Problem:  ob-python works fine on the first execution, but after
`exit()`ing the python session, it hangs without executing the code.
After a `C-g`, the prompt in the *Python* session shows up, but one then
has to re-execute the code block, as none of it has run.

The following three code blocks demonstrate the problem.  I have
bisected the problem, finding 06373a64 as the first bad commit.  I tried
to reproduce the problem on Emacs 28.2, but this commit of Org won't
compile on Emacs 28.2 for me.

#+begin_src elisp :results none
  (org-babel-do-load-languages 'org-babel-load-languages '((python . t)))
  (setq-local org-confirm-babel-evaluate nil)
#+end_src

#+begin_src python :results output
  print("Running first, this one issues a warning but competes
successfully.")
  exit()
#+end_src

#+begin_src python :results output
  print("Running second, this one hangs until user enters C-g.")
  print("None of the code executes.")
  exit()
#+end_src



Emacs  : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0)
 of 2023-07-31
Package: Org mode version 9.5.4 (release_9.5.4-763-g06373a @
/home/peterm/emacs/org-mode/lisp/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
   org-babel-header-arg-expand)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
 org-cycle-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
  [add-hook change-major-mode-hook org-fold-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)
 org-babel-load-languages '((python . t))
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")
 ("elisp" . "el"))
 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-speed-command-hook '(org-speed-command-activate
 org-babel-speed-command-activate)
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
 org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
  ("id" :follow org-id-open)
  ("eww" :follow org-eww-open :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
:store org-info-store-link :insert-description
org-info-description-as-command)
  ("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)
  ("doi" :follow org-link-doi-open :export
org-link-doi-export)
  ("file+sys") ("file+emacs")
  ("shell" :follow org-link--open-shell)
  ("news" :follow
#[514 "\301\300\302 Q \"\207"
 ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("mailto" :follow
#[514 "\301\300\302 Q \"\207"
 ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("https" :follow
#[514 "\301\300\302 Q \"\207"
 ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("http" :follow
#[514 "\301\300\302 Q \"\207"
 ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
)
  ("ftp" :follow
#[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"]
 6 "\n\n(fn URL ARG)"]
)
  ("help" :follow org-link--open-help :store
org-link--store-help)
  ("file" :complete 

Re: org-noter

2023-03-12 Thread Peter Mao
Hi Bruce,

The "official" repo will be at https://github.com/org-noter/org-noter, but
I need to work out some snafus/teething issues.

Peter

On Sun, Mar 12, 2023 at 4:37 AM Bruce D'Arcus  wrote:

> This is really cool, but doesn't there really need to be a single repo for
> distribution, issue reporting, etc.?
>
> Do you have a plan for which fork would become primary?
>
>
> On Sat, Mar 11, 2023, 11:35 PM Peter Mao  wrote:
>
>> Dear Org maintainers:
>>
>> I don't think org-noter is part of any official org distribution, having
>> been a MELPA-distributed package since inception (2017), but in the course
>> of discussing transfer of maintenance duties with Jonas Bernoulli (in his
>> MELPA-maintainer role), he suggested that we inform you of the impending
>> change to the maintenance of this package.
>>
>> In short, Dmitry and I have stabilized new features brought into the code
>> since Gonçalos' last commit in 2019 and brought in CI and a few new
>> features ourselves.  We have tried to contact Gonçalos since early Dec
>> 2022, but have not heard from him.
>>
>> Here are links to the relevant "issue" tickets on MELPA and the original
>> org-noter repository where we have made our proposal to maintain the
>> project:
>> https://github.com/weirdNox/org-noter/issues/173
>> https://github.com/melpa/melpa/issues/8413
>>
>> No action is needed on your part, but comments and suggestions are
>> welcomed.
>>
>> Peter
>>
>>
>>


org-noter

2023-03-11 Thread Peter Mao
Dear Org maintainers:

I don't think org-noter is part of any official org distribution, having
been a MELPA-distributed package since inception (2017), but in the course
of discussing transfer of maintenance duties with Jonas Bernoulli (in his
MELPA-maintainer role), he suggested that we inform you of the impending
change to the maintenance of this package.

In short, Dmitry and I have stabilized new features brought into the code
since Gonçalos' last commit in 2019 and brought in CI and a few new
features ourselves.  We have tried to contact Gonçalos since early Dec
2022, but have not heard from him.

Here are links to the relevant "issue" tickets on MELPA and the original
org-noter repository where we have made our proposal to maintain the
project:
https://github.com/weirdNox/org-noter/issues/173
https://github.com/melpa/melpa/issues/8413

No action is needed on your part, but comments and suggestions are welcomed.

Peter


Re: missing from the manual - move commands

2022-12-26 Thread Peter Mao
On Mon, Dec 26, 2022 at 7:03 AM Max Nikulin  wrote:

> On 24/12/2022 09:43, Peter Mao wrote:
> > The following commands are missing from the manual!
> >
> > org-forward-element
> > org-backward-element
>
> I think, the manual was written with assumption that Emacs users are
> familiar with C-up, M-{, C-down, M-} keystrokes.
>
Not everyone uses all of the motion commands.  I've been using emacs since
v18, and forward-paragraph and backward-paragraph have never been part of
my repertoire.

In addition, M-right and M-left, which I have used a lot outside of org,
for decades, behave differently in org, so the existence of motion commands
that are common in emacs (outside of org) do not guarantee an equivalent
inside of org.  BTW, I think M-f and M-b are better anyways, but decades of
muscle memory die hard.

Peter


Re: missing from the manual

2022-12-25 Thread Peter Mao
Also, it moves you to an outer level if you are at an end.

For my own use, because I want the command to treat the first item in a
list the same way as the others (when moving forward), I tweaked
org-forward-element from
(let* ((elem (org-element-at-point))

to:
(let* ((elem (progn
(when (equal (car (org-element-at-point))
'plain-list)
  (forward-char))
(org-element-at-point)))

The "backward" version behaves exactly as I would like it to.

Peter

On Sun, Dec 25, 2022 at 12:19 AM Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
> >> org-forward-element
> >> org-backward-element
> >>
> >> These two should be mentioned in the manual in section 2.3 "Motion"
> >
> > How are they different from `org-forward-heading-same-level` and
> > `org-backward-heading-same-level'?  (Not irony etc., I'm genuinely
> > curious.)
>
> They work on paragraphs, lists, blocks, etc.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


missing from the manual

2022-12-23 Thread Peter Mao
Dear maintainers,

The following commands are missing from the manual!

org-forward-element
org-backward-element

These two should be mentioned in the manual in section 2.3 "Motion"

I just found them via the *HELP* page for org mode (by accident).  I
thought nothing like them existed in org mode, so I had my own (less well
crafted) commands.

Peter