Re: [BUG] org-open-at-point-global fails on links with multiline descriptions in org-mode buffers [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2024-01-21 Thread Omar Antolín Camarena
Thank you for the quick fix! And I'm happily surprised you decided to check the 
whole paragraph. I hadn't dared suggest that because I thought the decision to 
check only the current line was made for performance reasons. On the other 
hand, I had not thought through my proposal carefully and in particular hadn't 
noticed the points you made in response to Gregor.

-- 
Omar Antolín-Camarena



Re: [BUG] Confirmation message for elisp links is badly formatted [9.5.2 (9.5.2-gfbff08 @ /home/omarantolin/.emacs.d/elpa/org-9.5.2/)]

2022-01-31 Thread Omar Antolín Camarena
> Thanks for the report, I’ve fixed this in b3ceafd0 :)

Perfect! Thank you!

-- 
Omar



[BUG] Confirmation message for elisp links is badly formatted [9.5.2 (9.5.2-gfbff08 @ /home/omarantolin/.emacs.d/elpa/org-9.5.2/)]

2022-01-30 Thread Omar Antolín Camarena


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


By default Org prompts you to make sure you really want to execute the code in 
an elisp link; as the docstring for org-link-elisp-confirm-function says, just 
think about a link like [[elisp:(shell-command "rm -rf ~/*")][Web Search]]!

But the formatting of the default confirmation message leaves something to be 
desired. The function org-link--open-elisp which is in charge of confirming 
that you want to execute the code does this:

#+begin_src emacs-lisp
(funcall org-link-elisp-confirm-function
  (format "Execute %S as Elisp? "
  (org-add-props path nil 'face 'org-warning)))
#+end_src emacs-lisp

And the combination of capital %S with the propertized path produces 
confirmation prompts like the following:

 Execute #("(describe-variable 'org-capture-templates)" 0 42 (face 
org-warning)) as Elisp? 

Notice that instead of /being/ propertized with the org-warning face it shows a 
textual representation of the propertize string!

I'd suggest fixing this by /not/ propertizing the link target.

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, 
cairo version 1.16.0)
 of 2021-04-04, unofficial emacs-snapshot build: http://emacs.ganneff.de/, git 
commit dd5ba88afbb63f54603cc632fc55993c04531a85
Package: Org mode version 9.5.2 (9.5.2-gfbff08 @ 
/home/omarantolin/.emacs.d/elpa/org-9.5.2/)

current state:
==
(setq
 org-link-elisp-confirm-function 'y-or-n-p
 org-directory "~/Notes"
 org-hide-emphasis-markers t
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-agenda-files '("~/Notes/Refile.org" "~/Notes/Daily.org"
"~/Notes/Work.org" "~/Notes/Someday.org")
 org-capture-templates '(("s" "Someday" entry (file "Someday.org") "* %?\n")
 ("d" "Daily" entry (file+olp+datetree "Daily.org")
  "* TODO %?\n")
 ("r" "Refile" entry (file "Refile.org") "* %?\n")
 ("j" "Journal entry" plain
  (file+olp+datetree "Journal.org"))
 ("e" "Emacs templates")
 ("ei" "Idea" entry
  (file+olp "Editors/Emacs.org" "Ideas") "* %?\n")
 ("et" "Tip" entry
  (file+olp "Editors/Emacs.org" "Tips") "* %?\n")
 ("eq" "Question" entry
  (file+olp "Editors/Emacs.org" "Questions") "* %?\n")
 ("ep" "Package" entry
  (file+olp "Editors/Emacs.org" "Packages") "* %?\n")
 )
 org-refile-targets '((nil :maxlevel . 2) ("~/Notes/Notes.org" :maxlevel . 2)
  ("~/Notes/Someday.org" :level . 0)
  ("~/Notes/Daily.org" :level . 3)
  ("~/Notes/Work.org" :maxlevel . 2)
  ("~/Notes/Math.org" :maxlevel . 2))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-refile-use-outline-path 'file
 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-link-from-user-regexp "|\\"
 org-mode-hook '(#[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]
 add-pretty-entities-hook org-tweak-syntax-table
 turn-off-visual-line-mode turn-on-auto-fill
 echo-area-tooltips ediff-with-org-show-all
 turn-on-org-cdlatex beginend-org-mode)
 outline-mode-hook '(beginend-outline-mode)
 org-ellipsis "…"
 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-highlight-latex-and-related '(latex script entities)
 org-agenda-mode-hook '(beginend-org-agenda-mode)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-latex-packages-alist '(("AUTO" "babel" t ("pdflatex")))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 

