]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-ctags.el
Update copyright year to 2016
[gnu-emacs] / lisp / org / org-ctags.el
index 833c1dd6c1eaab6f7266fe8da83b05bfe30cb8d2..ea4f52b586e9a9c9bef6d5b2400b6e98fa1d488c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-ctags.el - Integrate Emacs "tags" facility with org mode.
 ;;
-;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: Paul Sexton <eeeickythump@gmail.com>
 
 ;; with the same name as the link; then, if unsuccessful, ask the user if
 ;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
 ;; the user wishes to append 'tag' as a new toplevel heading at the end of
-;; the buffer; and finally, defer to org's default behaviour which is to
+;; the buffer; and finally, defer to org's default behavior which is to
 ;; search the entire text of the current buffer for 'tag'.
 ;;
-;; This behaviour can be modified by changing the value of
+;; This behavior can be modified by changing the value of
 ;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
-;; .emacs, which describes the same behaviour as the above paragraph with
+;; .emacs, which describes the same behavior as the above paragraph with
 ;; one difference:
 ;;
 ;; (setq org-ctags-open-link-functions
 ;;       '(org-ctags-find-tag
 ;;         org-ctags-ask-rebuild-tags-file-then-find-tag
 ;;         org-ctags-ask-append-topic
-;;         org-ctags-fail-silently))  ; <-- prevents org default behaviour
+;;         org-ctags-fail-silently))  ; <-- prevents org default behavior
 ;;
 ;;
 ;; Usage
 ;;
 ;;     (progn
 ;;       (message "-- rebuilding tags tables...")
-;;       (mapc 'org-create-tags tags-table-list))
+;;       (mapc 'org-ctags-create-tags tags-table-list))
 
 ;;; Code:
 
@@ -156,11 +156,8 @@ Format is: /REGEXP/TAGNAME/FLAGS,TAGTYPE/
 See the ctags documentation for more information.")
 
 (defcustom org-ctags-path-to-ctags
-  (case system-type
-    (windows-nt "ctags.exe")
-    (darwin "ctags-exuberant")
-    (t "ctags-exuberant"))
-  "Full path to the ctags executable file."
+  (if (executable-find "ctags-exuberant") "ctags-exuberant" "ctags")
+  "Name of the ctags executable file."
   :group 'org-ctags
   :version "24.1"
   :type 'file)
@@ -397,7 +394,8 @@ the new file."
       (org-open-file filename t))
      ((or (eql create t)
           (and (eql create 'ask)
-               (y-or-n-p (format "File `%s.org' not found; create?" name))))
+               (y-or-n-p (format-message
+                         "File `%s.org' not found; create?" name))))
       (org-ctags-open-file filename name))
      (t ;; File does not exist, and we don't want to create it.
       nil))))
@@ -436,8 +434,8 @@ the heading a destination for the tag `NAME'."
   "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
 Wrapper for org-ctags-append-topic, which first asks the user if they want
 to append a new topic."
-  (if (y-or-n-p (format "Topic `%s' not found; append to end of buffer?"
-                        name))
+  (if (y-or-n-p (format-message
+                "Topic `%s' not found; append to end of buffer?" name))
       (org-ctags-append-topic name narrowp)
     nil))
 
@@ -458,7 +456,7 @@ to rebuild (update) the TAGS file."
 Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
   (if (and (buffer-file-name)
           (y-or-n-p
-           (format
+           (format-message
             "Tag `%s' not found.  Rebuild table `%s/TAGS' and look again?"
             name
             (file-name-directory (buffer-file-name)))))