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

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

[elpa] externals/compat 0d88e93bdf: compat-27: Mark compat--dired-get-ma


From: ELPA Syncer
Subject: [elpa] externals/compat 0d88e93bdf: compat-27: Mark compat--dired-get-marked-files as obsolete
Date: Tue, 31 Jan 2023 08:33:30 -0500 (EST)

branch: externals/compat
commit 0d88e93bdfd4859238e6b114eb24585aaef6560d
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    compat-27: Mark compat--dired-get-marked-files as obsolete
    
    See https://github.com/magit/magit/pull/4867
---
 NEWS.org        |   1 +
 compat-27.el    |   5 +-
 compat-macs.el  |   2 +-
 compat-tests.el |   5 --
 compat.texi     | 190 +++++++++++++++++++++++++++-----------------------------
 5 files changed, 96 insertions(+), 107 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index c114b3bba4..04ae9cb191 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -3,6 +3,7 @@
 * Development
 
 - compat-26: Add ~make-temp-file~ with optional argument TEXT.
+- compat-27: Mark ~compat-call dired-get-marked-files~ as obsolete.
 - compat-29: Add ~funcall-with-delayed-message~ and ~with-delayed-message~.
 - compat-29: Add ~ert-with-temp-file~ and ~ert-with-temp-directory~.
 - compat-29: Add ~set-transient-map~ with optional arguments MESSAGE and 
TIMEOUT.
diff --git a/compat-27.el b/compat-27.el
index 5d23529baf..2be27a6785 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -566,9 +566,10 @@ The return value is a string (or nil in case we can’t find 
it)."
 
 ;;;; Defined in dired.el
 
