Re: [O] LaTex Output with Index

2019-05-14 Thread Robert Love
With your instructions I can now generate a document with an index.  Thanks.

However, I have one hitch.   How do I generate an index with an entry that has 
an “@“ symbol in it?

For example

#+index: @ terms

I’ve tried \@ and \verb{@} and several other ideas but once there is an @ sign, 
no entry shows up.  If I have “terms” instead of “@ terms” it works fine. The @ 
sign shows up OK in the body of the document, just not in an index.

Any suggestions?   


> On May 12, 2019, at 2:21 PM, Fraga, Eric  wrote:
> 
> On Sunday, 12 May 2019 at 10:17, Robert Love wrote:
>> Can someone point to an example of using Org mode to generate a LaTeX
>> document with an index?  I see the Org has section 13.1.8 Generating
>> an index.  What is the means to turn that into LaTex with an index?
>> Do I have to use a project?  Is there a simple example?
> 
> That part of the manual is for publishing to HTML, not for creating a
> PDF via LaTeX.
> 
> To generate an index for LaTeX, you add
> 
> #+index: term
> 
> lines to your org file.  
> 
> You need to have a couple of extra bits in your org file for LaTeX to
> know about creating an index.  In particular, you need:
> 
> #+LaTeX_HEADER: \usepackage{makeidx} \makeindex
> 
> and then a \printindex statement somewhere in your org file (probably at
> the end) for the index to be generated.
> 
> Once you have your org file the way you want it, you then need to use
> LaTeX itself to create the index.  So:
> 
> 1. export to LaTeX
> 2. run pdflatex on the LaTeX file
> 3. run it again just to make sure (sometimes 3 runs are needed...)
> 4. then run makeindex on the file (base name)
> 5. finally run pdflatex again (maybe twice)
> 
> You can do all these steps from within Emacs.  You can either visit the
> LaTeX file directly to execute steps 2-5 or you can modify
> org-latex-pdf-process (via file local variables, for instance) to insert
> the makeindex command.
> 
> HTH.
> -- 
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.3-327-g3375f0




Re: [O] Show weekday in daily agenda view

2019-05-14 Thread Nick Dokos
johanna@th-koeln.de writes:

> maybe I did not search the right way in google alias startpage. But I
> could not figure out how to write next to the date e.g. 2000-04-01 the
> weekday, i.e. the specific day of the week. It would come very handy to
> have the date displayed as 2019-05-14 Tu and 2019-05-15 We and so on. Or
> even have it spelled out as 2019-05-14 Tuesday.
>

How do you generate that view?

Doesn't your agenda view already show the day of the week?  With the
recommended keybinding, I get a daily agenda with C-c a a d.

Mine starts like this:

,
| Day-agenda (W20):
| Tuesday14 May 2019
|8:00.. 
|   appts:  10:00-11:30 Tools Meeting
|   10:00.. 
|   12:00.. 
|   14:00.. 
|   16:00.. 
|   18:00.. 
|   20:00.. 
|   work:   Sched.Xx:  TODO Review PR
|   work:   Sched.2x:  TODO Add issue
|   Weather:OpenWeatherMap: light rain, 3-8°C, 1010hpa, 90%, 3m/s
`

so it definitely shows the weekday, but perhaps you are doing something
different?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Show weekday in daily agenda view

2019-05-14 Thread Richard Lawrence
Hi Johanna,

johanna@th-koeln.de writes:

> maybe I did not search the right way in google alias startpage. But I
> could not figure out how to write next to the date e.g. 2000-04-01 the
> weekday, i.e. the specific day of the week. It would come very handy to
> have the date displayed as 2019-05-14 Tu and 2019-05-15 We and so on. Or
> even have it spelled out as 2019-05-14 Tuesday.
>
> Probably there is a way of setting this. How does it work?

Hmm.  My daily agenda (the default one) starts like this:

Day-agenda (W20):
Tuesday14 May 2019

and tasks, etc. are listed below that.  I don't think I've ever
customized this.  Are you seeing something different?  Or maybe you mean
something else by "agenda"?

If you're talking about Org's built-in agenda, you might want to take a
look at the `org-agenda-format-date' variable.  Mine is set to the
org-agenda-format-date-aligned function, which I assume is what outputs
the example above.

If you're just talking about timestamps in Org files, you might want to
look at the `org-time-stamp-custom-formats' and
`org-display-custom-times' variables.

Hope that helps!

-- 
Best,
Richard



[O] Show weekday in daily agenda view

2019-05-14 Thread johanna . may
Hi org-mode community,

maybe I did not search the right way in google alias startpage. But I
could not figure out how to write next to the date e.g. 2000-04-01 the
weekday, i.e. the specific day of the week. It would come very handy to
have the date displayed as 2019-05-14 Tu and 2019-05-15 We and so on. Or
even have it spelled out as 2019-05-14 Tuesday.

Probably there is a way of setting this. How does it work?

Thanks and cheers,

J



[O] bug#35419: [Proposal] Buffer Lenses and the Case of Org-Mode (also, Jupyter)

2019-05-14 Thread Dmitrii Korobeinikov
Dear Ihor,

> Note that indirect buffers always share *all* the contents with the master
> buffer. As a result, it may not be easy to make things like flyspell
> work on code blocks in org-mode, if these code blocks are treated as
> lenses.

