From: Peter M. <pet...@gm...> - 2022-04-23 19:33:25
|
note: I formatted this email in markdown for readability (let me know if there's a better way). I use **electric-pair-mode**. If you don't you can turn it on locally with ``` (electric-pair-local-mode t) ``` to see what the issue is. Briefly, with **electric-pair-mode** on (locally or globally), If I type the characters `(abc)def`, I get the same output. The characters that pair are the ones in the syntax table (use `describe-syntax' to see it) that are of type "open", "close", or "string". In **matlab-mode**, the pairs (), [], {} (all "open"/"close" type) work fine, as does the "string" type delimiter " (aka, double-quote, #x22, ?") because it is listed in the variable `electric-pair-pairs`. The only one that does NOT work is the "string" type delimiter ' (aka, single-quote, #x27, ?'). So with the `(abc)def` example above, with #x27, I get: ``` 'abc'def' ``` Note the single-quote at the end of the output string after the `f`. With some exploration of other modes, I have found that **perl-mode** also uses #x27 as a string delimiter in its syntax table, but it gives the correct output with my test input string. I will look into this, but if someone else with more experience coding syntax handling gets to it before me, that would be wonderful. thanks, Peter |
From: Eric L. <eri...@gm...> - 2022-04-25 14:11:33
|
Hi Peter, MATLAB's use of ' char for strings is a bit tricky, because it has many meanings, such as: * 'this is a string' * 'in a string '' first quote is escape for second quote' * this is a transpose' I'm not sure when the electric pair mode does it's thing, but if it tries to pair up a ' when you type it, but then later the matlab-mode scanner re-attributes it as punctuation (because it is transpose) or escape (because it is doubled up) I can imagine some confusion. As such, matlab-mode has special support for paren-mode. I might recommend turning off electric-pair-mode in matlab-mode, and turning on paren-mode instead. I know it isn't the same, but as I scan through elec-pair.el, I don't see much opportunity for matlab-mode to customize it for the special syntax features. It may be possible that setting `electric-pair-string-bound-function' to 'point-at-eol' in MATLAB buffers might help, since strings can't extend past one line, but I suspect the real problem is in the timing of the insert action since elec-pair uses edit hooks, and matlab fixes the syntax during a syntax-ppss call (ie - during font lock, or navigation keypress) Maybe someone else on the list knows other ways to customize elec-pair can offer a suggestion. cc-mode does similar stuff with syntax-propertize, and must have some fixes for elec-pair. Eric On Sat, Apr 23, 2022 at 3:33 PM Peter Mao <pet...@gm...> wrote: > note: I formatted this email in markdown for readability (let me know if > there's a better way). > > I use **electric-pair-mode**. If you don't you can turn it on locally with > ``` > (electric-pair-local-mode t) > ``` > to see what the issue is. > > Briefly, with **electric-pair-mode** on (locally or globally), If I type > the characters `(abc)def`, I get the same output. The characters that pair > are the ones in the syntax table (use `describe-syntax' to see it) that are > of type "open", "close", or "string". > > In **matlab-mode**, the pairs (), [], {} (all "open"/"close" type) work > fine, as does the "string" type delimiter " (aka, double-quote, #x22, ?") > because it is listed in the variable `electric-pair-pairs`. The only one > that does NOT work is the "string" type delimiter ' (aka, single-quote, > #x27, ?'). So with the `(abc)def` example above, with #x27, I get: > ``` > 'abc'def' > ``` > Note the single-quote at the end of the output string after the `f`. > > With some exploration of other modes, I have found that **perl-mode** also > uses #x27 as a string delimiter in its syntax table, but it gives the > correct output with my test input string. > > I will look into this, but if someone else with more experience coding > syntax handling gets to it before me, that would be wonderful. > > thanks, > > Peter > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > |
From: John C. <ci...@ma...> - 2022-04-25 15:34:09
|
There was a recent fix to the syntax class for the single quote, https://sourceforge.net/p/matlab-emacs/src/ci/a5e88cda8e0715f117f09e6101f39302387f2d6b/ I'm not familiar with electric pair mode but tried it and it seems to work for the case you mentioned. Some downsides I noticed with it was (2) trying to transpose a variable, typing a single quote at end of variable results in two single quotes and you need to delete (C-d) the extra single quote. (2) If you try to escape a quote in a string, it adds an extra quote. John ________________________________ From: Eric Ludlam <eri...@gm...> Sent: Monday, April 25, 2022 10:11 AM To: Peter Mao <pet...@gm...> Cc: matlab-emacs-discuss <mat...@li...> Subject: Re: [Matlab-emacs-discuss] matlab-mode, electric-pair-mode and the single quote (') Hi Peter, MATLAB's use of ' char for strings is a bit tricky, because it has many meanings, such as: * 'this is a string' * 'in a string '' first quote is escape for second quote' * this is a transpose' I'm not sure when the electric pair mode does it's thing, but if it tries to pair up a ' when you type it, but then later the matlab-mode scanner re-attributes it as punctuation (because it is transpose) or escape (because it is doubled up) I can imagine some confusion. As such, matlab-mode has special support for paren-mode. I might recommend turning off electric-pair-mode in matlab-mode, and turning on paren-mode instead. I know it isn't the same, but as I scan through elec-pair.el, I don't see much opportunity for matlab-mode to customize it for the special syntax features. It may be possible that setting `electric-pair-string-bound-function' to 'point-at-eol' in MATLAB buffers might help, since strings can't extend past one line, but I suspect the real problem is in the timing of the insert action since elec-pair uses edit hooks, and matlab fixes the syntax during a syntax-ppss call (ie - during font lock, or navigation keypress) Maybe someone else on the list knows other ways to customize elec-pair can offer a suggestion. cc-mode does similar stuff with syntax-propertize, and must have some fixes for elec-pair. Eric On Sat, Apr 23, 2022 at 3:33 PM Peter Mao <pet...@gm...<mailto:pet...@gm...>> wrote: note: I formatted this email in markdown for readability (let me know if there's a better way). I use **electric-pair-mode**. If you don't you can turn it on locally with ``` (electric-pair-local-mode t) ``` to see what the issue is. Briefly, with **electric-pair-mode** on (locally or globally), If I type the characters `(abc)def`, I get the same output. The characters that pair are the ones in the syntax table (use `describe-syntax' to see it) that are of type "open", "close", or "string". In **matlab-mode**, the pairs (), [], {} (all "open"/"close" type) work fine, as does the "string" type delimiter " (aka, double-quote, #x22, ?") because it is listed in the variable `electric-pair-pairs`. The only one that does NOT work is the "string" type delimiter ' (aka, single-quote, #x27, ?'). So with the `(abc)def` example above, with #x27, I get: ``` 'abc'def' ``` Note the single-quote at the end of the output string after the `f`. With some exploration of other modes, I have found that **perl-mode** also uses #x27 as a string delimiter in its syntax table, but it gives the correct output with my test input string. I will look into this, but if someone else with more experience coding syntax handling gets to it before me, that would be wonderful. thanks, Peter _______________________________________________ Matlab-emacs-discuss mailing list Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss<https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss> |
From: Peter M. <pet...@gm...> - 2022-04-26 04:14:15
|
hi Eric and John, Thanks for your responses. Eric -- did you mean `show-paren-mode`? I can't find any references to a `paren-mode` in melpa, elpa or emacs (28.1). I'll try it out if I can find it! I'm on the latest matlab-emacs, which include the commit John mentions, but the only way past the last single-quote is C-f or right-arrow. In my common usage of coding m scripts, I'm more often tweaking labels on plots (and hence string) than transposing matrices. I may add #x27 to `electric-pair-pairs` and see if that reduces my overall "minor annoyance level." Peter On Mon, Apr 25, 2022 at 8:33 AM John Ciolfi <ci...@ma...> wrote: > There was a recent fix to the syntax class for the single quote, > https://sourceforge.net/p/matlab-emacs/src/ci/a5e88cda8e0715f117f09e6101f39302387f2d6b/ > > I'm not familiar with electric pair mode but tried it and it seems to work > for the case you mentioned. Some downsides I noticed with it was (2) trying > to transpose a variable, typing a single quote at end of variable results > in two single quotes and you need to delete (C-d) the extra single quote. > (2) If you try to escape a quote in a string, it adds an extra quote. > > > John > ------------------------------ > *From:* Eric Ludlam <eri...@gm...> > *Sent:* Monday, April 25, 2022 10:11 AM > *To:* Peter Mao <pet...@gm...> > *Cc:* matlab-emacs-discuss <mat...@li...> > *Subject:* Re: [Matlab-emacs-discuss] matlab-mode, electric-pair-mode and > the single quote (') > > Hi Peter, > > MATLAB's use of ' char for strings is a bit tricky, because it has many > meanings, such as: > * 'this is a string' > * 'in a string '' first quote is escape for second quote' > * this is a transpose' > > I'm not sure when the electric pair mode does it's thing, but if it tries > to pair up a ' when you type it, but then later the matlab-mode scanner > re-attributes it as punctuation (because it is transpose) or escape > (because it is doubled up) I can imagine some confusion. > > As such, matlab-mode has special support for paren-mode. I might > recommend turning off electric-pair-mode in matlab-mode, and turning on > paren-mode instead. I know it isn't the same, but as I scan through > elec-pair.el, I don't see much opportunity for matlab-mode to customize it > for the special syntax features. > > It may be possible that setting `electric-pair-string-bound-function' to > 'point-at-eol' in MATLAB buffers might help, since strings can't extend > past one line, but I suspect the real problem is in the timing of the > insert action since elec-pair uses edit hooks, and matlab fixes the syntax > during a syntax-ppss call (ie - during font lock, or navigation keypress) > > Maybe someone else on the list knows other ways to customize elec-pair can > offer a suggestion. cc-mode does similar stuff with syntax-propertize, > and must have some fixes for elec-pair. > > Eric > > On Sat, Apr 23, 2022 at 3:33 PM Peter Mao <pet...@gm...> wrote: > > note: I formatted this email in markdown for readability (let me know if > there's a better way). > > I use **electric-pair-mode**. If you don't you can turn it on locally with > ``` > (electric-pair-local-mode t) > ``` > to see what the issue is. > > Briefly, with **electric-pair-mode** on (locally or globally), If I type > the characters `(abc)def`, I get the same output. The characters that pair > are the ones in the syntax table (use `describe-syntax' to see it) that are > of type "open", "close", or "string". > > In **matlab-mode**, the pairs (), [], {} (all "open"/"close" type) work > fine, as does the "string" type delimiter " (aka, double-quote, #x22, ?") > because it is listed in the variable `electric-pair-pairs`. The only one > that does NOT work is the "string" type delimiter ' (aka, single-quote, > #x27, ?'). So with the `(abc)def` example above, with #x27, I get: > ``` > 'abc'def' > ``` > Note the single-quote at the end of the output string after the `f`. > > With some exploration of other modes, I have found that **perl-mode** also > uses #x27 as a string delimiter in its syntax table, but it gives the > correct output with my test input string. > > I will look into this, but if someone else with more experience coding > syntax handling gets to it before me, that would be wonderful. > > thanks, > > Peter > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > |
From: Uwe B. <ou...@ma...> - 2022-04-26 06:30:38
Attachments:
smime.p7s
|
>>> "PM" == Peter Mao <pet...@gm...> writes: Hi all > hi Eric and John, > Thanks for your responses. Eric -- did you mean `show-paren-mode`? I > can't find any references to a `paren-mode` in melpa, elpa or emacs > (28.1). I'll try it out if I can find it! I was wondering myself. I tend to believe that years ago there was some paren-mode package, but I cannot find it in my archives. Uwe Brauer |
From: Uwe B. <ou...@ma...> - 2022-04-26 06:51:27
Attachments:
smime.p7s
|
>>> "PM" == Peter Mao <pet...@gm...> writes: Hi all > hi Eric and John, > Thanks for your responses. Eric -- did you mean `show-paren-mode`? I > can't find any references to a `paren-mode` in melpa, elpa or emacs > (28.1). I'll try it out if I can find it! I was wondering myself. I tend to believe that years ago there was some paren-mode package, but I cannot find it in my archives. Uwe Brauer |
From: Eric L. <eri...@gm...> - 2022-04-26 23:10:25
Attachments:
matlab-elecp-patch
|
Hi, yes - I meant `show-paren-mode'. Not sure what I was thinking at the time. In the code for matlab.el, it is all about show-paren-* features it is extending. I poked around some more to see how to extend electric-pair-mode, and found the defcustom `electric-pair-inhibit-predicate'. I hacked together a little thing that prevents the mode from pairing up a single quote after a symbol, ie - when used as transpose. The downside is it also disables the user's selection, so not sure what to do about that. Anyway, I attached it as a way to brainstorm what the right patterns are to fix the original problem. Eric On Tue, Apr 26, 2022 at 2:30 AM Uwe Brauer <ou...@ma...> wrote: > >>> "PM" == Peter Mao <pet...@gm...> writes: > > Hi all > > hi Eric and John, > > Thanks for your responses. Eric -- did you mean `show-paren-mode`? I > > can't find any references to a `paren-mode` in melpa, elpa or emacs > > (28.1). I'll try it out if I can find it! > > I was wondering myself. I tend to believe that years ago there was some > paren-mode package, but I cannot find it in my archives. > > Uwe Brauer > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > |
From: Peter M. <pet...@gm...> - 2022-04-29 03:24:35
Attachments:
matlab-elecp-patch_PHM
|
Hi Eric, Thank you -- that inspired me to make electric-pair-pairs a buffer local variable. Surprisingly (to me) electric still pairs double-quote (") as I would expect and single-quote (') works in all the contexts I can think of right now. questions/comments: 1. Your `(defvar electric-pair-inhibit-predicate)` did not seem necessary, so I removed it in my patch 2. I don't understand the `\\s_` option in your `looking-at` argument, but kept it in, as it seems to do no harm to any of my matlab code. 3. I added the `\\.` to `looking-at` to handle non-conjugate transpose. 4. I tried using `nconc` to add single quote to the local `electric-pair-pairs`, but it would always change the global value as well, so I fell back to `setq`. This is some bit of elisp that I just don't understand. 5. I'm using emacs 28.1 now with the native-compilation on. I find that the changes to matlab.el don't work for the first m-file opened, but on the second one (or kill and open the first) all the electric mods work as desired. Peter On Tue, Apr 26, 2022 at 4:10 PM Eric Ludlam <eri...@gm...> wrote: > Hi, yes - I meant `show-paren-mode'. Not sure what I was thinking at the > time. > In the code for matlab.el, it is all about show-paren-* features it is > extending. > > I poked around some more to see how to extend electric-pair-mode, and > found the defcustom `electric-pair-inhibit-predicate'. I hacked together a > little thing that prevents the mode from pairing up a single quote after a > symbol, ie - when used as transpose. The downside is it also disables the > user's selection, so not sure what to do about that. > > Anyway, I attached it as a way to brainstorm what the right patterns are > to fix the original problem. > > Eric > > On Tue, Apr 26, 2022 at 2:30 AM Uwe Brauer <ou...@ma...> wrote: > >> >>> "PM" == Peter Mao <pet...@gm...> writes: >> >> Hi all >> > hi Eric and John, >> > Thanks for your responses. Eric -- did you mean `show-paren-mode`? I >> > can't find any references to a `paren-mode` in melpa, elpa or emacs >> > (28.1). I'll try it out if I can find it! >> >> I was wondering myself. I tend to believe that years ago there was some >> paren-mode package, but I cannot find it in my archives. >> >> Uwe Brauer >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss >> > |
From: Eric L. <eri...@gm...> - 2022-05-15 20:19:55
|
Hi Peter, Sorry, I completely lost track of this thread when it came in. Thanks for trying out the patch. I'm glad it started working for you! Regarding your questions: 1) That defvar tells the byte-compiler that variable exists so it doesn't throw a warning when compiling in batch-mode. You are correct that it has no other functional value. 2) \\s_ matches symbol characters. This if you type MyVar_' it will correctly match. 4) Yes, nconc modifies the list. You would need to make a deep copy of electric-pairs-pairs first before modifying it. Thus, your soln of just typing in something is good. :) 5) Use 'toggle-debug-on-error' for your first file and see what the stack says. Hard to speculate otherwise. Run the toggle-debug command a 2nd time to turn off debugging. Good Luck Eric On 4/28/22 11:24 PM, Peter Mao wrote: > Hi Eric, > > Thank you -- that inspired me to make electric-pair-pairs a buffer > local variable. Surprisingly (to me) electric still pairs > double-quote (") as I would expect and single-quote (') works in all > the contexts I can think of right now. > > questions/comments: > 1. Your `(defvar electric-pair-inhibit-predicate)` did not seem > necessary, so I removed it in my patch > 2. I don't understand the `\\s_` option in your `looking-at` > argument, but kept it in, as it seems to do no harm to any of my > matlab code. > 3. I added the `\\.` to `looking-at` to handle non-conjugate transpose. > 4. I tried using `nconc` to add single quote to the local > `electric-pair-pairs`, but it would always change the global value as > well, so I fell back to `setq`. This is some bit of elisp that I just > don't understand. > 5. I'm using emacs 28.1 now with the native-compilation on. I find > that the changes to matlab.el don't work for the first m-file opened, > but on the second one (or kill and open the first) all the electric > mods work as desired. > > Peter > > On Tue, Apr 26, 2022 at 4:10 PM Eric Ludlam <eri...@gm...> wrote: > > Hi, yes - I meant `show-paren-mode'. Not sure what I was thinking > at the time. > In the code for matlab.el, it is all about show-paren-* features > it is extending. > > I poked around some more to see how to extend electric-pair-mode, > and found the defcustom `electric-pair-inhibit-predicate'. I > hacked together a little thing that prevents the mode from pairing > up a single quote after a symbol, ie - when used as transpose. The > downside is it also disables the user's selection, so not sure > what to do about that. > > Anyway, I attached it as a way to brainstorm what the right > patterns are to fix the original problem. > > Eric > > On Tue, Apr 26, 2022 at 2:30 AM Uwe Brauer <ou...@ma...> wrote: > > >>> "PM" == Peter Mao <pet...@gm...> writes: > > Hi all > > hi Eric and John, > > Thanks for your responses. Eric -- did you mean > `show-paren-mode`? I > > can't find any references to a `paren-mode` in melpa, elpa > or emacs > > (28.1). I'll try it out if I can find it! > > I was wondering myself. I tend to believe that years ago there > was some > paren-mode package, but I cannot find it in my archives. > > Uwe Brauer > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > |
From: Peter M. <pet...@gm...> - 2023-04-22 19:32:35
|
Hi Uwe, Here is the email thread from the PR I put up on sourceforge last night. Sorry for the confusion -- I'm much better acquainted with the github workflow. The PR is the equivalent of the two patches in this thread applied serially matlab.el of ~ a year ago. I had to make some adjustments by hand last night (patch couldn't always find the right location to add lines), but it seems to work fine for me. Peter On Sun, May 15, 2022 at 1:19 PM Eric Ludlam <eri...@gm...> wrote: > Hi Peter, > > Sorry, I completely lost track of this thread when it came in. > > Thanks for trying out the patch. I'm glad it started working for you! > > Regarding your questions: > 1) That defvar tells the byte-compiler that variable exists so it > doesn't throw a warning when compiling in batch-mode. You are correct > that it has no other functional value. > 2) \\s_ matches symbol characters. This if you type MyVar_' it will > correctly match. > > 4) Yes, nconc modifies the list. You would need to make a deep copy of > electric-pairs-pairs first before modifying it. Thus, your soln of just > typing in something is good. :) > 5) Use 'toggle-debug-on-error' for your first file and see what the > stack says. Hard to speculate otherwise. Run the toggle-debug command > a 2nd time to turn off debugging. > > Good Luck > Eric > > On 4/28/22 11:24 PM, Peter Mao wrote: > > Hi Eric, > > > > Thank you -- that inspired me to make electric-pair-pairs a buffer > > local variable. Surprisingly (to me) electric still pairs > > double-quote (") as I would expect and single-quote (') works in all > > the contexts I can think of right now. > > > > questions/comments: > > 1. Your `(defvar electric-pair-inhibit-predicate)` did not seem > > necessary, so I removed it in my patch > > 2. I don't understand the `\\s_` option in your `looking-at` > > argument, but kept it in, as it seems to do no harm to any of my > > matlab code. > > 3. I added the `\\.` to `looking-at` to handle non-conjugate transpose. > > 4. I tried using `nconc` to add single quote to the local > > `electric-pair-pairs`, but it would always change the global value as > > well, so I fell back to `setq`. This is some bit of elisp that I just > > don't understand. > > 5. I'm using emacs 28.1 now with the native-compilation on. I find > > that the changes to matlab.el don't work for the first m-file opened, > > but on the second one (or kill and open the first) all the electric > > mods work as desired. > > > > Peter > > > > On Tue, Apr 26, 2022 at 4:10 PM Eric Ludlam <eri...@gm...> > wrote: > > > > Hi, yes - I meant `show-paren-mode'. Not sure what I was thinking > > at the time. > > In the code for matlab.el, it is all about show-paren-* features > > it is extending. > > > > I poked around some more to see how to extend electric-pair-mode, > > and found the defcustom `electric-pair-inhibit-predicate'. I > > hacked together a little thing that prevents the mode from pairing > > up a single quote after a symbol, ie - when used as transpose. The > > downside is it also disables the user's selection, so not sure > > what to do about that. > > > > Anyway, I attached it as a way to brainstorm what the right > > patterns are to fix the original problem. > > > > Eric > > > > On Tue, Apr 26, 2022 at 2:30 AM Uwe Brauer <ou...@ma...> wrote: > > > > >>> "PM" == Peter Mao <pet...@gm...> writes: > > > > Hi all > > > hi Eric and John, > > > Thanks for your responses. Eric -- did you mean > > `show-paren-mode`? I > > > can't find any references to a `paren-mode` in melpa, elpa > > or emacs > > > (28.1). I'll try it out if I can find it! > > > > I was wondering myself. I tend to believe that years ago there > > was some > > paren-mode package, but I cannot find it in my archives. > > > > Uwe Brauer > > _______________________________________________ > > Matlab-emacs-discuss mailing list > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > > > |
From: Uwe B. <ou...@ma...> - 2023-04-23 05:35:24
Attachments:
smime.p7s
|
> Hi Peter, > Oh well, I can't find the patches, at least not easily. Would you mind > 1. Either send me the patches, again, by email indicating against > which commit they are supposed to applied. > 2. Or using a PR in gitlab (as I said, most likely in one month I > try to move/mirror the repository in github, meanwhile I make > some experiments, but in gitlab, I am more acquainted with > (because heptapod, where the mercurial development dwells uses a > gitlab clone) > the repository is found at > https://gitlab.com/kalthad/matlab-emacs > Since I am still more acquainted with patches, but would like to > understand PR, the logic is this > - you fork the repository > - you create a new branch, commit and send th RP, right? You > create a new branch? I have just to add, if you fork the gitlab repository, please note that the main branch is now called default, not master any longer (I am a mercurial user and that simplifies things for me). -- 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 ban of Russia from SWIFT. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Peter M. <pet...@gm...> - 2023-04-24 04:07:06
|
Hi Uwe, Here are the original patches (matlab-elecp-patch and matlab-elecp-patch_PHM) that would be applied to commit [5069e3c], and the patch corresponding to the PR in question (0001-fix-electric-pair-handling-of-single-quote.patch) to be applied to be applied to [b700722]. Content-wise, the PR is the same as the two original patches applied serially. Here is the text of the original issue: note: I formatted this email in markdown for readability (let me know if > there's a better way). > > I use **electric-pair-mode**. If you don't you can turn it on locally with > ``` > (electric-pair-local-mode t) > ``` > to see what the issue is. > > Briefly, with **electric-pair-mode** on (locally or globally), If I type > the characters `(abc)def`, I get the same output. The characters that pair > are the ones in the syntax table (use `describe-syntax' to see it) that are > of type "open", "close", or "string". > > In **matlab-mode**, the pairs (), [], {} (all "open"/"close" type) work > fine, as does the "string" type delimiter " (aka, double-quote, #x22, ?") > because it is listed in the variable `electric-pair-pairs`. The only one > that does NOT work is the "string" type delimiter ' (aka, single-quote, > #x27, ?'). So with the `(abc)def` example above, with #x27, I get: > ``` > 'abc'def' > ``` > Note the single-quote at the end of the output string after the `f`. > Peter |
From: Uwe B. <ou...@ma...> - 2023-04-23 05:39:28
Attachments:
smime.p7s
|
> Hi Peter, > Oh well, I can't find the patches, at least not easily. Would you mind > 1. Either send me the patches, again, by email indicating against > which commit they are supposed to applied. > 2. Or using a PR in gitlab (as I said, most likely in one month I > try to move/mirror the repository in github, meanwhile I make > some experiments, but in gitlab, I am more acquainted with > (because heptapod, where the mercurial development dwells uses a > gitlab clone) > the repository is found at > https://gitlab.com/kalthad/matlab-emacs > Since I am still more acquainted with patches, but would like to > understand PR, the logic is this > - you fork the repository > - you create a new branch, commit and send th RP, right? You > create a new branch? Sorry the gitlab repository I meant is https://gitlab.com/kalthad/matlab-emacs-default This is the actual one. 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 ban of Russia from SWIFT. 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-04-23 05:58:29
Attachments:
smime.p7s
|
>>> "PM" == Peter Mao <pet...@gm...> writes: Hi Peter, > Hi Uwe, > Here is the email thread from the PR I put up on sourceforge last night. > Sorry for the confusion -- I'm much better acquainted with the github > workflow. > The PR is the equivalent of the two patches in this thread applied serially > matlab.el of ~ a year ago. I had to make some adjustments by hand last > night (patch couldn't always find the right location to add lines), but it > seems to work fine for me. Oh well, I can't find the patches, at least not easily. Would you mind 1. Either send me the patches, again, by email indicating against which commit they are supposed to applied. 2. Or using a PR in gitlab (as I said, most likely in one month I try to move/mirror the repository in github, meanwhile I make some experiments, but in gitlab, I am more acquainted with (because heptapod, where the mercurial development dwells uses a gitlab clone) the repository is found at https://gitlab.com/kalthad/matlab-emacs Since I am still more acquainted with patches, but would like to understand PR, the logic is this - you fork the repository - you create a new branch, commit and send th RP, right? You create a new branch? Regards Uwe |
From: Uwe B. <ou...@ma...> - 2023-04-24 12:56:56
Attachments:
smime.p7s
|
>>> "PM" == Peter Mao <pet...@gm...> writes: > Hi Uwe, > Here are the original patches (matlab-elecp-patch and > matlab-elecp-patch_PHM) that would be applied to commit [5069e3c], and the > patch corresponding to the PR in question > (0001-fix-electric-pair-handling-of-single-quote.patch) to be applied to be > applied to [b700722]. Content-wise, the PR is the same as the two original > patches applied serially. Thanks I applied the patch and also committed as author Peter Mao. (That is easier if later copyright questions appear) Regards 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 ban of Russia from SWIFT. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ |
From: Peter M. <pet...@gm...> - 2023-04-25 05:09:23
|
Hi Uwe, thanks -- I see the new version on MELPA now. Peter On Mon, Apr 24, 2023 at 5:56 AM Uwe Brauer <ou...@ma...> wrote: > >>> "PM" == Peter Mao <pet...@gm...> writes: > > > Hi Uwe, > > Here are the original patches (matlab-elecp-patch and > > matlab-elecp-patch_PHM) that would be applied to commit [5069e3c], and > the > > patch corresponding to the PR in question > > (0001-fix-electric-pair-handling-of-single-quote.patch) to be applied to > be > > applied to [b700722]. Content-wise, the PR is the same as the two > original > > patches applied serially. > > Thanks I applied the patch and also committed as author Peter Mao. > (That is easier if later copyright questions appear) > > Regards > > 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 ban of Russia from SWIFT. > I support the EU membership of the Ukraine. > > https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/ > |