Re: Syncing orgcard.tex with upstream Emacs (was: bug#64578: orgcard.tex fixes to allow PDF rendering to be used as a triptych.)

2023-12-07 Thread Kyle Meyer
Ihor Radchenko writes:

> I see now. I guess I did not really have a full understanding of the
> purpose of emacs-sync. So, it might be helpful to add a similar
> explanation to worg/org-maintenance.org.

Okay, I'll plan to do that.

>> I don't see what problem it solves.  It's moving the divergence to a
>> different file (that would still be tracked in emacs-sync), and it adds
>> one more Org-specific wrinkle to the Emacs tree.  (Also, the orgcard
>> source would still be different given the upstream hunk in the diff I
>> posted in my last message.)
>
> My idea was not to sync that another extra file at all and leave it in
> Emacs repo only.

I see.  Not that it matters given what you say below, but I would
probably lean toward keeping track of such a file in emacs-sync.

> But the same will not work for xml and other diverging
> files. I now don't see any reason to change the existing state of affairs.

All right, thanks for your input.  I'll try to improve
worg/org-maintenance.org as discussed.



Re: Provide org-insert-subitem

2023-12-07 Thread Adam Porter

Hi Bastien,


I think that's a good idea to promote org-insert-subheading either by
binding it to a key or another way.

I already have some drafty code that might touch things in this (very
sensible) area, so if you don't mind, I'll come back to the details of
your suggestions when I can articulate them with the few ideas I have
in mind.  And after 9.4 is out.

But yes, there is room for enhancements here.

Don't hesitate to bump this thread in a few weeks if I don't share my
ideas since then.


Well, it's been a few years since I forgot to bump this thread. [0]  :) 
I just rediscovered it after wondering why the command 
org-insert-subheading still doesn't have a default binding.  May we 
revisit this?  I find myself wanting to insert a subheading almost every 
day, and I have to "M-x org-insert-subheading RET".


Of course I could bind it myself, and in one of my configs I have, but I 
still think it deserves a default binding, even if it were to be a 
"smart" command that worked like org-table-copy-down when in a table and 
does org-insert-subheading otherwise (because I still think that "S-RET" 
is an obviously appropriate binding for this command).


What do you think?  =)

Thanks,
Adam

0: https://yhetil.org/orgmode/875zg9trjo@bzg.fr/



[PATCH] Add new option 'org-imenu-flatten'

2023-12-07 Thread Morgan Smith
* lisp/org/org-compat.el: Add definition of 'org-imenu-flatten'.
(org-imenu-get-tree): Use 'org-imenu-flatten'.
---

Hello!

I've been using this patch for a bit and I quite like it.  One would think
there would be an option in imenu itself to flatten trees but that does not
seem to be the case.  I copied the defcustom from 'doc-view-imenu-flatten'.

Thanks,

Morgan

 lisp/org-compat.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 2697342d6..f2112e4e9 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -1333,6 +1333,10 @@ Pass COLUMN and FORCE to `move-to-column'."
 This also applied for speedbar access."
   :type 'integer)
 
+(defcustom org-imenu-flatten nil
+  "Whether to flatten the list of sections in an imenu or show it nested."
+  :type 'boolean)
+
  Imenu
 
 (defvar-local org-imenu-markers nil
@@ -1353,7 +1357,8 @@ This also applied for speedbar access."
(org-link-display-format (org-get-heading t t t t)
 (when (and (<= level org-imenu-depth) (org-string-nw-p headline))
   (let* ((m (point-marker))
- (item (propertize headline 'org-imenu-marker m 'org-imenu t)))
+ (item (propertize headline 'org-imenu-marker m 'org-imenu t))
+  (level (if org-imenu-flatten 1 level)))
 (push m org-imenu-markers)
 (if (>= level last-level)
 (push (cons item m) (aref subs level))
-- 
2.41.0




Re: Getting email from MS outlook into emacs

2023-12-07 Thread Leo Butler
On Thu, Nov 30 2023, "Fraga, Eric"  wrote:

> 
> Caution: This message was sent from outside the University of Manitoba.
> 
>
> On Wednesday, 29 Nov 2023 at 14:08, Presnell,Brett Douglas wrote:
>> I had to deal with this last spring.  I finally got things working again
>> with mbsync, msmtp, mu/mu4e, and for the oauth stuff, pizauth.  This
>> combination has worked well for me ever since.  Most of the details can
>> be found at
>
> Thank you for this.  Very useful.  I have davmail working for me for
> authentication so I'm going to stick to what's working.  However, it's
> nice to know that there is another route possible should davmail stop
> working.  But sad that we have to through these contortions just to
> access our email.

Aargh. Thanks for you post and webpage, Brett. It set me off to try to
get oath2.el working with gnus (failed effort #2).

But, I did learn several things, including this post:

https://sourceforge.net/p/davmail/mailman/davmail-users/thread/x2ey374g953.fsf%40vestur.ifi.uio.no/

At the bottom of the thread, the developer of davmail recommends setting

davmail.imapAlwaysApproxMsgSize=true

in the configuration file. That one change has made MS outlook + gnus as
fast (or slow) as it was before needing the davmail shim.

Leo


Re: [PATCH] Set Python shell in Org edit buffer

2023-12-07 Thread Ihor Radchenko
Liu Hui  writes:

> Ihor Radchenko  于2023年12月7日周四 18:33写道:
>
>> > +(defun org-babel-edit-prep:python (info)
>> > +  "Set Python shell in Org edit buffer according to INFO."
>> > +  (let ((session (cdr (assq :session (nth 2 info)
>> > +(when (and session (not (string= session "none")))
>> > +  (setq-local python-shell-buffer-name
>> > +  (org-babel-python-without-earmuffs session)
>>
>> Will this work if Python session does not exist yet?
>
> If the specified session does not exist, users have to start the
> session manually if they want to evaluate code directly in the edit
> buffer. In fact, python-shell-send-* commands will clearly suggest
> users using 'run-python' or C-c C-p to create the session in this
> case.

I am afraid that manually starting a python session with `run-python'
will be misleading. Look at how much
`org-babel-python-initiate-session-by-key' does. If users instead start
the session with `run-python' they may get inconsistent results

