From 3458b4fdfffc1b4f542405325ffa8b6eed0eb1df Mon Sep 17 00:00:00 2001 From: Nicholas D Steeves Date: Mon, 3 Jul 2017 20:44:19 -0400 Subject: New upstream version 9.0.9+dfsg --- lisp/org-footnote.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'lisp/org-footnote.el') diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 5b60a19..af03fbf 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -1,6 +1,6 @@ ;;; org-footnote.el --- Footnote support in Org -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp @@ -712,14 +712,18 @@ Return the number of footnotes removed." (let ((def-re (format "^\\[fn:%s\\]" (regexp-quote label))) (ndef 0)) (while (re-search-forward def-re nil t) - (let ((full-def (org-footnote-at-definition-p))) - (when full-def - ;; Remove the footnote, and all blank lines before it. - (goto-char (nth 1 full-def)) - (skip-chars-backward " \r\t\n") - (unless (bolp) (forward-line)) - (delete-region (point) (nth 2 full-def)) - (cl-incf ndef)))) + (pcase (org-footnote-at-definition-p) + (`(,_ ,start ,end ,_) + ;; Remove the footnote, and all blank lines before it. + (delete-region (progn + (goto-char start) + (skip-chars-backward " \r\t\n") + (if (bobp) (point) (line-beginning-position 2))) + (progn + (goto-char end) + (skip-chars-backward " \r\t\n") + (if (bobp) (point) (line-beginning-position 2)))) + (cl-incf ndef)))) ndef))) (defun org-footnote-delete (&optional label) -- cgit v1.2.3