unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37816: [PATCH] Remove XEmacs compat code from icalendar.el
@ 2019-10-18 20:27 Stefan Kangas
  2019-10-21 16:37 ` Ulf Jasper
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2019-10-18 20:27 UTC (permalink / raw)
  To: 37816

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

Package: emacs
Version: 27.0.50
Severity: wishlist
X-Debbugs-CC: ulf.jasper@web.de

Any objections to pushing this?

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Remove-XEmacs-compat-code-from-icalendar.el.patch --]
[-- Type: application/octet-stream, Size: 7270 bytes --]

From 13377b32ed76a3c11678ab642ac41999aab8148b Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 18 Oct 2019 21:51:07 +0200
Subject: [PATCH] Remove XEmacs compat code from icalendar.el

* lisp/calendar/icalendar.el (icalendar--convert-string-for-export)
(icalendar--convert-string-for-import)
(icalendar--parse-summary-and-rest)
(icalendar--convert-ordinary-to-ical)
(icalendar--convert-weekly-to-ical)
(icalendar--convert-yearly-to-ical)
(icalendar--convert-block-to-ical)
(icalendar--convert-cyclic-to-ical)
(icalendar--convert-anniversary-to-ical)
(icalendar--format-ical-event)
(icalendar--convert-recurring-to-diary): Remove XEmacs compat code.
(icalendar--rris): Declare obsolete.
---
 lisp/calendar/icalendar.el | 43 +++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 3ae0fcbe97..55d0f4238b 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -347,14 +347,9 @@ icalendar--clean-up-line-endings
 (defsubst icalendar--rris (regexp rep string &optional fixedcase literal)
   "Replace regular expression in string.
 Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to
-`replace-regexp-in-string' (Emacs) or to `replace-in-string' (XEmacs)."
-  (cond ((fboundp 'replace-regexp-in-string)
-         ;; Emacs:
-         (replace-regexp-in-string regexp rep string fixedcase literal))
-        ((fboundp 'replace-in-string)
-         ;; XEmacs:
-         (save-match-data ;; apparently XEmacs needs save-match-data
-           (replace-in-string string regexp rep literal)))))
+`replace-regexp-in-string'."
+  (declare (obsolete replace-regexp-in-string "27.1"))
+  (replace-regexp-in-string regexp rep string fixedcase literal))
 
 (defun icalendar--read-element (invalue inparams)
   "Recursively read the next iCalendar element in the current buffer.
@@ -978,14 +973,14 @@ icalendar--diarytime-to-isotime
 
 (defun icalendar--convert-string-for-export (string)
   "Escape comma and other critical characters in STRING."
-  (icalendar--rris "," "\\\\," string))
+  (replace-regexp-in-string "," "\\\\," string))
 
 (defun icalendar--convert-string-for-import (string)
   "Remove escape chars for comma, semicolon etc. from STRING."
-  (icalendar--rris
-   "\\\\n" "\n " (icalendar--rris
-                  "\\\\\"" "\"" (icalendar--rris
-                                 "\\\\;" ";" (icalendar--rris
+  (replace-regexp-in-string
+   "\\\\n" "\n " (replace-regexp-in-string
+                  "\\\\\"" "\"" (replace-regexp-in-string
+                                 "\\\\;" ";" (replace-regexp-in-string
                                               "\\\\," "," string)))))
 
 ;; ======================================================================
@@ -1232,7 +1227,7 @@ icalendar--parse-summary-and-rest
 		 (setq ct (+ ct 1))
                  (setq pos-uid (* 2 ct)))) )
         (mapc (lambda (ij)
-                (setq s (icalendar--rris (car ij) (cadr ij) s t t)))
+                (setq s (replace-regexp-in-string (car ij) (cadr ij) s t t)))
               (list
                ;; summary must be first! because of %s
                (list "%s"
@@ -1253,7 +1248,7 @@ icalendar--parse-summary-and-rest
                      (concat "\\(" icalendar-import-format-uid "\\)??"))))
 	;; Need the \' regexp in order to detect multi-line items
         (setq s (concat "\\`"
-			   (icalendar--rris "%s" "\\(.*?\\)" s nil t)
+			   (replace-regexp-in-string "%s" "\\(.*?\\)" s nil t)
                         "\\'"))
         (if (string-match s summary-and-rest)
             (let (cla des loc org sta url uid) ;; sum
@@ -1395,7 +1390,7 @@ icalendar--convert-ordinary-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time
-                   (read (icalendar--rris "^T0?" ""
+                   (read (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (if (< time 230000)
                   ;; Case: ends on same day
@@ -1483,7 +1478,7 @@ icalendar--convert-weekly-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time (read
-                         (icalendar--rris "^T0?" ""
+                         (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (setq endtimestring (format "T%06d"
                                           (+ 10000 time))))))
@@ -1570,7 +1565,7 @@ icalendar--convert-yearly-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time (read
-                         (icalendar--rris "^T0?" ""
+                         (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (setq endtimestring (format "T%06d"
                                           (+ 10000 time))))))
@@ -1704,7 +1699,7 @@ icalendar--convert-block-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time
-                   (read (icalendar--rris "^T0?" ""
+                   (read (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (setq endtimestring (format "T%06d"
                                           (+ 10000 time))))))
@@ -1857,7 +1852,7 @@ icalendar--convert-cyclic-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time
-                   (read (icalendar--rris "^T0?" ""
+                   (read (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (setq endtimestring (format "T%06d"
                                           (+ 10000 time))))))
@@ -1926,7 +1921,7 @@ icalendar--convert-anniversary-to-ical
         (when starttimestring
           (unless endtimestring
             (let ((time
-                   (read (icalendar--rris "^T0?" ""
+                   (read (replace-regexp-in-string "^T0?" ""
                                           starttimestring))))
               (setq endtimestring (format "T%06d"
                                           (+ 10000 time))))))
@@ -2051,12 +2046,12 @@ icalendar--format-ical-event
 		   (formatted-contents ""))
 	      (when (and contents (> (length contents) 0))
 		(setq formatted-contents
-		      (icalendar--rris "%s"
+		      (replace-regexp-in-string "%s"
 				       (icalendar--convert-string-for-import
 					contents)
 				       (symbol-value format)
 				       t t)))
-	      (setq string (icalendar--rris spec
+	      (setq string (replace-regexp-in-string spec
 					    formatted-contents
 					    string
 					    t t))))
@@ -2450,7 +2445,7 @@ icalendar--convert-recurring-to-diary
                (ex-d (icalendar--datetime-to-diary-date
                       ex-start)))
           (setq result
-                (icalendar--rris "^%%(\\(and \\)?"
+                (replace-regexp-in-string "^%%(\\(and \\)?"
                                  (format
                                   "%%%%(and (not (diary-date %s)) "
                                   ex-d)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#37816: [PATCH] Remove XEmacs compat code from icalendar.el
  2019-10-18 20:27 bug#37816: [PATCH] Remove XEmacs compat code from icalendar.el Stefan Kangas
@ 2019-10-21 16:37 ` Ulf Jasper
  2019-10-21 16:56   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Jasper @ 2019-10-21 16:37 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 37816

Am 18.10.2019 um 22:27 (+0200) schrieb Stefan Kangas:
> Any objections to pushing this?

No objections from me.  Push!

Best,
Ulf





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#37816: [PATCH] Remove XEmacs compat code from icalendar.el
  2019-10-21 16:37 ` Ulf Jasper
@ 2019-10-21 16:56   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2019-10-21 16:56 UTC (permalink / raw)
  To: Ulf Jasper; +Cc: 37816-done

Ulf Jasper <ulf.jasper@web.de> writes:
> > Any objections to pushing this?
>
> No objections from me.  Push!

Thanks.  Pushed to master as commit 8f9ed4c71d.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-21 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 20:27 bug#37816: [PATCH] Remove XEmacs compat code from icalendar.el Stefan Kangas
2019-10-21 16:37 ` Ulf Jasper
2019-10-21 16:56   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).