Re: org-capture user-error: Abort

2020-12-13 Thread Michael Albinus
Jean Louis  writes:

Hi Jean,

> Even if it is error, why it should be written with the dash as
> "user-error"?!

`user-error' is a standard error symbol in Emacs, which is fired by the
function `user-error'. See (info "(elisp) Signaling Errors")

Best regards, Michael.



[O] bug#32722: bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-10-22 Thread Michael Albinus
Nicolas Goaziou  writes:

> Hello,

Hi Nicolas,

> Alternatively, by using TRAMP (see [TRAMP User Manual]),
> `org-mobile-directory' may point to a remote directory accessible
> through, for example, SSH, SCP, or DAVS:
>
>   (setq org-mobile-directory "/davs:/u...@remote.host:org/webdav/")

Pls use (setq org-mobile-directory "/davs:u...@remote.host.org:/webdav/")
Otherwise, LGTM.

> Regards,

Best regards, Michael.





[O] bug#32722: bug#32722: bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-09-30 Thread Michael Albinus
Nicolas Goaziou  writes:

> Hello,

Hi Nicolas,

> 1 Setting up the staging area
> ═
>
>   The mobile application needs access to a file directory on a server[1]
>
>   Alternatively, by using TRAMP (see [TRAMP User Manual]),
>   `org-mobile-directory' may point to a remote directory accessible
>   through, for example, SSH and SCP:
>
>   ┌
>   │ (setq org-mobile-directory "/scpc:u...@remote.host:org/webdav/")
>   └
>
> [1] For a server to host files, consider using a WebDAV server, such
> as [Nextcloud] ().

Not every WebDAV server will support an ssh connection. On GNU/Linux
systems, Tramp supports also the connection methods "dav", "davs", and
"nextcloud" (this one since Emacs 27). Maybe it is worth to mention this.

> Regards,

Best regards, Michael.





[O] bug#32722: bug#32722: 26.1; Org-publish depend on non-free platform ?

2018-09-20 Thread Michael Albinus
Nicolas Goaziou  writes:

> Hello,

Hi,

>> Is the WebDAV server code free software?
>
> At least some implementations are, e.g., Nextcloud, listed in the FSF
> directory.
>
>> Can you talk to such a server without any nonfree client software?
>
> I do it with Gnome file manager. There is also an official client for
> Nextcloud, which is free.

For the records, Emacs 27.0.50 / Tramp 2.4.1-pre got a nextcloud client
for GNU/Linux systems. Like the Gnome File Manager it uses the GVFS
library and tools.

> Regards,

Best regards, Michael.





Re: [O] bug in tramp?

2017-07-07 Thread Michael Albinus
Nicolas Goaziou  writes:

> Hello,

Hi Nicolas,

