Re: orgmode tables

2024-04-22 Thread Mark Barton
I always forget the command to add columns, so I usually just modify the header 
row to add them to the end by using the "|" character to separate them. Once I 
press tab, then Org will correct the table.

started with two columns
| one | two |
|-+-|
|   1 |   2 |

add two more to the header line
| one | two | three | four|
|-+-|
|   1 |   2 |

press tab to have org correct the table.
| one | two | three | four |
|-+-+---+--|
|   1 |   2 |   |  |


> On Apr 22, 2024, at 12:17 PM, Jude DaShiell  wrote:
> 
> As it happens c-s-right comes back with c-s-right is undefined.
> This is emacs-nativecomp 29 on slint and slint is the international
> version of slackware.
> At this point I think orgmode could use is a tool to be run that will find
> and let the user or installer know all of the undefined key combinations
> in their current version of orgmode that are supposed to be defined along
> with a percentage of the total keystrokes so a user or installer can take
> further appropriate action.
> 
> 
> --
> Jude 
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo.
> Please use in that order."
> Ed Howdershelt 1940.
> 
> On Mon, 22 Apr 2024, Jude DaShiell wrote:
> 
>> m-s-right is meta-shift-rightarrow if I have that correct.  Now if I put
>> point in the last column of the table and do that, I'll get a column to
>> the left which will be blank.  What I tried to ask is if I put point in
>> the last column of the table what can I do to have a new column appear to
>> the right of where point exists?
>> 
>> 
>> --
>> Jude 
>> "There are four boxes to be used in defense of liberty:
>> soap, ballot, jury, and ammo.
>> Please use in that order."
>> Ed Howdershelt 1940.
>> 
>> On Mon, 22 Apr 2024, Leo Butler wrote:
>> 
>>> (info "(org)Built-in Table Editor")
>>> 
>>> ‘M-S-’ (‘org-table-insert-column’)
>>> Insert a new column at point position.  Move the recent column and
>>> all cells to the right of this column to the right.
>>> 
>>> Leo
>>> 
>>> On Mon, Apr 22 2024, Jude DaShiell  wrote:
>>> 
 when making a table in orgmode, I forgot to add three columns to the
 table.  What command or commands would I use to add columns to a table?
 
 
 --
 Jude 
 "There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo.
 Please use in that order."
 Ed Howdershelt 1940.
>> 
>> 
> 




Re: [DISCUSSION] What should we do with undocumented x^(superscript inside /round/ braces) syntax? (was: Subscript with parenthesis)

2024-02-17 Thread Mark Barton



> On Feb 17, 2024, at 5:33 AM, Ihor Radchenko  wrote:
> 
> WDYT?
+1

I use the curly braces since I often use underscores for other reasons. There 
would be no impact to me and this is the first I ever heard that parentheses 
would work. 




Re: [BUG] Clock report produces malformed table when contributed headings contain "|" in their title [9.7-pre (release_9.6.16-1060-g1aa455 @ /home/yantar92/.emacs.d/straight/build/org/)]

2024-01-14 Thread Mark Barton


> On Jan 14, 2024, at 5:56 AM, Ihor Radchenko  wrote:
> 
> The first heading is relatively easy to fix - we may replace "|" in
> title with \vert entity.
> 
> Not so easy for src block and other verbatim text - there is simply no
> way to escape "|" in tables.

I have encountered this a couple times, usually in org captured items for 
Meetings that someone else typed for the Meeting name. I could not figure out 
how to escape them and just ended up modifying the header to not include the 
pipe char.

In your example of the src block, I don't normally make those headers, but 
could the pipe char be replaced only in the clock table? If clock table links 
are turned on then the header link should point to the header and just the 
description changes. 

Mark Barton

Re: Limiting a repeating timestamp ?

2023-04-08 Thread Mark Barton



> On Apr 7, 2023, at 9:53 PM, David Masterson  wrote:
> 
> Is there a way of creating a Task which is a once a week meeting that
> will take place in (say) June, July, and August and then stop repeating?
> 
> -- 
> David Masterson
> 

Not exactly the answer to the question, but I sometimes use the 
org-clone-subtree-with-time-shift function to copy a scheduled meeting. That 
will give me copies with the timestamps shifted by the amount requested 
(weekly, monthly, etc.). The advantage I found with this, is that I can then 
edit any of the copies to adjust for holidays.

Mark Barton


Re: [RFC] If you use Org 9.6, please share the output of M-x org-element-cache-hash-show-statistics

2023-02-09 Thread Mark Barton



> On Feb 9, 2023, at 3:51 AM, Ihor Radchenko  wrote:
> 
> Hi,
> 
> I would like to assess the efficiency of one of search optimizations used
> in org-element.el [1]
> 
> The statistics about efficiency is collected by Org, but obviously not
> shared without your consent.
> 
> If you are ok with sharing the statistics, and you are running Emacs
> session for at least few hours (using Org mode, obviously), please reply
> sharing the output of
> M-x org-element-cache-hash-show-statistics 
> M-x emacs-uptime 
> 
> [1] Pugh [Information Processing Letters] (1990) Slow optimally balanced
> search strategies vs. cached fast uniformly balanced search strategies.
> http://dx.doi.org/10.1016/0020-0190(90)90130-P
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
> 



 command ‘org-element-cache-hash-show-statistics’ 
7.85% of cache searches hashed, 1.88% non-hashable.

emacs uptime: 22 hours, 24 minutes, 10 seconds

Org mode version 9.6.1 (release_9.6.1-23-gc45a05 @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)

GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin22.2.0, NS appkit-2299.30 
Version 13.1 (Build 22C65)) of 2023-02-08




Re: [BUG] M-S- does not adjust clock timestamps as described in docs [9.5.5]

2023-02-08 Thread Mark Barton


> On Feb 8, 2023, at 6:11 AM, Robert Nikander  
> wrote:
> 
> I’m pretty much a beginner with the clock features, so I don’t have an 
> opinion yet on how it should work. But yes, it seems like clarifying the 
> manual there would be an improvement. 
> 
> I don’t know what agenda clock check is. Is that a certain function, or 
> agenda view? Searching the manual and functions for that term didn’t yield 
> anything obvious.

