emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Bug] local variables definition at beginning of file is ignored
@ 2011-09-22  7:36 Viktor Rosenfeld
  2011-09-22  9:48 ` Viktor Rosenfeld
       [not found] ` <listuser36@googlemail.com>
  0 siblings, 2 replies; 68+ messages in thread
From: Viktor Rosenfeld @ 2011-09-22  7:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi everybody,

in http://thread.gmane.org/gmane.emacs.orgmode/47043 I've posted two
examples of local file definitions at the top of an org file which are
silently ignored for seemingly unrelated parts in the org file. The
definitions work if they are put at the end of the org file. 

This inconsistency is a bug, isn't it? Also, are local variables
documented somewhere? I couldn't find anything in the manual.

Cheers,
Viktor

^ permalink raw reply	[flat|nested] 68+ messages in thread
* [babel] Verbatim output from SQL command
@ 2011-10-18 13:20 Sebastien Vauban
  2011-10-18 16:15 ` Eric Schulte
  2011-10-19 16:29 ` Viktor Rosenfeld
  0 siblings, 2 replies; 68+ messages in thread
From: Sebastien Vauban @ 2011-10-18 13:20 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

#+BABEL:   :engine msosql :cmdline -S <SERVER> -U <USER> -P <PASS> -d <DATABASE> -n -w 700

* Show code of stored procedure

Despite telling Babel that I'd like to see the output as it is, it displays it
in a 4-column table.

See http://i.imgur.com/neDO3.png for the original layout in SQL Query Analyser
(1 column, 34 lines).

Babel seems to interpret every *leading space* as *one empty column*. Normal,
feature, bug?

Is there some workaround to this?  I thought stating "scalar" would really
completely override any interpretation...

** Code

This is an example of code run against a Microsoft SQL server.

#+begin_src sql :eval yes :results output scalar
EXEC sp_helptext 'dt_setpropertybyid'
#+end_src

