org-ctags: Silence byte-compiler

* lisp/org-ctags.el (y-or-n-minibuffer): Remove function.
(org-ctags-find-tag):
(org-ctags-find-tag-interactive): Use `xref-find-definitions' instead of
`find-tag'.
This commit is contained in:
Nicolas Goaziou 2015-11-13 23:21:26 +01:00
parent 7f937b3cea
commit cfbd2b516b
2 changed files with 9 additions and 13 deletions

View File

@ -540,7 +540,7 @@ Implements `file-equal-p' for older emacsen and XEmacs."
(/= (- (point-max) (point-min)) (buffer-size)))) (/= (- (point-max) (point-min)) (buffer-size))))
;; As of Emacs 25.1, `outline-mode` functions are under the 'outline-' ;; As of Emacs 25.1, `outline-mode` functions are under the 'outline-'
;; prefix. ;; prefix and `find-tag` is replaced with `xref-find-definition`.
(when (< emacs-major-version 25) (when (< emacs-major-version 25)
(defalias 'outline-show-all 'show-all) (defalias 'outline-show-all 'show-all)
(defalias 'outline-hide-subtree 'hide-subtree) (defalias 'outline-hide-subtree 'hide-subtree)
@ -548,7 +548,8 @@ Implements `file-equal-p' for older emacsen and XEmacs."
(defalias 'outline-show-branches 'show-branches) (defalias 'outline-show-branches 'show-branches)
(defalias 'outline-show-entry 'show-entry) (defalias 'outline-show-entry 'show-entry)
(defalias 'outline-hide-entry 'hide-entry) (defalias 'outline-hide-entry 'hide-entry)
(defalias 'outline-hide-sublevels 'hide-sublevels)) (defalias 'outline-hide-sublevels 'hide-sublevels)
(defalias 'xref-find-definitions 'find-tag))
(defmacro org-with-silent-modifications (&rest body) (defmacro org-with-silent-modifications (&rest body)
(if (fboundp 'with-silent-modifications) (if (fboundp 'with-silent-modifications)

View File

@ -273,11 +273,6 @@ Return the list."
(replace-regexp-in-string (regexp-quote search) replace string t t)) (replace-regexp-in-string (regexp-quote search) replace string t t))
(defun y-or-n-minibuffer (prompt)
(let ((use-dialog-box nil))
(y-or-n-p prompt)))
;;; Internal functions ======================================================= ;;; Internal functions =======================================================
@ -302,12 +297,12 @@ The new topic will be titled NAME (or TITLE if supplied)."
;;;; Misc interoperability with etags system ================================= ;;;; Misc interoperability with etags system =================================
(defadvice find-tag (before org-ctags-set-org-mark-before-finding-tag (defadvice xref-find-definitions
activate compile) (before org-ctags-set-org-mark-before-finding-tag activate compile)
"Before trying to find a tag, save our current position on org mark ring." "Before trying to find a tag, save our current position on org mark ring."
(save-excursion (save-excursion
(if (and (derived-mode-p 'org-mode) org-ctags-enabled-p) (when (and (derived-mode-p 'org-mode) org-ctags-enabled-p)
(org-mark-ring-push)))) (org-mark-ring-push))))
@ -359,7 +354,7 @@ visit the file and location where the tag is found."
(old-pnt (point-marker)) (old-pnt (point-marker))
(old-mark (copy-marker (mark-marker)))) (old-mark (copy-marker (mark-marker))))
(condition-case nil (condition-case nil
(progn (find-tag name) (progn (xref-find-definitions name)
t) t)
(error (error
;; only restore old location if find-tag raises error ;; only restore old location if find-tag raises error
@ -528,7 +523,7 @@ a new topic."
((member tag org-ctags-tag-list) ((member tag org-ctags-tag-list)
;; Existing tag ;; Existing tag
(push tag org-ctags-find-tag-history) (push tag org-ctags-find-tag-history)
(find-tag tag)) (xref-find-definitions tag))
(t (t
;; New tag ;; New tag
(run-hook-with-args-until-success (run-hook-with-args-until-success