Here is an option that I have been using for a few years now, in case it helps 
you find your solution.

I use org agenda view with log mode on to show clocked entries. The "v c" keys 
bring up the view of clock check
C-c a a l v c

Now to adjust the gaps or overlaps in clocking, I found this package helpful 
versus doing it manually for the entries.
https://github.com/dfeich/org-clock-convenience

I can go to a clock entry that needs adjustment and run the 
org-clock-convenience-fill-gap command and it will adjust the time to be 
contiguous. 

Mark

Re: Clocking in is pretty slow in version 9.6 when the item has a large

2022-12-07 Thread Mark Barton


> On Dec 7, 2022, at 10:36 AM, Ihor Radchenko  wrote:
> 
> Sorry, I meant (setq org-element--cache-self-verify nil).
> In any case, the time is back to previous, which should be good enough
> considering that no optimizations have been made to the clock table
> calculation.

I just realized my mistake on the variable. I'm good. It was very acceptable 
for me at 20s considering how many clocking lines I have to parse going back to 
2019. I will keep the self-verify as is if that will help capture errors before 
the release branch.

Mark

Re: Clocking in is pretty slow in version 9.6 when the item has a large

2022-12-07 Thread Mark Barton


> On Dec 7, 2022, at 3:53 AM, Ihor Radchenko  wrote:
> 
> What about setting org-element--cache-self-verify to nil?

(setq org-element--cache-self-verify-frequency nil)
Update clocktable
Wrong type argument: number-or-marker-p, nil

Try again but use zero instead of nil...
(setq org-element--cache-self-verify-frequency 0)
Updates in 11s.

Mark

Re: Clocking in is pretty slow in version 9.6 when the item has a large

2022-12-04 Thread Mark Barton


