Python 3 shell in Emacs

If you’d like to run a Python 3 shell within Emacs you could issue the following command:

C-u M-x run-python

It’ll then prompt you to confirm which Python version you’d want to run. You can just type 3 and click Enter again. If you use it a lot, however, it’s not going to be the most convenient of the solutions. You could automate the whole process by adding the following 2 lines to your ~/.emacs file:

(defun run-python3 () (interactive) (run-python "python3"))
(global-set-key [f5] 'run-python3)

The second line assigns a keybinding to the command. In the example above it is the F5 key.

emacs remember.el

For quick jotting down one can use the remember.el module of emacs. Simply add the following to your ~/.emacs:

(setq org-directory “~/data/orgs/”)
(setq org-default-notes-file (concat org-directory “/”))
(define-key global-map “\C-cr” ‘org-remember)

Obviously you need to adjust the paths accordingly.  As you can see Ctrl-c r will bring up a remember window where you’ll be able to jot down ideas. As it automatically loads the org mode, you can make use of all its features while making a note. Once you’re done, simply press C-c C-c to save the note in the org directory (in my case it’s ~/data/orgs/ The entry will start with the date of note creation and the first line of the note as a kind of the title.

edit: I realise there’s so much more to ‘remember’ than I’ve posted here. I’ll look into it in the near future.

The emacs way: boxquote.el

Finally I found a nice way of quoting in Emacs. It is particularly useful in gnus. The module in question is called boxquote and can be obtained from here.

It’ll draw a nice border around the quoted text:

 | This is the quoted text.

That’s the relevant entry from .emacs:

(require 'boxquote)
(global-set-key [f7] 'boxquote-region)

(global-set-key (kbd "C-c q y")   'boxquote-yank)
(global-set-key (kbd "C-c q r")   'boxquote-region)
(global-set-key (kbd "C-c q u")   'boxquote-unbox-region)
(global-set-key (kbd "C-c q t")   'boxquote-title)
(global-set-key (kbd "C-c q i")   'boxquote-insert-file)
(global-set-key (kbd "C-c q k")   'boxquote-kill)
(global-set-key (kbd "C-c q s")   'boxquote-shell-command)

(global-set-key (kbd "C-c q b")   'boxquote-buffer)
(global-set-key (kbd "C-c q p")   'boxquote-paragraph)
(global-set-key (kbd "C-c q n")   'boxquote-narrow-to-boxquote)
(global-set-key (kbd "C-c q w")   'boxquote-where-is)
(global-set-key (kbd "C-c q d f") 'boxquote-describe-function)
(global-set-key (kbd "C-c q d k") 'boxquote-describe-key)
(global-set-key (kbd "C-c q d v") 'boxquote-describe-variable)

If you use org-mode with standard key bindings, you are quite likely to encounter problems
as C-c b is also a common mapping for org-iswitchb:

(define-key global-map "\C-cb" 'org-iswitchb)

I personally changed the boxquote mappings to C-c q, which semantically makes more sense to me anyway