From: Eric L. <eri...@gm...> - 2021-01-17 20:22:44
|
Thanks Haik. That implies a patch like this will fix the issue... ? Do you know what is being set to read-only and why? A better patch might disable whatever that is since other code may need something similar, and it would be better to fix the source than add little patches like this around. Eric -- diff --git a/matlab-shell.el b/matlab-shell.el index b2943d8..0357119 100644 --- a/matlab-shell.el +++ b/matlab-shell.el @@ -1686,7 +1686,8 @@ This uses the lookfor command to find viable commands." It's output is returned as a string with no face properties. The text output of the command is removed from the MATLAB buffer so there will be no indication that it ran." - (let ((msbn (matlab-shell-buffer-barf-not-running)) + (let ((inhibit-read-only t) + (msbn (matlab-shell-buffer-barf-not-running)) (matlab-shell-suppress-prompt-hooks t)) ;; We are unable to use save-excursion to save point position because we are ;; manipulating the *MATLAB* buffer by erasing the current text typed at the On 1/17/21 2:35 PM, Haik Silm wrote: > Dear Jonathan, > > I am running Doom Emacs and had the same issue. The problem is that > the temporary output should be removed, but the lines in the > shell-buffer have a special read-only mode. The work-around is to set > `inhibit-read-only`. > > So what solved it: > > (defadvice! inhibit-real-only-a (oldfun &rest r) > "Temporary remove read-only lines in shell buffer" > :around#'matlab-shell-collect-command-output > (let ((inhibit-read-only t)) (apply oldfun r))) > > Best regards, > Haik > > 17.01.2021 20:20 Eric Ludlam <eri...@gm...> kirjutas: >> Hi Jonathan, >> >> I tried using: >> >> M-x matlab-shell RET >> M-x company-mode RET >> >> then @ matlab prompt: >> >> >> fo >> >> M-x company-matlab-shell RET >> >> to simulate what you have in your stack trace below. I get a yellow >> popup with completions I expect in it. I can pick one and it then >> inserts the completion correctly. >> >> I tried this in Emacs 26.3 as installed by Ubuntu, and also 28.0.50 as >> downloaded from git yesterday morning. >> >> I tend to run my Emacs as stock as possible so I don't accidentally >> create dependencies on random tools, so I'm not familiar with a more >> complex company mode setup. >> >> Due to the nature of using MATLAB Shell, I recommend looking at the >> value of `comint-prompt-read-only' to see if that might be involved. It >> is nil by default in my Emacsen, and matlab-shell doesn't set it because >> I do a lot of fiddling with the buffer in the background. If it were t, >> I would imagine a range of other things not working either though. >> >> That's pretty much all I can think of. Sorry I can't be more >> helpful. :( >> Eric >> >> On 1/6/21 5:50 AM, Jonathan Sahar wrote: >>> Hi, >>> I'm still getting the same error message with the updated version of >>> the repository... >>> the stack trace I get is: >>> ``` >>> Debugger entered--Lisp error: (error "Company: backend >>> company-matlab-shell error \"Text is read-only\" with args (prefix)") >>> signal(error ("Company: backend company-matlab-shell error \"Text is >>> read-only\" with args (prefix)")) >>> error("Company: backend %s error \"%s\" with args %s" >>> company-matlab-shell "Text is read-only" (prefix)) >>> company-call-backend-raw(prefix) >>> apply(company-call-backend-raw prefix) >>> company--force-sync(company-call-backend-raw (prefix) >>> company-matlab-shell) >>> company-call-backend(prefix) >>> company--begin-new() >>> company--perform() >>> company-auto-begin() >>> company-manual-begin() >>> #f(compiled-function (backend &optional callback) "Start a >>> completion at point using BACKEND." (interactive #f(compiled-function >>> () #<bytecode 0x27b2831>)) #<bytecode 0x36c7e49>)(company-matlab-shell) >>> apply(#f(compiled-function (backend &optional callback) "Start a >>> completion at point using BACKEND." (interactive #f(compiled-function >>> () #<bytecode 0x29caa1d>)) #<bytecode 0x36c7e49>) company-matlab-shell) >>> company-begin-backend(company-matlab-shell) >>> company-matlab-shell(interactive) >>> funcall-interactively(company-matlab-shell interactive) >>> ``` >>> >>> and the output in the console is: >>> >>> ``` >>> >> emacsdocomplete('all') >>> >>> emacs_completions_output = >>> >>> java.lang.String[]: >>> >>> 'all' >>> 'allchild' >>> 'allElectrodes' >>> 'allfeasible' >>> 'allMuPADNotebooks' >>> >>> ``` >>> >>> which is the same output that I get by running M-x >>> matlab-complete-symbol, if that helps to make sense of things. >>> >>> Thanks, >>> Jonathan >> >> >> >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |