emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Remaining org-src.el free variable warnings
@ 2015-05-25 22:01 Kyle Meyer
  2015-05-25 23:21 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2015-05-25 22:01 UTC (permalink / raw)
  To: Org-mode

Compiling org-src.el since 71641bc3a0882b has given free variable
warnings.  One of these was fixed in e50472d926f92c, but some still
remain:

    In org-src--contents-area:
    org-src.el:303:49:Warning: reference to free variable `beg'
    org-src.el:303:53:Warning: reference to free variable `end'

Despite the line numbers given, I think these are referring to the
line marked below (line 284 in org-src.el).

#+begin_src elisp
  (defun org-src--contents-area (datum)
    "Return contents boundaries of DATUM.
  DATUM is an element or object.  Return a list (BEG END CONTENTS)
  where BEG and END are buffer positions and CONTENTS is a string."
    (let ((type (org-element-type datum)))
      (cond
       ((eq type 'footnote-definition)
        (let* ((beg (org-with-wide-buffer
                     (goto-char (org-element-property :post-affiliated datum))
                     (search-forward "]")))
               (end (or (org-element-property :contents-end datum) beg)))
          (list beg end (buffer-substring-no-properties beg end))))
       ((org-element-property :contents-begin datum)
        (list (org-element-property :contents-begin datum)
              (org-element-property :contents-end datum)
              (buffer-substring-no-properties beg end)))  ; <---- HERE
       ((memq type '(example-block export-block src-block))
        [...]
       (t (error "Unsupported element or object: %s" type)))))
#+end_src

Also, what case does that branch of cond cover?

--
Kyle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remaining org-src.el free variable warnings
  2015-05-25 22:01 Remaining org-src.el free variable warnings Kyle Meyer
@ 2015-05-25 23:21 ` Nicolas Goaziou
  2015-05-26  1:57   ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2015-05-25 23:21 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Org-mode

Hello,

Kyle Meyer <kyle@kyleam.com> writes:

> Compiling org-src.el since 71641bc3a0882b has given free variable
> warnings.  One of these was fixed in e50472d926f92c, but some still
> remain:
>
>     In org-src--contents-area:
>     org-src.el:303:49:Warning: reference to free variable `beg'
>     org-src.el:303:53:Warning: reference to free variable `end'

I just noticed it, and fixed it.

> Also, what case does that branch of cond cover?

Inline footnote references with a definition, at the moment.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remaining org-src.el free variable warnings
  2015-05-25 23:21 ` Nicolas Goaziou
@ 2015-05-26  1:57   ` Kyle Meyer
  0 siblings, 0 replies; 3+ messages in thread
From: Kyle Meyer @ 2015-05-26  1:57 UTC (permalink / raw)
  To: Org-mode

Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Kyle Meyer <kyle@kyleam.com> writes:
>
>> Compiling org-src.el since 71641bc3a0882b has given free variable
>> warnings.  One of these was fixed in e50472d926f92c, but some still
>> remain:
>>
>>     In org-src--contents-area:
>>     org-src.el:303:49:Warning: reference to free variable `beg'
>>     org-src.el:303:53:Warning: reference to free variable `end'
>
> I just noticed it, and fixed it.

Great.  Thank you.

>> Also, what case does that branch of cond cover?
>
> Inline footnote references with a definition, at the moment.

Ahhh, thanks.  I was trying out a bunch of different elements and
couldn't find anything that went down that branch.

-- 
Kyle

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-26  1:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-25 22:01 Remaining org-src.el free variable warnings Kyle Meyer
2015-05-25 23:21 ` Nicolas Goaziou
2015-05-26  1:57   ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).