Re: Bug: org-capture does not work if called from minibuffer [9.4 (9.4-55-g706ba9-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201207/)]

2020-12-14 Thread Omar Antolín Camarena
> On my side that works. When it is enabled I get screen for Org capture
> and I can do it.

Odd, it definitely does not work here. If I call org-capture from the
minibuffer, the *Org Select* buffer does appear, but choosing any
template produces an error message of the form:

org-capture: Capture template ‘j’: Can’t expand minibuffer to full frame

> One solution you can use is that you open separate Emacs instance or
> Emacs as server that loads org-capture and serves for capturing
> things. It may run in background without interrupting your work. It
> can then spawn emacsclient to annotate or write the captured note.

Sure, but a much simpler solution is to exit the minibuffer before
calling org-capture. *shrug*

-- 
Omar



Re: Bug: org-capture does not work if called from minibuffer [9.4 (9.4-55-g706ba9-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201207/)]

2020-12-14 Thread Omar Antolín Camarena
> Would you be okay with a user-error message like "Cannot call org-capture
from the minibuffer"?

Oh, if I'm going to get an error message I don't care which one it is.
Might as well leave things as they are currently. What I was hoping is that
you would be able to fix org-capture so that you can also call it from the
minibuffer, if enable-recursive-minibuffers is set to t. I like to think
that I can call org-capture no matter what I am doing, take a quick note or
reminder, and go back to whatever it was. It is almost like that: I can't
interrupt myself if the minibuffer is open, but I can in all other cases.

This is not a big deal, so if it's not easy to fix, just leave it as is.
But if it happens to be easy to do I think it would be worthwhile, so that
org-capture can live up to its reputation of being able to quickly capture
something /no matter what you were doing at the time/!

--
Omar

On Sat, Dec 12, 2020 at 12:32 PM Bastien  wrote:

> Hi Omar,
>
> thanks for reporting this.
>
> Omar Antolín Camarena  writes:
>
> > I have enable-recursive-minibuffers set to t, and just noticed that
> > org-capture does not work if called from the minibuffer.
> >
> > Steps to reproduce:
> >
> > 1. run emacs -Q
> > 2. evaluate (setq enable-recursive-minibuffers t) in the scratch buffer
> > 3. Open the minibuffer, say by using C-x C-f
> > 4. While still in find-file, run M-x org-capture and pick a template (t
> for Task seems to be offered by default).
> >
> > You should get an error message saying "Can't expand minibuffer to
> > full frame".
>
> Would you be okay with a user-error message like
>
>   "Cannot call org-capture from the minibuffer"
>
> ?
>
> --
>  Bastien
>


-- 
Omar Antolín Camarena


Bug: org-capture does not work if called from minibuffer [9.4 (9.4-55-g706ba9-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201207/)]

2020-12-11 Thread Omar Antolín Camarena


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


I have enable-recursive-minibuffers set to t, and just noticed that
org-capture does not work if called from the minibuffer.

Steps to reproduce:

1. run emacs -Q
2. evaluate (setq enable-recursive-minibuffers t) in the scratch buffer
3. Open the minibuffer, say by using C-x C-f
4. While still in find-file, run M-x org-capture and pick a template (t for 
Task seems to be offered by default).

You should get an error message saying "Can't expand minibuffer to full frame".

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, 
cairo version 1.16.0)
 of 2020-10-13, unofficial emacs-snapshot build: http://emacs.ganneff.de/, git 
commit 8d241e8840fdb02dcfce52425626dd8f2125e51a
Package: Org mode version 9.4 (9.4-55-g706ba9-elpaplus @ 
/home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201207/)



Bug: org-catch-invisible-edits doesn't actually catch most deletions [9.4 (9.4-41-g9bb930-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)]

2020-11-22 Thread Omar Antolín Camarena


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Setting org-catch-invisible-edits to 'error does catch org-delete-backward-char 
(bound to  by default), but it doesn't catch backward-kill-word 
(), or kill-word with argument -1 (M-- M-d), or backward-kill-sexp 
(ESC ).

Steps to reproduce:

1. Create an org file with the following 3 lines:

* Stop, hammer time!
You can't touch this
* Break it down!

2. Run emacs -Q and visit the file.

