Function: org-ctags-create-tags
org-ctags-create-tags is an interactive and byte-compiled function
defined in org-ctags.el.gz.
Signature
(org-ctags-create-tags &optional DIRECTORY-NAME)
Documentation
(Re)create tags file in the directory of the active buffer.
The file will contain tag definitions for all the files in the
directory and its subdirectories which are recognized by ctags.
This will include files ending in .org as well as most other
source files (.C, .H, .EL, .LISP, etc). All the resulting tags
end up in one file, called TAGS, located in the directory. This
function may take several seconds to finish if the directory or
its subdirectories contain large numbers of taggable files.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-ctags.el.gz
;;; User-visible functions ===================================================
(defun org-ctags-create-tags (&optional directory-name)
"(Re)create tags file in the directory of the active buffer.
The file will contain tag definitions for all the files in the
directory and its subdirectories which are recognized by ctags.
This will include files ending in `.org' as well as most other
source files (.C, .H, .EL, .LISP, etc). All the resulting tags
end up in one file, called TAGS, located in the directory. This
function may take several seconds to finish if the directory or
its subdirectories contain large numbers of taggable files."
(interactive)
(cl-assert (buffer-file-name))
(let ((dir-name (shell-quote-argument
(expand-file-name
(if directory-name
(file-name-as-directory directory-name)
(file-name-directory (buffer-file-name))))))
(exitcode nil))
(save-excursion
(setq exitcode
(shell-command
(format (concat "%s --langdef=orgmode --langmap=orgmode:.org "
"--regex-orgmode=%s -f %sTAGS -e -R %s*")
org-ctags-path-to-ctags
(shell-quote-argument org-ctags-tag-regexp)
dir-name
dir-name)))
(cond
((eql 0 exitcode)
(setq-local org-ctags-tag-list
(org-ctags-all-tags-in-current-tags-table)))
(t
;; This seems to behave differently on Linux, so just ignore
;; error codes for now
;;(error "Calling ctags executable resulted in error code: %s"
;; exitcode)
nil)))))