From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: [PATCH] Fix several byte-compile warnings in org-contrib files Date: Sun, 31 Mar 2013 22:24:43 -0400 Message-ID: <1364783083-3175-1-git-send-email-aaronecay@gmail.com> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMUQV-0007bf-RS for emacs-orgmode@gnu.org; Sun, 31 Mar 2013 22:24:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMUQU-0007rB-J3 for emacs-orgmode@gnu.org; Sun, 31 Mar 2013 22:24:51 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:41003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMUQU-0007r6-FB for emacs-orgmode@gnu.org; Sun, 31 Mar 2013 22:24:50 -0400 Received: by mail-qa0-f53.google.com with SMTP id k4so671868qaq.5 for ; Sun, 31 Mar 2013 19:24:49 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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 --- contrib/lisp/org-bibtex-extras.el | 17 ++++++++++------- contrib/lisp/org-git-link.el | 14 +++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --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