I tried flyspell w/ different dictionaries on 2 buffers.
The dictionary is switched every time I switch into one of the buffers.
You are right, ispell and the like working w/ a file directly would have to
learn to work w/ indirect buffers by managing multiple simultaneous
processes.
Fortunately, that doesn't seem like a big hurdle.

>> (1) A question: when an indirect buffer is created and some region is
>> narrowed to, is the rest of the buffer duplicated in memory somewhere? If
>> this is so, there could be a useful efficiency-related modification to
>> indirect buffers, which would allow "hard-narrowing": not duplicating the
>> rest of the base buffer.
>
> There is no duplication of the buffer content in indirect buffers.
> Internally, indirect buffer's content is a pointer to the main buffer
> content. If you modify text in any of the indirect buffers or in the
> main buffer, the text is modified in all of them and in the main buffer.
> Only the buffer-local variables are duplicated.
> You can refer to "27.11 Indirect Buffers" in the elisp manual for
> details.

Bad choice of wording on my side, I didn't mean duplication, but rather
keeping unnecessary info, like text properties in the newly created
indirect buffer, in the regions which were "permanently" chosen to be
narrowed-out.
Anyway, this is a premature optimization for now.

> > The next immediately outstanding question is:
> > (2) how can "embedding" (of a buffer as a part of another buffer as an
> > area) be done efficiently? This could possibly be approached as two
> > problems: (i) displaying the area and (ii) interacting with it.
> > Any ideas?
>
> These issues have been discussed in
> https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00863.html.
> As I remember, the discussion stopped without a clear conclusion. It was
> not clear how to separate the main buffer contents from the nested
> buffer (I treat them as analogue of the buffer lenses). Another issue
> was how the keymaps and buffer-local variables would interact when the
> point is within a lense. It was not clear what should be the priority.

The short answer is probably that lens-mode looks at the changes to the
buffer and decides what's what.
Here is my vision for this.

Say, you have an indirect buffer, call it A, it's base has contents:

> line 1
> line 2
> line 3

Also, there is a buffer, call it B, where we want to embed A, with contents:

> word 1
> instruction: lens that displays A
> word 2

Lens-mode decides to identify the second line as a lens and constructs
layout of the file.

> [text]
> [lens#A]
> [text]

Now, construct and display the final buffer as:

> word 1
> line 1
> line 2
> line 3
> word 2

The core question: how is this "displaying" done.
In part, somewhat like how indirect buffers function.
A displayed piece of text is a pointer/reference to the text in the
indirect buffer.
Of course, this should be done in a way so that the modes running in B
don't change the properties of the text (following the layout constructed
by lens-mode as in the example above). Though, this might better&easier be
done at the display unit level.

What about interaction?
Well, when the cursor is inside the lens, the controller decides what to do
w/ each keybinding, whether to redirect it to the indirect buffer or not.
And what about the case when borders are crossed?
As I see it, any code that executes - does so as is.
For instance, consider a buffer with a lens (contents: "lens"), which looks
like this: "word1 lens word2".
Place the cursor on the first word, run a command to remove 2 words.
Now there are to possibilities here, depending on the implementation of the
function which does the removal:
1. Implementation identifies the boundaries of deletion and removes the
words as contents of the main buffer. Lens-mode identifies the removal and
deletes the lens altogether.
2. Delete "word1" -> the cursor is on "lens" -> next deletion command is
redirected to the indirect buffer, which does the removal. Lens-mode
identifies the lens as empty and removes it.

The second way might not be always desirable, so whenever a function is
called with the cursor outside a lens, as an option, decide to never
redirect the input to a lens while the function runs.

For another case, consider the first example with lines and, cursor being
in the beginning of the file, remove three lines.
To make this interesting, assume the first kind of implementation runs,
identifying the bounds, never redirecting a command to the lens.
Well, if the implementation of the lens is inspired by how indirect buffers
work, I imagine, the necessary changes in the embedded buffer take place
directly, in which case everything works as desirable.

Afterwards, lens-mode processes t

[O] Bug: org-agenda-set-tags with certain options sets tags on wrong entry [9.2.3 (9.2.3-13-g727c3f-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20190506/)]

2019-05-14 Thread Allen Li
Repro:

1. emacs -Q
2. Eval:

(setq org-tag-alist '(("agenda" . ?a)))
(add-to-list 'load-path "~/.emacs.d/elpa/org-plus-contrib-20190506")
(define-key global-map (kbd "C-c a") #'org-agenda)
(setq switch-to-buffer-preserve-window-point t)

3. Make a tmp.org containing:

* TODO foo
* TODO bar

4. Add tmp.org to agenda files.
5. Make sure point is on the foo entry.
6. C-c a t
7. Move point to the bar entry.
8. : a RET // Set agenda tag

Expected:

agenda tag set on bar entry

Actual:

agenda tag set on foo entry

More info:

switch-to-buffer-preserve-window-point interacts poorly with the
(delete-other-windows) call in org-fast-tag-selection.


Emacs  : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
 of 2019-04-12
Package: Org mode version 9.2.3 (9.2.3-13-g727c3f-elpaplus @
~/.emacs.d/elpa/org-plus-contrib-20190506/)