From: Aaron Ecay <aaronecay@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix several byte-compile warnings in org-contrib files
Date: Sun, 31 Mar 2013 22:24:43 -0400 [thread overview]
Message-ID: <1364783083-3175-1-git-send-email-aaronecay@gmail.com> (raw)
* contrib/lisp/org-bibtex-extras.el: convert to using cl-lib functions
(obe-bibtex-file),
(obe-html-link-base): add a 'group argument to defcustoms
(obe-citations): replace non-existent org-babel-clean-text-properties
with org-no-properties
* contrib/lisp/org-git-link.el: add an eval-and-compile to avoid
undefined function warnings
(org-git-show): use with-current-buffer instead of
save-excursion+set-buffer
---
| 17 ++++++++++-------
contrib/lisp/org-git-link.el | 14 +++++++-------
2 files changed, 17 insertions(+), 14 deletions(-)
--git a/contrib/lisp/org-bibtex-extras.el b/contrib/lisp/org-bibtex-extras.el
index e3c0f49..57a15ed 100644
--- a/contrib/lisp/org-bibtex-extras.el
+++ b/contrib/lisp/org-bibtex-extras.el
@@ -60,15 +60,18 @@
;;; Code:
(require 'org-bibtex)
+(require 'cl-lib)
-(defcustom obe-bibtex-file nil "File holding bibtex entries.")
+(defcustom obe-bibtex-file nil "File holding bibtex entries."
+ :group 'org-bibtex)
(defcustom obe-html-link-base nil
"Base of citation links.
For example, to point to your `obe-bibtex-file' use the following.
(setq obe-html-link-base (format \"file:%s\" obe-bibtex-file))
-")
+"
+ :group 'org-bibtex)
(defvar obe-citations nil)
(defun obe-citations ()
@@ -78,7 +81,7 @@ For example, to point to your `obe-bibtex-file' use the following.
(find-file obe-bibtex-file)
(goto-char (point-min))
(while (re-search-forward " :CUSTOM_ID: \\(.+\\)$" nil t)
- (push (org-babel-clean-text-properties (match-string 1))
+ (push (org-no-properties (match-string 1))
obe-citations))
obe-citations)))
@@ -117,18 +120,18 @@ For example, to point to your `obe-bibtex-file' use the following.
(defun obe-meta-to-json (meta &optional fields)
"Turn a list of META data from citations into a string of json."
(let ((counter 1) nodes links)
- (flet ((id (it) (position it nodes :test #'string= :key #'car))
+ (flet ((id (it) (cl-position it nodes :test #'string= :key #'car))
(col (k) (mapcar (lambda (r) (cdr (assoc k r))) meta))
(add (lst)
(dolist (el lst) (push (cons el counter) nodes))
(incf counter)))
;; build the nodes of the graph
(add (col :title))
- (add (remove-if (lambda (author) (string-match "others" author))
- (remove-duplicates (apply #'append (col :authors))
+ (add (cl-remove-if (lambda (author) (string-match "others" author))
+ (cl-remove-duplicates (apply #'append (col :authors))
:test #'string=)))
(dolist (field fields)
- (add (remove-duplicates (col field) :test #'string=)))
+ (add (cl-remove-duplicates (col field) :test #'string=)))
;; build the links in the graph
(dolist (citation meta)
(let ((dest (id (cdr (assoc :title citation)))))
diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el
index a4759c9..b5ca96f 100644
--- a/contrib/lisp/org-git-link.el
+++ b/contrib/lisp/org-git-link.el
@@ -131,11 +131,11 @@
relpath (concat (file-name-as-directory (second dirlist)) relpath))))
(list (expand-file-name ".git" dir) relpath))))
-
-(if (featurep 'xemacs)
- (defalias 'org-git-gitrepos-p 'org-git-find-gitdir)
- (defalias 'org-git-gitrepos-p 'org-git-find-gitdir
- "Return non-nil if path is in git repository"))
+(eval-and-compile
+ (if (featurep 'xemacs)
+ (defalias 'org-git-gitrepos-p 'org-git-find-gitdir)
+ (defalias 'org-git-gitrepos-p 'org-git-find-gitdir
+ "Return non-nil if path is in git repository")))
;; splitting the link string
@@ -196,8 +196,8 @@
(unless
(zerop (call-process org-git-program nil buffer nil
"--no-pager" (concat "--git-dir=" gitdir) "show" object))
- (error "git error: %s " (save-excursion (set-buffer buffer)
- (buffer-string)))))
+ (error "git error: %s " (with-current-buffer buffer
+ (buffer-string)))))
(defun org-git-blob-sha (gitdir object)
"Return sha of the referenced object"
--
1.8.2
next reply other threads:[~2013-04-01 2:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-01 2:24 Aaron Ecay [this message]
2013-04-01 14:27 ` [PATCH] Fix several byte-compile warnings in org-contrib files Nicolas Goaziou
2013-04-03 11:13 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364783083-3175-1-git-send-email-aaronecay@gmail.com \
--to=aaronecay@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.