emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Failure in compiling org-capture.el
@ 2017-04-17 14:11 Kaushal Modi
  2017-04-17 14:55 ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2017-04-17 14:11 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 4176 bytes --]

I am on master branch: ea3754f.

A recent change in org-capture.el breaks compilation:

In toplevel form:
org-capture.el:1586:1:Error: Unknown pattern ‘nil’
Compiling /home/kmodi/.emacs.d/elisp/org-mode/lisp/org-install.el...
Compiling /home/kmodi/.emacs.d/elisp/org-mode/lisp/org-loaddefs.el...
Compiling /home/kmodi/.emacs.d/elisp/org-mode/lisp/org-version.el...
Done (Total of 0 files compiled, 1 failed, 121 skipped)
make[2]: Leaving directory `/home/kmodi/.emacs.d/elisp/org-mode/lisp'
if [ ! -d
/home/kmodi/usr_local/apps/6/emacs/master/share/emacs/site-lisp/org ] ;
then \
          install -m 755 -d
/home/kmodi/usr_local/apps/6/emacs/master/share/emacs/site-lisp/org ; \
        fi ;
install -m 644 -p ob-C.elc ob-J.elc ob-R.elc ob-abc.elc ob-asymptote.elc
ob-awk.elc ob-calc.elc ob-clojure.elc ob-comint.elc ob-coq.elc ob-core.elc
ob-css.elc ob-ditaa.elc ob-dot.elc ob-ebnf.elc ob-emacs-lisp.elc
ob-eval.elc ob-exp.elc ob-forth.elc ob-fortran.elc ob-gnuplot.elc
ob-groovy.elc ob-haskell.elc ob-hledger.elc ob-io.elc ob-java.elc ob-js.elc
ob-keys.elc ob-latex.elc ob-ledger.elc ob-lilypond.elc ob-lisp.elc
ob-lob.elc ob-lua.elc ob-makefile.elc ob-matlab.elc ob-maxima.elc
ob-mscgen.elc ob-ocaml.elc ob-octave.elc ob-org.elc ob-perl.elc
ob-picolisp.elc ob-plantuml.elc ob-processing.elc ob-python.elc ob-ref.elc
ob-ruby.elc ob-sass.elc ob-scala.elc ob-scheme.elc ob-screen.elc ob-sed.elc
ob-shell.elc ob-shen.elc ob-sql.elc ob-sqlite.elc ob-stan.elc ob-table.elc
ob-tangle.elc ob.elc org-agenda.elc org-archive.elc org-attach.elc
org-bbdb.elc org-bibtex.elc org-capture.elc org-clock.elc org-colview.elc
org-compat.elc org-crypt.elc org-ctags.elc org-datetree.elc org-docview.elc
org-duration.elc org-eldoc.elc org-element.elc org-entities.elc
org-eshell.elc org-eww.elc org-faces.elc org-feed.elc org-footnote.elc
org-gnus.elc org-habit.elc org-id.elc org-indent.elc org-info.elc
org-inlinetask.elc org-irc.elc org-lint.elc org-list.elc org-macro.elc
org-macs.elc org-mhe.elc org-mime.elc org-mobile.elc org-mouse.elc
org-pcomplete.elc org-plot.elc org-protocol.elc org-rmail.elc org-src.elc
org-table.elc org-timer.elc org-w3m.elc org.elc ox-ascii.elc ox-beamer.elc
ox-html.elc ox-icalendar.elc ox-latex.elc ox-man.elc ox-md.elc ox-odt.elc
ox-org.elc ox-publish.elc ox-texinfo.elc ox.elc ob-C.el ob-J.el ob-R.el
ob-abc.el ob-asymptote.el ob-awk.el ob-calc.el ob-clojure.el ob-comint.el
ob-coq.el ob-core.el ob-css.el ob-ditaa.el ob-dot.el ob-ebnf.el
ob-emacs-lisp.el ob-eval.el ob-exp.el ob-forth.el ob-fortran.el
ob-gnuplot.el ob-groovy.el ob-haskell.el ob-hledger.el ob-io.el ob-java.el
ob-js.el ob-keys.el ob-latex.el ob-ledger.el ob-lilypond.el ob-lisp.el
ob-lob.el ob-lua.el ob-makefile.el ob-matlab.el ob-maxima.el ob-mscgen.el
ob-ocaml.el ob-octave.el ob-org.el ob-perl.el ob-picolisp.el ob-plantuml.el
ob-processing.el ob-python.el ob-ref.el ob-ruby.el ob-sass.el ob-scala.el
ob-scheme.el ob-screen.el ob-sed.el ob-shell.el ob-shen.el ob-sql.el
ob-sqlite.el ob-stan.el ob-table.el ob-tangle.el ob.el org-agenda.el
org-archive.el org-attach.el org-bbdb.el org-bibtex.el org-capture.el
org-clock.el org-colview.el org-compat.el org-crypt.el org-ctags.el
org-datetree.el org-docview.el org-duration.el org-eldoc.el org-element.el
org-entities.el org-eshell.el org-eww.el org-faces.el org-feed.el
org-footnote.el org-gnus.el org-habit.el org-id.el org-indent.el
org-info.el org-inlinetask.el org-install.el org-irc.el org-lint.el
org-list.el org-macro.el org-macs.el org-mhe.el org-mime.el org-mobile.el
org-mouse.el org-pcomplete.el org-plot.el org-protocol.el org-rmail.el
org-src.el org-table.el org-timer.el org-w3m.el org.el ox-ascii.el
ox-beamer.el ox-html.el ox-icalendar.el ox-latex.el ox-man.el ox-md.el
ox-odt.el ox-org.el ox-publish.el ox-texinfo.el ox.el org-version.el
org-loaddefs.el
/home/kmodi/usr_local/apps/6/emacs/master/share/emacs/site-lisp/org
install: cannot stat `org-capture.elc': No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/kmodi/.emacs.d/elisp/org-mode/lisp'
make: *** [install-lisp] Error 2


