Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Carsten Dominik 17 years ago
parent
commit
b0e67e64ca
7 changed files with 129 additions and 36 deletions
  1. 5 0
      CONTRIB/ChangeLog
  2. 1 0
      CONTRIB/README
  3. 80 0
      CONTRIB/scripts/org2hpda
  4. 6 0
      ChangeLog
  5. 10 18
      org-irc.el
  6. 1 0
      org.el
  7. 26 18
      org.texi

+ 5 - 0
CONTRIB/ChangeLog

@@ -1,3 +1,8 @@
+2008-02-17  Christian Egli  <christian.egli@alumni.ethz.ch>
+
+	* scripts/org2hpda: Added a Makefile for generation of hipster pda
+	style printouts
+
 2008-02-08  Phil Jackson  <phil@shellarchive.co.uk>
 
 	* scripts/dir2org.zsh: New file.

+ 1 - 0
CONTRIB/README

@@ -35,3 +35,4 @@ SCRIPTS (shell, bash, etc.)
 ===========================
 
 dir2org.zsh          --- Org compatible fs structure output
+org2hpda	     --- Generate hipster pda style printouts from Org-mode

+ 80 - 0
CONTRIB/scripts/org2hpda

@@ -0,0 +1,80 @@
+# org2hpda - a small utility to generate hipster pda style printouts from org mode 
+# Copyright (C) 2007  Christian Egli
+# 
+# Version: 0.4
+#
+# 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Commentary:
+# 
+# set cal-tex-diary to true so that diary entries show up in the calendar 
+#
+# the pdf* commands are part of the pdfjam package which can be found
+# at http://www.warwick.ac.uk/go/pdfjam
+
+EMACS = emacs -batch -l ~/.emacs
+LATEX = latex
+
+hipsterFiles =  weekCalendar.pdf yearCalendar.pdf monthCalendar3.pdf monthCalendar2.pdf monthCalendar1.pdf
+pocketModFiles =  weekCalendar.pdf yearCalendar-rotated.pdf \
+	monthCalendar3-rotated.pdf monthCalendar2-rotated.pdf monthCalendar1-rotated.pdf
+
+all: pocketMod.pdf hipsterPDA.pdf
+
+%.dvi: %.tex
+	# Quick hack to massage the LaTeX produced by cal-tex
+	# quote '@', then increase font size of week calendars and 
+	# finaly increase font of diary entries in moth calendar
+	sed 	-e 's/\\verb|@|/\@/g' \
+		-e 's/documentclass\[11pt\]/documentclass[12pt]/g' \
+		-e 's/{\\tiny \\raggedright #3}/{\\small \\raggedright #3}/g' \
+		< $< > /tmp/temp-org-file.$$$$; mv /tmp/temp-org-file.$$$$ $<
+	$(LATEX) $^
+
+%.pdf: %.dvi
+	dvipdf $^
+
+%-rotated.pdf: %.pdf
+	cp $^ $@
+	for n in 1 2 3; do \
+		pdf90 --outfile tmp.pdf $@; mv tmp.pdf $@; \
+	done
+
+weekCalendar.tex: ~/diary
+	$(EMACS) -eval "(progn (calendar) (cal-tex-cursor-week-iso 4) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+
+monthCalendar1.tex: ~/diary
+	 $(EMACS) -eval "(progn (calendar) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+
+monthCalendar2.tex: ~/diary
+	 $(EMACS) -eval "(progn (calendar) (calendar-forward-month 1) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+
+monthCalendar3.tex: ~/diary
+	 $(EMACS) -eval "(progn (calendar) (calendar-forward-month 2) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+
+yearCalendar.tex: ~/diary
+	 $(EMACS) -eval "(progn (calendar) (calendar-forward-month 2) (cal-tex-cursor-year-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+
+pocketMod.pdf: $(pocketModFiles)
+	pdfjoin --outfile tmp.pdf $^
+	pdfnup tmp.pdf --outfile $@ --nup 4x2 --frame true
+
+hipsterPDA.pdf: $(hipsterFiles)
+	pdfnup weekCalendar.pdf --outfile page1.pdf --nup 2x2 --frame true
+	pdfjoin --outfile tmp.pdf monthCalendar[1-3]-rotated.pdf yearCalendar-rotated.pdf
+	pdfnup tmp.pdf --outfile page2.pdf --nup 2x2 --frame true
+	pdfjoin --outfile $@ page1.pdf page2.pdf
+
+clean:
+	rm -rf *.aux *.dvi *.tex *.log *.pdf

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-02-19  Phil Jackson  <phil@shellarchive.co.uk>
+
+	* org.el (org-store-link): org-irc required.
+	* org-irc.el (org-irc-get-erc-link): Fixed to allow the extraction
+	of a nick from both CVS and stable versions of erc.
+
 2008-02-19  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org.el (org-set-regexps-and-options): Parse the new logging