-(compat-defun dired-get-marked-files ;; <compat-tests:dired-get-marked-files>
+(compat-defun dired-get-marked-files
     (&optional localp arg filter distinguish-one-marked error)
-  "Handle optional argument ERROR."
+  "Obsolete function."
+  :obsolete "The compatibility function has been made obsolete."
   :feature dired
   :extended t
   (let ((result (dired-get-marked-files localp arg filter 
distinguish-one-marked)))
diff --git a/compat-macs.el b/compat-macs.el
index 4b2368bf17..25b1088b1a 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -137,7 +137,7 @@ REST are attributes and the function BODY."
               (list def))
           ,@(when obsolete
               `((make-obsolete
-                 ',name ,(if (stringp obsolete) obsolete "No substitute")
+                 ',defname ,(if (stringp obsolete) obsolete "No substitute")
                  ,compat-macs--version))))))))
 
 (defmacro compat-guard (cond &rest rest)
diff --git a/compat-tests.el b/compat-tests.el
index 2e2d0d2866..7cd67d0a33 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2713,11 +2713,6 @@
                  ))
     (should-not (string-match-p regexp-unmatchable str))))
 
-(declare-function dired-get-marked-files "dired")
-(ert-deftest dired-get-marked-files ()
-  (require 'dired)
-  (should-error (compat-call dired-get-marked-files nil nil nil nil t)))
-
 (ert-deftest use-region ()
   (with-temp-buffer
     (insert "abc\ndef\n")
diff --git a/compat.texi b/compat.texi
index b5fd2dc64e..b2f4878d84 100644
--- a/compat.texi
+++ b/compat.texi
@@ -1361,6 +1361,97 @@ This function creates an empty file named 
@var{filename}.  As
 function signals an error.
 @end defun
 
+@defun text-property-search-forward prop &optional value predicate not-current
+Search for the next region that has text property @var{prop} set to
+@var{value} according to @var{predicate}.
+
+This function is modeled after @code{search-forward} and friends in
+that it moves point, but it returns a structure that describes the
+match instead of returning it in @code{match-beginning} and friends.
+
+If the text property can't be found, the function returns @code{nil}.
+If it's found, point is placed at the end of the region that has this
+text property match, and a @code{prop-match} structure is returned.
+
+@var{predicate} can either be @code{t} (which is a synonym for
+@code{equal}), @code{nil} (which means ``not equal''), or a predicate
+that will be called with two parameters: The first is @var{value}, and
+the second is the value of the text property we're inspecting.
+
+If @var{not-current}, if point is in a region where we have a match,
+then skip past that and find the next instance instead.
+
+The @code{prop-match} structure has the following accessors:
+@code{prop-match-beginning} (the start of the match),
+@code{prop-match-end} (the end of the match), and
+@code{prop-match-value} (the value of @var{property} at the start of
+the match).
+
+In the examples below, imagine that you're in a buffer that looks like
+this:
+
+@example
+This is a bold and here's bolditalic and this is the end.
+@end example
+
+That is, the ``bold'' words are the @code{bold} face, and the
+``italic'' word is in the @code{italic} face.
+
+With point at the start:
+
+@lisp
+(while (setq match (text-property-search-forward 'face 'bold t))
+  (push (buffer-substring (prop-match-beginning match)
+                          (prop-match-end match))
+        words))
+@end lisp
+
+This will pick out all the words that use the @code{bold} face.
+
+@lisp
+(while (setq match (text-property-search-forward 'face nil t))
+  (push (buffer-substring (prop-match-beginning match)
+                          (prop-match-end match))
+        words))
+@end lisp
+
+This will pick out all the bits that have no face properties, which
+will result in the list @samp{("This is a " "and here's " "and this is
+the end")} (only reversed, since we used @code{push}).
+
+@lisp
+(while (setq match (text-property-search-forward 'face nil nil))
+  (push (buffer-substring (prop-match-beginning match)
+                          (prop-match-end match))
+        words))
+@end lisp
+
+This will pick out all the regions where @code{face} is set to
+something, but this is split up into where the properties change, so
+the result here will be @samp{("bold" "bold" "italic")}.
+
+For a more realistic example where you might use this, consider that
+you have a buffer where certain sections represent URLs, and these are
+tagged with @code{shr-url}.
+
+@lisp
+(while (setq match (text-property-search-forward 'shr-url nil nil))
+  (push (prop-match-value match) urls))
+@end lisp
+
+This will give you a list of all those URLs.
+
+@xref{elisp,,,Property Search}.
+@end defun
+
+@defun text-property-search-backward prop &optional value predicate not-current
+This is just like @code{text-property-search-forward}, but searches
+backward instead.  Point is placed at the beginning of the matched
+region instead of the end, though.
+
+@xref{elisp,,,Property Search}.
+@end defun
+
 @subsection Extended Definitions
 These functions must be called explicitly via @code{compat-call},
 since their calling convention or behavior was extended in Emacs 27.1:
@@ -1483,105 +1574,6 @@ This compatibility version adds support to handle the 
optional second
 (@var{remote}) argument.
 @end defun
 
-@defun compat-call@ dired-get-marked-files &optional localp arg filter 
distinguish-one-marked error
-Return a list of file names that are @emph{marked} in a Dired buffer.
-
-This compatibility version handles the optional fifth (@var{error})
-argument, which signals an error if the list of found files is empty.
-@code{error} can be a string with the error message.
-@end defun
-
-@defun text-property-search-forward prop &optional value predicate not-current
-Search for the next region that has text property @var{prop} set to
-@var{value} according to @var{predicate}.
-
-This function is modeled after @code{search-forward} and friends in
-that it moves point, but it returns a structure that describes the
-match instead of returning it in @code{match-beginning} and friends.
-
-If the text property can't be found, the function returns @code{nil}.
-If it's found, point is placed at the end of the region that has this
-text property match, and a @code{prop-match} structure is returned.
-
-@var{predicate} can either be @code{t} (which is a synonym for
-@code{equal}), @code{nil} (which means ``not equal''), or a predicate
-that will be called with two parameters: The first is @var{value}, and
-the second is the value of the text property we're inspecting.
-
-If @var{not-current}, if point is in a region where we have a match,
-then skip past that and find the next instance instead.
-
-The @code{prop-match} structure has the following accessors:
-@code{prop-match-beginning} (the start of the match),
-@code{prop-match-end} (the end of the match), and
-@code{prop-match-value} (the value of @var{property} at the start of
-the match).
-
-In the examples below, imagine that you're in a buffer that looks like
-this:
-
-@example
-This is a bold and here's bolditalic and this is the end.
-@end example
-
-That is, the ``bold'' words are the @code{bold} face, and the
-``italic'' word is in the @code{italic} face.
-
-With point at the start:
-
-@lisp
-(while (setq match (text-property-search-forward 'face 'bold t))
-  (push (buffer-substring (prop-match-beginning match)
-                          (prop-match-end match))
-        words))
-@end lisp
-
-This will pick out all the words that use the @code{bold} face.
-
-@lisp
-(while (setq match (text-property-search-forward 'face nil t))
-  (push (buffer-substring (prop-match-beginning match)
-                          (prop-match-end match))
-        words))
-@end lisp
-
-This will pick out all the bits that have no face properties, which
-will result in the list @samp{("This is a " "and here's " "and this is
-the end")} (only reversed, since we used @code{push}).
-
-@lisp
-(while (setq match (text-property-search-forward 'face nil nil))
-  (push (buffer-substring (prop-match-beginning match)
-                          (prop-match-end match))
-        words))
-@end lisp
-
-This will pick out all the regions where @code{face} is set to
-something, but this is split up into where the properties change, so
-the result here will be @samp{("bold" "bold" "italic")}.
-
-For a more realistic example where you might use this, consider that
-you have a buffer where certain sections represent URLs, and these are
-tagged with @code{shr-url}.
-
-@lisp
-(while (setq match (text-property-search-forward 'shr-url nil nil))
-  (push (prop-match-value match) urls))
-@end lisp
-
-This will give you a list of all those URLs.
-
-@xref{elisp,,,Property Search}.
-@end defun
-
-@defun text-property-search-backward prop &optional value predicate not-current
-This is just like @code{text-property-search-forward}, but searches
-backward instead.  Point is placed at the beginning of the matched
-region instead of the end, though.
-
-@xref{elisp,,,Property Search}.
-@end defun
-
 @subsection Missing Definitions
 Compat does not provide support for the following Lisp features
 implemented in 27.1:



reply via email to

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