emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/lua-mode 78f7b78 014/468: emacs-compatibility: replace-in-


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 78f7b78 014/468: emacs-compatibility: replace-in-string not available on GNU emacs
Date: Thu, 5 Aug 2021 04:57:59 -0400 (EDT)

branch: elpa/lua-mode
commit 78f7b78d89f28ecfa37b64c76f6c20f4505cad40
Author: juergen <juergen>
Commit: juergen <juergen>

    emacs-compatibility: replace-in-string not available on GNU emacs
    xemacs-compatibility: fixed lua-traceback-line-re
---
 lua-mode.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index eca75a4..41f4c0f 100755
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -28,7 +28,7 @@
 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 ;; MA 02110-1301, USA.
 
-(defconst lua-version "20060620"
+(defconst lua-version "20060625"
   "Lua Mode version number.")
 
 ;; Keywords: languages, processes, tools
@@ -136,7 +136,7 @@ Should be a list of strings."
   )
 
 (defcustom lua-traceback-line-re
-  "\\(?:^[\t ]*\\|>[\t ]+\\)\\([^\n\t ]+\\):\\([0-9]+\\):"
+  "^\\(?:[\t ]*\\|.*>[\t ]+\\)\\([^\n\t ]+\\):\\([0-9]+\\):"
   "Regular expression that describes tracebacks and errors."
   :group 'lua
   :type  'regexp
@@ -248,6 +248,14 @@ traceback location."
           temporary-file-directory))))))
 
 ;;}}}
+;;{{{ replace-in-string
+
+(eval-and-compile
+  (if (not (fboundp 'replace-in-string)) ;GNU emacs doesn't have it
+      (defun replace-in-string  (string regexp newtext &optional literal)
+       (replace-regexp-in-string regexp newtext string nil literal))))
+
+;;}}}
 ;;{{{ lua-mode
 
 ;;;###autoload
@@ -1015,8 +1023,7 @@ If `lua-process' is nil or dead, start a new process 
first."
       (setq last-prompt (count-lines (point-min) (point-max)))
       (comint-simple-send (get-buffer-process (current-buffer)) 
                          (format "dofile(\"%s\")"  
-                                 (replace-regexp-in-string 
-                                  "\\\\" "\\\\\\\\" tempfile)))
+                                 (replace-in-string tempfile "\\\\" "\\\\\\\\" 
)))
       ;; wait for prompt
       (while (not prompt-found) 
        (accept-process-output (get-buffer-process (current-buffer)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]