3. M-: (setq org-catch-invisible-edits 'error)

4. Make sure the first headline is folded and place point after the ellipsis.

5. Now you can try any of the commands mentioned in the first paragraph.

The org-catch-invisible-edits will successfully block you from using 
, but any of the other command I mentioned will silently delete the 
word "this". Because of the variable's name, I would expect all these commands 
to be blocked.

Maybe technically this isn't a bug, since the docstring for 
org-catch-invisible-edits only says: "Check if in invisible region before 
inserting or deleting a character." So you can argue it only promises to block 
deletion if you attempt it one character at a time, and if you try to delete a 
word, the docstring doesn't promise to stop you.

I'd suggest that naming the variable org-catch-invisible-edits strongly 
suggests it should catch all deletions in the invisible text and that the 
current behavior is misleading.

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, 
cairo version 1.16.0)
 of 2020-10-13, unofficial emacs-snapshot build: http://emacs.ganneff.de/, git 
commit 8d241e8840fdb02dcfce52425626dd8f2125e51a
Package: Org mode version 9.4 (9.4-41-g9bb930-elpaplus @ 
/home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '((nil :maxlevel . 2) ("~/Notes/Notes.org" :maxlevel . 2)
  ("~/Notes/Someday.org" :level . 0)
  ("~/Notes/Daily.org" :level . 3))
 org-pretty-entities t
 org-capture-bookmark nil
 org-latex-default-packages-alist '(("AUTO" "inputenc" t ("pdflatex"))
("" "graphicx" t) ("" "grffile" t)
("" "longtable" nil) ("" "wrapfig" nil)
("" "rotating" nil) ("normalem" "ulem" t)
("" "amsmath" t) ("" "amssymb" t)
("" "capt-of" nil) ("" "hyperref" nil))
 org-special-ctrl-a/e t
 org-agenda-files '("~/Notes/Refile.org" "~/Notes/Daily.org"
"~/Notes/Alumnos.org" "~/Notes/Someday.org")
 org-mode-hook '(#[0 "\301\211%10\207"
   [imenu-create-index-function org-imenu-get-tree] 2]
 #[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
 ediff-with-org-show-all turn-on-org-cdlatex beginend-org-mode
 org-eldoc-load)
 org-outline-path-complete-in-steps nil
 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%1\236A\207" [:title] 3 
"\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-hide-emphasis-markers t
 org-highlight-latex-and-related '(latex script entities)
 org-ellipsis "…"
 org-agenda-loop-over-headlines-in-active-region nil
 org-src-lang-modes '(("latex-macros" . latex) ("inline-js" . javascript)
  ("redis" . redis) ("php" . php) ("arduino" . arduino)
  ("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)
  

Bug: Error message: "Symbol’s function definition is void: org-refile-get-location" [9.4 (9.4-41-g9bb930-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)]

2020-11-21 Thread Omar Antolín Camarena


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.

The org-goto command doesn't work unless org-refile has been loaded.

I started Emacs, loaded org, opened and org file and tried running org-goto.
I got the following error message:

Symbol’s function definition is void: org-refile-get-location

That sounded like a function that should be defined in org-refile, so I ran the 
org-refile command, which caused the org-refile library to be loaded, and after 
that org-goto worked as expected.

I'm not sure what the best fix for this is, maybe the org-goto library should 
simply require org-refile, or maybe org-refile-get-location should have an 
autoload.

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, 
cairo version 1.16.0)
 of 2020-10-13, unofficial emacs-snapshot build: http://emacs.ganneff.de/, git 
commit 8d241e8840fdb02dcfce52425626dd8f2125e51a
Package: Org mode version 9.4 (9.4-41-g9bb930-elpaplus @ 
/home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '((nil :maxlevel . 2) ("~/Notes/Notes.org" :maxlevel . 2)
  ("~/Notes/Someday.org" :level . 0)
  ("~/Notes/Daily.org" :level . 3))
 org-pretty-entities t
 org-latex-default-packages-alist '(("AUTO" "inputenc" t ("pdflatex"))
("" "graphicx" t) ("" "grffile" t)
("" "longtable" nil) ("" "wrapfig" nil)
("" "rotating" nil) ("normalem" "ulem" t)
("" "amsmath" t) ("" "amssymb" t)
("" "capt-of" nil) ("" "hyperref" nil))
 org-special-ctrl-a/e t
 org-agenda-files '("~/Notes/Refile.org" "~/Notes/Daily.org"