> I removed the sole (require 'tramp) I could find in the code base.
> Hopefully it solves the problem.

Thanks!

> Regards,

Best regards, Michael.



Re: [O] bug in tramp?

2017-07-06 Thread Michael Albinus
Thomas Holst  writes:

> Hi Michael,

Hi Thomas,

> The culprit was that I use org-mode and tramp from git. Now I set the
> load-path for org at the very beginning of my .emacs file but for
> tramp further down. As I understand org requires tramp at some point.
> So it loaded tramp from emacs but not from git repo.

I believe it is unfortune in Org to require Tramp while
loading. Instead, it shall declare used Tramp functions.

> Now I set load-path for tramp and require tramp before org and
> everything works fine.
>
> Thanks again.
>   Thomas

Best regards, Michael.



Re: [O] 6 failing tests on master branch

2017-06-09 Thread Michael Albinus
Kaushal Modi  writes:

> This seems to be related to a tramp file notation change on emacs
> master. I don't use tramp, but I heard about it on emacs-devel.

Indeed.

> Here is a test expression:
>
> (find-file-name-handler "/myself@some.where:papers/last.pdf"
> 'file-remote-p)
>
> On emacs 25.2, that returns tramp-file-name-handler.
> On emacs master, that returns nil.
>
> @Michael How should the above find-file-name-handler arg change to
> support that test file path?

The stronger Tramp file name syntax requires now a method. Something
like "/ssh:myself@some.where:papers/last.pdf". This is backward
compatible with Emacs 25, 24, etc pp.

> Thanks.

Best regards, Michael.



Re: [O] Bug: :session doesn't honor :verbatim [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/26.0.50/lisp/org/)]

2017-04-17 Thread Michael Albinus
"Charles C. Berry"  writes:

>> However, I don't want to change this globally. Is there an org mean to
>> change this locally just for the session?
>>
>> Maybe the shell prompt could be customizable for a session in ob-sh.el?
>
> That happens in the shell. You can do this to start your session:
>
> #+BEGIN_SRC shell :session mysess
>PS1="MyPrompt-$ "
> #+END_SRC
>
> #+RESULTS:
>
> and then tell emacs to locally set `comint-prompt-regexp' to a value
> other than what was copied from `shell-prompt-pattern'
>
> #+BEGIN_SRC emacs-lisp
>(save-excursion
>  (pop-to-buffer "mysess")
>  (setq-local comint-prompt-regexp "MyPrompt-$ "))
> #+END_SRC
>
> #+RESULTS:
> : MyPrompt-$
>
> and then it should work.
>
> #+BEGIN_SRC shell :session mysess
>echo "a%b"
> #+END_SRC
>
> #+RESULTS:
> : a%b
>
> ---
>
> You might skip the second step and instead set `shell-prompt-pattern'
> to "MyPrompt-$ ". If `comint-use-prompt-regexp' is nil, then the
> `comint-prompt-regexp' is only consulted by ob-shell.el funs per the 
> docstring of comint-use-prompt-regexp.

Thanks for the examples. Anything goes, of course, but I'm hoping for a
tighter integration. Maybe a :prompt param to sh source blocks, which
sets the prompt in a session, and which also manipulates
`comint-prompt-regexp' or `shell-prompt-pattern' local in the session buffer.

Or a mechanism like in Tramp, where the shell prompt is set to a random
string not expected in the shell (see `tramp-end-of-output'), and
`comint-prompt-regexp' or `shell-prompt-pattern' are adapted
automatically local in the session buffer.

> Chuck

Best regards, Michael.



Re: [O] Bug: :session doesn't honor :verbatim [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/26.0.50/lisp/org/)]

2017-04-16 Thread Michael Albinus
"Charles C. Berry"  writes:

> Michael might get some relief by altering `shell-prompt-pattern' whose
> default value is
>
> "^[^#$%>\n]*[#$%>] *"
>
> is tricked by the embedded `%' in the output lines
>
> If you know the prompt will not contain `%', you could delete that.
>
> Changing the asterisk to a plus might work (untested) or maybe adding
> a blank in the first (negated) char class (also untested). Or if you
> know what the prompt will be literally, use that: "^My-prompt-[$] *"

I've eval'ed (setq shell-prompt-pattern "^[^#$>\n]*[#$>] *") , this
helps. Thanks for the tip.

However, I don't want to change this globally. Is there an org mean to
change this locally just for the session?

Maybe the shell prompt could be customizable for a session in ob-sh.el?

> HTH,
>
> Chuck

Best regards, Michael.



[O] Bug: :session doesn't honor :verbatim [8.2.10 (release_8.2.10 @ /usr/local/share/emacs/26.0.50/lisp/org/)]

2017-04-16 Thread Michael Albinus
Hi,

when I eval the following source block, everything is fine:

#+BEGIN_SRC sh :results verbatim
df -h /
#+END_SRC

#+RESULTS:
: Filesystem  Size  Used Avail Use% Mounted on
: /dev/sda6   137G   55G   76G  43% /

However, using a :session shortens the output unexpectedly:

#+BEGIN_SRC sh :results verbatim :session *session*
df -h /
#+END_SRC

#+RESULTS:
: 
: Mounted on
: /

I suppose it is due to the "%" character in the output, because the
following works fine:

#+BEGIN_SRC sh :results verbatim :session *session*
df --output=source,size,used,avail,target -h /
#+END_SRC

#+RESULTS:
: Filesystem  Size  Used Avail Mounted on
: /dev/sda6   137G   55G   76G /


Emacs  : GNU Emacs 26.0.50 (build 44, x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
 of 2017-03-31
Package: Org-mode version 8.2.10 (release_8.2.10 @ 
/usr/local/share/emacs/26.0.50/lisp/org/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil "\300\301\302\303\304$\207"
   [org-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-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-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-occur-hook '(org-first-headline-recenter)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-confirm-shell-link-function 'yes-or-no-p
 )



Re: [O] Sync up the org in emacs master to org maint branch?

2017-01-26 Thread Michael Albinus
Rasmus  writes:

> Hi,

Hi,

> *AFAIR* it was too late and would thus not have received enough test from
> the general Emacs community.

org-mode comes with some hundred ert test cases. It would be great if
they'll land also in the Emacs master branch; this will give much more
testing.

> Thanks,
> Rasmus

Best regards, Michael.



Re: [O] [Patch] org-display-inline-images: Add support for remote images

2014-11-29 Thread Michael Albinus
Kit-Yan Choi k...@kychoi.org writes:

 But is it theoretically possible to have two remote file paths sharing
 the same local copy file name? i.e. `make-temp-file' generates the
 same temporary file name for two separate calls?

No, never ever. After choosing a random file name, make-temp-file checks
whether there exists already such a file. In case of yes, it chosses
another random file name, and so on.

 As far as org-mode is concerned, and assuming the current stable
 version of tramp, I think there are two options (1) the current
 approach which preserves the path of the remote file and therefore
 avoid unnecessary downloads; however we forgo the capability of
 compression that tramp's file-local-copy offers, (2) use
 `file-local-copy' but risk overwriting (albeit unlikely) downloaded
 local copy; this is possible with or with out a look-up table for
 reusing files.

Again, the risk of overwriting something else does not exist.

 Thanks,
 Kit

Best regards, Michael.



Re: [O] [Patch] org-display-inline-images: Add support for remote images

2014-11-25 Thread Michael Albinus
Kit-Yan Choi k...@kychoi.org writes:

 Ah my apologies. I forgot I had to use `file-name-directory' for
 creating the path to the temporary directory (too long ago since I did
 this). Here is the corrected version.

 --- a/lisp/org.el
 +++ b/lisp/org.el
 @@ -19340,7 +19340,7 @@ boundaries.
 (not (cdr (org-element-contents parent)
 (org-string-match-p file-extension-re
 (org-element-property :path link)))
 - (let ((file (expand-file-name (org-element-property :path link
 + (let ((file (substitute-in-file-name (expand-file-name
 (org-element-property :path link)
 (when (file-exists-p file)
 (let ((width
 ;; Apply `org-image-actual-width' specifications.
 @@ -19378,10 +19378,25 @@ boundaries.
 'org-image-overlay)))
 (if (and (car-safe old) refresh)
 (image-refresh (overlay-get (cdr old) 'display))
 - (let ((image (create-image file
 - (and width 'imagemagick)
 - nil
 - :width width)))
 + (let ((image 
 + (create-image (if (org-file-remote-p file)
 + (let* ((tramp-tmpdir (concat
 + (if (featurep 'xemacs)
 + (temp-directory)
 + temporary-file-directory)
 + /tramp
 + (file-name-directory (expand-file-name file
 + (newname (concat
 + tramp-tmpdir 
 + (file-name-nondirectory (expand-file-name file)
 + (make-directory tramp-tmpdir t)
 + (if (file-newer-than-file-p file newname)
 + (copy-file file newname t t))
 + newname)
 + file)
 + (and width 'imagemagick)
 + nil
 + :width width)))
 (when image
 (let* ((link
 ;; If inline image is the description

This code looks much to complicate to me. Wouldn't a simple
file-local-copy suffice? You don't need to care whether the file is
remote (let Tramp do the job) or local (there won't be a copy).

Best regards, Michael.



Re: [O] [Patch] org-display-inline-images: Add support for remote images

2014-11-25 Thread Michael Albinus
Kit-Yan Choi k...@kychoi.org writes:

 Michael,

Hi Kit,

 Thanks for the suggestion. Indeed `file-local-copy' would have made
 the code cleaner. Yet `file-local-copy' generates a new filename each
 time it's run. But I wanted to allow the code to check whether the
 remote image has already been fetched before and so skip unnecessary
 file transfer, which takes time (think of it like rsync -a).
 Therefore I wanted to preserve the remote path under a temporary
 directory.

After first retrieval via file-local-copy, you could cache this
information somewhere for later use.

Or you could write a ticket towards Tramp, that file-local-copy shall
remember that a file was downloaded already, and should offer that file
for reuse.

Note: I'm the Tramp maintainer :-)

 Best,
 Kit

Best regards, Michael.



Re: [O] Custom todo-like thing in agenda?

2014-08-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Hello Marcin,

Hi,

 - `org-debbugs.el' package from Michael Albinus

... which is meanwhile debbugs-org.el, part of the debbugs package on
GNU ELPA.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] results from Python block not visible

2014-07-24 Thread Michael Albinus
Daniel Clemente n142...@gmail.com writes:

 I reported this to emacs (bug 18095):
 http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-07/msg00736.html

 It's still happening with latest emacs and org-mode

It's fixed in Emacs' trunk.

Best regards, Michael.



Re: [O] [bug?] Tramp tries to open remote file links

2014-06-19 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 I'm not sure I use the right wording, but I'm trying to say that Org
 (when set to open inline images) should never try to open PDF files, as
 they can't be opened inline in a buffer anyway.

This might change, when Emacs' xwidget branch is merged into trunk.
And no, I don't know when this will happen.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Hello,

Hi Sebastien,

 When I just open an Org file that has a link to a remote file, Tramp
 tries to open it, leading to errors and timeouts when offline, at least.

 * References

 Some files of interest:

 [[file:/me-ohc15rc7jgtnlxjtenl...@public.gmane.org:papers/current.pdf][paper]]

 Errors:

   ╭
   │ Tramp: Opening connection for
 me-ohc15rc7jgtnlxjtenl...@public.gmane.org using plink...
   │ Tramp: Sending command `plink -l me -ssh -t somewhere.org  env
 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh   exit || exit'
   │ Tramp: Waiting for prompts from remote shell...
   │ Tramp failed to connect.  If this happens repeatedly, try
   │ `M-x tramp-cleanup-this-connection'
   │ Tramp: Waiting for prompts from remote shell...failed
   │ Tramp: Opening connection for
 me-ohc15rc7jgtnlxjtenl...@public.gmane.org using plink...failed
   ╰

 Is this supposed to be normal?  Why does Tramp open the file?

Because Tramp has been instructed so? I suppose, following the above
link results in

(insert-file-contents 
/me-ohc15rc7jgtnlxjtenl...@public.gmane.org:papers/current.pdf)

This is remote file name syntax, and Tramp tries to do its job, using
the default method plink. You could avoid Tramp's reaction by a link
like (untested)

[[file:/:/me-ohc15rc7jgtnlxjtenl...@public.gmane.org:papers/current.pdf][paper]]

Alternatively, you could choose another file name.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Is this supposed to be normal?  Why does Tramp open the file?

 Because Tramp has been instructed so? I suppose, following the above
 link results in

 I think we did not understand each other (or did we?) because that's the
 thing: I don't follow the link, I just open the file which contains such
 a link.

It doesn't for me, when I have a simple org file with just your
example. I use org 8.2.6.

Do you have some customization, which let org expand links per default?
Does it also happen when you start emacs -Q?

Or do you have some customization code in the file itself? Local
variables, code snippets to be evaluated when opening the file?

 See http://screencast.com/t/aXoxf9D1P.

This does not work for me :-(

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

   ... lots of contents...

Well, Tramp is invoked via (expand-file-name /myself@...). The call
hierarchy is (if I haven't overseen something)

expand-file-name
org-element-link-parser
org-element-context
org-image-file-name-regexp
org-display-inline-images
org-mode

Maybe it is worth to find out, why org-display-inline-images is invoked?

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Though, is it normal to try to open a remote PDF file while Emacs is
 unable of displaying it in the buffer (unlike PNG files, IIUC)?

Emacs is also able to open and display a remote PDF file.

 Maybe that's not a bug per se, but rather a feature that should only be
 enabled for specific file extensions?

I wouldn't parse URI-like file names in org-mode at all. There is
url-handlers.el, which shall do it proper.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-n...@mygooglest.com writes:

 Michael Albinus wrote:
 Sebastien Vauban writes:

 Though, is it normal to try to open a remote PDF file while Emacs is
 unable of displaying it in the buffer (unlike PNG files, IIUC)?

 Emacs is also able to open and display a remote PDF file.

 IIUC, Emacs can't display real PDF files. It only can convert them (via
 DocView) to PNG, one per page, in order to give a similar experience.

That's what I'm speaking about. And if you have a local DocView
installation, it works for either remote or local files (Tramp provides
a local copy of the remote file).

If you want to suppress PDFs in org, you shall do it regardless of its
location.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] [bug?] Tramp tries to open remote file links

2014-06-18 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 That's what I'm speaking about. And if you have a local DocView
 installation, it works for either remote or local files (Tramp provides
 a local copy of the remote file).

 But DocView won't display a PDF file as an image inside a buffer of
 text, will it?

No, it uses an own buffer.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] An org password manager

2014-06-06 Thread Michael Albinus
jorge.a.alf...@gmail.com (Jorge A. Alfaro-Murillo) writes:

 Michael Albinus michael.albi...@gmx.de writes:

Hi Jorge,

 A useful feature would be an auth-source backend, See (info (auth))
 By this, other packages (like Gnus or Tramp) would profit from the
 password manager directly.

 Thanks Michael. I will look more into auth. What is your idea? To be
 able to use something like auth-source-search, to pass features of the
 org-passwords database as secrets? 

yes.

 I only use auth for gnus and jabber, so my .authinfo.gpg is only five
 lines. What setup could benefit on that? Can auth send secrets to other
 applications, like a web browser?

If another Emacs package uses auth-source-search, it would benefit
automatically from your backend. Several packages uses it already, like
Tramp, gnus, url, erc, ldap.

 Best,

 Jorge.

Bet regards, Michael.



Re: [O] An org password manager

2014-05-21 Thread Michael Albinus
Bastien b...@gnu.org writes:

 Hi Jorge,

Hi,

 If there is interest from the community this can also go to
 /contrib.

 I think this would be a nice contribution.

A useful feature would be an auth-source backend, See (info (auth))
By this, other packages (like Gnus or Tramp) would profit from the
password manager directly.

Best regards, Michael.



Re: [O] Preventing Tramp from executing on agenda command?

2014-02-03 Thread Michael Albinus
'Mash subscr...@toshine.net writes:

 Morning,

Hi,

 I have an agenda file which contains a URL with port
 (https://example.example.com:2000) which unfortunately Tramp attempts
 to connect to when I pull the agenda, causing Emacs to hang.

 Any idea why this is happening by default?

That's not a Tramp file, Tramp shouldn't feel responsible. Could you try
to find out, which host Tramp is attempting to connect? You might see it
in the respective Tramp buffer name.

 Thanks,

 'Mash

Best regards, Michael.



Re: [O] Local variables and babel

2014-01-14 Thread Michael Albinus
t...@tsdye.com (Thomas S. Dye) writes:

 Aloha all,

Hi,

 This led me to try to incorporate some of the file-specific setup steps
 into the local variables as well.  For instance, in a file where I'm
 working with Common Lisp source code blocks and a graph library, I have
 this:

   # eval: (slime)
   # eval: (org-sbe graph-setup)

 What I've found is that the graph-setup doesn't have any effect on the
 Common Lisp environment when run this way. It works fine if, after slime
 is up and running, I go to the graph-setup source code block and
 evaluate it with C-c C-c.

 I'm guessing that I might be running into a concurrency problem here,
 such that the local variable evaluation of graph-setup is taking place
 before slime has finished setting itself up (which takes many seconds on
 my machine).

 I am well beyond my programming abilities here and would like to have
 opinions on whether this approach is potentially workable and, if so,
 how it might be implemented.

I don't know slime, but usual there are hooks where you could add your
code to run once a package (like slime) has finished its
initialization. Look for such a hook in slime, and add the call to
graph-setup there.

 All the best,
 Tom

Best regards, Michael.



[O] Local variables in org files

2014-01-09 Thread Michael Albinus
Hi,

I'm trying to save the result of M-x debbugs-org into a file (this is
a TODO list). For further handling, also some buffer local variables
must survive. Therefore, I append at the very end of that file something
like this:

* Local Variables
** Local Variables:
** eval: (debbugs-org-mode 1)
** debbugs-org-ids: (1 2 3)
** End:

This has the nice effect, that those variables do not disturb in
overview mode, because they look like

* Local Variables...

Being invisible would be even better, but so what.

Unfortunately, the value of debbugs-org-ids could be very lng,
exceeding the 3000 chars limit the Local Variables: section size is
allowed to be in Emacs. So I must rearrange things like this:

* Local Variables
** debbugs-org-ids: (1 2 3)
** Local Variables:
** eval: (debbugs-org-mode 1)
** debbugs-org-ids: (access-the-value-above)
** End:

Is there some functionality in org I could use implementing
`access-the-value-above'? It is org structure, so I'm hoping there is an
easy way to access a given node with a well defined position.

Or maybe there is already a clever way storing local variables in an org
file, which I'm not aware of.

Thanks, and best regards, Michael.



Re: [O] Local variables in org files

2014-01-09 Thread Michael Albinus
Nick Dokos ndo...@gmail.com writes:

 Not sure if there are any limits for the top style but maybe you could
 combine the two styles of local variables - maybe:

 # -*- foo: (1 2 3 4) -*-

This would move the problem to the headline. No idea, whether there is a
limit (to be tested). But this extremely long and ugly headline would be
visible - nothing I like to offer :-(

But maybe we don't need the Local Variables block? Code blocks could help?

--8---cut here---start-8---
* COMMENT Local Variables

#+NAME: init
#+BEGIN_SRC elisp
(set (make-local-variable 'debbugs-org-ids) '(1 2 3))
#+END_SRC

#+CALL: init
--8---cut here---end---8---

However, I must have misread the documentation. The #+CALL: init
directive has no effect when loading a respective xxx.org file :-(

Best regards, Michael.



Re: [O] Local variables in org files

2014-01-09 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Hello Michael,

Hi Sebastien,

 However, I must have misread the documentation. The #+CALL: init
 directive has no effect when loading a respective xxx.org file :-(

 Nope, it doesn't, but you can add an `eval' directive in your Local
 Variables section, and evaluate a call to the init block, like this:

 # Local variables:
 # eval: (sbe init)
 # End:

That does the trick. Thanks a lot!

 Best regards,
   Seb

Best regards, Michael.




Re: [O] Org-mode in windows fires Tramp without any intervention

2013-12-03 Thread Michael Albinus
Toni Cebrián ance...@gmail.com writes:

 Hi,

Hi Toni,

 I have my own complex Emacs configuration files developed over time
 when working in a Linux environment. You can see that
 https://github.com/tonicebrian/emacsconfig in case you are curious. It
 works seamlessly in Linux and I tried to use that as-is when working
 in Windows. Emacs in Windows reads that configuration and fires up
 also without any warning. The problem comes when I try to open a
 complex Org file, with some links in it. I don't know why, but Tramp
 is fired and tries to ssh to the machines in one URL within a link
 element that has the form http://machine:8080/more/levels;. 

 I don't even have the (require 'tramp) in my init.el file so this is
 something the Org mode plugging is doing by itself. By the way, the
 org mode version I have is org-20131202 from elpa and Emacs is 24.3.1
 for Windows. Do you know where to look or what to try? This same Org
 file, the same init.el and the same emacs version work without any
 problem in Linux.

 Any clues?

I guess something of the decoded URL, like /machine:8080, is treated
as remote file name Tramp feels responsible for.

Could you please send a short example file which triggers the bug? I
would try to debug it then.

Please note that I don't use org regularly, so some comments on what to
do with that file would be helpful.

Best regards, Michael.



Re: [O] org-debbugs.el

2013-11-05 Thread Michael Albinus


Bastien b...@gnu.org writes:

 Hi Michael,

Hi Bastien,

 Can you resend a patch so that I add this to contrib/?

Did you read the whole thread? My last message on the topic?

http://thread.gmane.org/gmane.emacs.orgmode/76830/focus=78010

 Thanks!

Best regards, Michael.




Re: [O] org-debbugs.el

2013-10-25 Thread Michael Albinus


Michael Albinus michael.albi...@gmx.de writes:

Hi,

 If the org-mode maintainers find this package useful, it could be added
 to the contrib directory.

 Still no response from the maintainers. Before I continue to invest into
 this package, I would like to know whether it is a suitable
 approach. Otherwise, I could spend my time better.

Well, I've renamed the file to debbugs-org.el; it is added to the
debbugs package on GNU ELPA. No need any longer to add this to contrib.

Best regards, Michael.




Re: [O] org-debbugs.el

2013-10-11 Thread Michael Albinus


Michael Albinus michael.albi...@gmx.de writes:

Hi,

 If the org-mode maintainers find this package useful, it could be added
 to the contrib directory.

Still no response from the maintainers. Before I continue to invest into
this package, I would like to know whether it is a suitable
approach. Otherwise, I could spend my time better.

Best regards, Michael.




Re: [O] org-debbugs.el

2013-10-11 Thread Michael Albinus


Nicolas Richard theonewiththeevill...@yahoo.fr writes:

 Hello Michael,

Hi Nicolas,

 While trying your package, I noticed that C-h m would not work because
 of a misplaced docstring. Here's the patch (but I'm not sure I have the
 latest version, sorry if this is already fixed).

Thanks. I've submitted a similar patch some days ago.

 Also, I heard recently on #org-mode about bugpile, which is an old (last
 updated more than a year ago) of Thorsten Jolitz and Eric Schulte. The
 doc says:
 ,
 |  The Bugpile project has two goals:
 | 
 | Develop a bugtracker (called Bugpile) for GNU Emacs Org-mode,
 | using Elisp, Elnode, Org-mode, and a dVCS.
 | As part of the engineering process, abstract out a web-framework
 | (iOrg) based on these GNU Emacs technologies.
 ` Source:
 http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/bugpile/

No idea about the status either. However, org-debbugs has the advantage
to access Emacs' bug tracking system, which is not listed above. I
expect org related bugs arriving not only via `org-submit-bug-report',
but also via `report-emacs-bug'.

Anyway, if the org maintainers decide for another bug tracking system
but debbugs, it would also be OK for me. It just decreases the priority
of that package for me.

Best regards, Michael.




Re: [O] org-debbugs.el

2013-10-04 Thread Michael Albinus
Michael Albinus michael.albi...@gmx.de writes:

Hi Suvayu,

 I tried to test by looking for a specific bug.  This is what I tried:

 - search phrase: emacsclient
 - submitter: fatkasuvayu (that is leading part of my email address)
 - status: done or nothing

 But then I get an empty *Org Bugs* buffer.

 Hmm, yes. But this seems to be a server side problem.

I still have no idea why the submitter does not work. However, there are
more attributes which could be used. I have added the author keyword
to the `org-debbugs-search' interface. This gives you all bugs, for
which you have sent an email with the given email address (or a
substring of). Patch appended.

Try

- search phrase: emacsclient
- author: fatkasuvayu

Best regards, Michael.

From 3c2ef9d8f8aa0da8dc0c2d8514a52b52ec36ed9b Mon Sep 17 00:00:00 2001
From: Michael Albinus michael.albi...@gmx.de
Date: Fri, 4 Oct 2013 21:12:08 +0200
Subject: [PATCH] * org-debbugs.el (org-debbugs-search): Accept empty phrase.
 Add keyword author. (org-debbugs-show-next-reports): Make Next bugs an
 own entry.

---
 contrib/lisp/org-debbugs.el | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/contrib/lisp/org-debbugs.el b/contrib/lisp/org-debbugs.el
index fe5430e..9ab805e 100644
--- a/contrib/lisp/org-debbugs.el
+++ b/contrib/lisp/org-debbugs.el
@@ -144,16 +144,14 @@ returned.
 
 	;; Check for the phrase.
 	(setq phrase (read-string debbugs-gnu-phrase-prompt))
-	(if (zerop (length phrase))
-	(setq phrase nil)
-	  (add-to-list 'debbugs-gnu-current-query (cons 'phrase phrase)))
+	(add-to-list 'debbugs-gnu-current-query (cons 'phrase phrase))
 
 	;; The other queries.
 	(catch :finished
 	  (while t
 	(setq key (completing-read
 		   Enter attribute: 
-		   '(severity package tags submitter
+		   '(severity package tags submitter author
 			 subject status)
 		   nil t))
 	(cond
@@ -178,7 +176,8 @@ returned.
 		(add-to-list
 		 'debbugs-gnu-current-query (cons (intern key) val1
 
-	 ((equal key submitter)
+	 ((member key '(submitter author))
+	  (when (equal key author) (setq key @author))
 	  (setq val1 (read-string Enter email address: ))
 	  (when (not (zerop (length val1)))
 		(add-to-list
@@ -405,7 +404,7 @@ returned.
 	(goto-char (point-max))
 	(insert
 	 (format
-	  [[elisp:(org-debbugs-show-next-reports %s)][Next bugs]]\n
+	  * [[elisp:(org-debbugs-show-next-reports %s)][Next bugs]]\n
 	  hits))
 
 (defconst org-debbugs-mode-map
-- 
1.8.1.2



Re: [O] org-debbugs.el

2013-10-02 Thread Michael Albinus
Michael Albinus michael.albi...@gmx.de writes:

Hi,

 I have produced a very first shot of org-debbugs.el. It shows you bug
 reports from debbugs.gnu.org as TODO items. It needs the debbugs package
 from the GNU ELPA repository.

Well, there hasn't been too much response for this. I have completed the
work anyway. Maybe it is worth to say, that the package does not show
org-mode bugs only. It could show any bug located on debbugs.gnu.org as
TODO item.

Compared with the first version, this package uses now tags similar to
the proposal by Suvayu. It also shows archived bugs, if desired.

There is a new minor mode org-debbugs-mode, which allows to send control
messages directly to debbugs.gnu.org. This simplifies handling of bugs.

There are also two new commands: `org-debbugs-search' allows full text
search on debbugs.gnu.org. `org-debbugs-bugs' shows bugs according to
their number. Read the Commentary section for details.

If the org-mode maintainers find this package useful, it could be added
to the contrib directory. A respective patch is appended. I'm pretty
sure that org-mode aficionados could improve the handling of TODO items;
I'm rather a rookie wrt org-mode. If there are questions wrt to the
gnus.debbugs.org interface I'll be happy to help.

Best regards, Michael.

From 6f002a1da1835625cd7451da2aaa4699254a6372 Mon Sep 17 00:00:00 2001
From: Michael Albinus michael.albi...@gmx.de
Date: Wed, 2 Oct 2013 09:28:50 +0200
Subject: [PATCH] Add org-debbugs.el.

---
 contrib/README  |   1 +
 contrib/lisp/org-debbugs.el | 455 
 2 files changed, 456 insertions(+)
 create mode 100644 contrib/lisp/org-debbugs.el

diff --git a/contrib/README b/contrib/README
index bdbdb47..6aba0d6 100644
--- a/contrib/README
+++ b/contrib/README
@@ -22,6 +22,7 @@ org-collector.el --- Collect properties into tables
 org-colview-xemacs.el	 --- Column View in Org-mode, XEmacs-specific version
 org-contacts.el  --- Contacts management
 org-contribdir.el--- Dummy file to mark the org contrib Lisp directory
+org-debbugs.el   --- Org-mode interface for the GNU bug tracker
 org-depend.el--- TODO dependencies for Org-mode
 org-drill.el --- Self-testing with org-learn
 org-element.el   --- Parser and applications for Org syntax
diff --git a/contrib/lisp/org-debbugs.el b/contrib/lisp/org-debbugs.el
new file mode 100644
index 000..9c31b2b
--- /dev/null
+++ b/contrib/lisp/org-debbugs.el
@@ -0,0 +1,455 @@
+;;; org-debbugs.el --- Org-mode interface for the GNU bug tracker
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus michael.albi...@gmx.org
+;; Keywords: comm, hypermedia, maint, outlines
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.
+
+;;; Commentary:
+
+;; This package provides an interface to bug reports which are located
+;; on the GNU bug tracker debbugs.gnu.org.  Its main purpose is to
+;; show and manipulate bug reports as org-mode TODO items.
+
+;; If you have `org-debbugs.el' in your load-path, you could enable
+;; the bug tracker commands by the following lines in your ~/.emacs
+;;
+;;   (autoload 'org-debbugs org-debbugs  'interactive)
+;;   (autoload 'org-debbugs-search org-debbugs  'interactive)
+;;   (autoload 'org-debbugs-bugs org-debbugs  'interactive)
+
+;; The bug tracker is called interactively by
+;;
+;;   M-x org-debbugs
+
+;; It asks for the severities, for which bugs shall be shown. This can
+;; be either just one severity, or a list of severities, separated by
+;; comma.  Valid severities are serious, important, normal,
+;; minor or wishlist.  Severities critical and grave are not
+;; used, although configured on the GNU bug tracker.  If no severity
+;; is given, all bugs are selected.
+
+;; If a prefix is given to the command, more search parameters are
+;; asked for, like packages (also a comma separated list, org-mode is
+;; the default), or whether archived bugs shall be shown.
+
+;; Another command is
+;;
+;;   M-x org-debbugs-search
+
+;; It behaves like `org-debbugs', but asks at the beginning for a
+;; search phrase to be used for full text search.  Additionally, it
+;; asks for key-value pairs to filter bugs.  Keys are as described in
+;; `debbugs-get-status', the corresponding value must be a regular
+;; expression

Re: [O] org-debbugs.el

2013-10-02 Thread Michael Albinus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Hi Michael,

Hi Suvayu,

 I tried to test by looking for a specific bug.  This is what I tried:

 - search phrase: emacsclient
 - submitter: fatkasuvayu (that is leading part of my email address)
 - status: done or nothing

 But then I get an empty *Org Bugs* buffer.

Hmm, yes. But this seems to be a server side problem. If you apply the
same search via its web interface, you get the same empty result:

http://debbugs.gnu.org/cgi/search.cgi?phrase=emacsclientsearch=searchskip=0attribute_field=submitterattribute_operator=STRINCattribute_value=fatkasuvayuorder_field=order_operator=STRAmax_results=10

I'll investigate.

 A small problem though, calling org-debbugs-search or org-debbugs-bugs
 from an *Org Bugs* buffer gives me the following backtraces:

Oops. Fixed, patch appended.

Best regards, Michael.

From c0214b63bc7a5e532a1c0fe06ebe3bb50f1a9b49 Mon Sep 17 00:00:00 2001
From: Michael Albinus michael.albi...@gmx.de
Date: Wed, 2 Oct 2013 13:36:20 +0200
Subject: [PATCH] * org-debbugs.el (org-debbugs-mode-map): Move docstring where
 it belongs to.

---
 contrib/lisp/org-debbugs.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-debbugs.el b/contrib/lisp/org-debbugs.el
index 9c31b2b..fe5430e 100644
--- a/contrib/lisp/org-debbugs.el
+++ b/contrib/lisp/org-debbugs.el
@@ -409,11 +409,11 @@ returned.
 	  hits))
 
 (defconst org-debbugs-mode-map
-  Keymap for the `org-debbugs-mode' minor mode.
   (let ((map (make-sparse-keymap)))
 (define-key map (kbd C-c # c) 'debbugs-gnu-send-control-message)
 (define-key map (kbd C-c # d) 'debbugs-gnu-display-status)
-map))
+map)
+  Keymap for the `org-debbugs-mode' minor mode.)
 
 ;; Make byte-compiler quiet.
 (defvar gnus-posting-styles)
-- 
1.8.1.2



Re: [O] org-debbugs.el

2013-10-02 Thread Michael Albinus
Michael Albinus michael.albi...@gmx.de writes:

 I tried to test by looking for a specific bug.  This is what I tried:

 - search phrase: emacsclient
 - submitter: fatkasuvayu (that is leading part of my email address)
 - status: done or nothing

 But then I get an empty *Org Bugs* buffer.

 Hmm, yes. But this seems to be a server side problem. If you apply the
 same search via its web interface, you get the same empty result:

 http://debbugs.gnu.org/cgi/search.cgi?phrase=emacsclientsearch=searchskip=0attribute_field=submitterattribute_operator=STRINCattribute_value=fatkasuvayuorder_field=order_operator=STRAmax_results=10

 I'll investigate.

PS: You could bypass this restriction using the search phrase
emacsclient AND fatkasuvayu (without quotes).

Best regards, Michael.



Re: [O] Org mode issue tracker

2013-10-02 Thread Michael Albinus
Brett Viren b...@bnl.gov writes:

 Hi,

Hi Brett,

   * TODO Subject timestamp :emacs_ver:org_ver:org_module:
 ...
 Emacs version ends up as a tag:

 * TODO  .   :24.3:

 Or, if I add an Org version:

  * TODO  .   :24.3:8.0.3:

 These bare numbers seem a bit too anonymous to me.  I think it's
 unlikely that Org will reach versions in the 20's anytime soon so
 collision won't happen for a while but eventually (hackers willing!) it
 will.

 So, I suggest simply qualifying the versions like:

   * TODO  .  :emacs_24.3:org_8.0.3:

From the metadata retrieved from debbugs.gnu.org, we have just a list of
version strings. There is no indication about the meaning:

 (found_versions 24.3)

One could teach people to use also package names but mere version
numbers, but that's up to the package maintainer's will. So up to now
the strings provided by found_versions will be used as tags, until
there's a better rule for matching.

 I can also see a desire to list other software and their versions that
 might be implicated in the bug being reported.  Listing their bare
 versions as tags is, I think, obviously no good.  They could just
 include this info in an ad-hoc manner in the body of their report, but
 maybe it would be good to define a property to explicitly list them
 following the same package_version pattern of the tags.

   * TODO  .  :emacs_24.3:org_8.0.3:
 :PROPERTIES:
 :IMPLICATED_SOFTWARE: texlive_2012.20120611-5 beamer_3.10-2

The debbugs server returns also a list like

 (found
  (item
   (key . 24.3)
   (value)))

Maybe this could go the direction we want. Obviously, in this example
key should be Emacs, and value should be 24.3. Then we might also
get something like (if set properly by submitter or maintainer)

 (found
  (item
   (key . emacs)
   (value . 24.3))
  (item
   (key . org)
   (value . 8.0.3)))

The IMPLICATED_SOFTWARE property proposed by you could be derived from the

 (affects)

entry. But I haven't seen ever that somebody uses this attribute. It's
always empty, as shown in this example.

 -Brett.

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-27 Thread Michael Albinus
Eric Schulte schulte.e...@gmail.com writes:

 I'd rather not hard-code the value of /tmp/.  Perhaps you could rework
 the patch so that it introduces a new customizable variable (including a
 documentation string) so that users can set the value for their system.

 Also, please package the patch with git format-patch.

Patch is appended.

 Thanks,

Best regards, Michael.

From 2b8db5486de75ec35c2c0d3e6063847cf582ace7 Mon Sep 17 00:00:00 2001
From: Michael Albinus michael.albi...@gmx.de
Date: Fri, 27 Sep 2013 13:34:03 +0200
Subject: [PATCH] * ob-core.el (org-babel-local-file-name): Simplify.
 (org-babel-process-file-name): Apply `expand-file-name' first.
 (org-babel-remote-temporary-directory): New defcustom. (org-babel-temp-file):
 Use it.

---
 lisp/ob-core.el | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 5a032a1..a7c227b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2680,11 +2680,7 @@ Fixes a bug in `tramp-handle-call-process-region'.
 
 (defun org-babel-local-file-name (file)
   Return the local name component of FILE.
-  (if (file-remote-p file)
-  (let (localname)
-	(with-parsed-tramp-file-name file nil
- localname))
-file))
+  (or (file-remote-p file 'localname) file))
 
 (defun org-babel-process-file-name (name optional no-quote-p)
   Prepare NAME to be used in an external process.
@@ -2694,7 +2690,10 @@ remotely.  The file name is then processed by `expand-file-name'.
 Unless second argument NO-QUOTE-P is non-nil, the file name is
 additionally processed by `shell-quote-argument'
   ((lambda (f) (if no-quote-p f (shell-quote-argument f)))
-   (expand-file-name (org-babel-local-file-name name
+   ;; We must apply `expand-file-name' on the whole filename.  If we
+   ;; would apply it on the local filename only, undesired effects
+   ;; like prepending a drive letter on MS Windows could happen.
+   (org-babel-local-file-name (expand-file-name name
 
 (defvar org-babel-temporary-directory)
 (unless (or noninteractive (boundp 'org-babel-temporary-directory))
@@ -2707,6 +2706,11 @@ additionally processed by `shell-quote-argument'
 Used by `org-babel-temp-file'.  This directory will be removed on
 Emacs shutdown.))
 
+(defcustom org-babel-remote-temporary-directory /tmp/
+  Directory to hold temporary files on remote hosts.
+  :group 'org-babel
+  :type 'string)
+
 (defmacro org-babel-result-cond (result-params scalar-form rest table-forms)
   Call the code to parse raw string results according to RESULT-PARAMS.
   (declare (indent 1)
@@ -2736,7 +2740,8 @@ of `org-babel-temporary-directory'.
   (if (file-remote-p default-directory)
   (let ((prefix
  (concat (file-remote-p default-directory)
- (expand-file-name prefix temporary-file-directory
+ (expand-file-name
+		  prefix org-babel-remote-temporary-directory
 (make-temp-file prefix nil suffix))
 (let ((temporary-file-directory
 	   (or (and (boundp 'org-babel-temporary-directory)
-- 
1.8.1.2



[O] org-debbugs.el

2013-09-27 Thread Michael Albinus
Hi,

I have produced a very first shot of org-debbugs.el. It shows you bug
reports from debbugs.gnu.org as TODO items. It needs the debbugs package
from the GNU ELPA repository.

If you want to try it, you could call

  (org-debbugs nil '(org-mode))

You will see a list of TODO items which belong to the org-mode bugs on
debbugs.gnu.org. The last link of such an item, [[Messages]], shows you
all corresponding messages for that bug.

If you want to see a bulk of bug reports, call

  (org-debbugs
'(serious important normal)
'(emacs))

This returns much more bugs (from the emacs project), presented as
chunk of 500 TODO items. If you follow the link at the very end of the
buffer, you will get the next 500 items. And so on.

You can call it also interactively, via M-x org-debbugs or C-u M-x
org-debbugs.

Have fun!

Best regards, Michael.



org-debbugs.el
Description: application/emacs-lisp


Re: [O] org mode R remote code evaluation

2013-09-26 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 Michael,

Hi Alex,

 * this doesn't work
 #+BEGIN_SRC sql :engine postgresql :dir /grid: :results output
 select 1+2 as three;
 #+END_SRC

 /plinkx:grid:/tmp/sql-in-7928arv...done
 psql -A -F   -f c:/tmp/sql-in-7928arv -o c:/tmp/sql-out-7928Z_E 
 -f c:/tmp/sql-in-7928arv -o c:/tmp/sql-out-7928Z_E
 No such file or directory 'c:/tmp/sql-in-7928arv'

Try this extended patch:

--8---cut here---start-8---
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 5a032a1..2789f47 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2680,11 +2680,7 @@ Fixes a bug in
`tramp-handle-call-process-region'.
 
 (defun org-babel-local-file-name (file)
   Return the local name component of FILE.
-  (if (file-remote-p file)
-  (let (localname)
-   (with-parsed-tramp-file-name file nil
-localname))
-file))
+  (or (file-remote-p file 'localname) file))
 
 (defun org-babel-process-file-name (name optional no-quote-p)
   Prepare NAME to be used in an external process.
@@ -2694,7 +2690,10 @@ remotely.  The file name is then processed by
   `expand-file-name'.
 Unless second argument NO-QUOTE-P is non-nil, the file name is
 additionally processed by `shell-quote-argument'
   ((lambda (f) (if no-quote-p f (shell-quote-argument f)))
-   (expand-file-name (org-babel-local-file-name name
+   ;; We must apply `expand-file-name' on the whole filename.  If we
+   ;; would apply it on the local filename only, undesired effects
+   ;; like prepending a drive letter on MS Windows could happen.
+   (org-babel-local-file-name (expand-file-name name
 
 (defvar org-babel-temporary-directory)
 (unless (or noninteractive (boundp 'org-babel-temporary-directory))
@@ -2736,7 +2735,7 @@ of `org-babel-temporary-directory'.
   (if (file-remote-p default-directory)
   (let ((prefix
  (concat (file-remote-p default-directory)
- (expand-file-name prefix temporary-file-directory
+ (expand-file-name prefix /tmp/
 (make-temp-file prefix nil suffix))
 (let ((temporary-file-directory
   (or (and (boundp 'org-babel-temporary-directory)
--8---cut here---end---8---

 Thanks
 Alex

Best regards, Michael.

PS: the analysis of your cygwin problem is delayed. I don't run MS
Windows on my machines, I need to hijack a machine from my wife or
somebody else for analysis.



Re: [O] Org mode issue tracker

2013-09-26 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

Hi Sebastien and Suvayu,

Thanks a lot for your comments. That's pretty good for starting a
proof-of-concept. Will do.

Some comments from my side:

 ((source . unknown)
  (found_versions 24.3)

 Emacs version ends up as a tag:

 * TODO  .   :24.3:

found_versions is optional. So we cannot assume it is always
set. Furthermore, it is a *list* of strings (although I haven't seen
ever more than one entry). What to do in this case?

  (msgid . 877gfqkm9t.fsf-re5jqeeqqe8avxtiumw...@public.gmane.org)

 An added bonus idea: Gmane has this amazing feature where you can link
 to a message using it's message id.  So a property like: GMANE_URL would
 be awesome.

 * TODO  .   :24.3:
   :PROPERTIES:
   :GMANE_URL:
 http://mid.gmane.org/877gfqkm9t.fsf-re5jqeeqqe8avxtiumw...@public.gmane.org
   :END:
   2013-08-13 Tue

Agreed. However, debbugs.el is also capable to retrieve all messages
from the server, as we do in debbugs-gnu. I'll show below.

  (severity . normal)

I would really appreciate, if we could make the severity visible. In the
org manual, I've read something about A B C priorities. On debbugs, we
have the severities serious, important, normal, minor,
wishlist, and tagged. How could we map them on the TODO items? In
debbugs-gnu we use different faces (colors) for the entries.

  (subject . 24.3; org-crypt: Making epg-context local to *epg* while 
 let-bound!)

 * TODO Making epg-context local to *epg* while let-bound! :24.3:org_crypt:
   :PROPERTIES:
   :DEBGUGS_ID:   15081
   :GMANE_URL:
 http://mid.gmane.org/877gfqkm9t.fsf-re5jqeeqqe8avxtiumw...@public.gmane.org
   :END:
   2013-08-13 Tue

 As you see above, it would be great if we could simplify the suject and
 tag the org-module involved (note hyphens are not allowed, they need to
 be transformed to underscore).

OK. However, we cannot assume a given syntax on the subject. An error
can be reported by a simple mail to @debbugs.gnu.org, with free
subject. A preformatted subject can be assumed only, if the error has
been reported by `report-emacs-bug' or `org-submit-bug-report'.

  (pending . pending)

 And this should finally decide the TODO state.  For the moment a
 reasonable mapping would be pending - TODO.  But would be good to
 have support for DONE, WIP, or similar (I'm not familiar with all
 the debbug states :-p)

The pending field could have the values pending, forwarded or
done. forwarded does not seem to be used on debbugs.gnu.org.

  (tags)

Tags are useful for more information on the status. They are a list of
strings like fixed, notabug, wontfix, unreproducible,
moreinfo or patch. In the given example, this list is empty.

  (package emacs org-mode)

 I guess this is how you filter out org-mode bugs from the rest.

Yep. In the org-mode case, it is sufficient to filter for the package
org-mode. But why not create a todo list for another debbugs project,
like emacs or gnus or whatever? And btw, one could filter also for
other attributes but just package. Even full text search is possible.

 * TODO Making epg-context local to  *epg* while let-bound! 
 :24.3:org_crypt:
   :PROPERTIES:
   :DEBGUGS_ID:   15081
   :REPORTER: Thierry Volpiatto 
 thierry.volpiatto-re5jqeeqqe8avxtiumw...@public.gmane.org
   :GMANE_URL:
 http://mid.gmane.org/877gfqkm9t.fsf-re5jqeeqqe8avxtiumw...@public.gmane.org
   :END:

Yep.

Now it comes to the attached emails. In a second (!) step, debbugs-gnu
is able to retrieve the corresponding emails. In the given example, it
would call (debbugs-get-bug-log 15081) This returns a list like

(((body . The body of the message)
  (msg_num . 5)
  (attachments)
  (header . All header lines of the message)))

I have just shown one message, of course all messages will be
retrieved. Alternative, one could retrieve the messages in MBOX format.

Wouldn't it be nice, if we could include the messages as well? Likely
not by default (it would be expensive to download all messages for,
let's say, 500 bugs at once). But we could add a kind of link which,
when followed, could show the messages as well in org-mode. Somehow.

 Best regards,
   Seb

Best regards, Michael.




Re: [O] Org mode issue tracker

2013-09-26 Thread Michael Albinus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 I forgot to add; regarding your comment about retrieving several
 messages might be expensive, there could be an elisp link or a babel
 source block that does this on demand.

Elisp link is the beast I was looking for, thanks. Likely, there is no
need for a babel source block.

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-26 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 #+BEGIN_SRC sql :engine postgresql :dir /grid: :results output :
 colnames yes
 select 2+2 as four, 1+1 as one;
 #+END_SRC

 #+RESULTS:
 | 4\t2 |

 It works! As you see there are still some problems with ob-sql (no
 column names and \t is not parsed correctly) but the remote execution
 seems to be fixed.

Great! I will prepare the patch tomorrow, as instructed by Eric.

 Thanks,
 Alex

Best regards, Michael.



Re: [O] Org mode issue tracker

2013-09-25 Thread Michael Albinus


Sebastien Vauban sva-news-D0wtAvR13HarG/idocf...@public.gmane.org
writes:

 Hi Suvayu,

Hi,

 The other solution that I'd see would be using Emacs' own bug tracker (the
 `org' package is already known to them), if that's
 possible. Anyway, having the
 bugs in an Org file seems natural too!

 I think this is a great idea.  A combination of an Org file (either
 public or private) and the Emacs bug tracker with Org package tags
 should be able to handle our needs.

 I see only one potential problem, is there an easy way to subscribe to
 only a specific package tag on the Emacs bug tracker?  I imagine most
 contributors following Org bugs will not be interested in other Emacs
 bugs.

 I don't know. I guess this should be asked directly to them. Indeed, it'd be
 good to have a (virtual) newsgroup with only bugs related to `org', like what
 exists for Stack Overflow.

There is the debbugs package on ELPA. The frontend, debbugs-gnu, allows
to filter for packages and tags. Try

(debbugs-gnu '(serious important normal) '(org-mode))

On my wannabe todo list is a package debbugs-org.el, which shows the
entries as TODO items. If the org community decides to use debbugs as
issue tracker, it would give me a push.

(I'm not so experienced with org-mode, so I would need at least some
assistance how such a TODO item should look like)

 Best regards,
   Seb

Best regards, Michael.




Re: [O] org mode R remote code evaluation

2013-09-25 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 Hi Michael,

Hi Alex,

 The patch seems to be working, the only thing I noticed is having
 http://www.emacswiki.org/emacs/setup-cygwin.el loaded together with
 the patched ob-core.el makes tramp prepend /cygwin to /tmp/. When I
 disabled (require 'setup-cygwin) the patch works as expected. Outside
 of org/babel setup-cygwin has no effect on Tramp.

This problem does not seem to be related to org-mode code. Could
somebody, please, commit my patch to org's repository? Thanks.

I will try to find out what's up with Tramp and Cygwin. Sadly, it has
been a misalliance very often :-(

 Thanks,
 Alex

Best regards, Michael.



Re: [O] Org mode issue tracker

2013-09-25 Thread Michael Albinus
Loyall, David david.loy...@nebraska.gov writes:

 (I'm not so experienced with org-mode, so I would need at least some
 assistance how such a TODO item should look like)

 A 'headline' is a 'TODO item' if-and-only-if it contains one of the
 TODO Keywords in the appropriate position.

 See: http://orgmode.org/worg/dev/org-syntax.html

 While you're in that document, have a look at the various structures
 that can live inside a headline (for example, timestamps).

Thanks. I've contacted already the org info pages, in order to get an
idea what's possible. But a general doc is one thing, a mapping of a
debbugs record onto a TODO entry is another one.

Let's check it with an example. For bug 15081, debbugs-gnu returns the
following list:

((source . unknown)
 (found_versions 24.3)
 (done)
 (blocks)
 (date . 1376383861)
 (fixed)
 (fixed_versions)
 (mergedwith)
 (found
  (item
   (key . 24.3)
   (value)))
 (unarchived)
 (blockedby)
 (keywords)
 (summary)
 (msgid . 877gfqkm9t@gmail.com)
 (id . 15081)
 (forwarded)
 (severity . normal)
 (owner)
 (log_modified . 1376383862)
 (location . db-h)
 (subject . 24.3; org-crypt: Making epg-context local to  *epg* while 
let-bound!)
 (originator . Thierry Volpiatto thierry.volpia...@gmail.com)
 (last_modified . 1376408720)
 (pending . pending)
 (affects)
 (archived)
 (tags)
 (package emacs org-mode)
 (fixed_date)
 (found_date)
 (bug_num . 15081))

The keys shall be self-explaining. How would a TODO item look like?
Note, that these metadata do not contain the corresponding messages
yet. debbugs-gnu could retrieve them in a second run; the TODO item
shall offer a link to them, inline.

 Thank you,
 --Dave

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-25 Thread Michael Albinus
Eric Schulte schulte.e...@gmail.com writes:

 I'd rather not hard-code the value of /tmp/.  Perhaps you could rework
 the patch so that it introduces a new customizable variable (including a
 documentation string) so that users can set the value for their system.

Will do, tomorrow. I would even prefer a more general solution, a new
function which returns a (the) temp directory on a remote host. This
would be useful also outside org-mode. But this would require changes in
Emacs/Tramp, which won't be applicable for org immediately (backwards
compatibility, and alike).

 If you can keep the patch under 15LOC we can include it w/o requiring
 FSF copyright assignment, otherwise see [1] for contribution details.

No problem. As Tramp maintainer, I have signed the FSF papers for Emacs
10+ years ago. This shall be valid also for org patches.

 Thanks,

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 The :results output doesn't help in my setup (I'm on Windows, the
 remote system is linux, access is via putty/plink)

I do not run Windows, so I cannot reproduce exactly. However, ...

 #+BEGIN_SRC sh :results output :dir /grid:
 ls
 #+END_SRC

 executing Sh code block...
 Tramp: Encoding region using function `base64-encode-region'...done
 Tramp: Decoding region into remote file
 /plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY...done
 byte-code: Couldn't write region to
 `/plinkx:grid:/Users/avorobi/AppData/Local/Temp/ob-input-6116fuY',
 decode using `tramp_perl_decode_with_module %s' failed

 The /Users directory obviously does not exist on linux.

... this looks like an old problem. Which Emacs/Tramp version are you using?
Check variables `emacs-version' and `tramp-version'.

 Thanks,
 Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 Here is what I have:

 ELISP emacs-version
 24.3.1
 ELISP tramp-version
 2.2.7
 ELISP org-version
 8.2

Well, that sounds recent. Could you, please, perform (setq tramp-verbose 6)
prior your test? There will be a Tramp debug buffer, which I would like
to analyze.

 Thanks,
 Alex

Best regards, Michael.



Re: [O] org mode R remote code evaluation

2013-09-24 Thread Michael Albinus
Alexander Vorobiev alexander.vorob...@gmail.com writes:

 Hi Michael,

Hi Alex,

 Here it is.

Thanks. I believe, the following patch shall cure it:

--8---cut here---start-8---
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2735,8 +2735,12 @@
 value of `temporary-file-directory' temporarily set to the value
 of `org-babel-temporary-directory'.
   (if (file-remote-p default-directory)
   (let ((prefix
+;; We cannot use `temporary-file-directory' as local part
+;; on the remote host, because it might be another OS
+;; there.  So we assume /tmp, which ought to exist on
+;; relevant architectures.
  (concat (file-remote-p default-directory)
- (expand-file-name prefix temporary-file-directory
+ (expand-file-name prefix /tmp/
 (make-temp-file prefix nil suffix))
 (let ((temporary-file-directory
   (or (and (boundp 'org-babel-temporary-directory)
--8---cut here---end---8---

Could you, please, test?

 Thanks,
 Alex

Best regards, Michael.



Re: [O] Connect to the ssh and execute any command

2013-09-18 Thread Michael Albinus
Andrey Tykhonov atykho...@gmail.com writes:

 Hi Michael!

Hi Andrey,

 Your remote host does not find a proper id command. What happens, if
 you call the following commands in a shell on that remote host:
 
 # id -u

 id: Command not found.

 # whereis id

 whereis: Command not found.

 I also didn't find 'id' by means of

 find / -name id

 As I understand TRAMP is not able to work without 'id'. Therefore TRAMP is
 not suitable for me...

 # uname -a

 FreeBSD {hostname} 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Sep 13
 21:22:42 PDT 2013 auto-build@{hostname}:{some/path/} amd64

Strange. `id' (and also `whereis') belong to FreeBSD proper. See for
example http://www.freebsd.org/cgi/man.cgi?query=idamp;sektion=1

You might check with your remote host why it is not installed.

 Best regards,
 Andrey

Best regards, Michael.



Re: [O] Connect to the ssh and execute any command

2013-09-17 Thread Michael Albinus
Andrey Tykhonov atykho...@gmail.com writes:

Hi Andrey,

 Tramp does not use FUSE for ssh connections. Please show an example
 connection to the remote host, and how it fails.

 Here I try to ls -la and get the following error:

 Couldn't find a POSIX `id' command

Your remote host does not find a proper id command. What happens, if
you call the following commands in a shell on that remote host:

# id -u
# id --version
# which id
# whereis id
# uname -a

 Best regards,
 Andrey.

Best regards, Michael.



Re: [O] Connect to the ssh and execute any command

2013-09-13 Thread Michael Albinus
Andrey Tykhonov atykho...@gmail.com writes:

[Cc to tramp-de...@gnu.org, because I want to help with Tramp config]

 Hi all!

Hi Andrey,

 During last several days I was trying to implement quite simple script
 which:

 1. Creates new buffer with the shell (M-x shell)
 2. Executes there ssh usern...@domain.com. As result -- the password
 prompt appears in the minibuffer. I manually input password.
 3. Then script executes any command in the recently created buffer
 (shell), for example: ls -la. So I expect to see directory listing on
 the domain.com.

 but, for sorry, I cannot to do so that ls -la will be executed!

 I googled, I have tried many different approaches but without any luck :-(

 Here I should mention quite important thing: I cannot use TRAMP because
 it does not work with the server to which the script connects and then
 on which executes ls -la. (I suppose that TRAMP uses FUSE, but for
 sorry FUSE does not work with mine server). So TRAMP is not available
 for me.

Tramp does not use FUSE for ssh connections. Please show an example
connection to the remote host, and how it fails.

Prior to the test, you should apply

   (setq tramp-verbose 6)

This will create a Tramp debug buffer, which shall show the problem.

 Regards,
 Andrey

Best regards, Michael.



Re: [O] ediff-directories - how to ignore timestamps and work recursively

2013-09-04 Thread Michael Albinus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Hello,
 
 I want to compare two directories and see what files are different,
 however, the comparison should ignore timestamps of files. Is there
 a simple solution?
 
 I had assumed that ediff would also consider files in subdirectories
 of the directory paths given for comparison. Apparently, it does not
 do that in Emacs 23.4.1 - is there a recursive option?
 

 You might have better luck on the emacs list.  That said, did you look
 at `ediff-directories'?

That's also my tool of choice. Combined with the key sequene = h x,
which shows you only the files which differ.

`ediff-directories' is not recursive, but it gives you also subdirectory
pairs to compare. Just hit enter on such a pair.

As bonus, it even works for remote directories.

Best regards, Michael.



Re: [O] bug-tracker

2013-02-22 Thread Michael Albinus
Andreas Röhler andreas.roeh...@easy-emacs.de writes:

 Hi folks,

Hi,

 What about using some of the tools around?

 Mirroring the stuff at github would provide a tracker just by the way...

Or you use debbugs.gnu.org, which hosts the Emacs bugtracker. Some of
the org bugs will arrive there anyway, from people using M-x
report-emacs-bug.

advertisement
And there are debbugs.el and debbugs-gnu.el, which allow access to the
bugs from inside Emacs. I could imagine a debbugs-org.el as well, which
translates bugs into org tasks, or whatever.
/advertisement

 Cheers,

 Andreas

Best regards, Michael (author of debbugs.el, coauthor of debbugs-gnu.el)



Re: [O] bug-tracker

2013-02-22 Thread Michael Albinus
Andreas Röhler andreas.roeh...@easy-emacs.de writes:

 With exception of the noise, M-x report-emacs-bugs tends to send.

 Herewith is a slim version, adapted to org-mode AFAIU

Why do you want to code all the nasty bits yourself? There is
`reporter-submit-bug-report' of reporter.el, which you could customize
to your needs.

Compare, how Tramp uses it in `tramp-bug' (Ha! another advertisement!).

Best regards, Michael.



Re: [O] bug-tracker

2013-02-22 Thread Michael Albinus
David Engster d...@randomsample.de writes:

 Is it OK to report bugs for upstream/development versions through
 `report-emacs-bugs', though? I always thought this should only be used
 for stuff that's actually bundled with Emacs (what about bugs in
 org/contrib, for instance?).

debbugs.gnu.org is not only for Emacs. See
http://debbugs.gnu.org/db/ix/packages.html which other projects are
hosted there. gnus is a prominent example for a subpackage of Emacs
with an own bug package using debbugs.gnu.org.

An alternative approach is tagging bugs of a project with your package
name. See existing user tags of project emacs at
http://debbugs.gnu.org/cgi/pkgindex.cgi?indexon=usertag;user=emacs. cedet
uses this mechanism already.

And shame on me, Tramp doesn't use debbugs.gnu.org (yet).

 -David

Best regards, Michael.



Re: [O] bug-tracker

2013-02-22 Thread Michael Albinus
David Engster d...@randomsample.de writes:

 I was always under the impression that those tags are merely a way for,
 well, tagging bugs, so that you can search for them.  Same for
 packages. I didn't know that this also implied that you're encouraged to
 report bugs against upstream packages, possibly for features which are
 not yet in Emacs (or may even never land there, like some stuff in
 org/contrib, cedet/contrib, etc.).

This must be discussed with the Emacs maintainers, of course. If org
error reports will contain a substantial part of non-core Emacs
problems, an own debbugs package org might be better. Reports arriving
via the Emacs report chain could be reassigned to both packages
emacs,org then.

I recommend to contact Glenn Morris.

 -David

Best regards, Michael.



Re: [O] bug-tracker

2013-02-22 Thread Michael Albinus
Andreas Röhler andreas.roeh...@easy-emacs.de writes:

 There is `reporter-submit-bug-report' of reporter.el, which you could
 customize to your needs.

 Compare, how Tramp uses it in `tramp-bug' (Ha! another advertisement!).

 Hmm, maybe you are fastest just to copy a version with org-mode in the slots.

 That may replace org-submit-bug-report, if Bastien and the others agree.

I believe it is better written by org maintainers. They know much better
which kind of information is needed.

 Andreas

Best regards, Michael.



Re: [O] Running a sudo in a #+begin_src sh fails to get tty and askpass

2013-02-09 Thread Michael Albinus
Emilio Torres Manzanera tor...@uniovi.es writes:

 Dear list,
 I want to compile (C-c C-c) the following code

 #+begin_src sh
 sudo apt-get update
 #+end_src

#+begin_src sh :dir /sudo::
apt-get update
#+end_src

 Thanks!
 Emilio

Best regards, Michael.



Re: [O] [BUG] remote execution in heterogeneous environment

2013-01-09 Thread Michael Albinus
Achim Gratz strom...@nexgo.de writes:

 Works a treat.  Please install!

I have no write access to the org repo. Maybe somebody else could install?

 Regards,
 Achim.

Best regards, Michael.



Re: [O] [BUG] remote execution in heterogeneous environment

2013-01-09 Thread Michael Albinus
Bastien b...@altern.org writes:

 Hi Michael,

Hi Bastien,

 Please send me your public key so that I can give your write access.
 Otherwise can you just resent the patch as a git patch with a commit
 message have an Emacs-ready ChangeLog entry?

I don't believe I need permanent write access. Patch appended.

 Thanks!

Best regards, Michael.

From a39b35c3967ac7c95e3442434a3ca44cba54fca5 Mon Sep 17 00:00:00 2001
From: Michael Albinus michael.albi...@gmx.de
Date: Wed, 9 Jan 2013 13:48:30 +0100
Subject: [PATCH] * ob-eval.el (org-babel-shell-command-on-region): Use
 `executable-find' for local `shell-file-name'

---
 lisp/ob-eval.el |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el
index 8764920..8018111 100644
--- a/lisp/ob-eval.el
+++ b/lisp/ob-eval.el
@@ -137,11 +137,17 @@ specifies the value of ERROR-BUFFER.
 		   t)))
   (let ((input-file (org-babel-temp-file input-))
 	(error-file (if error-buffer (org-babel-temp-file scor-) nil))
+	;; Unfortunately, `executable-find' does not support file name
+	;; handlers.  Therefore, we could use it in the local case
+	;; only.
 	(shell-file-name
-	 (if (file-executable-p
-	  (concat (file-remote-p default-directory) shell-file-name))
-	 shell-file-name
-	   /bin/sh))
+	 (cond ((and (not (file-remote-p default-directory))
+		 (executable-find shell-file-name))
+		shell-file-name)
+	   ((file-executable-p
+		 (concat (file-remote-p default-directory) shell-file-name))
+		shell-file-name)
+	   (/bin/sh)))
 	exit-status)
 ;; There is an error in `process-file' when `error-file' exists.
 ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this
-- 
1.7.10.4



Re: [O] [BUG] remote execution in heterogeneous environment

2013-01-08 Thread Michael Albinus
Achim Gratz strom...@nexgo.de writes:

 +  (let ((input-file (org-babel-temp-file input-))
 +(error-file (if error-buffer (org-babel-temp-file scor-) nil))
 +(shell-file-name
 + (if (file-executable-p
 +  (concat (file-remote-p default-directory) shell-file-name))
 + shell-file-name
 +   /bin/sh))

 The hard-coded /bin/sh breaks testing with NT-Emacs and using Cygwin as
 the backend because of the different path conventions in both
 environments.  This is a hack, but it works when setting SHELL=dash,
 note that there are no path components in there and even if your test
 would fail: NTEmacs knows nothing about Cygwin's path.  Can you please
 arrange that shell-file-name is used without alteration when the
 execution is local?  Even for remote execution hardcoding /bin/sh seems
 a bit heavy-handed to me…

What about this:

--8---cut here---start-8---
--- a/lisp/ob-eval.el
+++ b/lisp/ob-eval.el
@@ -137,11 +137,17 @@ specifies the value of ERROR-BUFFER.
   t)))
   (let ((input-file (org-babel-temp-file input-))
(error-file (if error-buffer (org-babel-temp-file scor-) nil))
+   ;; Unfortunately, `executable-find' does not support file name
+   ;; handlers.  Therefore, we could use it in the local case
+   ;; only.
(shell-file-name
-(if (file-executable-p
- (concat (file-remote-p default-directory) shell-file-name))
-shell-file-name
-  /bin/sh))
+(cond ((and (not (file-remote-p default-directory))
+(executable-find shell-file-name))
+   shell-file-name)
+  ((file-executable-p
+(concat (file-remote-p default-directory) shell-file-name))
+   shell-file-name)
+  (/bin/sh)))
exit-status)
 ;; There is an error in `process-file' when `error-file' exists.
 ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this
--8---cut here---end---8---

The use of /bin/sh as fallback should be OK. In the local case, the
first cond clause shall be selected (otherwise there is something really
wrong). And for remote execution, /bin/sh should exist execept in case
of remote MS Windows or Android devices. Once you want run shells from
org there, we could even tweak this :-)

 Regards,
 Achim.

Best regards, Michael.



Re: [O] [BUG] remote execution in heterogeneous environment

2013-01-08 Thread Michael Albinus
Achim Gratz strom...@nexgo.de writes:

 The use of /bin/sh as fallback should be OK. In the local case, the
 first cond clause shall be selected (otherwise there is something really
 wrong).

 Yes.  But on Windows there is always something wrong… :-)

Again: under Windows, on the local host, `shell-file-name' should do. For
the remote case you are right, but I doubt that any org user has ever
tried to run a remote Windows shell via Tramp.

 And for remote execution, /bin/sh should exist execept in case
 of remote MS Windows or Android devices. Once you want run shells from
 org there, we could even tweak this :-)

 I was thinking towards being able to use a restricted shell.

`shell-file-name' is your friend. /bin/sh is just the last resort. If
you dislike it, you could raise an error instead :-)

 Regards,
 Achim.

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-24 Thread Michael Albinus
George Jones elu...@gmail.com writes:

 Success. No setting of temporary-file-directory needed.

Great! Thanks for your inisistent testing.

 Thanks,
 ---George

Best regards, Micvhael.



Re: [O] remote execution in heterogeneous environment

2012-12-23 Thread Michael Albinus
George Jones elu...@gmail.com writes:

 Still need to 
 (setq temporary-file-directory /tmp/) 

 for things to work, else I get:

 Couldn't write region to
 `/scpc:george@localhost#:/var/folders/j6/j6w17khs3vl9s2_yg4rb5zsmgn/T/input-
 11249kNp', decode using `base64 -d -i %s\
 ' failed 

 Test script and output, without explicitly setting
 temporary-file-directory, attached:

Indeed. I've published a patch to ob.el (as of Emacs trunk). Meanwhile,
ob.el has been renamed to ob-core.el; likely that patch was lost :-(

Bastien, could you please apply this patch (for `org-babel-temp-file')?

 Thanks,
 ---George Jones

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-23 Thread Michael Albinus
Bastien b...@altern.org writes:

 Hi Michael,

Hi Bastien,

 Indeed. I've published a patch to ob.el (as of Emacs trunk). Meanwhile,
 ob.el has been renamed to ob-core.el; likely that patch was lost :-(

 Bastien, could you please apply this patch (for `org-babel-temp-file')?

 Mhh... not sure what patch you refer to -- can you send me the patch
 itself and/or a link to it?

http://thread.gmane.org/gmane.emacs.orgmode/63586/focus=63709

The last patch in this message. Again, the function seems to be moved to
ob-core.el now.

 Thanks!



Re: [O] remote execution in heterogeneous environment

2012-12-22 Thread Michael Albinus
George elu...@gmail.com writes:

Hi George,

 Make everything works with:

   (setq temporary-file-directory /tmp/)

That's a misunderstanding. I meant the workaround I have proposed
yesterday on the org-mode ML, and which has been committed by Bastien.

Meanwhile, everything shall work out-of-the box. Does it for you?

 Thanks,
 ---George Jones

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-21 Thread Michael Albinus
Bastien b...@altern.org writes:

 Hi Michael,

Hi everybody,

 From the org-mode repo, simply run make test: it will compile the
 files and run the test suite.  

I could reproduce the problem.

Finally, it is an error in `process-file', which wasn't detected until
now. Thanks to triggering this!

I've fixed it already in Emacs' trunk. For org-mode, I have used the
following workaround:

--8---cut here---start-8---
~/src/org-mode git diff
diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el
index 23e7143..df95d0a 100644
--- a/lisp/ob-eval.el
+++ b/lisp/ob-eval.el
@@ -143,6 +143,11 @@ specifies the value of ERROR-BUFFER.
 shell-file-name
   /bin/sh))
exit-status)
+;; There is an error in `process-file', when `error-file' exists.
+;; Fixed already in Emacs trunk; for the time being we apply a
+;; workaround.
+(unless (file-remote-p default-directory)
+  (delete-file error-file))
 (if (or replace
(and output-buffer
 (not (or (bufferp output-buffer) (stringp output-buffer)
--8---cut here---end---8---

With that workaround, make test results in

--8---cut here---start-8---
Ran 320 tests, 319 results as expected, 1 unexpected (2012-12-21 09:13:44+0100)
7 expected failures

1 unexpected results:
   FAILED  ob-exp/exports-inline
--8---cut here---end---8---

 Best,

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-21 Thread Michael Albinus
George Jones elu...@gmail.com writes:

 Hi.

Hi George,

 Similar procedure on a mac still yeilds:

 Couldn't write region to
 `/scpc:g...@example.com:/var/folders/j6/j6w17khs3vl9s2_yg4rb5zsmgn/T/input-
 61683xyS', decode using `mimencode -u -b %s' f\
 ailed

Could you, please, show the exact test case? And please apply the
workaround first (see my other email).

 FYI/Thanks,
 ---George Jones

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-20 Thread Michael Albinus
Michael Albinus michael.albi...@gmx.de writes:

Hi,

 Looks, like nobody did take the ball :-(

 Maybe I'll check it again over XMas days, and maybe I can propose a
 concrete patch then.

The following patch I've committed to Emacs' trunk, it fixes the problem
as far as I could test. Maybe somebody from the org maintainers could
merge it into the org repository.

--8---cut here---start-8---
~/src/emacs/lisp/org bzr diff 123
=== modified file 'lisp/org/ChangeLog'
--- lisp/org/ChangeLog  2012-12-13 05:29:15 +
+++ lisp/org/ChangeLog  2012-12-20 13:09:40 +
@@ -1,3 +1,12 @@
+2012-12-20  Michael Albinus  michael.albi...@gmx.de
+
+   * ob.el (org-babel-temp-file): Fix setting of
+   `temporary-file-directory' on remote hosts.
+
+   * ob-eval.el (org-babel-shell-command-on-region): Use
+   `process-file' instead of `call-process-region'.  The latter one
+   does not work on remote hosts.
+
 2012-12-13  Bastien Guerry  b...@gnu.org

* org-latex.el (org-export-latex-links): Escape raw path when

=== modified file 'lisp/org/ob-eval.el'
--- lisp/org/ob-eval.el 2012-09-30 15:14:59 +
+++ lisp/org/ob-eval.el 2012-12-20 13:06:27 +
@@ -134,14 +134,13 @@
   current-prefix-arg
   shell-command-default-error-buffer
   t)))
-  (let ((error-file
-(if error-buffer
-(make-temp-file
- (expand-file-name scor
-(if (featurep 'xemacs)
-(temp-directory)
-  temporary-file-directory)))
-  nil))
+  (let ((input-file (org-babel-temp-file input-))
+   (error-file (if error-buffer (org-babel-temp-file scor-) nil))
+   (shell-file-name
+(if (file-executable-p
+ (concat (file-remote-p default-directory) shell-file-name))
+shell-file-name
+  /bin/sh))
exit-status)
 (if (or replace
(and output-buffer
@@ -151,12 +150,14 @@
  ;; Don't muck with mark unless REPLACE says we should.
  (goto-char start)
  (and replace (push-mark (point) 'nomsg))
+ (write-region start end input-file)
+ (delete-region start end)
  (setq exit-status
-   (call-process-region start end shell-file-name t
-(if error-file
-(list output-buffer error-file)
-  t)
-nil shell-command-switch command))
+   (process-file shell-file-name input-file
+ (if error-file
+ (list output-buffer error-file)
+   t)
+ nil shell-command-switch command))
  ;; It is rude to delete a buffer which the command is not using.
  ;; (let ((shell-buffer (get-buffer *Shell Command Output*)))
  ;;   (and shell-buffer (not (eq shell-buffer (current-buffer)))
@@ -175,14 +176,14 @@
(progn (setq buffer-read-only nil)
   (delete-region (max start end) (point-max))
   (delete-region (point-min) (min start end))
+  (write-region (point-min) (point-max) input-file)
+  (delete-region (point-min) (point-max))
   (setq exit-status
-(call-process-region (point-min) (point-max)
- shell-file-name t
- (if error-file
- (list t error-file)
-   t)
- nil shell-command-switch
- command)))
+(process-file shell-file-name input-file
+  (if error-file
+  (list t error-file)
+t)
+  nil shell-command-switch command)))
  ;; Clear the output buffer, then run the command with
  ;; output there.
  (let ((directory default-directory))
@@ -192,11 +193,11 @@
  (setq default-directory directory))
  (erase-buffer)))
  (setq exit-status
-   (call-process-region start end shell-file-name nil
-(if error-file
-(list buffer error-file)
-  buffer)
-nil shell-command-switch command)))
+   (process-file shell-file-name nil

Re: [O] remote execution in heterogeneous environment

2012-12-20 Thread Michael Albinus
Achim Gratz strom...@nexgo.de writes:

 The following patch I've committed to Emacs' trunk, it fixes the problem
 as far as I could test. Maybe somebody from the org maintainers could
 merge it into the org repository.

 I've already merged it in maint and master.

 Unfortunately it breaks testing, at least in batch mode.  See my other
 posting about it.

Could you, please, give me a short pointer how to run the test suite? I
will check then what happened.

Note, that I don't use the org repository (yet). Maybe you must explain
from the beginning ...

Or you give me a short test program I could run for this dedicated test.

 Regards,
 Achim.

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-17 Thread Michael Albinus
[Cc emacs-orgmode@gnu.org]

George Jones elu...@gmail.com writes:

Hi George,

 Did you ever get resolution on these?  I think I'm hitting the same
 exact problems.

In my last message, I gave some hints what to do in org's code. Since I
don't use org myself (yet), I haven't followed that.

Looks, like nobody did take the ball :-(

Maybe I'll check it again over XMas days, and maybe I can propose a
concrete patch then.

 Thanks,
 ---George Jones

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-12-01 Thread Michael Albinus
Neil Best nb...@ci.uchicago.edu writes:

 I had just recently upgraded Emacs through Macports but had not since
 restarted it, that's all.  No such luck on the Tramp upgrade.  I will
 just wait for the next release to propagate through Macports unless
 some intolerable behavior crops up.  I do have a shiny new version of
 Org to play with thanks to ELPA.  :)

There are still several problems, even with Tramp 2.2.6. I use Org
20121126 from ELPA.

1. test
===

My local and remote hosts use /tmp, both run Linux. So I have applied
prior to the test

--8---cut here---start-8---
(setq temporary-file-directory ~/tmp/)
--8---cut here---end---8---

This directory is known to exist locally, but not remotely. When I eval
the source code block, I don't run into this infloop as you have seen
(this is fixed with Tramp 2.2.6, indeed). But there is another error

--8---cut here---start-8---
Tramp: Decoding region into remote file 
/scpc:ford:/home/albinus/tmp/sh-205735cU...done
cond: Couldn't write region to `/scpc:ford:/home/albinus/tmp/sh-205735cU', 
decode using `base64 -d -i %s' failed
--8---cut here---end---8---

Somewhere in the code, the remote temporary directory is created based
on `temporary-file-directory', which is wrong. I believe this is in
Org's code, must be debugged further.

2. test
===

I keep `temporary-file-directory' as /tmp. The source code block
evaluates fine, but the result is:

--8---cut here---start-8---
#+BEGIN_SRC sh :dir /ford:~
echo Executed by `whoami` on `hostname` in `pwd`
#+END_SRC

#+RESULTS:
: Executed by albinus on detlef in /home/albinus
--8---cut here---end---8---

Obviously, the code is executed on the local host. As far as I could
debug it, this is because `org-babel-shell-command-on-region' calls
`call-process-region', which is not aware of remote execution.

 PS: it's on my wishlist for a long time to learn org-mode. Maybe I have
 a chance now.

 You won't regret it.  Have fun.  What's your use case?

Accessing lists on different devices, under Linux, Android etc.

 How did you happen to get on this thread?  Was there a cross-post that
 I missed?

Nothing special. I have looked into the ML archive for some other
reason, and I have seen this thread by accident.

 Thanks for pitching in, everyone.

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-11-30 Thread Michael Albinus
Nick Dokos nicholas.do...@hp.com writes:

 See

   http://thread.gmane.org/gmane.emacs.orgmode/62963

I've seen that.

 It was a weird setting of the variable ``temporary-file-directory'' in
 Neil's Macport setup, plus the assumption by tramp that that setting was
 valid for the remote - that turned out to be a bad assumption. Not sure
 it's worth it for tramp to provide a way to customize that, but that's
 your decision :-) AFAIAC, /tmp should be a universal standard.

I don't believe it is a weird setting of `temporary-file-directory'. It
is a valid value for OS X, AFAIK.

And /tmp isn't a universal standard. For example, it doesn't work,
when your local machine runs MS Windows.

The patch in Tramp I have mentioned tries to distinguish between local
and remote temporary directories. I would like to know, whether this
works correctly for org-mode, or whether there is still an issue.

 Nick

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-11-30 Thread Michael Albinus
Nick Dokos nicholas.do...@hp.com writes:

 OK - thanks. Sorry for the noise.

 Trying-to-get-foot-out-of-mouth-ly yours,

Come on, there's nothing you have to sorry. You don't know Tramp, that's
all. And this is not exclusive by you :-)

 Nick

Best regards, Michael.



Re: [O] remote execution in heterogeneous environment

2012-11-30 Thread Michael Albinus
Neil Best nb...@ci.uchicago.edu writes:

 tramp-version
 2.2.3-24.1

 emacs-version
 24.2.1

 Looks like I should upgrade tramp.  I will look into that.

Emacs 24.3 is in pretest, it contains Tramp 2.2.6. This might be another
option. See http://thread.gmane.org/gmane.emacs.devel/155058.

 I think if I restart emacs it will be upgraded to some minor, minor
 release, so maybe that took care of it already.  Fat chance?

Sorry, this I don't understand ...

 Btw, I don't use org. For local tests, what shall I apply in order to
 execute the code in #+BEGIN_SRC  ... #+END_SRC?

 I should mention that my source code block got mangled when I tried to
 post through Gmane.  It should look like this:

 #+BEGIN_SRC sh :dir /midway:~
 echo Executed by `whoami` on `hostname` in `pwd`
 #+END_SRC

 Just go into Org mode, move the point within the block, and hit C-c C-c.

Thanks, I will try to reproduce your problem locally.

Best regards, Michael.

PS: it's on my wishlist for a long time to learn org-mode. Maybe I have
a chance now.



Re: [O] remote execution in heterogeneous environment

2012-11-29 Thread Michael Albinus
Neil Best nb...@ci.uchicago.edu writes:

Hi,

 I run Macport's Emacs and ELPA's Org on my Mac but my data lives in a
 Red Hat environment.  I thought I could edit locally and compute
 remotely but there seems to be a problem with temp files for executing
 source blocks.

 #+BEGIN_SRC sh :dir /midway:~ echo Executed by `whoami` on `hostname`
 in `pwd` #+END_SRC

 Results are empty and in the message buffers appears this:

 executing Sh code block...  Tramp: Opening connection for midway using
 ssh...

 Opening connection for midway using ssh... \ Tramp: Opening connection
 for midway using ssh...done Tramp: Encoding region using function
 `base64-encode-region'...done Tramp: Decoding region into remote file
 /ssh:midway:/var/folders/2y/qrw3hhkx0dlb9sbl51mjy5wmgn/T/sh-510999vN...done
 byte-code: Couldn't write region to
 `/ssh:midway:/var/folders/2y/qrw3hhkx0dlb9sbl51mjy5wmgn/T/sh-510999vN',
 decode using `base64 -d -i %s' failed

Which version of Tramp are you using? You find it by C-h v tramp-version.
I remember a problem with remote temporary directories, fixed in Tramp 2.2.6.

Btw, I don't use org. For local tests, what shall I apply in order to
execute the code in #+BEGIN_SRC  ... #+END_SRC?

Best regards, Michael (Tramp maintainer).