From oub at mat.ucm.es Mon Feb 27 01:22:17 2017 Content-Type: multipart/mixed; boundary="===============0687340761048465429==" MIME-Version: 1.0 From: Uwe Brauer To: xemacs-beta at xemacs.org Subject: problems with make-extent in matlab.el using the matlab debugger. Date: 2011-01-10 14:42:15 +0100 Message-ID: <87k4icj2o8.fsf@gilgamesch.quim.ucm.es> --===============0687340761048465429== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hello I am not sure whether the problem I describe has to do with the implementation of make-extent in xemacs or the problems lies in a different part of the code. Matlab.el (version 3.1.1) allows to debug matlab code. During the debugging matlab.el, split the window, opens the file you debug, the cursor jumps from line to line and show in the other window via the matlab-shell the result of the executed command. = However GNU emacs and Xemacs behave differently = In GNU emacs you see in the matlab-shell buffer = Someting like = 1 tspan=3D[0 1] Where 1 is underlined and clicking with the mouse on it is jumps to the matlab file which is debugged. In Xemacs however the matlab-buffer displays = 1 tspan=3D[0 1] Which I find very annoying. I tried to debug it but can localise the problem. It seems to me the issue is the code = (defun matlab-shell-render-errors-as-anchor (str) "Detect non-url errors, and treat them as if they were url anchors. Argument STR is the text that might have errors in it." (when (string-match matlab-shell-error-stack-end str) (save-excursion (when (re-search-backward matlab-shell-error-stack-start nil t) (let ((groupend nil) (first nil)) (save-excursion (setq groupend (re-search-forward matlab-shell-error-stack-end)) ) ;; We have found an error stack to investigate. (while (re-search-forward gud-matlab-error-regexp nil t) (let* ((err-start (match-beginning 0)) (err-end (match-end 0)) (err-text (match-string 0)) (err-file (match-string 2)) (err-line (match-string 3)) (o (matlab-make-overlay err-start err-end)) (url (concat "opentoline('" err-file "'," err-line ",0)")) ) = (matlab-overlay-put o 'mouse-face 'highlight) (matlab-overlay-put o 'face 'underline) ;; The url will recycle opentoline code. (matlab-overlay-put o 'matlab-url url) (matlab-overlay-put o 'keymap matlab-shell-html-map) ;; Keep track of the very first error in this error stack. ;; It will represent the "place to go" for "go-to-last-error". (matlab-overlay-put o 'first-in-error-stack first) (when (not first) (setq first url)) )) ))))) Where the various overlay functions are defaliases to = (defalias 'matlab-make-overlay 'make-extent) (defalias 'matlab-overlay-put 'set-extent-property) (defalias 'matlab-overlay-get 'extent-property) (defalias 'matlab-delete-overlay 'delete-extent) (defalias 'matlab-overlay-start 'extent-start-position) (defalias 'matlab-overlay-end 'extent-end-position) (defalias 'matlab-previous-overlay-change 'previous-extent-change) (defalias 'matlab-next-overlay-change 'next-extent-change) Etc. So since GNU emacs and Xemacs behave so differently I thought that maybe make-extent and friend a implemented in a different way. Anybody has an idea? regards Uwe Brauer = _______________________________________________ XEmacs-Beta mailing list XEmacs-Beta(a)xemacs.org http://lists.xemacs.org/mailman/listinfo/xemacs-beta --===============0687340761048465429==-- From james at xemacs.org Mon Feb 27 01:22:17 2017 Content-Type: multipart/mixed; boundary="===============4329485096059762381==" MIME-Version: 1.0 From: Jerry James To: xemacs-beta at xemacs.org Subject: Re: problems with make-extent in matlab.el using the matlab debugger. Date: 2011-01-10 20:36:14 -0700 Message-ID: In-Reply-To: 87k4icj2o8.fsf@gilgamesch.quim.ucm.es --===============4329485096059762381== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Are you willing to try an experiment? On Mon, Jan 10, 2011 at 6:42 AM, Uwe Brauer wrote: > Where the various overlay functions are defaliases to > (defalias 'matlab-make-overlay 'make-extent) > (defalias 'matlab-overlay-put 'set-extent-property) > (defalias 'matlab-overlay-get 'extent-property) > (defalias 'matlab-delete-overlay 'delete-extent) > (defalias 'matlab-overlay-start 'extent-start-position) > (defalias 'matlab-overlay-end 'extent-end-position) > (defalias 'matlab-previous-overlay-change 'previous-extent-change) > (defalias 'matlab-next-overlay-change 'next-extent-change) > > > Etc. > What happens if you alias those to the overlay functions defined in the fsf-compat package (overlay.el)? For example: (require 'overlay) (defalias 'matlab-make-overlay 'make-overlay) (defalias 'matlab-overlay-put 'overlay-put) etc. -- = Jerry James http://www.jamezone.org/ _______________________________________________ XEmacs-Beta mailing list XEmacs-Beta(a)xemacs.org http://lists.xemacs.org/mailman/listinfo/xemacs-beta --===============4329485096059762381==-- From Eric.Ludlam at mathworks.com Mon Feb 27 01:22:17 2017 Content-Type: multipart/mixed; boundary="===============2433030593422558061==" MIME-Version: 1.0 From: Eric Ludlam To: xemacs-beta at xemacs.org Subject: RE: problems with make-extent in matlab.el using the matlab debugger. Date: 2011-01-12 16:10:51 +0000 Message-ID: In-Reply-To: 87k4icj2o8.fsf@gilgamesch.quim.ucm.es --===============2433030593422558061== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, I remember having trouble getting the below to work when the text being mat= ched was split between multiple calls to the process filter. Perhaps I err= oneously ended up with something that fit Emacs' timing, but not XEmacs? Also, I think you have an older version of matlab.el. Try out the latest v= ersion from CVS and perhaps that will help. Thanks Eric -----Original Message----- From: Uwe Brauer [mailto:oub.oub.oub(a)gmail.com] On Behalf Of Uwe Brauer Sent: Monday, January 10, 2011 8:42 AM To: XEmacs Beta Discussion Cc: Eric Ludlam Subject: problems with make-extent in matlab.el using the matlab debugger. Hello I am not sure whether the problem I describe has to do with the implementation of make-extent in xemacs or the problems lies in a different part of the code. Matlab.el (version 3.1.1) allows to debug matlab code. During the debugging matlab.el, split the window, opens the file you debug, the cursor jumps from line to line and show in the other window via the matlab-shell the result of the executed command. = However GNU emacs and Xemacs behave differently = In GNU emacs you see in the matlab-shell buffer = Someting like = 1 tspan=3D[0 1] Where 1 is underlined and clicking with the mouse on it is jumps to the matlab file which is debugged. In Xemacs however the matlab-buffer displays = 1 tspan=3D[0 1] Which I find very annoying. I tried to debug it but can localise the problem. It seems to me the issue is the code = (defun matlab-shell-render-errors-as-anchor (str) "Detect non-url errors, and treat them as if they were url anchors. Argument STR is the text that might have errors in it." (when (string-match matlab-shell-error-stack-end str) (save-excursion (when (re-search-backward matlab-shell-error-stack-start nil t) (let ((groupend nil) (first nil)) (save-excursion (setq groupend (re-search-forward matlab-shell-error-stack-end)) ) ;; We have found an error stack to investigate. (while (re-search-forward gud-matlab-error-regexp nil t) (let* ((err-start (match-beginning 0)) (err-end (match-end 0)) (err-text (match-string 0)) (err-file (match-string 2)) (err-line (match-string 3)) (o (matlab-make-overlay err-start err-end)) (url (concat "opentoline('" err-file "'," err-line ",0)")) ) = (matlab-overlay-put o 'mouse-face 'highlight) (matlab-overlay-put o 'face 'underline) ;; The url will recycle opentoline code. (matlab-overlay-put o 'matlab-url url) (matlab-overlay-put o 'keymap matlab-shell-html-map) ;; Keep track of the very first error in this error stack. ;; It will represent the "place to go" for "go-to-last-error". (matlab-overlay-put o 'first-in-error-stack first) (when (not first) (setq first url)) )) ))))) Where the various overlay functions are defaliases to = (defalias 'matlab-make-overlay 'make-extent) (defalias 'matlab-overlay-put 'set-extent-property) (defalias 'matlab-overlay-get 'extent-property) (defalias 'matlab-delete-overlay 'delete-extent) (defalias 'matlab-overlay-start 'extent-start-position) (defalias 'matlab-overlay-end 'extent-end-position) (defalias 'matlab-previous-overlay-change 'previous-extent-change) (defalias 'matlab-next-overlay-change 'next-extent-change) Etc. So since GNU emacs and Xemacs behave so differently I thought that maybe make-extent and friend a implemented in a different way. Anybody has an idea? regards Uwe Brauer = _______________________________________________ XEmacs-Beta mailing list XEmacs-Beta(a)xemacs.org http://lists.xemacs.org/mailman/listinfo/xemacs-beta --===============2433030593422558061==--