]> git.eshelyaron.com Git - emacs.git/commitdiff
xref: Replace defgeneric and defmethod with cl- counterparts
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 22 Jan 2015 02:24:31 +0000 (04:24 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 22 Jan 2015 02:24:31 +0000 (04:24 +0200)
* lisp/progmodes/xref.el (xref-location-marker, xref-location-group):
Use `cl-defgeneric' and `cl-defmethod' instead of the EIEIO
counterparts.

* lisp/progmodes/etags.el (xref-location-marker): Same.

lisp/ChangeLog
lisp/progmodes/etags.el
lisp/progmodes/xref.el

index 9b50a66a39df73a4aa91503e27addf3a9392eac7..39ae463b0439e37d92bcb429ed72873d09b84f49 100644 (file)
@@ -1,5 +1,11 @@
 2015-01-22  Dmitry Gutov  <dgutov@yandex.ru>
 
+       * progmodes/xref.el (xref-location-marker, xref-location-group):
+       Use `cl-defgeneric' and `cl-defmethod' instead of the EIEIO
+       counterparts.
+
+       * progmodes/etags.el (xref-location-marker): Same.
+
        * progmodes/xref.el (xref--current): Rename from `xref--selected'.
        (xref--inhibit-mark-current): Rename from
        `xref--inhibit-mark-selected'.  Update the usages.
index dc3380d02f6c87065145d2f1fd4104129696ea09..626855ecdd42cbf8749e5becc243fde23e45048e 100644 (file)
@@ -2122,7 +2122,7 @@ for \\[find-tag] (which see)."
   (make-instance 'xref-etags-location :tag-info tag-info
                  :file (expand-file-name file)))
 
-(defmethod xref-location-marker ((l xref-etags-location))
+(cl-defmethod xref-location-marker ((l xref-etags-location))
   (with-slots (tag-info file) l
     (let ((buffer (find-file-noselect file)))
       (with-current-buffer buffer
index b82cd8eaacba0e8b98f7377a4b10c445bbdf379b..55405b63fe0fbd18db2e35f640d735433cdb6e9b 100644 (file)
 
 ;; If a backend decides to subclass xref-location it can provide
 ;; methods for some of the following functions:
-(defgeneric xref-location-marker (location)
+(cl-defgeneric xref-location-marker (location)
   "Return the marker for LOCATION.")
 
-(defgeneric xref-location-group (location)
+(cl-defgeneric xref-location-group (location)
   "Return a string used to group a set of locations.
 This is typically the filename.")
 
@@ -88,7 +88,7 @@ Line numbers start from 1 and columns from 0.")
   "Create and return a new xref-file-location."
   (make-instance 'xref-file-location :file file :line line :column column))
 
-(defmethod xref-location-marker ((l xref-file-location))
+(cl-defmethod xref-location-marker ((l xref-file-location))
   (with-slots (file line column) l
     (with-current-buffer
         (or (get-file-buffer file)
@@ -102,7 +102,7 @@ Line numbers start from 1 and columns from 0.")
           (move-to-column column)
           (point-marker))))))
 
-(defmethod xref-location-group ((l xref-file-location))
+(cl-defmethod xref-location-group ((l xref-file-location))
   (oref l :file))
 
 (defclass xref-buffer-location (xref-location)
@@ -113,12 +113,12 @@ Line numbers start from 1 and columns from 0.")
   "Create and return a new xref-buffer-location."
   (make-instance 'xref-buffer-location :buffer buffer :position position))
 
-(defmethod xref-location-marker ((l xref-buffer-location))
+(cl-defmethod xref-location-marker ((l xref-buffer-location))
   (with-slots (buffer position) l
     (let ((m (make-marker)))
       (move-marker m position buffer))))
 
-(defmethod xref-location-group ((l xref-buffer-location))
+(cl-defmethod xref-location-group ((l xref-buffer-location))
   (with-slots (buffer) l
     (or (buffer-file-name buffer)
         (format "(buffer %s)" (buffer-name buffer)))))
@@ -134,10 +134,10 @@ actual location is not known.")
   "Create and return a new xref-bogus-location."
   (make-instance 'xref-bogus-location :message message))
 
-(defmethod xref-location-marker ((l xref-bogus-location))
+(cl-defmethod xref-location-marker ((l xref-bogus-location))
   (user-error "%s" (oref l :message)))
 
-(defmethod xref-location-group ((_ xref-bogus-location)) "(No location)")
+(cl-defmethod xref-location-group ((_ xref-bogus-location)) "(No location)")
 
 ;; This should be in elisp-mode.el, but it's preloaded, and we can't
 ;; preload defclass and defmethod (at least, not yet).
@@ -151,7 +151,7 @@ actual location is not known.")
 (defun xref-make-elisp-location (symbol type file)
   (make-instance 'xref-elisp-location :symbol symbol :type type :file file))
 
-(defmethod xref-location-marker ((l xref-elisp-location))
+(cl-defmethod xref-location-marker ((l xref-elisp-location))
   (with-slots (symbol type file) l
     (let ((buffer-point
            (pcase type