"~/Notes/Alumnos.org" "~/Notes/Someday.org")
 org-mode-hook '(#[0 "\301\211%10\207"
   [imenu-create-index-function org-imenu-get-tree] 2]
 #[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
 ediff-with-org-show-all turn-on-org-cdlatex beginend-org-mode
 org-eldoc-load)
 org-outline-path-complete-in-steps nil
 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%1\236A\207" [:title] 3 
"\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-hide-emphasis-markers t
 org-highlight-latex-and-related '(latex script entities)
 org-ellipsis "…"
 org-agenda-loop-over-headlines-in-active-region nil
 org-src-lang-modes '(("latex-macros" . latex) ("inline-js" . javascript)
  ("redis" . redis) ("php" . php) ("arduino" . arduino)
  ("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)
 org-agenda-mode-hook '(beginend-org-agenda-mode)
 org-structure-template-alist '(("a" . "export ascii") ("c" . "center")
("C" . "comment") ("e" . "example")
("E" . "export") ("h" . "export html")
("l" . "export latex") ("q" . "quote")
("s" . "src") ("v" . "verse")
("thm" . "theorem") ("pf" . "proof")
("lem" . "lemma") ("cor" . "corollary")
("def" . "definition") ("rem" . "remark")
("exer" . "exercise") ("prop" . "proposition")
  

Re: [O] Org mode pollutes the narrow-map

2019-09-12 Thread Omar Antolín Camarena
Great, thanks!

On Fri, Aug 23, 2019, 3:40 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Omar Antolín Camarena  writes:
>
> > Hello everyone,
> >
> > Does it seems a little rude that Org mode binds its own narrowing
> commands in the global narrow-map?
> >
> > You can find this in org.el starting at line 19018:
> >
> > #+begin_src emacs-lisp
> >    Narrow map
> >   (org-defkey narrow-map "s" #'org-narrow-to-subtree)
> >   (org-defkey narrow-map "b" #'org-narrow-to-block)
> >   (org-defkey narrow-map "e" #'org-narrow-to-element)
> > #+end_src
> >
> > I don't need or really want those commands bound in non-org buffers.
> > I think it would be better to bind them (to C-x n s, C-x n b and C-x
> > n e) in org-mode-map. This is the approach taken by AUCTeX, for
> > example. (To be clear, I mean AUCTeX has some narrowing commands and
> > it binds them to C-x n e and C-x n g in its own keymaps.)
>
> It sounds reasonable. I changed the bindings in master. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


[O] Org mode pollutes the narrow-map

2019-08-22 Thread Omar Antolín Camarena
Hello everyone,

Does it seems a little rude that Org mode binds its own narrowing commands in 
the global narrow-map?

You can find this in org.el starting at line 19018:

#+begin_src emacs-lisp
   Narrow map
  (org-defkey narrow-map "s" #'org-narrow-to-subtree)
  (org-defkey narrow-map "b" #'org-narrow-to-block)
  (org-defkey narrow-map "e" #'org-narrow-to-element)
#+end_src

I don't need or really want those commands bound in non-org buffers. I think it 
would be better to bind them (to C-x n s, C-x n b and C-x n e) in org-mode-map. 
This is the approach taken by AUCTeX, for example. (To be clear, I mean AUCTeX 
has some narrowing commands and it binds them to C-x n e and C-x n g in its own 
keymaps.)

-- 
Omar Antolín Camarena



[O] org-backward-paragraph probably should *not* signal user-error at start of buffer

2017-07-27 Thread Omar Antolín Camarena
I just noticed that org-backward-paragraph raises a user error if you call
it at the beginning of the buffer. This is not what the general
backward-paragraph command does, nor is it what I remember other Emacs
movement commands doing when the move can't actually be done.

I think consistency with other movement commands is reason enough to change
the behavior of org-backward-paragraph, but here's a potentially more
convincing reason: the function org-inside-LaTeX-fragment-p is supposed to
return nil if point is inside a LaTeX fragment (and a truthy value
otherwise). But since org-inside-LaTeX-fragment-p uses
org-backward-paragraph internally, what actually happens is that it works
as described *unless* you are at the beginning of the buffer in which case
it doesn't return any value at all but instead signals a user-error!

I've worked around this in my own code by changing
(org-inside-LaTeX-fragment-p) to (unless (bobp)
(org-inside-LaTeX-fragment-p)), but it feels like org-backward-paragraph
should be changed instead.

-- 
Omar Antolín Camarena