generate emacs org agenda view from a few org files - emacs

I am using Emacs org and enjoy it. I know org agenda and try it, but do not keep using it. Because I always have a lot of things to do, a few projects, home and personal things.All these are recorded in a few org files.
How can I generate one agenda view from these a few org files?

Customise the org-agenda-files variable.
You can do this interactively by visiting your Org files and add them to the agenda files by pressing C-c [. The agenda files may be stored in a section like the following in your init file:
(custom-set-variables
'(org-agenda-files (quote ("~/org/gtd.org"))))
Some advice: this is basic Org functionality. I suggest working through one of the good tutorials out there to learn the basic Org commands and customisation options, for example http://orgmode.org/guide/Agenda-files.html#Agenda-files.

Related

Emacs 24 Eww(Browser) - buffer and project open and refresh

In Emacs 24 there is a new feature Eww which is the Emacs web browser.
I am using this resource ergoemacs as a reference.
Looking through describe mode I can see a list of commands but not for what I want to do.
Describe mode
CTRL+h m
I want to be able to link an index.html file as the root file of a project and open the file in Eww and refresh automatically when I make updates.
There is also the other option of
eww-browse-with-external-browser
So I can create a split window
split-window-right
But how can I tie it together in 2 key combos to open current file in eww-internal and eww-external and refresh automatically on updates in project?
Just key binding isn't working for me.
(global-set-key (kbd "C-x a") 'eww-browse-with-external-browser)
NB if it helps I am using Helm, unsure if this would help but it current seems awesome and I am only scratching the surface of what it can do.

Emacs mode for Stack Overflow's markdown

I am using Org-mode in Emacs to handle all my technical documentation. I would like to use Emacs to prepare questions that I have for Stack Overflow. Is there an Emacs mode for that, or even better, an extension for Org-mode to handle Stack Overflow formatting? Ideally it should include all formatting options supported by the markdown syntax used in the Stack Overflow question/comment buffers.
Integrating Emacs with Stack Overflow
As mentioned you can use markdown-mode. To integrate markdown-mode with Stack Overflow you can use the Firefox plugin It's All Text which lets you edit textareas with an external editor. Here is how to set it up:
Install markdown-mode. If you use Debian or Ubuntu you can install it by issuing
sudo apt-get install emacs-goodies-el
or if you're on emacs 24 (or have package.el on emacs 23) and Marmalade or Melpa you can install it with
M-x package-install RET markdown-mode
Install It's All Text.
Set It's All Text's preferences to use Emacs. Either you can set it to the executable (e.g. /usr/bin/emacs) or the emacsclient.
Add the following to your .emacs to enable markdown-mode for Stack Overflow and Stack Exchange textareas:
;; Integrate Emacs with Stack Exchange https://stackoverflow.com/a/10386560/789593
(add-to-list 'auto-mode-alist '("stack\\(exchange\\|overflow\\)\\.com\\.[a-z0-9]+\\.txt" . markdown-mode))
Alternatively, if as-external-alist is defined—if M-x describe-variable RET as-external-alist doesn't fail—it will probably override your auto-mode-alist. It has a slightly different format (it's a list of pairs instead of a list of cons cells) so this will work:
(add-to-list 'as-external-alist '("stack\\(exchange\\|overflow\\)\\.com\\.[a-z0-9]+\\.txt" markdown-mode))
Press the blue edit button at the bottom right side of a textarea to edit it via emacs. The blue edit button is shown in the following screenshot:
In the following screenshot is an Emacs buffer in markdown-mode editing this post:
When you are done editing in Emacs save the buffer to send it to Firefox.
If you want this functionality for other domains you need to change the regexp above. The following recognizes Stack Exchange, Stack Overflow, Ask Ubuntu and Super User:
;; Integrate Emacs with Stack Exchange https://stackoverflow.com/a/10386560/789593
(add-to-list 'auto-mode-alist '("\\(stack\\(exchange\\|overflow\\)\\|superuser\\|askubuntu\\)\\.com\\.[a-z0-9]+\\.txt" . markdown-mode))
Using markdown-mode with Org-mode
To use markdow-mode with Org-mode you can use its feature for working with source code. With it you can include blocks of markdown inside your Org-mode buffers which you can edit via markdown-mode. You can use it as follows:
When in an Org-mode buffer enter <s on a newline and press Tab. This will result in
#+begin_src
#+end_src
Enter markdown after #+begin_src so that you have
#+begin_src markdown
#+end_src
When inside the source block (between #+begin_src markdown and #+end_src) press C-c ' to edit the source block with markdown-mode.
Edit the source block in markdown-mode.
Press C-c ' to return to the Org-mode buffer and insert the edit. This can look like what the following screenshot shows:
There is markdown-mode: http://jblevins.org/projects/markdown-mode/
See http://emacswiki.org/emacs/MarkdownMode for some customization.
And there is a markdown backend for the new export engine here:
http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-md.el;hb=HEAD
Make sure you add the contrib/lisp/ directory to your load-path.
Then (require 'org-export) and (require 'org-md).
M-x org-md-export-to-markdown RET will export to markdown.
#N.N's answer is applicable to Chrome also, with these changes in details.
Chrome has Edit with Emacs extension, which is similar to It's all text. After installing it, you'll find further instructions from the extension options page.
There is an emacs customization group edit-server with options, most importantly the major mode change per site is configured differently than in #N.N's answer:
(add-to-list 'edit-server-url-major-mode-alist
'("^stackoverflow" . markdown-mode))
Also, for the edit-server to work in terminal emacs, I had to disable the edit-server-new-frame option.
Pandoc has support for reading a subset of org-mode and can output markdown.
In other words, you can keep writing in org-mode, including writing italics /like this/, and then export to markdown.
From emacs you can convert to markdown by selecting the region, hitting C-u M-S-\ and typing pandoc -r org -t markdown, getting output like this:
In other words, you can keep writing in org-mode, including writing italics *like this*, and then export to markdown.
Or, you can save the file and convert it at the command line.
It Is Easy With Chrome Too
This is less an answer than a test of my solution using
the
Edit with Emacs chrome
plugin and the Emacs Edit Server
configured to use markdown-mode
for Stackoverflow (and other Stackexchange sites I use). All I had to do after
installing the extension and MELPA packages was set
(setq edit-server-url-major-mode-alist
'(("mail.google.com" . org-mode)
("stackoverflow\\.com" . markdown-mode)
(".*\\.stackexchange\\.com" . markdown-mode)
("github\\.com" . markdown-mode)))
Gmail Message Support
Note in the above setting, I'm using org-mode for gmail messages. Still need
to do a little work here, but it is possible, with a little effort, to draft
your gmail message using org-mode and then use org-mime to generate html from
your org structured text. You could just use markdown and a markdown to html
conversion.

How to make org syntax links in any emacs buffer look like in org-mode?

I am using emacs org-mode for managing my notes. Often I wish to use links to this notes from files, which I am editing in other modes, like AUCTeX.
See here for a descriptive screenshot. (I am not yet allowed to post images here.)
Storing and following this links works pretty well. But I find it disturbing to read the full org syntax of the links: [[file:notes.org::*note][Description]], which is obviously not folded outside of org-mode.
I wonder if there is any minor-mode which provides the folding of such links to a clickable Description, like it is done in org-mode.
You can use links outside Org-mode.
4.5 Using links outside Org
You can insert and follow links that have Org syntax not only in Org, but in any Emacs buffer. For this, you should create two global commands, like this (please select suitable global keys yourself):
(global-set-key "\C-c L" 'org-insert-link-global)
(global-set-key "\C-c o" 'org-open-at-point-global)
-- Source: Using-links-outside-Org
Edit (1 Nov 2012): As of October 2011 the minor mode enabling org-like links didn't exist, but there were discussions. Now the minor mode exists, it is called org-link-minor-mode and is included in org-contrib.
I think the standard answer would be to use the publishing methods within org-mode to publish to a different file type, and link to that instead. Publishing, once set up, is really easy and fast to use and can produce things like html files that you could safely link to from something else (that is hopefully HTML compliant). Since you didn't say what the other-thing(s) is that you're using it's hard to recommend a good publishing output.

Adding a submode to nXhtml

Having made the jump just recently from XEmacs to GNU Emacs, I'm really loving nXhtml mode for writing web code. I'd like to be able to add a sub mode to it, though, and I'm not sure how. There doesn't seem to be a good reference to do so.
I have a mode for Perl's Template Toolkit, loaded as tt-mode and the default for .tmpl files, and I'd like to use nXhtml for my .tmpl files, with tt-mode taking over only between the [% %] tags.
Well, it appears (after some digging), that modes are defined in util/mumamo-fun.el, and there is already a Template Toolkit mode defined.
EDIT: Took out my original notes about having a problem with automatically loading it, because I was doing something dumb. :P)
Setting it up automatically was pretty simple:
(require 'mumamo-fun)
(setq auto-mode-alist (append '(("\\.tmpl$" . tt-html-mumamo)) auto-mode-alist))
Voila!
It looks like setting up other new modes is a fairly simple process. util/mumamo-fun.el contains the templates for all of the submodes. Following that format, it defines functions for finding chunks of the buffer that define a certain submode, and then builds them with other chunks (like the inline css and javascript, etc) into something that mumamo understands. I haven't actually tried to build a different mode, though, so I'm not sure if there is any additional work that needs to be done, but once defined, they seem to be registered with mumamo automatically.

How to change emacs config in Lisp In A Box

I have been a programmer for a decade now, but I believe this is the first time I've ever asked a question on a forum. I just can't figure this out and can't find the answer already online.
I am trying to turn on CUA mode so that emacs is more bearable for a windows user (normal copy paste functions). I am running Windows 7 and installed emacs through the Lisp In A Box package. I understand that I need to add a line to my .emacs file or init.el file. I'm not sure which, but I can't find either in my Lip In A Box install directory. The emacs package install also did not come with any tutorials or help files, so its really hard to pick this up.
I am stuck, any help is greatly appreciated!
The .emacs can be found by looking at the answers to this similar question.
Regarding documentation and tutorials, it looks like the link you provided for "Lisp in a Box" says:
If you are new to Emacs, it is
recommended that you read the Emacs
Tutorial which you can access from
with Emacs by going to the Help menu,
or by typing Control-h, letting go,
and hitting t. A more extensive manual
is also available from the Help menu,
or on the web at
http://www.gnu.org/software/emacs/manual/.
Which makes it sound like the manual is there, and certainly the tutorial (I made bold the directions to get to the tutorial).
As far as other places to get information, there is a collection of screencasts on the wiki.
Your question doesn't specify whether or not you what to add to your .emacs to activate CUA mode. You can check out the CUA mode documentation on the wiki (which has links to the manual). The minimal installation is just adding this to your .emacs: (cua-mode t).
For GNU/Emacs, you can choose to use any one of the following three file names as the start-up configuration file:
${HOME}/.emacs
${HOME}/.emacs.el
${HOME}/.emacs.d/init.el
It would probably be a good idea to decide on one of the three options and then stick to it - the first one seems to be the most widely used one. In any case, ${HOME} stands for your home directory -- which is likely to be different from the Lisp In A Box install directory!
Coming from a Unix tradition, Emacs understands ~ (tilde) as an abbreviation for your home directory, so you can visit the .emacs file by typing:
C-x C-f ~/.emacs [ENTER]
(Note that the capital C is Emacs standard notation for a combination of the CTRL key and a second key, i.e. here you press CTRL-x CTRL-f which stands for "find-file" and will then ask you for a file name in the bottom part of the Frame (aka mini-buffer).)
If these are your first customizations, you will just see an empty buffer. Enter
;; start CUA mode every time Emacs starts
(cua-mode t)
and save the buffer with C-x C-s.
Next time you start Emacs, CUA mode should be turned on automatically.
What the others have told you is true: Simply adding (cua-mode t) to your dotfile would be sufficient. HOWEVER: Lisp in a box' Emacs doesn't load this file by default.
Therefore, be sure to edit the shortcut so that it does load the dotfile. This is important, because otherwise you would get weird behavior, where you would add the correct line to the dotfile, start emacs, and then not get cua mode. That would suck.
The reason it does this is to ensure that it starts a vanilla emacs everytime, instead of finding, say C:/_emacs and loading that instead, giving you another user's customizations and confusing you.
The flag for not loading an init file is -q or --no-init-file. Also make sure that --no-site-file is not there.
(I realize that this is an old post, but I found this while looking for something related, and I don't want people walking away frustrated over something that doesn't work.)