> Another choice is to use '(org-babel-python-initiate-session session)'
> in org-babel-edit-prep:python, like ob-R, to create the session when
> the specified session does not exist, but I feel it is invasive as
> users may just want to edit the code.

What about displaying a yes/no query about starting a new session when
there is none?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Using backticks for the inline code delimiter? (now with `org-publish-all`)

2023-12-07 Thread Ihor Radchenko
chris  writes:

>> You will need to patch the parser in org-element.el.
>
> Yes, that seems a very good idea.
> I've never "patched" emacs before: in the hack I've been using so far I was 
> doing some `(advice-add 'org-do-emphasis-faces :override #'org-do-emphasis-
> faces-fixed)` thing.

This is an equivalent. Also, you may check out 
https://github.com/radian-software/el-patch

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Set Python shell in Org edit buffer

2023-12-07 Thread Liu Hui
Ihor Radchenko  于2023年12月7日周四 18:33写道:

> > +(defun org-babel-edit-prep:python (info)
> > +  "Set Python shell in Org edit buffer according to INFO."
> > +  (let ((session (cdr (assq :session (nth 2 info)
> > +(when (and session (not (string= session "none")))
> > +  (setq-local python-shell-buffer-name
> > +  (org-babel-python-without-earmuffs session)
>
> Will this work if Python session does not exist yet?

If the specified session does not exist, users have to start the
session manually if they want to evaluate code directly in the edit
buffer. In fact, python-shell-send-* commands will clearly suggest
users using 'run-python' or C-c C-p to create the session in this
case.

Another choice is to use '(org-babel-python-initiate-session session)'
in org-babel-edit-prep:python, like ob-R, to create the session when
the specified session does not exist, but I feel it is invasive as
users may just want to edit the code.



Re: Citations and basic processor: examples of some things that don't work

2023-12-07 Thread William Denton

On 7 December 2023, Ihor Radchenko wrote:


This is another, new bug I introduced while fixing the previous one :)
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a59193e47


Fantastic!  Thanks.  Now it all works.


It would be nice to have proper tests for oc-basic and other oc-* backends.


I'll have a look in there and see if I can add some.

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 420.04 ppm (Mauna Loa Observatory, 2023-12-01)

Re: [BUG] org-babel-load-file, org-babel-tangle-use-relative-file-links and :tangle header [9.6.11 (release_9.6.11 @ /opt/emacs/share/emacs/30.0.50/lisp/org/)]

2023-12-07 Thread TAKAHASHI Yoshio
TAKAHASHI Yoshio  writes:

>> This is because the default value of `org-babel-default-header-args'
>> already contains (:tangle . "no").
> Your explanation is very clear.  Thank you.

I did some tests.  Please check below transcript.  I expect to have the
same results in bloth case.


tkh:~$ cd /tmp
tkh:/tmp$ cat test1.org
* test1

#+begin_src emacs-lisp
  (print "1")
#+end_src

#+begin_src emacs-lisp :tangle "yes"
  (print "2")
#+end_src

#+begin_src emacs-lisp
  (print "3")
#+end_src

tkh:/tmp$ cat a.el
(require 'ox)
(setq org-babel-default-header-args
  (cons '(:tangle . "yes")
(assq-delete-all :tangle org-babel-default-header-args)))
(org-babel-tangle-file "/tmp/test1.org" "/tmp/test1.el" "emacs-lisp")
tkh:/tmp$ emacs -Q -batch --eval="(setq 
org-babel-tangle-use-relative-file-links t)" -l a.el
Tangled 3 code blocks from test1.org
tkh:/tmp$ cat test1.el
(print "2")
tkh:/tmp$ emacs -Q -batch --eval="(setq 
org-babel-tangle-use-relative-file-links nil)" -l a.el
Tangled 3 code blocks from test1.org
tkh:/tmp$ cat test1.el
(print "1")

(print "2")

(print "3")
tkh:/tmp$

-- 
TAKAHASHI Yoshio 



Re: oeg-add-note and double backslash ?

2023-12-07 Thread Ihor Radchenko
David Masterson  writes:

> Hmm. glancing through the manual, there is a bit of assumption implicit
> about the use of '\\'.  We had the problem with Unix Shell scripts that
> we would need a backslash at the end of a line to prevent the EOL as
> being interpreted as end-of-input. Depending on the layers of scripting
> we were using, we added backslashes after the backslash because each
> layer would peel off a backslash.  This is what I first thought of in
> reading the manual.

We do document the line breaks in
https://orgmode.org/manual/Paragraphs.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Syncing orgcard.tex with upstream Emacs (was: bug#64578: orgcard.tex fixes to allow PDF rendering to be used as a triptych.)

2023-12-07 Thread Ihor Radchenko
Kyle Meyer  writes:

>> Maybe we should even have that file in the main repo as a part of
>> emacs-sync branch?
>
> I prefer not to.  I intended that branch to track the state of Org files
> that are synced, not to store auxiliary logs.
> ...
> The emacs-sync branch provides a transparent way to keep track of the
> limited set of Emacs-specific modifications needed for the sync.  We're
> not talking about an ever-growing set of changes.
> ...
> The emacs-sync branch has other Emacs-specific modifications, yes.
> Again, keeping track of those is the reason it exists.
>
>   $ git diff --stat bugfix...emacs-sync
>.gitignore   |  1 -
>doc/{doc-setup.org => org-setup.org} |  2 +-
>doc/{org-manual.org => org.org}  |  4 ++--
>doc/orgcard.tex  |  7 ++-
>etc/schema/schemas.xml   | 57 
> +
>lisp/org-version.el  | 24 
>6 files changed, 90 insertions(+), 5 deletions(-)

I see now. I guess I did not really have a full understanding of the
purpose of emacs-sync. So, it might be helpful to add a similar
explanation to worg/org-maintenance.org.

>> I can see the point. Although, I feel like accumulating such divergence
>> may backfire after some time.
>
> How do you see this particular spot backfiring?  If Emacs changes the
> Emacs-specific text (as they did once in 2016), I port that to the
> emacs-sync branch.  Or if Org changes neighboring text, I resolve the
> conflict on merge into emacs-sync (very likely just taking both sides).
> The resolution is recorded for anyone to look back on.

I was mainly concerned about complex conflicts that might
(theoretically) occur. But it indeed does not matter if the conflicts
are limited and manageable.

>> May we possibly resolve the conflict properly using something like the
>> attached patch?  Then, we can use the same orgcard source but have
>> orgcardemacsnotice.tex empty in Org repository.
>
> I don't see what problem it solves.  It's moving the divergence to a
> different file (that would still be tracked in emacs-sync), and it adds
> one more Org-specific wrinkle to the Emacs tree.  (Also, the orgcard
> source would still be different given the upstream hunk in the diff I
> posted in my last message.)

My idea was not to sync that another extra file at all and leave it in
Emacs repo only. But the same will not work for xml and other diverging
files. I now don't see any reason to change the existing state of affairs.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] Set Python shell in Org edit buffer

2023-12-07 Thread Ihor Radchenko
Liu Hui  writes:

>> May you also mention what this means in practice? Like that users can
>> now send region for evaluation right from the edit src buffer?
>> Otherwise, it may not be very clear for ordinary users what this feature
>> adds.
>
> Yes, I have updated the text and you're welcome to improve it. Thanks!

Thanks for the update!

> +(defun org-babel-edit-prep:python (info)
> +  "Set Python shell in Org edit buffer according to INFO."
> +  (let ((session (cdr (assq :session (nth 2 info)
> +(when (and session (not (string= session "none")))
> +  (setq-local python-shell-buffer-name
> +  (org-babel-python-without-earmuffs session)

Will this work if Python session does not exist yet?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Citations and basic processor: examples of some things that don't work

2023-12-07 Thread Ihor Radchenko
William Denton  writes:

> Thanks for digging into this, Ihor.  It exports now, but I'm afraid it's 
> doing too much capitaliztion.
>
> A name like "van Dongen" should become "Van Dongen" when cited with a caps 
> variant, for example [cite/a/c:@friends].  This is turning it into "VAN 
> DONGEN", 
> upcasing the whole string when it should just be doing the first letter.

This is another, new bug I introduced while fixing the previous one :)
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a59193e47

It would be nice to have proper tests for oc-basic and other oc-* backends.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at