From 85aa6ede9fe1b8165a99a4046dd8262ec93a02d5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 30 May 2015 09:43:57 -0700 Subject: [PATCH] Use \r rather than ^M in string literals This is less likely to cause problems on platforms that use CRLF (or CR!) termination for lines. --- lisp/cedet/semantic/grammar-wy.el | 4 ++-- lisp/gnus/nnimap.el | 2 +- lisp/org/org.el | 6 +++--- lisp/progmodes/vhdl-mode.el | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el index fba8adfcd75..4b59e17f1e0 100644 --- a/lisp/cedet/semantic/grammar-wy.el +++ b/lisp/cedet/semantic/grammar-wy.el @@ -387,12 +387,12 @@ (let ((s $1)) (if - (string-match "^{[ \n ]*" s) + (string-match "^{[\r\n\t ]*" s) (setq s (substring s (match-end 0)))) (if - (string-match "[ \n ]*}$" s) + (string-match "[\r\n\t ]*}$" s) (setq s (substring s 0 (match-beginning 0)))) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index c476be6bc8d..208fd073caf 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1266,7 +1266,7 @@ If LIMIT, first try to limit the search to the N last articles." (progn (skip-chars-forward " \"") (point)) (progn (end-of-line) - (skip-chars-backward " \"") + (skip-chars-backward " \r\"") (point))))) (unless (member '%NoSelect flags) (push (utf7-decode (if (stringp group) diff --git a/lisp/org/org.el b/lisp/org/org.el index 29ef8efb640..e9dae191b99 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -16955,12 +16955,12 @@ Allowed values for TYPE are: When TYPE is nil, fall back on returning a regexp that matches both scheduled and deadline timestamps." - (cond ((eq type 'all) "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?: +[^]+0-9> \n -]+\\)?\\(?: +[0-9]\\{1,2\\}:[0-9]\\{2\\}\\)?\\)") + (cond ((eq type 'all) "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?: +[^]+0-9>\r\n -]+\\)?\\(?: +[0-9]\\{1,2\\}:[0-9]\\{2\\}\\)?\\)") ((eq type 'active) org-ts-regexp) - ((eq type 'inactive) "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^ \n>]*?\\)\\]") + ((eq type 'inactive) "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)\\]") ((eq type 'scheduled) (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>")) ((eq type 'deadline) (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")) - ((eq type 'closed) (concat org-closed-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^ \n>]*?\\)\\]")) + ((eq type 'closed) (concat org-closed-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)\\]")) ((eq type 'scheduled-or-deadline) (concat "\\<\\(?:" org-deadline-string "\\|" org-scheduled-string "\\) *<\\([^>]+\\)>")))) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index eb234944904..f85f4c4fada 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -8270,7 +8270,7 @@ case fixing to a region. Calls functions `vhdl-indent-buffer', (setq end (save-excursion (goto-char end) (point-marker))) (save-excursion ; remove DOS EOL characters in UNIX file (goto-char beg) - (while (search-forward " " nil t) + (while (search-forward "\r" nil t) (replace-match "" nil t))) (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t)) (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end)) -- 2.11.4.GIT