From: Uwe B. <ou...@ma...> - 2023-07-11 07:17:03
|
-- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Uwe B. <ou...@ma...> - 2023-07-25 07:03:41
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: Hi Eri I am not sure who is the culprit here. But this is what I see in emacs/gnus. > --_004_mn2pr05mb65581320f9aede6160120580af02amn2pr05mb6558namp_ > Content-type: multipart/alternative; boundary="_000_mn2pr05mb65581320f9aede6160120580af02amn2pr05mb6558namp_" I can't read this email in emacs, don't know what happened, could you sent it again please? It seems that your are sending a patch, against which commit? Uwe |
From: Uwe B. <ou...@ma...> - 2023-07-25 09:11:00
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > Hi Uwe, > Here’s a revised patch that does a better job filling comments, and > also fixes the indent region issue you found. It seemed that I was able to repair your message (it seems that MATHWORKS changed something with its servers basically all message from them cause me now problems. > Hope these work for you. So to which commit shall I apply that patch? Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-25 12:40:15
|
The patch was based on the same rev that the previous patch was based on. Ie – it includes the previous patch, or changes to it. If that doesn’t fit, I can make and push a branch against main instead. That might be easier to work with if you have more feedback. Eric From: Uwe Brauer <ou...@ma...> Sent: Tuesday, July 25, 2023 5:11 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > Hi Uwe, > Here’s a revised patch that does a better job filling comments, and > also fixes the indent region issue you found. It seemed that I was able to repair your message (it seems that MATHWORKS changed something with its servers basically all message from them cause me now problems. > Hope these work for you. So to which commit shall I apply that patch? Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Uwe B. <ou...@ma...> - 2023-07-25 16:11:52
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > The patch was based on the same rev that the previous patch was based > on. Ie – it includes the previous patch, or changes to it. If that > doesn’t fit, I can make and push a branch against main instead. That > might be easier to work with if you have more feedback. Oops indeed I cannot apply the patch to the current master version (I thought I applied your patch and already put it on a different branch that I did not push for sure). So maybe the easiest way to proceed indeed is if you create a new branch fix-fill say and apply that patch to the current master commit? I changed only in the relevant files, the copyright stuff. The last commit on the master branch should be 803f9d3d8ee25950ad5352ec0651b2531aaa29e5 Thanks Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-25 18:04:11
|
Hi Uwe, I created a fill-fix branch which I hung off master to include the changes. That branch happens to include an mlint hack for Cygwin, and a toy I wrote a while ago but never got around to sending a long. The commit log should explain the changes. Eric From: Uwe Brauer <ou...@ma...> Sent: Tuesday, July 25, 2023 12:12 PM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > The patch was based on the same rev that the previous patch was based > on. Ie – it includes the previous patch, or changes to it. If that > doesn’t fit, I can make and push a branch against main instead. That > might be easier to work with if you have more feedback. Oops indeed I cannot apply the patch to the current master version (I thought I applied your patch and already put it on a different branch that I did not push for sure). So maybe the easiest way to proceed indeed is if you create a new branch fix-fill say and apply that patch to the current master commit? I changed only in the relevant files, the copyright stuff. The last commit on the master branch should be 803f9d3d8ee25950ad5352ec0651b2531aaa29e5 Thanks Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Uwe B. <ou...@ma...> - 2023-07-27 07:07:26
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > Hi Uwe, > I created a fill-fix branch which I hung off master to include the changes. > That branch happens to include an mlint hack for Cygwin, and a toy I > wrote a while ago but never got around to sending a long. The commit > log should explain the changes. Thanks, I just tested it, looks much better save matlab-fill-region I created a new subdirectory test-fill-but, with an example and a README file and pushed Please have a look Thanks very much for your effort. Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-27 13:04:48
|
I saw an error indicated in your readme and tried it out. I pushed a fix that will improve that particular case. Eric From: Uwe Brauer <ou...@ma...> Sent: Thursday, July 27, 2023 2:59 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > Hi Uwe, > I created a fill-fix branch which I hung off master to include the changes. > That branch happens to include an mlint hack for Cygwin, and a toy I > wrote a while ago but never got around to sending a long. The commit > log should explain the changes. Thanks, I just tested it, looks much better save matlab-fill-region I created a new subdirectory test-fill-but, with an example and a README file and pushed Please have a look Thanks very much for your effort. Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Uwe B. <ou...@ma...> - 2023-07-27 15:46:44
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > I saw an error indicated in your readme and tried it out. I pushed a > fix that will improve that particular case. Eric Thanks I did test it. It is better but still not perfect 1. It does not return error, but 2. it did not change much the filling (contrary to matlab-fill-comment-line which now works very nicely. 3. I also added a new test file, for which it still returns error. 4. I pushed Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-27 16:23:24
|
For prob2, it looks like when 'matlab-fill-code' is nil, it won't fill the code (via auto-fill mode), and it throws that error. I pushed a change that will not fill code if matlab-fill-code is nil so it won't error anymore. Ideally, I suppose you might wan to set matlab-fill-code to t round-about line 2774 if you think it should fill if you specifically ask it to. ie: (if (= (point) (progn (matlab-auto-fill) (point))) (error "Fill algorithm failed!")) Would become (if (= (point) (let ((matlab-fill-code t)) (matlab-auto-fill) (point))) (error "Fill algorithm failed!")) In addition to removing the initial check to short-circuit this block. I remember this going in where the request was to auto-fill comments, but stop auto-filling code since it often didn't do what was desired. Eric From: Uwe Brauer <ou...@ma...> Sent: Thursday, July 27, 2023 11:46 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > I saw an error indicated in your readme and tried it out. I pushed a > fix that will improve that particular case. Eric Thanks I did test it. It is better but still not perfect 1. It does not return error, but 2. it did not change much the filling (contrary to matlab-fill-comment-line which now works very nicely. 3. I also added a new test file, for which it still returns error. 4. I pushed Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> From: Uwe Brauer <ou...@ma...> Sent: Thursday, July 27, 2023 11:46 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > I saw an error indicated in your readme and tried it out. I pushed a > fix that will improve that particular case. Eric Thanks I did test it. It is better but still not perfect 1. It does not return error, but 2. it did not change much the filling (contrary to matlab-fill-comment-line which now works very nicely. 3. I also added a new test file, for which it still returns error. 4. I pushed Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Uwe B. <ou...@ma...> - 2023-07-31 15:32:09
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > For prob2, it looks like when 'matlab-fill-code' is nil, it won't fill > the code (via auto-fill mode), and it throws that error. I pushed a > change that will not fill code if matlab-fill-code is nil so it won't > error anymore. I have set matlab-fill-code to t and now the latest commit of yours produces more errors, I just pushed the updated README file with the new bug, sorry -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-31 15:46:05
|
Is anyone out there interested in the "code fill" feature? It was a hairy thing to implement back in the day, and most of the feedback I got was "how do I turn this off?" It is likely easier to drop the feature than figure out how to fix it for all cases. Basically, it isn't hard to create a line of code it can't fill, in which case it throws this error. Maybe a warning is better? Eric From: Uwe Brauer <ou...@ma...> Sent: Monday, July 31, 2023 11:26 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > For prob2, it looks like when 'matlab-fill-code' is nil, it won't fill > the code (via auto-fill mode), and it throws that error. I pushed a > change that will not fill code if matlab-fill-code is nil so it won't > error anymore. I have set matlab-fill-code to t and now the latest commit of yours produces more errors, I just pushed the updated README file with the new bug, sorry -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Uwe B. <ou...@ma...> - 2023-07-31 15:57:37
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <el...@ma...> writes: > Is anyone out there interested in the "code fill" feature? You mean besides me 😇 I do hope so! > It was a hairy thing to implement back in the day, and most of the > feedback I got was "how do I turn this off?" It is likely easier to > drop the feature than figure out how to fix it for all cases. I cannot judge this and I don't want to cause you headaches. However I can tell you that code that is written with the native matlab editor (say by my students) tend to have these enormous comment lines as in the files fill_prob2.m fill_prob.m So filling these lines would help me quite a bit and I thought emacs users sharing code with those using the native editor might face similar problems. The thing that puzzles me: in commit 0f305501f26d633048c83a89b6652db169394a3f that line filling problems seemed to be solved But in the last two commits it throws an error. So what changed and can't we just go back? > Basically, it isn't hard to create a line of code it can't fill, in > which case it throws this error. Maybe a warning is better? Yes I think so. Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Eric L. <el...@ma...> - 2023-07-31 16:12:26
|
Hi Uwe, If you think it is useful, then feel free to turn that error into a warning. A problem with the algorithm is it doesn’t plan ahead. It tries to break at the fill-column, and if that happens to be at the beginning of a string, then the resultant split adds some syntax to re-assemble the broken string. Once you do that, the remaining string can’t be re-broken b/c the words may be too long. There are a series of other similar problems like this for different kinds of syntaxes. The reason it used to “work” is because it treated a line as all comment even if it was an end-of-code comment. To treat it correctly, I needed to treat the beginning as code. Ie – need to fill the code in order to get the comment close enough to the fill column that it will be fillable. That’s why comments would fill erratically sometimes. There is lots of room to make the algorithm a bit better, but like I said, it needs a deeper heuristic. Maybe tweaking matlab-fill-fudge will help. I haven’t worked on this bit in a long time to remember how it all works. Eric From: Uwe Brauer <ou...@ma...> Sent: Monday, July 31, 2023 11:57 AM To: Eric Ludlam <el...@ma...> Cc: Uwe Brauer <ou...@ma...>; Matlab-emacs-discuss <mat...@li...> Subject: Re: the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...<mailto:el...@ma...>> writes: > Is anyone out there interested in the "code fill" feature? You mean besides me 😇 I do hope so! > It was a hairy thing to implement back in the day, and most of the > feedback I got was "how do I turn this off?" It is likely easier to > drop the feature than figure out how to fix it for all cases. I cannot judge this and I don't want to cause you headaches. However I can tell you that code that is written with the native matlab editor (say by my students) tend to have these enormous comment lines as in the files fill_prob2.m fill_prob.m So filling these lines would help me quite a bit and I thought emacs users sharing code with those using the native editor might face similar problems. The thing that puzzles me: in commit 0f305501f26d633048c83a89b6652db169394a3f that line filling problems seemed to be solved But in the last two commits it throws an error. So what changed and can't we just go back? > Basically, it isn't hard to create a line of code it can't fill, in > which case it throws this error. Maybe a warning is better? Yes I think so. Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: John C. <ci...@ma...> - 2024-05-20 14:14:09
Attachments:
fill-paragraph.patch
|
Hi Uwe, I don't think these fill-paragraph patches made it into master. Attached are the patches that work for me. Are there any reasons to not apply them? Thanks, John ________________________________ From: Uwe Brauer <ou...@ma...> Sent: Monday, July 31, 2023 11:57 AM To: Eric Ludlam <el...@ma...> Cc: Matlab-emacs-discuss <mat...@li...> Subject: Re: [Matlab-emacs-discuss] the filling patch and its problems >>> "EL" == Eric Ludlam <el...@ma...> writes: > Is anyone out there interested in the "code fill" feature? You mean besides me 😇 I do hope so! > It was a hairy thing to implement back in the day, and most of the > feedback I got was "how do I turn this off?" It is likely easier to > drop the feature than figure out how to fix it for all cases. I cannot judge this and I don't want to cause you headaches. However I can tell you that code that is written with the native matlab editor (say by my students) tend to have these enormous comment lines as in the files fill_prob2.m fill_prob.m So filling these lines would help me quite a bit and I thought emacs users sharing code with those using the native editor might face similar problems. The thing that puzzles me: in commit 0f305501f26d633048c83a89b6652db169394a3f that line filling problems seemed to be solved But in the last two commits it throws an error. So what changed and can't we just go back? > Basically, it isn't hard to create a line of code it can't fill, in > which case it throws this error. Maybe a warning is better? Yes I think so. Uwe -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the NATO membership of the Ukraine. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/<https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view> |
From: Eric L. <el...@ma...> - 2023-07-24 19:10:13
Attachments:
matlab-fill.patch
|
Hi Uwe, Here’s a revised patch that does a better job filling comments, and also fixes the indent region issue you found. Hope these work for you. Eric From: Uwe Brauer <ou...@ma...> Sent: Tuesday, July 11, 2023 2:53 AM To: Eric Ludlam <el...@ma...> Cc: Matlab-emacs-discuss <mat...@li...> Subject: the filling patch and its problems Hi Just to resume the discussion. I insert below the emails discussing the two problems I found I applied the two patches, I attach below and then I run into a problem: First problem Take one of these awful long comment line ev = 0; % el número de evaluaciones al inicio es cero, pues no ha habido ninguna iteración this after running matlab-fill-comment-line to ev = 0; % el número de evaluaciones al inicio es cero, pues no ha % habido % ninguna % iteración Which does not look correct to me, shouldn't it be ev = 0; % el número de evaluaciones al inicio es cero, pues no ha % habido ninguna iteración Or do I miss here something Second problem. I tried just to run matlab-indent-region on ev = 0; % el número de evaluaciones al inicio es cero, pues no ha % habido % ninguna % iteración and I obtained an error I attach, something is not right here |
From: Uwe B. <ou...@ma...> - 2024-05-21 13:39:47
Attachments:
smime.p7s
|
-- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: John C. <ci...@ma...> - 2024-05-21 14:36:05
|
It looks like we have more work to do and they are not ready. Thanks ________________________________ From: Uwe Brauer Sent: Tuesday, May 21, 2024 9:39 AM To: John Ciolfi Cc: Eric Ludlam; Uwe Brauer; Matlab-emacs-discuss Subject: Re: [Matlab-emacs-discuss] the filling patch and its problems "JC" == John Ciolfi <ci...@ma...> writes: Hi John Hi Uwe, I don't think these fill-paragraph patches made it into master. Attached are the patches that work for me. Are there any reasons to not apply them? In July last year Eric provided some patches for improving the filling. I started a new branch and run some test and sooner or later them there were corner cases where it did not work as expected or made the filling worse. Your patch differ from all the commits, so I just applied it to master and start testing. However there also cases where there problems. The following is taken from files from Students who wrote their code using the native matlab editor in MS Windows. I give you some examples, now. But if you wish I push your patch as a different branch, and add a directory tests-for-new-filling or so. Number 1 j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % UB:03.05.2024:18:08: no entiendo esta linea % explicalo por favor lo utilizo para calcular la derivada de @func; debería poder usar 1 en lugar de la segunda parte de la ecuacion pero me da error y no logro ver por qué, como así me funcionaba no lo he tocado When running matlab-fill-comment-line cursor is at the end of the first line I obtain j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % % UB:03.05.2024:18:08: % no entiendo % esta linea % explicalo por favor lo utilizo para calcular la derivada de @func; debería poder usar 1 en lugar de la segunda parte de la ecuacion pero me da error y no logro ver por qué, como así me funcionaba no lo he tocado When applying the function after the word «tocado», I obtain j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % % UB:03.05.2024:18:08: % no entiendo % esta linea % explicalo % por favor % lo utilizo % para % calcular la % derivada de % @func; % debería % poder usar % 1 en lugar % de la % segunda % parte de la % ecuacion % pero me da % error y no % logro ver % por qué, % como así me % funcionaba % no lo he % tocado And this looks wired to me, don't you think? Uwe |
From: John C. <ci...@ma...> - 2024-05-21 18:47:08
|
If you try M-x set-variable RET fill-column RET 150 The two M-q commands will look better. I assume you were using a smaller fill column. Perhaps, this is good enough to update SourceForge? The missing item is that it should only take one fill (M-q) command, which we could do as a follow-up. I tried M-q in a *.cpp file for a similar case and it requires only one M-q. Are there any other cases that behave poorly? Thanks ________________________________ From: John Ciolfi via Matlab-emacs-discuss <mat...@li...> Sent: Tuesday, May 21, 2024 10:35 AM To: Uwe Brauer <ou...@ma...> Cc: Matlab-emacs-discuss <mat...@li...>; Eric Ludlam <el...@ma...> Subject: Re: [Matlab-emacs-discuss] the filling patch and its problems It looks like we have more work to do and they are not ready. Thanks ________________________________ From: Uwe Brauer Sent: Tuesday, May 21, 2024 9:39 AM To: John Ciolfi Cc: Eric Ludlam; Uwe Brauer; Matlab-emacs-discuss Subject: Re: [Matlab-emacs-discuss] the filling patch and its problems "JC" == John Ciolfi <ci...@ma...> writes: Hi John Hi Uwe, I don't think these fill-paragraph patches made it into master. Attached are the patches that work for me. Are there any reasons to not apply them? In July last year Eric provided some patches for improving the filling. I started a new branch and run some test and sooner or later them there were corner cases where it did not work as expected or made the filling worse. Your patch differ from all the commits, so I just applied it to master and start testing. However there also cases where there problems. The following is taken from files from Students who wrote their code using the native matlab editor in MS Windows. I give you some examples, now. But if you wish I push your patch as a different branch, and add a directory tests-for-new-filling or so. Number 1 j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % UB:03.05.2024:18:08: no entiendo esta linea % explicalo por favor lo utilizo para calcular la derivada de @func; debería poder usar 1 en lugar de la segunda parte de la ecuacion pero me da error y no logro ver por qué, como así me funcionaba no lo he tocado When running matlab-fill-comment-line cursor is at the end of the first line I obtain j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % % UB:03.05.2024:18:08: % no entiendo % esta linea % explicalo por favor lo utilizo para calcular la derivada de @func; debería poder usar 1 en lugar de la segunda parte de la ecuacion pero me da error y no logro ver por qué, como así me funcionaba no lo he tocado When applying the function after the word «tocado», I obtain j_func = @(t, y_1, jfunc, h, y_2) [h*jfunc(t, y_2) - jfunc(t, y_2)\jfunc(t, y_2)]; % % UB:03.05.2024:18:08: % no entiendo % esta linea % explicalo % por favor % lo utilizo % para % calcular la % derivada de % @func; % debería % poder usar % 1 en lugar % de la % segunda % parte de la % ecuacion % pero me da % error y no % logro ver % por qué, % como así me % funcionaba % no lo he % tocado And this looks wired to me, don't you think? Uwe |
From: Uwe B. <ou...@ma...> - 2024-05-22 08:23:16
Attachments:
smime.p7s
|
>>> "JC" == John Ciolfi <ci...@ma...> writes: > If you try > M-x set-variable RET fill-column RET > 150 I was using 100, now I changed to 150. > The two M-q commands will look better. I assume you were using a smaller fill column. I presume your M-q executes command matlab-fill-comment-line, right? #+begin_src while diff > TOL && k <= nmax % por una parte se condiciona al while con un valor de tolerancia para el error diff, error de una iteración (de la iteración simple), y, por otra parte, se toma un numero máximo de iteraciones porque puede perfectamente el error de iteración no ser menor que la tolerancia, provocando un bucle infinito #+end_src Results in #+begin_src while diff > TOL && k <= nmax % por una parte se condiciona al while con un valor de tolerancia para el error diff, error de una iteración (de % la iteración simple), y, por otra parte, se toma un numero máximo de iteraciones % porque puede perfectamente el error de iteración no ser menor que la tolerancia, % provocando un bucle infinito #+end_src Which looks bad with or without truncation line on or off. So I am not sure who is the culprit here set-fill-column 100 seems reasonable to me. I will try to run more tests -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Uwe B. <ou...@ma...> - 2024-05-22 08:28:34
Attachments:
smime.p7s
|
> If you try > M-x set-variable RET fill-column RET > 150 Consider #+begin_src function [teuler,yeuler,ev]=mieulerimpfixpc(f,intv,y0,N,TOL,nmax) % se implementa el tercer tipo de función dada por el enunciado a = min(intv); % se preparan los datos de la mísma forma como se ha comentado en la anterior función b = max(intv); h = (a + b)/N; tk = a; yk = y0; teuler = a; yeuler = y0; ev = 0; faux = @(t, y, f, h, z) [y + h*f(t, z)]; #+end_src Put the cursor on the word «mismo» in the second line run the M-q and I obtain #+begin_src function [teuler,yeuler,ev]=mieulerimpfixpc(f,intv,y0,N,TOL,nmax) % se implementa el tercer tipo de función dada por el % enunciado a = min(intv); % se preparan los datos de % la mísma forma como se ha comentado en la anterior % función b = max(intv); h = (a + b)/N; tk = a; yk = % y0; teuler = a; yeuler = y0; ev = 0; faux = @(t, y, % f, h, z) [y + h*f(t, z)]; for i = 1:N % la % diferencia fundamental con respecto a la función % anterior es que en este caso se va a utilizar para % la iteración simple como valor inicial 'y' el % calculado por el método de euler explícito t = tk + % h; y_pred = yk + h*f(tk, yk); % aquí se calcula % dicha 'y' que se va a utilizar en la iteración % simple ev = ev + 1; y = y_pred; k = 0; diff = 100; % while diff > TOL && k <= nmax % se hace la % iteración simple como en la anterior función pero % teniendo en cuenta ahora que la 'y' de valor % inicial es el calculado por el método de euler % explícito anteriormente obtenido k = k + 1; z = % faux(t, yk, f, h, y); diff = max(max(abs(z - y))); % y = z; ev = ev + 1; end #+end_src That is a disaster, code has changed into comments -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: John C. <ci...@ma...> - 2024-05-22 15:55:29
|
Ouch, that's bad, we'll need to keep this as an open issue. Thanks John ________________________________ From: Uwe Brauer Sent: Wednesday, May 22, 2024 4:28 AM To: John Ciolfi Cc: Uwe Brauer; Matlab-emacs-discuss; Eric Ludlam Subject: [another problem] (was: [Matlab-emacs-discuss] the filling patch and its problems) > If you try > M-x set-variable RET fill-column RET > 150 Consider #+begin_src function [teuler,yeuler,ev]=mieulerimpfixpc(f,intv,y0,N,TOL,nmax) % se implementa el tercer tipo de función dada por el enunciado a = min(intv); % se preparan los datos de la mísma forma como se ha comentado en la anterior función b = max(intv); h = (a + b)/N; tk = a; yk = y0; teuler = a; yeuler = y0; ev = 0; faux = @(t, y, f, h, z) [y + h*f(t, z)]; #+end_src Put the cursor on the word «mismo» in the second line run the M-q and I obtain #+begin_src function [teuler,yeuler,ev]=mieulerimpfixpc(f,intv,y0,N,TOL,nmax) % se implementa el tercer tipo de función dada por el % enunciado a = min(intv); % se preparan los datos de % la mísma forma como se ha comentado en la anterior % función b = max(intv); h = (a + b)/N; tk = a; yk = % y0; teuler = a; yeuler = y0; ev = 0; faux = @(t, y, % f, h, z) [y + h*f(t, z)]; for i = 1:N % la % diferencia fundamental con respecto a la función % anterior es que en este caso se va a utilizar para % la iteración simple como valor inicial 'y' el % calculado por el método de euler explícito t = tk + % h; y_pred = yk + h*f(tk, yk); % aquí se calcula % dicha 'y' que se va a utilizar en la iteración % simple ev = ev + 1; y = y_pred; k = 0; diff = 100; % while diff > TOL && k <= nmax % se hace la % iteración simple como en la anterior función pero % teniendo en cuenta ahora que la 'y' de valor % inicial es el calculado por el método de euler % explícito anteriormente obtenido k = k + 1; z = % faux(t, yk, f, h, y); diff = max(max(abs(z - y))); % y = z; ev = ev + 1; end #+end_src That is a disaster, code has changed into comments -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |