Re: [O] org-babel-expand-src-block behavior

2017-08-14 Thread Nicolas Goaziou
Hello,

Ken Mankoff  writes:

> Is there a way to get variables into org-edit-special? Maybe by pre-pending
> C-u to C-c '?

The problem is not getting the variables into the remote editing buffer.
As you noticed, we would only need to remove the read-only status from
`org-babel-expand-src-block' output. The difficulty is writing back to
the source buffer. You need to mark somehow the original contents of the
src block and be able to retrieve it upon exiting the buffer.

Also, the remote editing buffer is not really suited for debugging.
Since it is not associated to a file, some compilers refuse to run the
code in there (e.g., asymptote blocks).

> How do others debug code with input variables?

I expand everything, copy it and write it into a temporary file. I do
the debugging in the temp file. When I'm satisfied, I copy the contents
of the file back into the remote editing buffer. Nothing fancy.


Regards,

-- 
Nicolas Goaziou



Re: [O] Can't remove deadline or schedule in bulk mode

2017-08-14 Thread Julien Cubizolles
Kyle Meyer  writes:


> Since you have the git repo set up and have a good/bad range, you can use
> git bisect to find the offending commit.

I'm having trouble using setting it up. To go back to a previous state
using magit, I'm 

* choosing a commit in the log view of magit-status
* magit-checkout or magit-reset --soft to this commit
* rebuild org-mode with make clean && make update

--8<---cut here---start->8---
(add-to-list 'load-path "~/git-repositories/org-mode/lisp")
(add-to-list 'load-path "~/git-repositories/org-mode/contrib/lisp")
(org-reload)
--8<---cut here---end--->8---

Somehow I'm missing something since even when going back to 8.xx
versions of org-mode, the problem remains although the stock version
(Org mode version 9.0.9 (release_9.0.9 @
/usr/share/emacs/26.0.50/lisp/org/)) doesn't exhibit it.

What is the right way to load the org-mode from the git repo instead of
the one already installed on the system ?

Julien.




Re: [O] Escaping links

2017-08-14 Thread Neil Jerram

Except if your original string was "%org-9.0"...

For this kind of approach to work, you generally need to prefix 
everything; specifically included the cases that are _not_ encoded.


Regards - Neil


On 12/08/17 16:01, John Kitchin wrote:

I was thinking of something like how all PDF files start with something
like %PDF-1.3. So any string that started with %org-9.0, for example
would be certain to be encoded, whereas any other beginning would not be
certain.

Nicolas Goaziou writes:


Hello,

John Kitchin  writes:


Could you put some magic at the beginning of the string that indicates it
is encoded?

I don't know. Could you elaborate a bit?

Regards,







Re: [O] Escaping links

2017-08-14 Thread Fabrice Popineau
You could also prefix the link by a string holding (in ascii) the number of
bytes of the unencoded link.

But that makes raw/manual editing of an org file much harder.


2017-08-14 18:26 GMT+02:00 Neil Jerram :

> Except if your original string was "%org-9.0"...
>
> For this kind of approach to work, you generally need to prefix
> everything; specifically included the cases that are _not_ encoded.
>
> Regards - Neil
>
>
>
> On 12/08/17 16:01, John Kitchin wrote:
>
>> I was thinking of something like how all PDF files start with something
>> like %PDF-1.3. So any string that started with %org-9.0, for example
>> would be certain to be encoded, whereas any other beginning would not be
>> certain.
>>
>> Nicolas Goaziou writes:
>>
>> Hello,
>>>
>>> John Kitchin  writes:
>>>
>>> Could you put some magic at the beginning of the string that indicates it
 is encoded?

>>> I don't know. Could you elaborate a bit?
>>>
>>> Regards,
>>>
>>
>>
>
>


-- 
Fabrice Popineau
-
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
--


Re: [O] Can't remove deadline or schedule in bulk mode

2017-08-14 Thread Julien Cubizolles
Julien Cubizolles  writes:

> Kyle Meyer  writes:
>
>
>> Since you have the git repo set up and have a good/bad range, you can use
>> git bisect to find the offending commit.

I finally found the offending commit,

it's commit 4f578a3f7fe193229adc239c93d6983bcc030d41 org-agenda: Small
refactoring by N. Goaziou.

Julien.





Re: [O] Table columns not aligning when width set

2017-08-14 Thread William Denton
I was able to use git bisect (on master) to narrow down where the problem 
started (for me, at least):


27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4 is the first bad commit
commit 27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4
Author: Nicolas Goaziou 
Date:   Thu Jul 27 15:22:45 2017 +0200

Fix `org-string-width'

* lisp/org.el (org-string-width): Better handle various invisible
  characters.

I'm not sure what's going on ... is anyone else seeing this problem with tables?

Bill

On 8 August 2017, William Denton wrote:

I noticed this last week, but I'm on vacation.  I'm compiling and running Org 
and Emacs from source, and have been keeping up to date, but the problem's 
been there for a while.  For Org, I'm on the master branch, not tables, and 
running "make update" to update.


In the example below, the <40> and <10> widths are not respected.  If you hit 
C-c C-C on the STARTUP line, first one things goes wrong and then another, 
and you can toggle back and forth.


Bill

# --

#+TITLE: Table column problem
#+STARTUP: align

| Forty| Ten  |
| <40> | <10> |
|--+--|
| This cell has more than forty characters in it, but it won't align | Under. 
|

| This cell has under forty characters.| More than ten over here. |

# --



--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: http://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/



[O] Fill column indicator and org indent mode

2017-08-14 Thread Galen Menzel

Hi all,

I use [Semantic 
linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/) 
for a lot of my org files, for which having a visual indicator of column 
80 is useful. I'm currently using 
[`fill-column-indicator`](https://github.com/alpaker/Fill-Column-Indicator) 
for this, but the column indicator does not adjust for the indention 
level when using `org-indent-mode` — it just draws straight down on 
column 80 of the frame, regardless of the line's indention level. (So in 
a line under a level-3 headline with `org-indent-indentation-per-level` 
set to 2, the fill column indicator will appear on column 80 of the 
frame, which is actually column 76 of the line.)


Is anyone aware of a solution to displaying the fill column in a way 
that takes the indention level into account?


Thanks!

Best,

Galen

Re: [O] Table columns not aligning when width set

2017-08-14 Thread Kaushal Modi
On Mon, Aug 14, 2017 at 1:55 PM William Denton  wrote:

> I was able to use git bisect (on master) to narrow down where the problem
> started (for me, at least):
>
> 27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4 is the first bad commit
> commit 27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4
> Author: Nicolas Goaziou 
> Date:   Thu Jul 27 15:22:45 2017 +0200
>
>  Fix `org-string-width'
>
>  * lisp/org.el (org-string-width): Better handle various invisible
>characters.
>
> I'm not sure what's going on ... is anyone else seeing this problem with
> tables?
>

Thanks for doing the bisect. I am also seeing the same problem you stated.

Here's what the table in your example looks like after I hit tab in the
first cell.. it should have got aligned.

[image: image.png]
-- 

Kaushal Modi


[O] Patch that enables visibility settings in org-mode iCalendar export

2017-08-14 Thread Tobias Schlemmer
Hi,

for some reasons I need to control the visibility of individual entries
of my caldav calendars. I have implemented a small patch that passes the
`CLASS' propery to the iCalendar export:

https://github.com/keinstein/org-mode/pull/1

I'd like to have this patch integrated in the short term. It is mostly
done by cut and paste from the same file.

For long term I think a configurable framework would be more useful:

• It would be helpful to have a configuration variable that tells which
properties are passed more or less verbatim as iCalendar fields
• It would be helpful to save some/all other fields with some prefix
(X-ORG-MODE-…) in the calendar file/service. The prefix should be
configurable as well as the list of saved properties.
• A mapping between org-mode properties and iCalendar fields could be
helpful. Together with some default action all of the above could be
realized with only two variables.

I'm not familiar enough with Lisp to do the work by myself. So this is a
pure feature request.

Tobias

P.S.: Please add me to CC for all discussions as I'm not on the mailing
list.




[O] Bug: Deleting region in table [9.0.8 (9.0.8-dist @ /Users/nick/.emacs.d/lisp/org/)]

2017-08-14 Thread Nick Helm

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

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

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


Deleting a region within an org table causes point to jump.

Recipe:

  Emacs -Q
  org-mode

  ;make a table
  | this is a simple | table |

  double-click "simple" ;place region over a word
  

With the last command, I expect the word "simple" to be deleted, the
right-hand "|" separator (and following column) to close up six chars,
and point to end up to the right of "a ".

Note however that point winds up in the middle of the next column over
the word "table". Or, more precisely, one screen column to the left of
where it started. An additional space is also inserted in the first
column.

I had a look at org.el and I think this occurs because the function
`org-delete-backward-char' (which my system calls by default to delete
text in a table) is unaware of the region and treats the case above as a
single char backwards delete.

Tweaking the function like this seems to help.

--- a/src/org.el2017-06-06 03:25:46.0 +1200
+++ b/src/org.el2017-08-13 15:52:32.0 +1200
@@ -20243,6 +20243,7 @@
 (org-check-before-invisible-edit 'delete-backward)
 (if (and (org-at-table-p)
 (eq N 1)
+(not (org-region-active-p))
 (string-match "|" (buffer-substring (point-at-bol) (point)))
 (looking-at ".*?|"))
(let ((pos (point))

The situation is the same with org 9.0.9 and master.



Emacs  : GNU Emacs 25.2.1 (x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 
1504.83)
 of 2017-08-12
Package: Org mode version 9.0.8 (9.0.8-dist @ /Users/nick/.emacs.d/lisp/org/)

current state:
==
(setq
 org-export-backends '(ascii html latex odt)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-adapt-indentation nil
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width 150
 org-startup-align-all-tables t
 org-startup-folded nil
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append 
local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 (lambda nil
  (face-remap-add-relative (quote font-lock-comment-face) 
(quote org-comment))
  (font-lock-add-keywords nil
   (quote (("^\\s-*\\([+-]\\|[0-9]+\\.\\)\\s-" 1 (quote 
org-list-bullet)
  )
 )
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-fontify-quote-and-verse-blocks t
 org-export-before-parsing-hook '((lambda (x) (setq org-odt-styles-dir 
nh-emacs-etc)))
 org-catch-invisible-edits 'show
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store 
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export 
:store org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export :store
org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete
org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") 
("file+emacs")
   ("doi" :follow org--open-doi-link) ("elisp" :follow 
org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" 
path)

Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-14 Thread Kaushal Modi
On Wed, Aug 9, 2017 at 5:58 AM Rasmus  wrote:

> There’s definitely some sort of issue...
>
> I guess this is for a local file?


Correct. I was testing it out only on an HTML file (local) exported from
org.


>   I guess it needs to be publicly
> available.  But it doesn’t seem to work all the time even for public
> pages.
>
> Using the following example, it only works from the http version, not the
> https version.
>
> https://pages.gitlab.io/org-mode/
> http://pages.gitlab.io/org-mode/


OK. Thanks for the info.

About the fix for blank titles, I just pushed it to master (
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=c8ade76ca2d579e9415cb3588605a6c98803f413
 ).
-- 

Kaushal Modi


Re: [O] Can't remove deadline or schedule in bulk mode

2017-08-14 Thread Kyle Meyer
Julien Cubizolles  writes:

> Julien Cubizolles  writes:
>
>> Kyle Meyer  writes:
>>
>>
>>> Since you have the git repo set up and have a good/bad range, you can use
>>> git bisect to find the offending commit.
>
> I finally found the offending commit,
>
> it's commit 4f578a3f7fe193229adc239c93d6983bcc030d41 org-agenda: Small
> refactoring by N. Goaziou.

Yep, that's the same commit that I pointed to in the later part of the
message you quote, but my guess about what the problematic bits were was
wrong.  Anyway, should be fixed with b900a85fe.

-- 
Kyle



[O] [Feature request] LaTeX blocks preview

2017-08-14 Thread edgar

Hello,

I would like to ask if it is possible to preview latex blocks. Something 
like this (replace EXPORT with SRC, if you wish):


#+BEGIN_EXPORT latex
\begin{align}
  I_{0}
  & > \max{(\lambda_{f}^{2})}
  \\
  & > 2^{2}
  \\
  I_{0} & > 4
\end{align}
#+END_EXPORT

to be previewed in the same way as

\begin{align}
  I_{0}
  & > \max{(\lambda_{f}^{2})}
  \\
  & > 2^{2}
  \\
  I_{0} & > 4
\end{align}

- Rationale :: the LaTeX blocks have improved highlighting and editing 
commands than pure Org-mode, they can be folded (hidden?) in Org-mode 
and some extra options can be activated when exporting. Many times, it 
is needed to preview the equations before actually exporting.


- Related ::
  - org-edit-latex-mode
There is org-edit-latex-mode, but it requires  some extra work:
1. org-edit-special (C-')
2. org-edit-latex-preview-at-point (C-c C-p C-p)
3. org-edit-src-exit (C-')

Besides, the preview does not stay in the original Org-mode buffer, 
but it's lost with step 3.


Please? Thank you!

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] Table columns not aligning when width set

2017-08-14 Thread Colin Baxter
> "William" == William Denton  writes:

William> I was able to use git bisect (on master) to narrow down
William> where the problem started (for me, at least):

William> 27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4 is the first bad
William> commit commit 27466a38bcd6f5f3c6bd3c61b8ec9253d4dbf4e4
William> Author: Nicolas Goaziou  Date: Thu
William> Jul 27 15:22:45 2017 +0200

William> Fix `org-string-width'

William> * lisp/org.el (org-string-width): Better handle various
William> invisible characters.

William> I'm not sure what's going on ... is anyone else seeing this
William> problem with tables?

Yes, I have it too. I'm on org-mode release_9.0.9-748-g3359e0, with
emacs-25.2.

-- 
--
Colin Baxter
m43...@yandex.com
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 41C8



Re: [O] Fill column indicator and org indent mode

2017-08-14 Thread Tim Cross

I was using fci, but found all sorts of problems when it comes to
org-mode. In addition to the issue you mention, you will also find
'spurious' additional characters turning up in things like html exports
of your org files. I also started getting font-lock errors when I tried
to edit special blocks using C-c ' and a number of other bits of weird
behaviour.

Once I dropped fci and configured the whitespace package to show
characters past my fill column in a different colour, all the odd issues
I was seeing just vanished and my exports were working correctly again.

I preferred using fci and even used it for a while before I started
seeing problems. It was only once I stopped using it I realised that
many of the minor issues I was experiencing were due to fci and org
incompatibilities.

I did dig into this and found some others who had experienced similar
issues and even some partial fixes, but in the end, they still didn't
help with some of the more annoying issues and were likely to introduce
other problems.

While whitespace mode can provide similar functionality, I don't think
it will adjust to the org indentation as well. The problem is that these
packages just consider the screen and is not aware of mode level
specifics. Of the two, I suspect you could make whitespace act more
'dynamically' than fci, but we probably really need an org-aware column
indicator package/extension.

tim

Galen Menzel writes:

> Hi all,
>
> I use [Semantic 
> linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/) 
> for a lot of my org files, for which having a visual indicator of column 
> 80 is useful. I'm currently using 
> [`fill-column-indicator`](https://github.com/alpaker/Fill-Column-Indicator) 
> for this, but the column indicator does not adjust for the indention 
> level when using `org-indent-mode` —it just draws straight down on 
> column 80 of the frame, regardless of the line's indention level. (So in 
> a line under a level-3 headline with `org-indent-indentation-per-level` 
> set to 2, the fill column indicator will appear on column 80 of the 
> frame, which is actually column 76 of the line.)
>
> Is anyone aware of a solution to displaying the fill column in a way 
> that takes the indention level into account?
>
> Thanks!
>
> Best,
>
> Galen


-- 
Tim Cross



Re: [O] Fill column indicator and org indent mode

2017-08-14 Thread Kaushal Modi
On Mon, Aug 14, 2017 at 5:59 PM Tim Cross  wrote:

>
> I was using fci, but found all sorts of problems when it comes to
> org-mode. In addition to the issue you mention, you will also find

'spurious' additional characters turning up in things like html exports
> of your org files.


I fixed that particular problem using this:

=
;; It is required to disable `fci-mode' when `htmlize-buffer' is called;
;; otherwise the invisible fci characters show up as funky looking
;; visible characters in the source code blocks in the html file.
;; http://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00777.html
(with-eval-after-load 'fill-column-indicator
  (defvar modi/htmlize-initial-fci-state nil
"Variable to store the state of `fci-mode' when `htmlize-buffer' is
called.")

  (defun modi/htmlize-before-hook-fci-disable ()
(setq modi/htmlize-initial-fci-state fci-mode)
(when fci-mode
  (fci-mode -1)))

  (defun modi/htmlize-after-hook-fci-enable-maybe ()
(when modi/htmlize-initial-fci-state
  (fci-mode 1)))

  (add-hook 'htmlize-before-hook #'modi/htmlize-before-hook-fci-disable)
  (add-hook 'htmlize-after-hook
#'modi/htmlize-after-hook-fci-enable-maybe))
=

When the code blocks are exported to HTML, htmlize is used to load the
major mode to get the syntax highlighting. The side effect of that is that
the FCI mode also gets enabled as they would have been added to the major
mode's hook var. Now, FCI shows that column indicator using a special
sequence of characters. The spurious additional characters are those.

Above snippet basically prevents the fci mode from getting enabled when
htmlize is doing its thing.

In general I agree that FCI needs one to put such hacks in their config,
and whitespace mode (ships with Emacs) is much nicer. Though, there is no
package that does the exact same thing as FCI.
-- 

Kaushal Modi


Re: [O] Fill column indicator and org indent mode

2017-08-14 Thread Eduardo Mercovich

Dear Galen.


I use Semantic linefeeds for a lot of my org files [...]


Thank you for the reference about Semantic linefeeds.

I didn't knew it, but used it something similar sometimes when 
operating on complex sentences/paragraphs.


I created org list items as in Slf, one semantic nucleus per line, 
and rearranged them to develop the idea clearly seeing the order, 
the cuts (colon, semicolon, etc.), the lengths.


When it's done, I joined the items again.

But, as is usual in the beautiful orgmode world, I don't even have 
to. Org exports the paragraph perfectly even keeping the short 
lines in the source. :)


Thanks again...

--
eduardo mercovich

Donde se cruzan tus talentos 
con las necesidades del mundo, 
ahí está tu vocación. 
(Anónimo)