[O] Bug: error: (invalid-function org-table-with-shrunk-field) [9.2.6 (9.2.6-4-ge30905-elpaplus @ /home/minshall/.emacs.d/elpa/org-plus-contrib-20191014/)]

2019-10-15 Thread Greg Minshall
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


using elpa org-mode, with org-plus-contrib, typing a character, or
deleting a character, in an existing column in a table gives the error
: (invalid-function org-table-with-shrunk-field)

to reproduce, first
: (setq debug-on-error t)

then, open a (presumably empty) file, foo.org, say, and type

| this | is | a | test |

then, at the end of the line, hit , and type, e.g., "t" (or
) and the error appears.

following a suggestion (a comment by the original poster) on
stackexchange

https://emacs.stackexchange.com/q/46923

i deleted org-plus-contrib, restarted emacs, and the problem repeated.
(more precisely, i was originally running the pre-packaged org-mode,
i.e., 9.1.9; when i deleted org-plus-contrib with 9.1.9 org-mode, the
problem went away.  thinking i maybe had version mismatches, i
"upgraded" to org "20191014", using the emacs package manager, and also
reinstalled org-plus-contrib (same "version"), and saw the problem again
(after restarting emacs).  so, i once again deleted org-plus-contrib and
restarted emacs.  but, this time, with "20191014" org-mode, the problem
did *not* go away after deleting org-plus-contrib.)


Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29
Package: Org mode version 9.2.6 (9.2.6-4-ge30905-elpaplus @ 
/home/minshall/.emacs.d/elpa/org-plus-contrib-20191014/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-files ... /elided/
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-tempo 
org-jsinfo
   org-irc org-mew org-mhe org-rmail org-vm org-wl org-w3m 
org-drill)
 org-mode-hook '(org-tempo-setup
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-all append local] 
5]
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 modi/highlight-confusing-chars
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . 
default)
 ("\\.pdf\\'" . "xpdf %s"))
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-babel-load-languages '((emacs-lisp . t) (R . t) (asymptote . t) (ditaa . 
t) (awk . t)
(python . t) (C . t) (latex . t) (org . t) (scheme 
. t)
(octave . t) (shell . t) (gnuplot . t) (js . t))
 org-export-backends '(ascii beamer html latex)
 org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" . php) 
("C" . c)
  ("C++" . c++) ("asymptote" . asy) ("bash" . sh) ("beamer" 
. latex)
  ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
  ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . 
tuareg)
  ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql))
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-babel-tangle-lang-exts '(("latex" . "tex") ("D" . "d") ("C++" . "cpp")
  ("python" . "py") ("awk" . "awk") ("asymptote" . 
"asy")
  ("processing" . "pde") ("emacs-lisp" . "el")
  ("elisp" . "el"))
 org-font-lock-set-keywords-hook '(org-drill-add-cloze-fontification)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open) ("w3m" :store 
org-w3m-store-link)
   ("wl" :follow org-wl-open :store org-wl-store-link)
   ("vm-imap" :follow org-vm-imap-open)
   ("vm" :follow org-vm-open :store org-vm-store-link)
 

