Re: [PATCH] Improved mode line clock truncation behavior

2025-05-18 Thread Rohit Patnaik
> Applied, onto main. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7eafc194d Thanks so much! This was a long-standing minor annoyance of mine, and it's great to have the fix upstream. Thanks, Rohit

Re: [PATCH] Improved mode line clock truncation behavior

2025-05-18 Thread Ihor Radchenko
"Rohit Patnaik" writes: > I have updated the patch to ensure that 'org-mode-line-clock-overrun is > applied > properly when the effort time exceeds the estimated time. I also added some > tests to catch the regression. However, I made these changes *before* I saw > that you'd attached a revis

Re: [PATCH] Improved mode line clock truncation behavior

2025-05-16 Thread Rohit Patnaik
> In your patch, you lost 'org-mode-line-clock-overrun face > application. Please, fix it. I have updated the patch to ensure that 'org-mode-line-clock-overrun is applied properly when the effort time exceeds the estimated time. I also added some tests to catch the regression. However, I made th

Re: [PATCH] Improved mode line clock truncation behavior

2025-05-13 Thread Ihor Radchenko
"Rohit Patnaik" writes: >> Rather than hard-coding number 5, I'd rather >> 1. Let-bind "%s (%s) " value >> 2. Compute spaces-and-parenth-length by formatting that value with %s >>placeholders being empty. > > This is the approach I took. I let-bound the format strings into variables and > for

Re: [PATCH] Improved mode line clock truncation behavior

2025-05-11 Thread Rohit Patnaik
I'm so sorry it took this long to get back to you. I got busy, and unfortunately this patch slipped off my radar. > Rather than hard-coding number 5, I'd rather > 1. Let-bind "%s (%s) " value > 2. Compute spaces-and-parenth-length by formatting that value with %s >placeholders being empty. Th

Re: [PATCH] Improved mode line clock truncation behavior

2025-04-12 Thread Ihor Radchenko
"Rohit Patnaik" writes: >> Why "5"? > > That accounts for the spaces and parentheses surrounding the headline. I've > updated the code to use a variable (`spaces-and-parens-length') for that > instead. This does not eliminate the problem with magic constant in the code. If we ever change the exa

Re: [PATCH] Improved mode line clock truncation behavior

2025-04-01 Thread Rohit Patnaik
I have updated the docstring for org-clock-get-clock-string, which I'd forgotten to do in the previous version of the patch. Thanks, RohitFrom ba1662b116e8c0601c7f174d379005ac767f7f52 Mon Sep 17 00:00:00 2001 From: Rohit Patnaik Date: Tue, 18 Mar 2025 04:45:06 -0500 Subject: [PATCH] org-clock: Ma

Re: [PATCH] Improved mode line clock truncation behavior

2025-03-30 Thread Rohit Patnaik
> I suggest adding an optional parameter &optional limit. Then, > `org-clock-update-mode-line' will pass LIMIT = org-clock-string-limit. Done, but I renamed the optional parameter to `max-length' for clarity. > Why "5"? That accounts for the spaces and parentheses surrounding the headline. I've

Re: [PATCH] Improved mode line clock truncation behavior

2025-03-29 Thread Ihor Radchenko
"Rohit Patnaik" writes: > Currently =org-clock-string-limit= truncates rather crudely. It just does a > =substring=, which results in the closing parenthesis of the clock string > getting cut off. The attached patch seeks to improve this truncation behavior > by trimming the headline such that th

[PATCH] Improved mode line clock truncation behavior

2025-03-18 Thread Rohit Patnaik
Hello, Currently =org-clock-string-limit= truncates rather crudely. It just does a =substring=, which results in the closing parenthesis of the clock string getting cut off. The attached patch seeks to improve this truncation behavior by trimming the headline such that the closing paren can be dis