> On Dec 4, 2022, at 10:18 AM, Ihor Radchenko  wrote:
> 
> Ihor Radchenko mailto:yanta...@posteo.net>> writes:
> 
>> Eli Qian mailto:eli.q.q...@gmail.com>> writes:
>> 
>>> Any idea about speeding up clocking in?
>> 
>> Try reducing `org-element--cache-self-verify-frequency' to a smaller
>> number.
> 
> For some context, self-verify staff will only be enabled during pretest.
> It is an equivalent of ./configure --enable-checking in Emacs. We do it,
> because we absolutely need to catch all issues with org-element cache
> ASAP, before the code goes into Emacs release.

FYI here is how reducing that number helped with my clocktable updates in the 
order I tested each value.
*** org-element--cache-self-verify-frequency 0.01 
update takes 1:18 (minutes : seconds)
*** org-element--cache-self-verify-frequency 0.005
update takes 0:48
*** org-element--cache-self-verify-frequency 0.002
update takes 0:28
*** org-element--cache-self-verify-frequency 0.001
update takes 0:19
*** org-element--cache-self-verify-frequency 0.0005
update takes 0:20
*** org-element--cache-self-verify-frequency 0.03 (default value)
update takes 3:29



Re: Clocking in is pretty slow in version 9.6 when the item has a large

2022-12-04 Thread Mark Barton


> On Dec 4, 2022, at 4:12 AM, Eli Qian  wrote:
> 
> After investigation by using profiler, I found the problem is caused by
> `org-element-at-point`

I'm also seeing this slowdown after compliling from Emacs master around the 
time of the 29.1 cutoff. I use the org version in Emacs master. I use 
clocktable reports that scope a two week period to calculate the time spent on 
tasks. Normally the update to the table takes maybe 10s-30s, but lately it 
takes over 3 minutes to run.

Emacs 30.0.50 (Build 21G115) of 2022-12-02
Org mode version release_9.6-3-ga4d38e @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/
Emacs  -Q
Open org file with clocking data and find the clocktable line as shown below. 
C-c C-c to update the clocktable report.

#+BEGIN: clocktable :scope file :maxlevel 6 :link nil :tstart "[2022-11-19 Sat 
00:00]" :tend "[2022-12-03 Sat 11:00]" :formula % :step day :stepskip0 t

This took over 3 minutes to run.

If I use an older build I have as my "stable" version for testing...
Emacs 29.0.50 (Build 21F79) of 2022-08-05
Org mode version 9.5.4-17-g6e991f 
then the same clocktable line takes 11s to update.

Mark

Re: Org and Multimedia..?

2022-11-30 Thread Mark Barton



> On Nov 30, 2022, at 11:35 AM, David Masterson  wrote:
> 
> Is it possible to attach (say) an image to a task?
> 
> I'd like to use images to help explain tasks better (or just remind me
> what my intention was).  I imagine you could do something with file
> links, but is there a defined method?  Issues:
> 
> 1. Directory structure containing Org / Media files
> 2. Syncing images with Org files to other systems
> 3. In particular, syncing to smart phones (BeOrg, Orgzly, ...) 
> 4. Any add-on packages that would help
> 
> -- 
> David Masterson
> 

I use a link in my tasks in Org mode that will open a DEVONthink object. Which 
could be an image, pdf, email, or DEVONthink group related to my task. In my 
case DEVONthink runs on my Mac and ios devices, so that link works from Emacs 
org mode on the Mac as well as from BeOrg on ios.

DEVONthink is not free though. I used to use Omnifocus and it supported media 
in the tasks, but that quickly presented a new problem with syncing such large 
volumes of data. I also found that I needed that media as reference after the 
task was done, so I would have to store it else where too. That is when I took 
the advice and separated the tasks from the reference material from a storage 
perspective and integrated them with links instead. When I migrated to Emacs 
and Org mode, I used the same strategy of links.

Below is an example of such a link where I reference the email I sent to 
Shannon that is associated with the task.

 DONE Shared a copy of the Directory Inventory spreadsheet with Shannon.
CLOSED: [2022-11-30 Wed 11:53]
[[x-devonthink-item://%3C8403DA9F-CDFB-4A6F-9CC5-C33D88290E42%40disney.com%3E][directory
 inventory.eml]]

You might be able to do something similar with other software you have running 
your devices that allows a single link to work on all the devices.

Mark




Re: prevent underscores to be translates in subscript when exporting to latex

2022-10-08 Thread Mark Barton


> On Oct 8, 2022, at 6:58 AM, Luca Ferrari  wrote:
> 
> Hi all,
> I've a link like
> [[https://foo.com/bar_baz.html][https://foo.com/bar_baz.html] 
> ] that,
> once rendered in LaTeX, is converted to a subscript like
> bar\textsubscript{baz}.
> Is there a way to prevent this?

I settled on adding an OPTION line to my org file to disable this behavior, 
since the documents I'm working on rarely need subscripts and I can use the 
LaTeX form when I do need to specify them.

#+OPTIONS: toc:nil H:3 num:nil ^:nil

The last part forces the export to recognize just the LaTeX form of specifying 
subscripts.

[[info:org#Export Settings][org#Export Settings]]
‘^’
 Toggle TeX-like syntax for sub- and superscripts.  If you write
 ‘^:{}’, ‘a_{b}’ is interpreted, but the simple ‘a_b’ is left as it
 is (‘org-export-with-sub-superscripts’).

Mark

Re: access to specific instance(s) of past recurring event(s)

2022-09-25 Thread Mark Barton


> On Sep 25, 2022, at 5:44 AM, Saša Janiška  wrote:
> 
> When looking for some solution I've stumbled upon this (old) post 
> https://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/ which 
> utilizes *org-clone-subtree-with-time-shift*.

I also use this method for some of my reoccurring events. I usually create a 
year's worth of clones and then a task to clone more for next year. It is nice 
to be able to remove/adjust some of the subtree entries to accommodate 
holidays. 

When I don't use this method for a reoccurring event then I usually just 
schedule a repeating task and then have my notes in that task to record what 
happened each time. 

Mark


Re: IM dev discussions?

2022-09-23 Thread Mark Barton


> On Sep 23, 2022, at 6:44 PM, Tim Cross  wrote:
> 
> You will likely find more young people
> who use Emacs and org will also use email more, but I don't know if that
> is because the types of people attracted to Emacs and org mode are also
> the types of people more attracted to email for comms.


My trend has been moving from GUI to the benefit that text based solutions 
provide: reproducibility, version control, and documentation. 
In my case, email is much easier to extract into my task management system than 
most IM type solutions. IM is good for short conversations, but really has a 
problem with organizing more historic data that may be needed for much tougher 
topics that cannot be answered in a single session. Slack threads really drive 
me crazy, because I have a hard time finding them again after a day or so. This 
is where I use DEVONthink to associate different forms of data into the related 
projects and use DEVONthink links in org mode for my notes and task management.

Re: Images in org-mode

2022-09-10 Thread Mark Barton



> On Sep 10, 2022, at 12:03 PM, Colin Baxter  wrote:
> 
> 
> I seem to remember that the option
> 
> #+ATTR_ORG: :width 100
> 
> could scale the display of an image in an org-mode file. This no longer
> works - perhaps it never did. How should I scale an image display in an
> org-mode file (not exported)?
> 
> Best wishes,
> 
> Colin Baxter.
> 
> 

Check the value set for org-image-actual-width. Mine defaulted to t, so I 
changed it. There is some documentation if you use:
C-h v org-image-actual-width

Mark


bug#50514: 28.0.50; org inline call to python src block req C-g to break

2022-08-27 Thread Mark Barton


> On Aug 27, 2022, at 11:59 AM, Barton, Mark  wrote:
> 
>  
> 
>> On Aug 27, 2022, at 7:11 AM, Ihor Radchenko  wrote:
>> 
>> ---
>> lisp/ob-python.el | 8 
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>> 
>> diff --git a/lisp/ob-python.el b/lisp/ob-python.el
>> index 932aca08e..2ad907bd8 100644
>> --- a/lisp/ob-python.el
>> +++ b/lisp/ob-python.el
>> @@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key 
>> ( session)
>>(setq py-buffer (org-babel-python-with-earmuffs session)))
>>  (let ((python-shell-buffer-name
>> (org-babel-python-without-earmuffs py-buffer)))
>> -  (run-python cmd)
>> -  (sleep-for 0 10)))
>> +  (run-python cmd)))
>>((and (eq 'python-mode org-babel-python-mode)
>>   (fboundp 'py-shell)) ; python-mode.el
>>  (require 'python-mode)
>> @@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key 
>> ( session)
>> (defun org-babel-python-initiate-session ( session _params)
>>   "Create a session named SESSION according to PARAMS."
>>   (unless (string= session "none")
>> -(org-babel-python-session-buffer
>> - (org-babel-python-initiate-session-by-key session
>> +(let ((session (org-babel-python-session-buffer
>> +(org-babel-python-initiate-session-by-key session)
>> +(org-babel-comint-wait-for-output session)))
>> 
>> (defvar org-babel-python-eoe-indicator "org_babel_python_eoe"
>>   "A string to indicate that evaluation has completed.")
>> -- 
>> 2.35.1
> 
> I get the following in the Messages:
> org-babel-comint-wait-for-output: Buffer python-chain does not exist or has 
> no process
> 
> Note that python-chain is the name of my session passed to the python blocks 
> as shown in the following line within my org file.
> 
> #+PROPERTY: header-args:python :session python-chain :exports results 
> :results raw file :file-ext table
> 
> Thanks,
> 
> Mark
> 
I will work on getting more details this weekend. It looked like the buffer 
passed to org-babel-comint-wait-for-output was missing the "earmuffs". I tried 
adding the earmuffs with the org function for that but although I got passed 
that error, I messed up my python session and the following python blocks were 
not aware of the imports in the first block.

Mark

 

Re: C-c $ missing?

2022-08-19 Thread Mark Barton


> On Aug 18, 2022, at 11:39 PM, Summer Emacs  wrote:
> 
> TY! That's exactly what I was hoping for. And thank you to Ihor and Matt
> as well for pointing me in the right direction. I was just reading up on
> C-c $ with C-h k when you replied so thank you to all of you for helping
> out. Noted everything down for future reference. 

You are welcome. You may eventually want to read about Speed Keys in Org mode 
that is enabled with the org-use-speed-commands variable. That enables you to 
just press "a" when at the beginning of a headline to archive that subtree. I 
use speed keys daily to clock-in to a task and to refile a task into one of my 
project subtrees.

Re: C-c $ missing?

2022-08-19 Thread Mark Barton


> On Aug 18, 2022, at 11:06 PM, Summer Emacs  wrote:
> 
> So I was just curious as to what happened to C-c $? 

On my Emacs setup C-c $ is mapped to flyspell-correct-word-before-point, but 
C-h b  shows that it is bound to org-archive-subtree. Did you recently enable 
spellcheck in org mode?

If I M-x flyspell-mode to turn off flyspell then C-c $ is mapped back to 
org-archive-subtree.

If that is the case for you, you could try adding this to your init file.

(eval-after-load "flyspell"
  '(define-key flyspell-mode-map (kbd "C-c $") nil))

Mark

Re: Exporting tables from python code block: Wrong type argument: markerp, nil

2022-08-02 Thread Mark Barton


> On Aug 2, 2022, at 6:58 AM, Darren Syzling  wrote:
> 
> If I execute the code in the editor the org-mode table appears in the 
> results. If I export to html or pdf I get the error: org-babel-insert-result: 
> Wrong type argument: markerp, nil.

I also am experiencing this error.
Org mode version 9.5.4 (release_9.5.4-17-g6e991f @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)
GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.5.0, NS appkit-2113.50 
Version 12.4 (Build 21F79)) of 2022-08-01

In order to export the pdf, I evaluated the following to disable having the 
export execute the src blocks and just manually ran them to have the updated 
results inserted into the org file.
(setq org-export-use-babel nil)

The last time I exported that document successfully was 2022-05-10. 


Mark

Re: Trouble producing nicely aligned org tables from emacs-jupyter code blocks using latest org version

2022-05-19 Thread Mark Barton
Richard,

You might want to check to see if pulsar is a good replacement for beacon. I 
had been using beacon for a while and switched recently. I don’t use 
Jupiter-python blocks any more because of some compatibility issues I 
experienced because I chose to compile Emacs from the master branch. I found 
the python blocks met my needs. He is the link to the pulsar package if you are 
interested. I found it much easier to config what actions cause the line to 
pulse to find point.
https://github.com/protesilaos/pulsar 

Mark

> On May 19, 2022, at 11:16 AM, Richard H. Stanton  
> wrote:
> 
> After a lot of bisecting my init.el to create the simplest possible example 
> that shows the problem, I found that removing the package beacon makes 
> everything work OK, both in sync and async mode.
> 
> 
> 
>> On May 19, 2022, at 6:37 AM, Ihor Radchenko  wrote:
>> 
>> Richard Stanton  writes:
>> 
>>> A bit more experimenting shows that asynchronous execution is actually a 
>>> part of my original problem. By default, I have jupyter-python blocks 
>>> running asynchronously. In that case, the tables don’t format quite right, 
>>> as I noted. But if I add the header ":async nil", the table comes out fine. 
>>> Table formatting is OK in python blocks with or without asynchronous 
>>> execution. 
>> 
>> Can you also see the problem without using jupyter-python?
>> A detailed recipe starting from emacs -Q would help (see
>> https://orgmode.org/manual/Feedback.html)
>> 
>> Best,
>> Ihor
> 
> 



Re: master 4a1f69ebca 2/2: Use (TICKS . HZ) for current-time etc.

2022-04-27 Thread Mark Barton
The change also breaks org-file-newer-than-p function that triggered the 
debugger while loading my init that uses org babel. I was able to use the 
example of the patch that Paul Eggert provided earlier for the desktop-save to 
add the time-convert to “fix” org-file-newer-than-p as shown below. Not 
positive that I needed to change it in both places, but it works for me now on 
macOS Monterey.

modified   lisp/org/org-macs.el
@@ -264,8 +264,8 @@ org-file-newer-than-p
;; (e.g. HFS+) do not retain any finer granularity.  As
;; a consequence, make sure we return non-nil when the two
;; times are equal.
-   (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2)
-(cl-subseq time 0 2)
+   (not (time-less-p (cl-subseq (time-convert (nth 5 (file-attributes 
file)) 'list) 0 2)
+(cl-subseq (time-convert time 'list) 0 2)




Re: [RFC] DOCT: Declarative Org Capture Templates (easier template syntax)

2022-03-20 Thread Mark Barton
+1 as interested
I saw this project a while ago
https://github.com/progfolio/doct 

I was concerned about long term support and if I would be left with templates I 
would have to rewrite again, plus I was too busy at the time to adopt it and it 
stays in my list of TODOs that are not scheduled. That being said, I use org 
capture daily, but to the points you raise, I avoid changing or adding to to my 
capture templates.



> On Mar 20, 2022, at 3:19 AM, Ihor Radchenko  wrote:
> 
> I am pinging this thread again because I believe that doct syntax is
> much easier to write compared to current defaults. It should be added to
> Org core.
> 
> Also, if anyone agrees with my arguments below, do not stay silent and
> drop a "+1" email below. Otherwise, this whole thing will be stalled.
> There is no point discussing technical aspects, if there is no interest.
> 
> Citing again an example illustrating the difference between a slightly
> non-trivial capture template using current vs. doct syntax:
> 
> No Wayman  writes:
> 
>> Without DOCT:
>> 
>> ;;rest of template configured elsewhere...
>> ;;make sure you update this if you ever change the key for this 
>>  template!
>> (defun my-org-template-hook ()
>>  (when (string= (org-capture-get :key t) "t")
>>(message "Template \"t\" selected.")))
>> 
>> (add-hook 'org-capture-mode-hook 'my-org-template-hook)
>> 
>> With DOCT:
>> 
>> (doct `("Example" :keys "t" :file ""
>>:hook (lambda () (message "Template %s selected." 
>>(doct-get :keys)
>> 
>> DOCT ensures that function is only run for that template without 
>> having the user manually filter against `org-capture-plist's :key.
>> It also allows the user to do this inline with the rest of the 
>> declaration vs spreading it out.
> 
> I believe that the right way to introduce this syntax is creating an
> easy-to-use macro like (org-declare-capture-template ...), which takes
> care about fiddling with org-capture-templates variable and its format.
> 
> The current format of a number of Org customisations is cumbersome. For
> example, org-capture-templates and org-agenda-custom-commands often
> become long list of lists with each element that must have a very
> specific position. Every single time I need to write a new template, I
> have to carefully consult the docstring; and every single time I an
> reviewing my templates, I have to consult the docstring again simply to
> understand the meaning of the first, second, ..., nth element of the
> template. Having CL-style :keyword value plists is much more readable.
> 
> More generally, it would be useful to provide a doct-like functionality
> for org-agenda-custom-commands and similar variables (like
> org-agenda-custom-commands, or say, also org-latex-classes).
> 
> Best,
> Ihor
> 



Re: C-c . no longer inserts org-time-stamp (after upgrade to 9.5)

2021-11-02 Thread Mark Barton
It looks like follow-mode-prefix is a variable you can customize. It defaults 
to "C-c .” which is why the org-time-stamp does not run with "C-c .”

To see the follow-mode-map use "M-x describe-keymap follow-mode-map”



> On Nov 2, 2021, at 8:23 AM, Michael Maurer  wrote:
> 
> On Tue, 2 Nov 2021 at 09:41, Colin Baxter   wrote:
>> 
>>> Michael Maurer  writes:
>> 
>>> Subject line says it all, I upgraded to 9.5 two days ago and
>>> everything seemed to work, but today I fire up the PC and C-c . no
>>> longer is bound to anything. I guess I could custom-bind it in my
>>> config, but I'm more interested in why it's happening. The last
>>> package I installed after the upgrade was undo-fu and
>>> undo-fu-sessions, but I dont' think they are involved.
>> 
>> They could be. I don't have those packages and C-c . works for me and I
>> am running the latest git pull from org-mode. You might also have
>> multiple org files present.
>> 
>> Best wishes.
> 
> I figured it out. It's follow-mode. As soon as you enable it in a
> buffer, C-c . stops working. I'm not sure if this incompatibility got
> introduced with 9.5, since it's been years since I last used
> follow-mode.
> 




Re: How to open a link to a folder/file in Finder, not Dired

2021-10-20 Thread Mark Barton


> On Oct 20, 2021, at 1:36 AM, Gerardo Moro  wrote:
> 
> I am having the same problem as reported here: 
> https://emacs.stackexchange.com/questions/66593/how-to-open-a-link-to-a-folder-file-in-finder-not-dired
>  
> 
>  
> 
> I copy paste:
> 
> I used to be able to create links with open-insert-link pointing to folders 
> or files. When I clicked on them, I would be redirected to Finder. Lately, 
> they are shown within Dired. How to control this behaviour? When I use either 
> [[file:/users/Shared]] or [[file+emacs:/users/Shared]], and click on them, I 
> get the dired buffer, not the Finder app. 
> 
> Thanks!
> G.M.

According to the help for org-open-at-point it should work if you give a double 
prefix argument. I tried C-u C-u C-c C-o and it opened a link in finder.

I normally prefer dired, but when I need finder, I use Keyboard Maestro to 
associate H-f to bring the finder to focus in a manner specific to the current 
application. So when emacs is the current application, Keyboard Maestro will 
send the following keystrokes to emacs to open finder in the directory 
associated with the current buffer:M-! open .

For the case where other applications other than emacs are the current 
application, I can configure the macro to bring up finder using the various 
application specific menu options to show file in finder. If there are no 
specific configurations for the application, then it just switches to finder.

Mark

Re: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-09 Thread Mark Barton
 It works on my system with native compilation on macOS 11.6. I made the change 
to org.el that is in my local clone of the emacs master branch and recompiled.

Looking at the Help for the function, I see it is native compiled Lisp in my 
test here.

- *Help* - buffer
org-save-all-org-buffers is an interactive native compiled Lisp
function in ‘org.el’.

(org-save-all-org-buffers)
—

- diff -
Save all Org buffers without user confirmation.

modified   lisp/org/org.el
@@ -15362,7 +15362,7 @@ org-save-all-org-buffers
   "Save all Org buffers without user confirmation."
   (interactive)
   (message "Saving all Org buffers...")
-  (save-some-buffers t (lambda () (derived-mode-p 'org-mode)))
+  (save-some-buffers t (lambda () (and (derived-mode-p 'org-mode) t)))
   (when (featurep 'org-id) (org-id-locations-save))
   (message "Saving all Org buffers... done"))
 


> On Oct 9, 2021, at 9:38 AM, No Wayman  wrote:
> 
> 
> Your analysis is correct. I looked into this a couple days ago.
> See the following message for an explanation and a patch (testing 
> appreciated):
> 
> https://list.orgmode.org/87zgrmc2rg@gmail.com/T/#m9888bc09d77d7bba70ba99671aca72446c4d41b9
> 
> 




Re: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-08 Thread Mark Barton
The debugger shows that pred gets set to org-mode rather than the function to 
test for org mode.

Debugger entered--returning value: org-mode
  (setq pred pred-fun)
* (progn (setq pred pred-fun))
* (if (functionp pred-fun) (progn (setq pred pred-fun)))
* (let ((pred-fun (and (functionp pred) (funcall pred (if (functionp 
pred-fun) (progn (setq pred pred-fun
* (closure (backup-extract-version-start t) ( arg pred) "Save some 
modified file-visiting buffers.  Asks us..." (interactive "P") (if pred nil 
(setq pred save-some-buffers-default-predicate)) (let ((pred-fun (and 
(functionp pred) (funcall pred (if (functionp pred-fun) (progn (setq pred 
pred-fun (let* ((switched-buffer nil) 
(save-some-buffers--switch-window-callback #'(lambda (buffer) (setq 
switched-buffer buffer))) queried autosaved-buffers files-done abbrevs-done) 
(unwind-protect (let ((wconfig (current-window-configuration))) (unwind-protect 
(progn (let ... ...) (setq files-done ...) (and save-abbrevs abbrevs-changed 
...) (or queried ... abbrevs-done ...)) (set-window-configuration wconfig))) 
(if switched-buffer (progn (pop-to-buffer-same-window switched-buffer))(t 
#)
* apply((closure (backup-extract-version-start t) ( arg pred) "Save 
some modified file-visiting buffers.  Asks us..." (interactive "P") (if pred 
nil (setq pred save-some-buffers-default-predicate)) (let ((pred-fun (and 
(functionp pred) (funcall pred (if (functionp pred-fun) (progn (setq pred 
pred-fun (let* ((switched-buffer nil) 
(save-some-buffers--switch-window-callback #'(lambda (buffer) (setq 
switched-buffer buffer))) queried autosaved-buffers files-done abbrevs-done) 
(unwind-protect (let ((wconfig (current-window-configuration))) (unwind-protect 
(progn (let ... ...) (setq files-done ...) (and save-abbrevs abbrevs-changed 
...) (or queried ... abbrevs-done ...)) (set-window-configuration wconfig))) 
(if switched-buffer (progn (pop-to-buffer-same-window switched-buffer)) (t 
#))
* save-some-buffers(t #)
  org-save-all-org-buffers()
  funcall-interactively(org-save-all-org-buffers)
  command-execute(org-save-all-org-buffers record)
  execute-extended-command(nil "org-save-all-org-buffers" nil)
  funcall-interactively(execute-extended-command nil "org-save-all-org-buffers" 
nil)
  command-execute(execute-extended-command)


> On Oct 8, 2021, at 3:00 PM, Mark Barton  wrote:
> 
> I can confirm this too.
> 
> (defun org-save-all-org-buffers ()
>  "Save all Org buffers without user confirmation."
>  (interactive)
>  (message "Saving all Org buffers...")
>  (save-some-buffers t (lambda () (derived-mode-p 'org-mode)))
>  (when (featurep 'org-id) (org-id-locations-save))
>  (message "Saving all Org buffers... done"))
> 
> If I comment out this change to the function save-some-buffers, then 
> org-save-all-org-buffers works again.
> 
> a9ad3d477441feefa3bf6107d58281cb64e0e78a
> Author: Juri Linkov 
> AuthorDate: Fri Aug 13 10:10:29 2021 +0300
> Commit: Juri Linkov 
> CommitDate: Fri Aug 13 10:10:29 2021 +0300
> 
> Parent: c4d34d24e3 CC Mode: Enhance C++ Mode raw strings to multi-line 
> strings for any language
> Merged: emacs-27 feature/native-comp
> Contained:  master
> Follows:emacs-27.1 (8875)
> 
> Add save-some-buffers-root to save-some-buffers-default-predicate (bug#46374)
> 
> * lisp/files.el (save-some-buffers-default-predicate): Add choice
> 'save-some-buffers-root'.
> (save-some-buffers-root): New predicate function.
> (save-some-buffers): Check if 'pred' returns a lexically-bound lambda,
> then use it as 'pred'.
> 
> 
> (defun save-some-buffers ( arg pred)
>   "Save some modified file-visiting buffers.  Asks user about each one.
> You can answer `y' or SPC to save, `n' or DEL not to save, `C-r'
> @@ -5758,6 +5772,11 @@ save-some-buffers
>   (interactive "P")
>   (unless pred
> (setq pred save-some-buffers-default-predicate))
> +  ;; Allow `pred' to be a function that returns a predicate
> +  ;; with lexical bindings in its original environment (bug#46374).
> +  (let ((pred-fun (and (functionp pred) (funcall pred
> +(when (functionp pred-fun)
> +  (setq pred pred-fun)))
>   (let* ((switched-buffer nil)
>  (save-some-buffers--switch-window-callback
>   (lambda (buffer)
> 
> I think it has to do with how org-save-all-org-buffers sets the pred argument 
> with:
> (lambda () (derived-mode-p 'org-mode))
> 
>> On Oct 8, 2021, at 4:55 AM, Lennart C. Karssen  wrote:
>> 
>> Dear list,
>> 
>> Confirmed.
>> 
>> This is to confirm Micheal's overservation that
>> `org-save-all-org-buffers' doesn't save any Org buffers any more in
>> Emacs 28, compiled a few days ago from 

Re: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-08 Thread Mark Barton
I can confirm this too.

(defun org-save-all-org-buffers ()
  "Save all Org buffers without user confirmation."
  (interactive)
  (message "Saving all Org buffers...")
  (save-some-buffers t (lambda () (derived-mode-p 'org-mode)))
  (when (featurep 'org-id) (org-id-locations-save))
  (message "Saving all Org buffers... done"))

If I comment out this change to the function save-some-buffers, then 
org-save-all-org-buffers works again.

a9ad3d477441feefa3bf6107d58281cb64e0e78a
Author: Juri Linkov 
AuthorDate: Fri Aug 13 10:10:29 2021 +0300
Commit: Juri Linkov 
CommitDate: Fri Aug 13 10:10:29 2021 +0300

Parent: c4d34d24e3 CC Mode: Enhance C++ Mode raw strings to multi-line 
strings for any language
Merged: emacs-27 feature/native-comp
Contained:  master
Follows:emacs-27.1 (8875)

Add save-some-buffers-root to save-some-buffers-default-predicate (bug#46374)

* lisp/files.el (save-some-buffers-default-predicate): Add choice
'save-some-buffers-root'.
(save-some-buffers-root): New predicate function.
(save-some-buffers): Check if 'pred' returns a lexically-bound lambda,
then use it as 'pred'.


 (defun save-some-buffers ( arg pred)
   "Save some modified file-visiting buffers.  Asks user about each one.
 You can answer `y' or SPC to save, `n' or DEL not to save, `C-r'
@@ -5758,6 +5772,11 @@ save-some-buffers
   (interactive "P")
   (unless pred
 (setq pred save-some-buffers-default-predicate))
+  ;; Allow `pred' to be a function that returns a predicate
+  ;; with lexical bindings in its original environment (bug#46374).
+  (let ((pred-fun (and (functionp pred) (funcall pred
+(when (functionp pred-fun)
+  (setq pred pred-fun)))
   (let* ((switched-buffer nil)
  (save-some-buffers--switch-window-callback
   (lambda (buffer)

I think it has to do with how org-save-all-org-buffers sets the pred argument 
with:
(lambda () (derived-mode-p 'org-mode))

> On Oct 8, 2021, at 4:55 AM, Lennart C. Karssen  wrote:
> 
> Dear list,
> 
> Confirmed.
> 
> This is to confirm Micheal's overservation that
> `org-save-all-org-buffers' doesn't save any Org buffers any more in
> Emacs 28, compiled a few days ago from commit d86b2e59c and Org 9.5 from
> Elpa, running on Ubuntu Linux 21.04.
> I can't say if this is because of the upgrade of Org 9.5 or the newly
> compiled Emacs as I did both at the same time.
> Command used for testing:
>  emacs -Q -L ~/.emacs.d/elpa/org-9.5/ /tmp/test.org
> 
> 
> Best regards,
> 
> Lennart Karssen.
> 
> On 05-10-2021 21:51, Michael Powe wrote:
>> 
>> forgot to hit 'reply all.'
>> 
>> 
>>  Forwarded Message 
>> Subject: Re: [BUG] org-save-all-org-buffers reapplies startup
>> visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]
>> Date:Tue, 5 Oct 2021 15:47:42 -0400
>> From:Michael Powe 
>> To:  Bhavin Gandhi 
>> 
>> 
>> 
>> Hello,
>> 
>> I hesitate to reply, but here's a report from Windows 10.
>> 
>> works as expected
>> C:\Emacs\emacs-28\bin\runemacs.exe -Q -L
>> C:\Users\micha\AppData\Roaming\.emacs.d\elpa\org-9.5\ 'G:\My
>> Drive\org\daily.org'
>> GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-08-11
>> Org mode version 9.5 (9.5-g0a86ad @
>> c:/Users/micha/AppData/Roaming/.emacs.d/elpa/org-9.5/)
>> 
>> Now for the bad news.
>> 
>> does not save files at all!
>> C:\Emacs\emacs29\bin\runemacs.exe -Q 'G:\My Drive\org\daily.org'
>> GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) of 2021-10-02
>> Org mode version 9.5 (release_9.5 @
>> c:/Emacs/emacs29/share/emacs/29.0.50/lisp/org/)
>> 
>> Upon invoking the save, contents of the file shift to the left, then
>> shift back; and that's it.
>> 
>> HTH.
>> 
>> mp
>> 
>> Bhavin Gandhi wrote on 10/5/2021 13:53:
>>> Hello Marcel,
>>> 
>>> On Tue, 5 Oct 2021 at 19:14, Marcel van der Boom  wrote:
 […]
 - emacs -Q test.org
 - make sure the outline is unfolded
 - make a change so test.org is 'dirty'
 - M-x org-save-all-org-buffers
 
 Observed behaviour:
 The outline in test.org will collapse and only show 'Header one'
 
 Expected behaviour:
 Outline state does not change on calling `org-save-all-buffers`
 
>>> I tried to follow the above steps with Emacs 27.1, and Org mode latest
>>> main branch as well as the release_9.5 tag. The only different step I
>>> took was this:
>>> 
>>> emacs -Q -L ~/src/org-mode/lisp/ ~/test.org
>>> 
>>> When I modify the test.org and call org-save-all-org-buffers, all the
>>> headings remain unfolded. I tried to switch to a different buffer and
>>> called the function, but still it remained in overview state. Maybe
>>> someone with the latest Emacs build from master can try to reproduce?
>>> 
>> 
>> -- 
>> Sent from Postbox 
> 
> -- 
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> L.C. Karssen
> 's-Hertogenbosch
> The Netherlands
> 
> lenn...@karssen.org
> http://blog.karssen.org
> GPG key ID: A88F554A
> 

Re: Org + git branches for derived files

2021-08-13 Thread Mark Barton
Ken,

You could consider using git-lfs, Large File Support. There is some setup and 
then you can say track *.pdf and that will tell git to track the binary file in 
a more efficient way. I use this mailing for csv files that I want to have a 
snapshot version of with the Jupyter notebook that used them. Once you are 
tracking the files with git-lfs, they will be tracked with the normal git 
commits.

I agree that the best practice is not to commit these types of files, but 
sometimes it is handy to. By committing the PDF files to the repo, I can use 
Working Copy, a git client, on my iPad to quickly reference a document. Since 
the iPad cannot run Emacs, I am unable to regenerate the PDF from there.

Mark

> On Aug 13, 2021, at 11:40 AM, Ken Mankoff  wrote:
> 
> Hello,
> 
> I think this might be more of a git question than an Org question, but I 
> imagine I might find the answer here and that it might be useful to others, 
> so I ask here.
> 
> I'd like to keep derivative products (the LaTeX output, the final PDF, etc.) 
> available in Git, but not commit those changes each time I change the Org 
> file. Perhaps git-annex as appropriate for this, but seems over-kill.
> 
> Is there some way to mostly-seamlessly commit the LaTeX and/or PDF and/or 
> other files to their own git branches but in a way that overwrites the 
> history of that branch, so that a small Org file that generates a big binary 
> PDF does not pollute the git tree?
> 
> Thanks,
> 
>  -k.
> 




Re: [BUG] Async pdf export broken with native-comp

2021-07-15 Thread Mark Barton



> On Jul 15, 2021, at 10:45 AM, Sébastien Miquel  
> wrote:
> 
> Hi,
> 
> The async pdf export functionality appears to be broken with latest org and a
> recent emacs version compiled with native-comp enabled (I have not tested
> without native-comp).
> 
> To reproduce:
> 
>  - use `emacs -q` and an empty init.el file (your init file gets picked up by
>the async emacs instance)
>  - (setq org-export-async-debug t)
>  - find any org file and hit =C-c C-e C-a C-l C-p= to export as pdf file.
> 
> The async process will exit abnormaly.
> 
> The issue stems from this line in `org-export-to-file`
>  :   (ignore-errors (funcall ',post-process ,file))
> 
> In `org-latex-export-to-pdf`, this `post-process` is set to
>  :   (lambda (file) (org-latex-compile file))
> 
> I think native-comp compiles this lambda, which messes things up.
> 
> As a fix, you can quote the lambda in `org-latex-export-to-pdf`
>  :   '(lambda (file) (org-latex-compile file))
> 
> The same applies to other backends but I don't know if it's the right thing 
> to do.
> 
> Regards,
> 
> -- 
> Sébastien Miquel
> 
> 

Did you post this to the Emacs list? Native-comp is in master, but not 
“released”. So I agree with what Tim said about it is too soon for Org to 
consider solutions if it happens to be an edge case that native-comp might be 
able to address. I use native-comp, but have not tried the async export yet.

Mark


Re: org-ctrl-c-minus includes bullet in links

2021-07-09 Thread Mark Barton



> On Jul 9, 2021, at 6:12 PM, Samuel Wales  wrote:
> 
> this might be a bad bug report.  it seems intermittent.
> 
> recent maint.
> 
> create headers each with a link on it.  mark all.  org-ctrl-c-minus.
> 
> this has incorrectly put - as part of the link descriptions.
> 
> -- 
> The Kafka Pandemic
> 
> Please learn what misopathy is.
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
> 


I realize you said it was intermittent, but is this example below what you are 
describing except that it worked in my case?

** TODO test org-ctrl-c-minus
[2021-07-09 Fri 18:49]
*** [[x-devonthink-item://27605B38-B418-4B49-A086-DFEFBAAD5FC5][Ragged point 
inn_2021-07-02]]
*** 
[[x-devonthink-item://%3c8d99415d-20fc-4e2d-b41b-9cc43d97b...@gmail.com%3E][Re: 
First Aid Class]]

I then highlighted the two headings with links and used org-ctrl-c-minus to get:

** TODO test org-ctrl-c-minus
[2021-07-09 Fri 18:49]
- [[x-devonthink-item://27605B38-B418-4B49-A086-DFEFBAAD5FC5][Ragged point 
inn_2021-07-02]]
- 
[[x-devonthink-item://%3c8d99415d-20fc-4e2d-b41b-9cc43d97b...@gmail.com%3E][Re: 
First Aid Class]]

I compiled from the master branch yesterday.
"GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.5.0, NS appkit-2022.50 
Version 11.4 (Build 20F71))
 of 2021-07-08"




Re: Bug: tab key no longer bound to org-cycle in commit 565361eb69 [9.4.6 (9.4.6-10-gee652a-elpaplus @ /Users/bartm002/.emacs.d/elpa/org-plus-contrib-20210705/)]

2021-07-07 Thread Mark Barton
So I put back the mapping in org-key.el to map TAB instead of  in my local 
copy and instead commented out line 185 in outline.el to get TAB to map to 
org-cycle.

——snippet from outline.el
(defvar outline-mode-cycle-map
  (let ((map (make-sparse-keymap)))
(let ((tab-binding `(menu-item
 "" outline-cycle
 ;; Only takes effect if point is on a heading.
 :filter ,(lambda (cmd)
(when (outline-on-heading-p) cmd)
  (define-key map [tab]   tab-binding)
  (define-key map (kbd "TAB") tab-binding)
  (define-key map (kbd "") #'outline-cycle-buffer))
map)
  "Keymap used by `outline-mode-map' and `outline-minor-mode-cycle'.")

Does that sound like the right thing to do? If so then I could submit it to the 
Emacs dev list.

I don’t see outline as a minor mode listed when I use C-h m while in an org 
file expecting org-cycle.

Mark
> On Jul 7, 2021, at 6:35 AM, Nicolas Goaziou  wrote:
> 
> Hello,
> 
> Eric S Fraga  writes:
> 
>> On Tuesday,  6 Jul 2021 at 18:05, Mark Barton wrote:
>>> I normally use C-RET to enter a new headline and then press TAB to
>>> make it child headline. Recently it stopped working and I think I have
>>> it tracked down to the change that was made last week. I could be
>>> missing something that allows “TAB” to work for a kdb binding, but the
>>> previous format of "" works.
>> 
>> I've also found TAB no longer moving from cell to cell in tables.  I use
>> evil and now TAB (translated from  according to C-h c) is bound to
>> evil-jump-forward.  The only change in my environment has been updating
>> org.
> 
> Binding  is frowned upon, because it has higher priority than TAB,
> and also because it doesn't work everywhere, like in terminals.
> 
> If TAB doesn't work properly in Org, then something, e.g., a minor mode
> (Evil in the second case), is stealing the binding. I guess you have to
> reclaim it back.
> 
> Please see (and answer there)
> <https://orgmode.org/list/00ca1c7b-1e1d-fc91-eef3-dfc29b51b...@daniel-mendler.de/>
> 
> Regards,
> -- 
> Nicolas Goaziou
> 




Bug: tab key no longer bound to org-cycle in commit 565361eb69 [9.4.6 (9.4.6-10-gee652a-elpaplus @ /Users/bartm002/.emacs.d/elpa/org-plus-contrib-20210705/)]

2021-07-06 Thread Mark Barton
I normally use C-RET to enter a new headline and then press TAB to make it 
child headline. Recently it stopped working and I think I have it tracked down 
to the change that was made last week. I could be missing something that allows 
“TAB” to work for a kdb binding, but the previous format of "" works.

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.5.0, NS 
appkit-2022.50 Version 11.4 (Build 20F71))
 of 2021-07-06
Package: Org mode version 9.4.6 (9.4.6-10-gee652a-elpaplus @ 
/Users/bartm002/.emacs.d/elpa/org-plus-contrib-20210705/)

In commit 565361eb69 org-keys.el line 445

(org-defkey org-mode-map (kbd "TAB") #'org-cycle)

This does not work for my configuration and tab ends up bound to outline-cycle 
instead.

If I change “TAB” back to “” and byte compile org-keys.el then the tab key 
gets bound to org-cycle
(org-defkey org-mode-map (kbd "") #'org-cycle)