-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 4459 bytes --]

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

* Re: Failure in compiling org-capture.el
  2017-04-17 14:11 Failure in compiling org-capture.el Kaushal Modi
@ 2017-04-17 14:55 ` Kaushal Modi
  2017-04-17 15:10   ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2017-04-17 14:55 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

To add, I am using emacs build from the master branch as of today.

Doing M-x byte-compile-file on org-capture.el gives:

-----
Compiling file /home/kmodi/.emacs.d/elisp/org-mode/lisp/org-capture.el at
Mon Apr 17 10:48:22 2017
org-capture.el:1586:1:Error: Unknown pattern ‘nil’
-----


On Mon, Apr 17, 2017 at 10:11 AM Kaushal Modi <kaushal.modi@gmail.com>
wrote:

> I am on master branch: ea3754f.
>
> A recent change in org-capture.el breaks compilation:
>
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 996 bytes --]

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

* Re: Failure in compiling org-capture.el
  2017-04-17 14:55 ` Kaushal Modi
@ 2017-04-17 15:10   ` Kaushal Modi
  2017-04-17 15:19     ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2017-04-17 15:10 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

This patch works:

From 5edec74298a0140c5ebf55e7be0d64de6c702b17 Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Mon, 17 Apr 2017 11:01:28 -0400
Subject: [PATCH] Fix nil case in pcase

* lisp/org-capture.el (org-capture-fill-template): Use `nil for the
  nil case in pcase form.
---
 lisp/org-capture.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 76cacdda764..cd67c280392 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1782,7 +1782,7 @@ The template may still contain \"%?\" for cursor
positioning."
  (lambda (s) (org-insert-link 0 s))))
    (first-value (car org-capture--clipboards)))
        (pcase (length org-capture--clipboards)
- (nil nil)
+ (`nil nil)
  (`(,value) (funcall insert-fun value))
  (`(,first-value . ,_)
   (funcall insert-fun
-- 
2.11.0

> --

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2071 bytes --]

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

* Re: Failure in compiling org-capture.el
  2017-04-17 15:10   ` Kaushal Modi
@ 2017-04-17 15:19     ` Kaushal Modi
  2017-04-17 18:05       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2017-04-17 15:19 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

While that error is fixed, we still have this byte compilation warning:

org-capture.el:1586:1:Warning: Unused lexical variable ‘first-value’

I haven't used pcase extensively, but based on the warning, the below
doesn't work as intended in the compiled elc:

   ((or "C" "L")
    (let ((insert-fun (if (equal key "C") #'insert
(lambda (s) (org-insert-link 0 s))))
  (first-value (car org-capture--clipboards)))
      (pcase (length org-capture--clipboards)
(`nil nil)
(`(,value) (funcall insert-fun value))
(`(,first-value . ,_)
 (funcall insert-fun
  (read-string "Clipboard/kill value: "
first-value                                                ; Based on the
warning, does it mean that the value of first-value is not picked from the
value calculated in the let form above?
'org-capture--clipboards
first-value)))                                             ; And the same
here
(_ (error "Invalid `org-capture--clipboards' value: %S"
  org-capture--clipboards)))))
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2430 bytes --]

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

* Re: Failure in compiling org-capture.el
  2017-04-17 15:19     ` Kaushal Modi
@ 2017-04-17 18:05       ` Nicolas Goaziou
  2017-04-17 18:11         ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-04-17 18:05 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list

Hello,

Kaushal Modi <kaushal.modi@gmail.com> writes:

> While that error is fixed, we still have this byte compilation warning:
>
> org-capture.el:1586:1:Warning: Unused lexical variable ‘first-value’
>
> I haven't used pcase extensively, but based on the warning, the below
> doesn't work as intended in the compiled elc:
>
>    ((or "C" "L")
>     (let ((insert-fun (if (equal key "C") #'insert
> (lambda (s) (org-insert-link 0 s))))
>   (first-value (car org-capture--clipboards)))
>       (pcase (length org-capture--clipboards)
> (`nil nil)
> (`(,value) (funcall insert-fun value))
> (`(,first-value . ,_)
>  (funcall insert-fun
>   (read-string "Clipboard/kill value: "
> first-value                                                ; Based on the
> warning, does it mean that the value of first-value is not picked from the
> value calculated in the let form above?
> 'org-capture--clipboards
> first-value)))                                             ; And the same
> here
> (_ (error "Invalid `org-capture--clipboards' value: %S"
>   org-capture--clipboards)))))

This was a typo of mine. Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: Failure in compiling org-capture.el
  2017-04-17 18:05       ` Nicolas Goaziou
@ 2017-04-17 18:11         ` Kaushal Modi
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushal Modi @ 2017-04-17 18:11 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

On Mon, Apr 17, 2017 at 2:05 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> This was a typo of mine. Fixed. Thank you.
>
> Regards,
>

Thanks. I confirm the fix.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 544 bytes --]

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

end of thread, other threads:[~2017-04-17 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-17 14:11 Failure in compiling org-capture.el Kaushal Modi
2017-04-17 14:55 ` Kaushal Modi
2017-04-17 15:10   ` Kaushal Modi
2017-04-17 15:19     ` Kaushal Modi
2017-04-17 18:05       ` Nicolas Goaziou
2017-04-17 18:11         ` Kaushal Modi

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).