Re: [O] [PATCH] Respect buffer-local value of `org-edit-src-content-indentation'

2019-10-15 Thread Adam Porter
Hi Sebastian,

Sebastian Miele  writes:

> * lisp/org-src.el (org-src--contents-for-write-back): Use the
> potentially buffer-local value of `org-edit-src-content-indentation'
> from the source buffer instead of that from the editing buffer.
> ---
>  lisp/org-src.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/org-src.el b/lisp/org-src.el
> index 9134d5b5d..b7fe4c0fa 100644
> --- a/lisp/org-src.el
> +++ b/lisp/org-src.el
> @@ -422,7 +422,8 @@ Assume point is in the corresponding edit buffer."
>(if org-src--preserve-indentation 0
>  (+ (or org-src--block-indentation 0)
> (if (memq org-src--source-type '(example-block src-block))
> -   org-edit-src-content-indentation
> +   (with-current-buffer (marker-buffer org-src--beg-marker)
> + org-edit-src-content-indentation)
>   0
>   (use-tabs? (and (> org-src--tab-width 0) t))
>   (source-tab-width org-src--tab-width)

You might consider using the function buffer-local-value instead of the
macro with-current-buffer.  Not that it matters so much here, but
benchmarking shows that it is much faster when simply accessing the
buffer-local value of a variable.




Re: [O] (re-)introducing: orgtbl-query (nee org-query)

2019-10-15 Thread Adam Porter
Hi Greg,

That's very cool!  Thanks for sharing it.




Re: [O] [RFC] Document level property drawer

2019-10-15 Thread Adam Porter
Gustav Wikström  writes:

> Hi again,
>
> I'd like to take the next step with this patch. I'm hesitant to do it
> without wider support though, since only a few people have commented.
>
> @Marco Wahl; As I understand you've applied the patch and tried it
> out. Have you found any issues yet? What do you think of the patch
> after having used it for a while?
>
> Any other thoughts/comments/objections/praises?

Please do not merge your patch without the approval of the Org
maintainers.




[O] (re-)introducing: orgtbl-query (nee org-query)

2019-10-15 Thread Greg Minshall
apologies for the extra noise.

i've renamed (and moved) my small utility, now known as orgtbl-query,
that allows one to query, from the shell (command line), the contents of
an org-mode table in a file.  orgtbl-query is now located at:

https://gitlab.com/minshall/orqtbl-query

part of it has also been re-written in C for performance reasons (a
makefile is included); apologies for making it that much harder to
install.  (the awk part remains.)

it works for my use cases (obviously), but i'm sure it will break, or be
feature-deficient, for those of others.  i'd be happy to try to fix
bugs.  below are the first N lines of help output.

cheers, Greg


usage: orgtbl-query -h|--help
 : orgtbl-query [-f|--field column] [--complement] [--regexp]
[--ignore-case] file [[table:]column] 
key
 : orgtbl-query -t|--tables file
 : orgtbl-query -c|--columns file [table[:]]
 : orgtbl-query -k|--keys file [[table:]column]

the first form prints this help message

the second form searches for KEY in FILE, TABLE, COLUMN, and prints out
any matching lines (or a single column).  tables are named, as in emacs
org-mode, "#+name: TABLE", starting in column one

the third form lists all the tables in FILE

the fourth form lists all the columns in a single TABLE in FILE

the fifth form lists the keys in column COLUMN of the table TABLE in FILE

...



Re: [O] Inject value of macro into code using a variable

2019-10-15 Thread Nicolas Goaziou
Hello,

wlharvey4 via Emacs-orgmode  writes:

> Is it possible to inject the value of a macro into code using
> a variable?

No, macros are mostly text replacement. They are not Babel related.

You may want to pass arguments to Babel blocks using other Babel blocks.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Document level property drawer

2019-10-15 Thread Gustav Wikström
Hi again,

I'd like to take the next step with this patch. I'm hesitant to do it without 
wider support though, since only a few people have commented.

@Marco Wahl; As I understand you've applied the patch and tried it out. Have 
you found any issues yet? What do you think of the patch after having used it 
for a while?

Any other thoughts/comments/objections/praises?

Regards
Gustav

> -Original Message-
> From: Gustav Wikström
> Sent: den 29 september 2019 12:27
> To: emacs-orgmode@gnu.org
> Cc: Nicolas Goaziou 
> Subject: [RFC] Document level property drawer
> 
> Hi,
> 
> This patch introduces a document level property drawer.
> 
> This has been discussed previously in a larger context:
> - https://lists.gnu.org/archive/html/emacs-orgmode/2019-06/msg0.html
> - https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00339.html
> - https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00010.html
> 
> The patch is a somewhat modified version of what was included in the third
> link above.
> 
> The following will be true for document level property drawers:
> 1) In the same way that one can have a property drawer for a heading, one
>can have a property drawer for a whole document.
> 2) All existing commands that can work with property drawers will
>(shall) work also on property drawers before the first heading.
> 3) Properties defined in a property drawer will have precedence over
>properties defined as a property keyword, if the same property is
>defined using both conventions.
> 4) The position for the document level property drawer is:
>- At the first line in a file that is not a comment or a keyword.
> 
>  I.e. the following will work:
>  #+begin_src org
># -*- mode: org -*-
>,#+TITLE: Test
>:PROPERTIES:
>:CATEGORY: Test
>:END:
> 
>Preamble
> 
>,* Some heading
>Some content
>  #+end_src
> 
>  but not this:
>  #+begin_src org
>Some comment and/or empty line
> 
>:PROPERTIES:
>:CATEGORY: Test
>:END:
> 
>,* Some heading
>Some content
>  #+end_src
> 
> What do you say?
> 
> Regards
> Gustav Wikström


[O] Inject value of macro into code using a variable

2019-10-15 Thread wlharvey4 via Emacs-orgmode
Is it possible to inject the value of a macro into code using a variable?

I set a macro called ‘version’ with a version number at the top of my .org 
file.  I would like to do something like this:

#+macro:version Version 0.2.5

#+name:code-name
#+begin_src js :tangle some-file.js :var ver={{{version}}} :exports both 
:results output
const version = ver;
#+end_src

When this code is evaluated during export, there is an error:

org-babel-ref-resolve: Reference ‘{{{version}}}’ not found in this buffer