+ 10 - 18
CONTRIB/lisp/org-irc.el → org-irc.el

@@ -1,11 +1,12 @@
-;;; org-irc.el --- Store links to IRC sessions.
-;; Copyright (C) 2008 Phil Jackson
+;;; org-irc.el --- Store links to IRC sessions
+;;
+;; Copyright (C) 2008  Free Software Foundation, Inc.
 ;;
 ;; Author: Philip Jackson <emacs@shellarchive.co.uk>
 ;; Keywords: erc, irc, link, org
-;; Version: 0.03
+;; Version: 1.0
 ;;
-;; This file is not yet part of GNU Emacs.
+;; This file is part of GNU Emacs.
 ;;
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -21,7 +22,6 @@
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 ;;; Commentary:
 ;;
@@ -51,14 +51,12 @@
 ;;
 ;;; Code:
 
-(require 'org)
-
 (defvar org-irc-client 'erc
   "The IRC client to act on")
-(defvar org-irc-link-to-logs t
+(defvar org-irc-link-to-logs nil
   "non-nil will store a link to the logs, nil will store an irc: style link")
 
-;; Generic functions/config (extend for other clients)
+;; Generic functions/config (extend these for other clients)
 
 (add-to-list 'org-store-link-functions
              'org-irc-store-link)
@@ -149,16 +147,10 @@ of the current ERC session"
     (concat link "/"
             (if (and (erc-default-target)
                      (erc-channel-p (erc-default-target))
-                     (get-text-property (point) 'erc-parsed)
-                     (elt (get-text-property (point) 'erc-parsed) 1))
+                     (car (get-text-property (point) 'erc-data)))
                 ;; we can get a nick
-                (let ((nick
-                       (car
-                        (erc-parse-user
-                         (elt (get-text-property (point)
-                                                 'erc-parsed) 1)))))
-                  (concat (erc-default-target) "/"
-                          (substring nick 1)))
+                (let ((nick (car (get-text-property (point) 'erc-data))))
+                  (concat (erc-default-target) "/" nick))
                 (erc-default-target)))))
 
 (defun org-irc-visit-erc (link)

+ 1 - 0
org.el

@@ -11943,6 +11943,7 @@ For links to usenet articles, arg negates `org-usenet-links-prefer-google'.
 For file links, arg negates `org-context-in-file-links'."
   (interactive "P")
   (setq org-store-link-plist nil)  ; reset
+  (require 'org-irc)
   (let (link cpltxt desc description search txt)
     (cond
 

+ 26 - 18
org.texi

@@ -2274,6 +2274,7 @@ cursor on or at a target.
 @cindex links, external
 @cindex GNUS links
 @cindex BBDB links
+@cindex IRC links
 @cindex URL links
 @cindex file links
 @cindex VM links
@@ -2286,20 +2287,20 @@ cursor on or at a target.
 @cindex elisp links
 
 Org-mode supports links to files, websites, Usenet and email messages,
-and BBDB database entries.  External links are URL-like locators.  They
-start with a short identifying string followed by a colon.  There can be
-no space after the colon.  The following list shows examples for each
-link type.
+BBDB database entries and links to both IRC conversations and their
+logs.  External links are URL-like locators.  They start with a short
+identifying string followed by a colon.  There can be no space after
+the colon.  The following list shows examples for each link type.
 
 @example
 http://www.astro.uva.nl/~dominik          @r{on the web}
 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
 file:papers/last.pdf                      @r{file, relative path}
 news:comp.emacs                           @r{Usenet link}
-mailto:adent@@galaxy.net                   @r{Mail link}
+mailto:adent@@galaxy.net                  @r{Mail link}
 vm:folder                                 @r{VM folder link}
 vm:folder#id                              @r{VM message link}
-vm://myself@@some.where.org/folder#id      @r{VM on remote machine}
+vm://myself@@some.where.org/folder#id     @r{VM on remote machine}
 wl:folder                                 @r{WANDERLUST folder link}
 wl:folder#id                              @r{WANDERLUST message link}
 mhe:folder                                @r{MH-E folder link}
@@ -2309,6 +2310,7 @@ rmail:folder#id                           @r{RMAIL message link}
 gnus:group                                @r{GNUS group link}
 gnus:group#id                             @r{GNUS article link}
 bbdb:Richard Stallman                     @r{BBDB link}
+irc:/irc.com/#emacs/bob                   @r{IRC link}
 shell:ls *.org                            @r{A shell command}
 elisp:(find-file-other-frame "Elisp.org") @r{An elisp form to evaluate}
 @end example
@@ -2349,18 +2351,23 @@ insert it into an org-mode file, and to follow the link.
 Store a link to the current location.  This is a @emph{global} command
 which can be used in any buffer to create a link.  The link will be
 stored for later insertion into an Org-mode buffer (see below).  For
-Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
-points to the target.  Otherwise it points to the current headline.  For
-VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
-indicate the current article/entry.  For W3 and W3M buffers, the link
-goes to the current URL.  For any other files, the link will point to
-the file, with a search string (@pxref{Search options}) pointing to the
-contents of the current line.  If there is an active region, the
-selected words will form the basis of the search string.  If the
-automatically created link is not working correctly or accurately
-enough, you can write custom functions to select the search string and
-to do the search for particular file types - see @ref{Custom searches}.
-The key binding @kbd{C-c l} is only a suggestion - see @ref{Installation}.
+Org-mode files, if there is a @samp{<<target>>} at the cursor, the
+link points to the target.  Otherwise it points to the current
+headline.  For VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the
+link will indicate the current article/entry.  For W3 and W3M buffers,
+the link goes to the current URL.  For IRC links, if you set the
+variable @code{org-irc-link-to-logs} to non-nil then @kbd{C-c l} will
+store a @samp{file:/} style link to the relevant point in the logs for
+the current conversation. Otherwise an @samp{irc:/} style link to the
+user/channel/server under the point will be stored.  For any other
+files, the link will point to the file, with a search string
+(@pxref{Search options}) pointing to the contents of the current line.
+If there is an active region, the selected words will form the basis
+of the search string.  If the automatically created link is not
+working correctly or accurately enough, you can write custom functions
+to select the search string and to do the search for particular file
+types - see @ref{Custom searches}.  The key binding @kbd{C-c l} is
+only a suggestion - see @ref{Installation}.
 @c
 @kindex C-c C-l
 @cindex link completion
@@ -4599,6 +4606,7 @@ similar way.}:
 Link type          |  Available keywords
 -------------------+----------------------------------------------
 bbdb               |  %:name %:company
+bbdb               |  %::server %:port %:nick
 vm, wl, mh, rmail  |  %:type %:subject %:message-id
                    |  %:from %:fromname %:fromaddress
                    |  %:to   %:toname   %:toaddress