org-ctags: Use lexical binding

* lisp/org-ctags.el (org-ctags-open-file):
(org-ctags-fail-silently): Silence byte-compiler.
This commit is contained in:
Nicolas Goaziou 2016-06-20 15:04:33 +02:00
parent b67a3ff715
commit 7d3380612f
1 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
;;; org-ctags.el - Integrate Emacs "tags" facility with org mode. ;;; org-ctags.el - Integrate Emacs "tags" Facility with Org -*- lexical-binding: t; -*-
;; ;;
;; Copyright (C) 2007-2016 Free Software Foundation, Inc. ;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
@ -280,18 +280,17 @@ Return the list."
"Visit or create a file called `NAME.org', and insert a new topic. "Visit or create a file called `NAME.org', and insert a new topic.
The new topic will be titled NAME (or TITLE if supplied)." The new topic will be titled NAME (or TITLE if supplied)."
(interactive "sFile name: ") (interactive "sFile name: ")
(let ((filename (substitute-in-file-name (expand-file-name name)))) (condition-case v
(condition-case v (progn
(progn (org-open-file name t)
(org-open-file name t) (message "Opened file OK")
(message "Opened file OK") (goto-char (point-max))
(goto-char (point-max)) (insert (org-ctags-string-search-and-replace
(insert (org-ctags-string-search-and-replace "%t" (capitalize (or title name))
"%t" (capitalize (or title name)) org-ctags-new-topic-template))
org-ctags-new-topic-template)) (message "Inserted new file text OK")
(message "Inserted new file text OK") (org-mode-restart))
(org-mode-restart)) (error (error "Error %S in org-ctags-open-file" v))))
(error (error "Error %S in org-ctags-open-file" v)))))
;;;; Misc interoperability with etags system ================================= ;;;; Misc interoperability with etags system =================================
@ -459,10 +458,10 @@ Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
nil)) nil))
(defun org-ctags-fail-silently (name) (defun org-ctags-fail-silently (_name)
"This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS. "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
Put as the last function in the list if you want to prevent org's default Put as the last function in the list if you want to prevent Org's
behavior of free text search." default behavior of free text search."
t) t)