Regards,
Wesley




Re: [O] beamer export: misplaced \end{frame} with \lecture structure

2019-10-15 Thread Fraga, Eric
On Monday, 14 Oct 2019 at 06:24, Gürtler, Martin wrote:
> 1. What can I do in the org mode file in order to enforce ending the
>   frame before the \lecture statement.

Not ideal but you could do something like this:

@@beamer:\end{frame}\lecture{This week's lecture}{week2}\begin{frame}Today's 
lecture: \insertlecture@@

maybe using it by defining a macro (untested)

#+macro: lecture @@beamer:\end{frame}\lecture{$1}{$2}\begin{frame}Today's 
lecture: \insertlecture@@

and then use as

{{{lecture(This week's lecture,week2)}}}

> 2. Would anybody be willing to implement \lecture and maybe \part in the
>   exporter?

Can you play with changing the org-latex-class beamer entry?  Probably not, I 
guess, as both part and lecture need two arguments...

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78


Re: [O] JShell support in Babel?

2019-10-15 Thread Ken Mankoff


On 2019-10-15 at 13:04 +02, Jarmo Hurri  wrote...
> JShell is a pretty nifty tool for exploring and demonstrating basic Java
> features. Has anyone happened to write support for it in Babel?

You can start working with it even without official Babel support:

#+BEGIN_SRC bash :results verbatim
jshell
int a[] = {0,1,3,5,8}
a
a[3] = 42
a

""
#+END_SRC
#+RESULTS:
#+begin_example
|  Welcome to JShell -- Version 11.0.4
|  For an introduction type: /help intro

jshell> int a[] = {0,1,3,5,8}
a ==> int[5] { 0, 1, 3, 5, 8 }

jshell> a
a ==> int[5] { 0, 1, 3, 5, 8 }

jshell> a[3] = 42
$3 ==> 42

jshell> a
a ==> int[5] { 0, 1, 3, 42, 8 }

jshell> 

jshell> ""
#+end_example


The last line doesn't P (from REPL) until I added the "". You can probably find 
a more elegant solution using :post.

  -k.
  



[O] JShell support in Babel?

2019-10-15 Thread Jarmo Hurri


Hello.

JShell is a pretty nifty tool for exploring and demonstrating basic Java
features.

https://en.wikipedia.org/wiki/JShell

Has anyone happened to write support for it in Babel?

If no-one has done this, I might try to implement it later by mimicking
some other language support. Unfortunately I have too much work on my
plate right now, so at this point I am just hoping to find something
ready.

Have fun,

Jarmo




Re: [O] Bug and quick bugfix

2019-10-15 Thread Godefroy
Thanks for your replies. Your solution works for me, thank you a lot for
your work.

Sincerely,

Godefroy Vannoye

On 10/13/19 1:21 PM, Vladimir Lomov wrote:
> Hello,
> ** Nicolas Goaziou  [2019-10-13 09:26:42 +0200]:
>
>> Hello,
>>
>> Godefroy  writes:
>>
>>> I recently encountered a bug when exporting an org file to LaTeX: when
>>> generating a figure with a caption, the LaTeX result has the following
>>> shape:
>>>
>>> \begin{figure}
>>> …
>>> \caption{\label{…}
>>> Content of the caption}
>>> \end{figure}
>>>
>>> When compiling to LaTeX, the carriage return causes a indesirable white
>>> space in some cases. What I would expect is:
>>>
>>> \begin{figure}
>>> …
>>> \caption{Content of the caption}
>>> \label{…}
>>> \end{figure}
>>>
>>> To fix this, I have changed the org-latex--caption/label-string function
>>> in ox-latex.el on lines 1314 and 1315:
>>>
>>> (format (if nonfloat "\\captionof{%s}%s{%s%s}\n"
>>>  "\\caption%s%s{%s%s}\n")
>>>
>>> becomes
>>>
>>> (format (if nonfloat "\\captionof{%s}%s{%s}\n%s"
>>>  "\\caption%s%s{%s}\n%s")
>> IIRC, the label has to be included in the caption command. I applied
>> a different solution. Let me know if that works for you.
> There is no strict rule but a general good practice: for caption
> material put label command inside the caption macro. Otherwise there
> might be some side effects.
>
>> Regards,
>>
>> -- 
>> Nicolas Goaziou
> ---
> WBR, Vladimir Lomov
>



[O] Configuring listings for file or language

2019-10-15 Thread Jarmo Hurri


Greetings.

The help documentation for the variable org-latex-listings-options
suggests that it is easy to configure these options
- globally for all files and languages using this variable
- for each code block separately using #+attr_latex

Is it possible to configure these options for all code blocks
1. in a single org file
2. for a single language?

Thanks!

Jarmo