summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-13 23:21:26 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-13 23:21:26 +0100
commitcfbd2b516b95857e2a1764c5fd6700cd100012eb (patch)
tree45e3496e9fe39b4a34f011ab1c2a08f77aadcadf
parent7f937b3ceabd541f864820fb80b6e18b0c768184 (diff)
downloadorg-mode-cfbd2b516b95857e2a1764c5fd6700cd100012eb.tar.gz
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'.
-rw-r--r--lisp/org-compat.el5
-rw-r--r--lisp/org-ctags.el17
2 files changed, 9 insertions, 13 deletions
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index b3a43a5..8632eb6 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -540,7 +540,7 @@ Implements `file-equal-p' for older emacsen and XEmacs."
(/= (- (point-max) (point-min)) (buffer-size))))
;; 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)
(defalias 'outline-show-all 'show-all)
(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-entry 'show-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)
(if (fboundp 'with-silent-modifications)
diff --git a/lisp/org-ctags.el b/lisp/org-ctags.el
index c8c1ea1..474648f 100644
--- a/lisp/org-ctags.el
+++ b/lisp/org-ctags.el
@@ -273,11 +273,6 @@ Return the list."
(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 =======================================================
@@ -302,12 +297,12 @@ The new topic will be titled NAME (or TITLE if supplied)."
;;;; Misc interoperability with etags system =================================
-(defadvice find-tag (before org-ctags-set-org-mark-before-finding-tag
- activate compile)
+(defadvice xref-find-definitions
+ (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."
(save-excursion
- (if (and (derived-mode-p 'org-mode) org-ctags-enabled-p)
- (org-mark-ring-push))))
+ (when (and (derived-mode-p 'org-mode) org-ctags-enabled-p)
+ (org-mark-ring-push))))
@@ -359,7 +354,7 @@ visit the file and location where the tag is found."
(old-pnt (point-marker))
(old-mark (copy-marker (mark-marker))))
(condition-case nil
- (progn (find-tag name)
+ (progn (xref-find-definitions name)
t)
(error
;; only restore old location if find-tag raises error
@@ -528,7 +523,7 @@ a new topic."
((member tag org-ctags-tag-list)
;; Existing tag
(push tag org-ctags-find-tag-history)
- (find-tag tag))
+ (xref-find-definitions tag))
(t
;; New tag
(run-hook-with-args-until-success