#+results:
| Text                                    |                                                                         |                                                                                             |                                            |
|-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------------------------|
| /*                                      |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| **                                      | If the property already exists, reset the value; otherwise add property |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| **                                      |                                                                         | id -- the id in sysobjects of the object                                                    |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| **                                      |                                                                         | property -- the name of the property                                                        |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| **                                      |                                                                         | value -- the text value of the property                                                     |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| **                                      |                                                                         | lvalue -- the binary value of the property (image)                                          |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| */                                      |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| create procedure dbo.dt_setpropertybyid |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | @id int,                                                                |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | @property varchar(64),                                                  |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | @value varchar(255),                                                    |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | @lvalue image                                                           |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
| as                                      |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | set nocount on                                                          |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | declare @uvalue nvarchar(255)                                           |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | set @uvalue = convert(nvarchar(255), @value)                            |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | if exists (select * from dbo.dtproperties                               |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             | where objectid=@id and property=@property) |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | begin                                                                   |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         | --                                                                                          |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         | -- bump the version count for this row as we update it                                      |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         | --                                                                                          |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         | update dbo.dtproperties set value=@value, uvalue=@uvalue, lvalue=@lvalue, version=version+1 |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             | where objectid=@id and property=@property  |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | end                                                                     |                                                                                             |                                            |
|                                         |                                                                         |                                                                                             |                                            |
|                                         | else                                                                    |                                                                                             |                                            |
...

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 68+ messages in thread
* Export an org file from the command line in the background
@ 2011-10-19 16:21 Viktor Rosenfeld
  2011-10-19 16:27 ` Jambunathan K
  0 siblings, 1 reply; 68+ messages in thread
From: Viktor Rosenfeld @ 2011-10-19 16:21 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

is it possible to export an org file from the command line, so that a
currently running Emacs instance is not disturbed? I want to export the
attached org file and run the included source blocks, so I have an
activity report in the end. I use the shell script pasted below, but
there are two problems:

- my Emacs instance is blocked during the execution of the shell
  scripts contained in the file
- the script globally sets org-confirm-babel-evaluate to nil for my
  Emacs instance

The second problem could possibly be solved with a local file variable.
But the first problem remains. If I use emacs instead of emacsclient, it
complains about a running Emacs instance.

  #!/bin/sh

  emacsclient -c \
  --eval "(progn
    (find-file \"macports.org\"))
    (setq org-confirm-babel-evaluate nil)
    (org-export-as-html 3)
    (kill-buffer)
    (delete-frame))"

I'm using Org-Mode 7.7.

Cheers,
Viktor

[-- Attachment #2: macports.org --]
[-- Type: text/plain, Size: 1200 bytes --]

#+TITLE: MacPorts Update Report

* Helper functions                                                                        :noexport:
** Set up =$PATH= environment

Set up =$PATH=:

#+begin_src sh :session port-update :results silent
PATH=$PATH:/opt/local/bin
#+end_src

** Table Header for the list of outdated ports

#+begin_src sh :session port-update :results silent
print_outdated_header() {
    echo \|Port\|Installed\|Available\|
    echo "|--|"
}
#+end_src

** Format each row of =port outdated= as table entry

#+begin_src sh :session port-update :results silent
format_port_outdated() {
    awk '{print "|" $1 "|" $2 "|" $4 "|"}'
}
#+end_src

* Outdated ports

The following ports are outdated:

#+begin_src sh :session port-update :results output raw :exports results
print_outdated_header
port -q outdated | format_port_outdated
#+end_src

The following outdated ports are requested:

#+begin_src sh :session port-update :results output raw :exports results
print_outdated_header
port -q outdated and requested | format_port_outdated
#+end_src

* Update log

#+begin_src sh :session port-update :exports results :results verbatim
for i in 1 2 3 4 5 6 7 8 9 0; do echo "."; done
#+end_src

^ permalink raw reply	[flat|nested] 68+ messages in thread
* Question regarding remote references in tables
@ 2011-11-16 15:27 Viktor Rosenfeld
  0 siblings, 0 replies; 68+ messages in thread
From: Viktor Rosenfeld @ 2011-11-16 15:27 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm trying to copy the values of a column in one table to another table
in. If I understand the manual correctly, this should be possible with
remote references. But I can't get it to work. In the example below, if
I evaluate the table formula, column 2 of table "bar" is copied into
column 3.

Cheers,
Viktor

* Source table

#+TBLNAME: foo
| Query | Time |
|-------+------|
|     1 |  123 |
|     2 |  234 |
|     3 |  345 |

* Reference table

#+TBLNAME: bar
| Query | Garbage | Old Time |
|-------+---------+----------|
|     1 | a       |          |
|     2 | b       |          |
|     3 | c       |          |
#+TBLFM: $3=remote(foo,$2)

* Expected

| Query | Garbage | Old Time |
|-------+---------+----------|
|     1 | a       |      123 |
|     2 | b       |      234 |
|     3 | c       |      345 |

* Produced

| Query | Garbage | Old Time |
|-------+---------+----------|
|     1 | a       | a        |
|     2 | b       | b        |
|     3 | c       | c        |

^ permalink raw reply	[flat|nested] 68+ messages in thread
* Refresh of http://orgmode.org
@ 2011-12-12 23:39 Bastien
  2011-12-13 17:25 ` Achim Gratz
                   ` (4 more replies)
  0 siblings, 5 replies; 68+ messages in thread
From: Bastien @ 2011-12-12 23:39 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

I made a small refresh of the website.

http://orgmode.org

- random quote (taken from worg/org-quotes.org)
- random screenshot
- twitter feed
- g+/flattr/fb buttons
- french translation (http://orgmode.org/fr/)

If you want to help with the translation in your language, 
please send your public key and I will give you push access.
This is just a bunch of .org files, only 1 hour needed to
translate the whole website.

Hope you like it!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 68+ messages in thread
* Functions in SBE blocks
@ 2012-07-07 18:58 Viktor Rosenfeld
  0 siblings, 0 replies; 68+ messages in thread
From: Viktor Rosenfeld @ 2012-07-07 18:58 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I can't get SBE blocks called from a table to work, if they use
functions like org-parse-time-string.

Suppose I have the following table:

| Start            | Ende             | |
|------------------+------------------+-|
| [2011-06-29 Wed] | [2012-02-29 Wed] | |
#+TBLFM: $3='(sbe "billable-month" (start $1) (end $2))

and the following source block:

#+NAME: billable-month(start="[2011-06-29 Wed]", end="[2012-02-29 Wed]")
#+BEGIN_SRC emacs-lisp
(let* ((start-date start))
   (message "%s" start-date))
#+END_SRC

If I evaluate the table, the start date is put into the last column.
However, if I change the code to the following:

#+NAME: billable-month(start="[2011-06-29 Wed]", end="[2012-02-29 Wed]")
#+BEGIN_SRC emacs-lisp
(let* ((start-date (org-parse-time-string start)))
   (message "%s" (nth 4 start-date)))
#+END_SRC

then the string #ERROR is inserted into the table. Evaluating the source
block directly yields the correct result.

What's going on here?

Thanks,
Viktor

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

end of thread, other threads:[~2012-07-08  0:55 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22  7:36 [Bug] local variables definition at beginning of file is ignored Viktor Rosenfeld
2011-09-22  9:48 ` Viktor Rosenfeld
     [not found] ` <listuser36@googlemail.com>
2011-09-22 14:43   ` Nick Dokos
2011-09-22 14:58     ` Nick Dokos
2011-10-19 16:47   ` [babel] Verbatim output from SQL command Nick Dokos
2011-10-19 17:31     ` Viktor Rosenfeld
2011-10-19 17:34     ` Sebastien Vauban
2011-10-19 21:12   ` Export an org file from the command line in the background Nick Dokos
2011-10-19 22:28     ` Viktor Rosenfeld
2011-10-19 21:22   ` Code block evaluation export bug ? (was: Re: Export an org file from the command line in the background) Nick Dokos
2011-10-21  1:57     ` Code block evaluation export bug ? Thomas S. Dye
2011-10-21  2:42       ` Nick Dokos
2011-10-21  4:37         ` Nick Dokos
2011-10-22 23:51       ` Nick Dokos
2011-11-09 21:13         ` Eric Schulte
2011-11-09 21:55           ` Nick Dokos
2011-10-19 22:37   ` Export an org file from the command line in the background Nick Dokos
2011-11-16 15:52   ` Question regarding remote references in tables Nick Dokos
2011-11-16 16:40     ` Nick Dokos
2011-11-16 17:43     ` Viktor Rosenfeld
2011-12-13 22:16   ` Refresh of http://orgmode.org Nick Dokos
2012-07-07 20:02   ` Functions in SBE blocks Nick Dokos
2012-07-08  0:55     ` Viktor Rosenfeld
  -- strict thread matches above, loose matches on Subject: below --
2011-10-18 13:20 [babel] Verbatim output from SQL command Sebastien Vauban
2011-10-18 16:15 ` Eric Schulte
2011-10-19  9:19   ` Sebastien Vauban
2011-10-19 18:08     ` Eric Schulte
2011-10-20  8:03       ` Sebastien Vauban
2011-10-19 16:29 ` Viktor Rosenfeld
2011-10-19 16:21 Export an org file from the command line in the background Viktor Rosenfeld
2011-10-19 16:27 ` Jambunathan K
2011-10-19 20:14   ` Viktor Rosenfeld
2011-11-16 15:27 Question regarding remote references in tables Viktor Rosenfeld
2011-12-12 23:39 Refresh of http://orgmode.org Bastien
2011-12-13 17:25 ` Achim Gratz
2011-12-13 19:27   ` Bastien
2011-12-13 19:32     ` Nick Dokos
2011-12-13 20:27     ` Achim Gratz
2011-12-20 23:23       ` Bastien
2011-12-13 17:39 ` Samuel Wales
2011-12-13 18:39   ` Eric S Fraga
2011-12-13 18:59     ` Samuel Wales
2011-12-13 19:35     ` Bastien
2011-12-13 19:51       ` Samuel Wales
2011-12-14  8:49       ` Eric S Fraga
2011-12-13 19:33   ` Bastien
2011-12-13 21:50 ` Viktor Rosenfeld
2011-12-13 22:22   ` Bastien
2011-12-14  8:53     ` Eric S Fraga
2011-12-14 12:54     ` Viktor Rosenfeld
2011-12-14 17:40       ` Bastien
2011-12-14 18:15       ` Bastien
2011-12-14 22:10         ` Viktor Rosenfeld
2011-12-14 22:17           ` Eric Schulte
2011-12-14  1:19   ` Eric Schulte
2011-12-14 10:07     ` Bastien
2011-12-14 18:45       ` Eric Schulte
2011-12-15  4:11         ` Eric Schulte
2011-12-15 14:03           ` Bastien
2011-12-15 15:10             ` Eric Schulte
2011-12-15 15:18               ` Bastien
2011-12-15 15:26                 ` Eric Schulte
2011-12-15 15:44                   ` Bastien
2011-12-15 14:10         ` Bastien
2011-12-14 13:17   ` Stefan Vollmar
2011-12-14  2:30 ` Scott Randby
2011-12-15 13:10 ` Martyn Jago
2012-07-07 18:58 Functions in SBE blocks Viktor Rosenfeld

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