Release 4.40
This commit is contained in:
parent
2ff8fc1133
commit
8fd900c684
11
README
11
README
|
@ -1,4 +1,11 @@
|
|||
The is a distribution of org-mode
|
||||
The is a distribution of Org-mode, a plain text notes and project planning
|
||||
tool for Emacs.
|
||||
|
||||
The homepage of org-mode is at http://www.astro.uva.nl/~domnik/Tools/org/
|
||||
The homepage of Org-mode is at http://www.astro.uva.nl/~domnik/Tools/org/
|
||||
|
||||
The manual is in the file org.pdf, it includes a section about installation.
|
||||
|
||||
The xemacs directory contains special code for XEmacs users, in particular
|
||||
a port of the GNU Emacs outline.el to XEmacs. Org-mode does not work
|
||||
under XEmacs without this file installed. It did until version 4.37,
|
||||
but no longer.
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
;;; org-publish.el --- publish related org-mode files as a website
|
||||
|
||||
;; Copyright (C) 2006 David O'Toole
|
||||
;; Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: David O'Toole <dto@gnu.org>
|
||||
;; Keywords: hypermedia, outlines
|
||||
;; Version:
|
||||
|
||||
;; $Id: org-publish.el,v 1.67 2006/05/30 10:44:31 dto Exp dto $
|
||||
;; $Id: org-publish.el,v 1.73 2006/06/15 12:43:48 dto Exp $
|
||||
|
||||
;; This file is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,8 +23,6 @@
|
|||
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
;; Boston, MA 02110-1301, USA.
|
||||
|
||||
;; This file is NOT part of GNU Emacs.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Requires at least version 4.27 of org.el
|
||||
|
@ -321,6 +319,20 @@ whether file should be published."
|
|||
(set-file-times timestamp)))
|
||||
|
||||
|
||||
;;;; A hash mapping files to project names
|
||||
|
||||
|
||||
(defvar org-publish-files (make-hash-table :test 'equal) "Hash
|
||||
table mapping file names to project names.")
|
||||
|
||||
|
||||
;;;; Checking filenames against this hash
|
||||
|
||||
|
||||
(defun org-publish-validate-link (link)
|
||||
(gethash (file-truename link) org-publish-files))
|
||||
|
||||
|
||||
;;;; Getting project information out of org-publish-project-alist
|
||||
|
||||
|
||||
|
@ -333,19 +345,25 @@ When argument is not given, return all property lists for all projects."
|
|||
(project nil)
|
||||
(plists nil)
|
||||
(components nil))
|
||||
|
||||
;;
|
||||
;;
|
||||
(while (setq project (pop alist))
|
||||
;; what kind of project is it?
|
||||
(if (setq components (plist-get (cdr project) :components))
|
||||
;; meta project. annotate each plist with name of enclosing project
|
||||
(setq plists
|
||||
(append plists
|
||||
(mapcar (lambda (p)
|
||||
(plist-put p :project-name (car project)))
|
||||
(mapcan 'org-publish-get-plists components))))
|
||||
(apply 'append
|
||||
(mapcar 'org-publish-get-plists components))))
|
||||
;; normal project
|
||||
(let ((p (cdr project)))
|
||||
(setq p (plist-put p :project-name (car project)))
|
||||
(setq plists (append plists (list (cdr project)))))))
|
||||
(setq plists (append plists (list (cdr project)))))
|
||||
;;
|
||||
(dolist (p plists)
|
||||
(let* ((exclude (plist-get p :exclude))
|
||||
(files (org-publish-get-base-files p exclude)))
|
||||
(dolist (f files)
|
||||
(puthash (file-truename f) (car project) org-publish-files)))))
|
||||
plists))
|
||||
|
||||
|
||||
|
@ -371,7 +389,7 @@ matching filenames."
|
|||
;; include extra files
|
||||
(let ((inc nil))
|
||||
(while (setq inc (pop include-list))
|
||||
(setq allfiles (cons (concat dir inc) allfiles))))
|
||||
(setq allfiles (cons (expand-file-name inc dir) allfiles))))
|
||||
|
||||
allfiles))
|
||||
|
||||
|
@ -380,14 +398,8 @@ matching filenames."
|
|||
"Figure out which project a given FILENAME belongs to, if any.
|
||||
Filename should contain full path. Returns name of project, or
|
||||
nil if not found."
|
||||
(let ((found nil))
|
||||
(mapcar
|
||||
(lambda (plist)
|
||||
(let ((files (org-publish-get-base-files plist)))
|
||||
(if (member (expand-file-name filename) files)
|
||||
(setq found (plist-get plist :project-name)))))
|
||||
(org-publish-get-plists))
|
||||
found))
|
||||
(org-publish-get-plists)
|
||||
(gethash (file-truename filename) org-publish-files))
|
||||
|
||||
|
||||
(defun org-publish-get-plist-from-filename (filename)
|
||||
|
@ -402,6 +414,7 @@ nil if not found."
|
|||
found))
|
||||
|
||||
|
||||
|
||||
;;;; Pluggable publishing back-end functions
|
||||
|
||||
|
||||
|
@ -450,7 +463,6 @@ FILENAME is the filename of the file to be published."
|
|||
If :auto-index is set, publish the index too."
|
||||
(let* ((exclude-regexp (plist-get plist :exclude))
|
||||
(publishing-function (or (plist-get plist :publishing-function) 'org-publish-org-to-html))
|
||||
(buf (current-buffer))
|
||||
(index-p (plist-get plist :auto-index))
|
||||
(index-filename (or (plist-get plist :index-filename) "index.org"))
|
||||
(index-function (or (plist-get plist :index-function) 'org-publish-org-index))
|
||||
|
@ -463,9 +475,7 @@ FILENAME is the filename of the file to be published."
|
|||
;; check timestamps
|
||||
(when (org-publish-needed-p f)
|
||||
(funcall publishing-function plist f)
|
||||
(org-publish-update-timestamp f))))
|
||||
;; back to original buffer
|
||||
(switch-to-buffer buf)))
|
||||
(org-publish-update-timestamp f))))))
|
||||
|
||||
|
||||
(defun org-publish-org-index (plist &optional index-filename)
|
||||
|
@ -505,7 +515,9 @@ default is 'index.org'."
|
|||
;;;###autoload
|
||||
(defun org-publish (project-name &optional force)
|
||||
"Publish the project PROJECT-NAME."
|
||||
(interactive "sProject name: \nP")
|
||||
(interactive (list (completing-read "Project name: " org-publish-project-alist
|
||||
nil t)
|
||||
current-prefix-arg))
|
||||
(let ((org-publish-use-timestamps-flag (if force nil t))
|
||||
(plists (org-publish-get-plists project-name)))
|
||||
(mapcar 'org-publish-plist plists)))
|
||||
|
|
BIN
orgcard.pdf
BIN
orgcard.pdf
Binary file not shown.
176
orgcard.tex
176
orgcard.tex
|
@ -1,5 +1,5 @@
|
|||
% Reference Card for Org Mode
|
||||
\def\orgversionnumber{4.37}
|
||||
\def\orgversionnumber{4.40}
|
||||
\def\year{2006}
|
||||
%
|
||||
%**start of header
|
||||
|
@ -288,10 +288,8 @@ are preserved on all copies.
|
|||
|
||||
\section{Motion}
|
||||
|
||||
\key{next heading}{C-c C-n}
|
||||
\key{previous heading}{C-c C-p}
|
||||
\key{next heading, same level}{C-c C-f}
|
||||
\key{previous heading, same level}{C-c C-b}
|
||||
\key{next/previous heading}{C-c C-n/p}
|
||||
\key{next/previous heading, same level}{C-c C-f/b}
|
||||
\key{backward to higher level heading}{C-c C-u}
|
||||
\key{jump to another place in document}{C-c C-j}
|
||||
\key{previous/next plain list item}{S-UP/DOWN$^3$}
|
||||
|
@ -306,13 +304,18 @@ are preserved on all copies.
|
|||
\key{promote current subtree up one level}{M-S-LEFT}
|
||||
\key{demote current subtree down one level}{M-S-RIGHT}
|
||||
|
||||
\key{move subtree/list item up}{M-S-UP}
|
||||
\key{move subtree/list item down}{M-S-DOWN}
|
||||
\key{move subtree/list item up/down}{M-S-UP/DOWN}
|
||||
\key{kill subtree}{C-c C-x C-w}
|
||||
\key{copy subtree}{C-c C-x M-w}
|
||||
\key{yank subtree}{C-c C-x C-y}
|
||||
\key{narrow buffer to current subtree}{C-x n s}
|
||||
|
||||
\key{archive subtree}{C-c \$}
|
||||
\section{Archiving}
|
||||
|
||||
\key{toggle ARCHIVE tag}{C-c C-x C-a}
|
||||
\metax{mark fully dine children}{C-u C-c C-x C-a}
|
||||
\key{move subtree to achive file}{C-c \$}
|
||||
\key{move all fully done children}{C-u C-c \$}
|
||||
To set archive location for current file, add a line like$^2$:
|
||||
\vskip -1mm
|
||||
\beginexample%
|
||||
|
@ -329,18 +332,8 @@ To set archive location for current file, add a line like$^2$:
|
|||
%\key{agenda for the week}{C-c a$^1$}
|
||||
%\key{agenda for date at cursor}{C-c C-o}
|
||||
|
||||
\section{Tags}
|
||||
|
||||
\key{set tags for current heading}{C-c C-c}
|
||||
\key{realign tags in all headings}{C-u C-c C-c}
|
||||
\key{create sparse tree with matching tags}{C-c \\}
|
||||
\key{globally (agenda) match tags at cursor}{C-c C-o}
|
||||
|
||||
\section{Tables}
|
||||
|
||||
%Org-mode has its own built-in intuitive table editor with unique
|
||||
%capabilities.
|
||||
|
||||
{\bf Creating a table}
|
||||
|
||||
%\metax{insert a new Org-mode table}{M-x org-table-create}
|
||||
|
@ -466,6 +459,39 @@ formula, \kbd{:=} a named-field formula.
|
|||
%\key{\kbd{vm://myself@some.where.org/folder\#id}}{\rm VM remote}
|
||||
|
||||
|
||||
\section{Remember-mode Integration}
|
||||
|
||||
See the manual for how to make remember.el use Org-mode links and
|
||||
files. The note-finishing command \kbd{C-c C-c} will first prompt for
|
||||
an org file. In the file, find a location with:
|
||||
|
||||
\key{rotate subtree visibility}{TAB}
|
||||
\key{next heading}{DOWN}
|
||||
\key{previous heading}{UP}
|
||||
|
||||
Insert the note with one of the following:
|
||||
|
||||
\key{as sublevel of heading at cursor}{RET}
|
||||
\key{right here (cursor not on heading)}{RET}
|
||||
\key{before current heading}{LEFT}
|
||||
\key{after current heading}{RIGHT}
|
||||
\key{shortcut to end of buffer (cursor at buf-start)}{RET}
|
||||
\key{Abort}{q}
|
||||
|
||||
\section{Completion}
|
||||
|
||||
In-buffer completion completes TODO keywords at headline start, TeX
|
||||
macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
|
||||
after ``{\tt :}'', and dictionary words elsewhere.
|
||||
|
||||
\key{Complete word at point}{M-TAB}
|
||||
|
||||
|
||||
\newcolumn
|
||||
\title{Org-Mode Reference Card (2/2)}
|
||||
|
||||
\centerline{(for version \orgversionnumber)}
|
||||
|
||||
\section{TODO Items}
|
||||
|
||||
\key{rotate the state of the current item}{C-c C-t}
|
||||
|
@ -480,6 +506,13 @@ formula, \kbd{:=} a named-field formula.
|
|||
\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
|
||||
\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
|
||||
|
||||
\section{Tags}
|
||||
|
||||
\key{set tags for current heading}{C-c C-c}
|
||||
\key{realign tags in all headings}{C-u C-c C-c}
|
||||
\key{create sparse tree with matching tags}{C-c \\}
|
||||
\key{globally (agenda) match tags at cursor}{C-c C-o}
|
||||
|
||||
\section{Timestamps}
|
||||
|
||||
\key{prompt for date and insert timestamp}{C-c .}
|
||||
|
@ -502,18 +535,26 @@ formula, \kbd{:=} a named-field formula.
|
|||
%\key{... forward/backward one month}{M-S-LEFT/RIGT}
|
||||
|
||||
|
||||
\newcolumn
|
||||
\title{Org-Mode Reference Card (2/2)}
|
||||
|
||||
\centerline{(for version \orgversionnumber)}
|
||||
|
||||
\section{Clocking Time}
|
||||
|
||||
\key{start clock on current item}{C-c C-x C-i}
|
||||
\key{stop clock on current item}{C-c C-x C-o}
|
||||
\key{cancel current clock}{C-c C-x C-x}
|
||||
|
||||
\key{display total subtree times}{C-c C-x C-d}
|
||||
\key{remove displayed times}{C-c C-c}
|
||||
\key{insert/update table with clock report}{C-c C-x C-r}
|
||||
|
||||
\section{Dynamic Blocks}
|
||||
|
||||
\key{update dynamic block at point}{C-c C-x C-u}
|
||||
\metax{update all dynamic blocks}{C-u C-c C-x C-u}
|
||||
|
||||
\section{LaTeX and cdlatex-mode}
|
||||
|
||||
\key{preview LaTeX fragment}{C-c C-x C-l}
|
||||
\key{Expand abbreviation (cdlatex-mode)}{TAB}
|
||||
\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
|
||||
|
||||
\section{Agenda Views}
|
||||
|
||||
|
@ -565,6 +606,7 @@ To set categories, add lines like$^2$:
|
|||
\key{change state of current TODO item}{t}
|
||||
\key{show tags of current headline}{T}
|
||||
\key{set tags for current headline}{:}
|
||||
\key{toggle ARCHIVE tag}{a}
|
||||
\key{set priority of current item}{p}
|
||||
\key{raise/lower priority of current item}{S-UP/DOWN$^3$}
|
||||
\key{display weighted priority of current item}{P}
|
||||
|
@ -577,7 +619,6 @@ To set categories, add lines like$^2$:
|
|||
\key{Stop the clock (clock-out)}{O}
|
||||
\key{Cancel current clock}{X}
|
||||
|
||||
\newcolumn
|
||||
|
||||
{\bf Calendar commands}
|
||||
|
||||
|
@ -593,6 +634,13 @@ To set categories, add lines like$^2$:
|
|||
\key{quit agenda, remove agenda buffer}{q}
|
||||
\key{exit agenda, remove all agenda buffers}{x}
|
||||
|
||||
\section{Calendar and Diary Integration}
|
||||
|
||||
To include entries from the Emacs diary in your Org-mode agenda:
|
||||
\beginexample%
|
||||
(setq org-agenda-include-diary t)
|
||||
\endexample
|
||||
|
||||
\section{Exporting and Publishing}
|
||||
|
||||
Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
|
||||
|
@ -629,18 +677,19 @@ keywords. {\tt M-TAB} again just after keyword is complete inserts examples.
|
|||
\key{language code for html}{\#+LANGUAGE:}
|
||||
\key{free text description of file}{\#+TEXT:}
|
||||
\key{... which can carry over multiple lines}{\#+TEXT:}
|
||||
\key{settings for the export process - see below}{\#+OPTIONS:}
|
||||
%\key{settings for the export process - see below}{\#+OPTIONS:}
|
||||
\key{settings for the export process}{\#+OPTIONS:}
|
||||
|
||||
\key{set number of headline levels for export}{H:2}
|
||||
\key{turn on/off section numbers}{num:t}
|
||||
\key{turn on/off table of contents}{toc:t}
|
||||
\key{turn on/off linebreak preservation}{\\n:nil}
|
||||
\key{turn on/off quoted html tags}{@:t}
|
||||
\key{turn on/off fixed width sections}{::t}
|
||||
\key{turn on/off tables}{|:t}
|
||||
\key{turn on/off \TeX\ syntax for sub/super-scripts}{\^{}:t}
|
||||
\key{turn on/off emphasised text}{*:nil}
|
||||
\key{turn on/off \TeX\ macros}{TeX:t}
|
||||
%\key{set number of headline levels for export}{H:2}
|
||||
%\key{turn on/off section numbers}{num:t}
|
||||
%\key{turn on/off table of contents}{toc:t}
|
||||
%\key{turn on/off linebreak preservation}{\\n:nil}
|
||||
%\key{turn on/off quoted html tags}{@:t}
|
||||
%\key{turn on/off fixed width sections}{::t}
|
||||
%\key{turn on/off tables}{|:t}
|
||||
%\key{turn on/off \TeX\ syntax for sub/super-scripts}{\^{}:t}
|
||||
%\key{turn on/off emphasised text}{*:nil}
|
||||
%\key{turn on/off \TeX\ macros}{TeX:t}
|
||||
|
||||
{\bf Comments: Text not being exported}
|
||||
|
||||
|
@ -651,53 +700,20 @@ Subtrees whose header starts with COMMENT are never exported.
|
|||
|
||||
\key{toggle COMMENT keyword on entry}{C-c ;}
|
||||
|
||||
\section{Completion}
|
||||
|
||||
In-buffer completion completes TODO keywords at headline start, TeX
|
||||
macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
|
||||
after ``{\tt :}'', and dictionary words elsewhere.
|
||||
%\section{CUA and pc-select compatibility}%
|
||||
|
||||
\key{Complete word at point}{M-TAB}
|
||||
|
||||
\section{Calendar and Diary Integration}
|
||||
|
||||
To include entries from the Emacs diary in your Org-mode agenda:
|
||||
\beginexample%
|
||||
(setq org-agenda-include-diary t)
|
||||
\endexample
|
||||
|
||||
\section{Remember-mode Integration}
|
||||
|
||||
See the manual for how to make remember.el use Org-mode links and
|
||||
files. The note-finishing command \kbd{C-c C-c} will first prompt for
|
||||
an org file. In the file, find a location with:
|
||||
|
||||
\key{rotate subtree visibility}{TAB}
|
||||
\key{next heading}{DOWN}
|
||||
\key{previous heading}{UP}
|
||||
|
||||
Insert the note with one of the following:
|
||||
|
||||
\key{as sublevel of heading at cursor}{RET}
|
||||
\key{right here (cursor not on heading)}{RET}
|
||||
\key{before current heading}{LEFT}
|
||||
\key{after current heading}{RIGHT}
|
||||
\key{shortcut to end of buffer (cursor at buf-start)}{RET}
|
||||
\key{Abort}{q}
|
||||
|
||||
\section{CUA and pc-select compatibility}
|
||||
|
||||
Configure the variable {\tt org-CUA-compatibility} to make Org-mode
|
||||
avoid the \kbd{S-<cursor>} bindings used by these modes. When set,
|
||||
Org-mode will change the following keybindings (also in the agenda
|
||||
buffer, but not during date selection). See note mark four$^3$
|
||||
throughout the reference card.
|
||||
%\vskip-mm
|
||||
\beginexample
|
||||
S-UP $\to$ M-p S-DOWN $\to$ M-n
|
||||
S-LEFT $\to$ M-- S-RIGHT $\to$ M-+
|
||||
S-RET $\to$ C-S-RET
|
||||
\endexample
|
||||
%Configure the variable {\tt org-CUA-compatibility} to make Org-mode
|
||||
%avoid the \kbd{S-<cursor>} bindings used by these modes. When set,
|
||||
%Org-mode will change the following keybindings (also in the agenda
|
||||
%buffer, but not during date selection). See note mark four$^3$
|
||||
%throughout the reference card.
|
||||
%%\vskip-mm
|
||||
%\beginexample
|
||||
%S-UP $\to$ M-p S-DOWN $\to$ M-n
|
||||
%S-LEFT $\to$ M-- S-RIGHT $\to$ M-+
|
||||
%S-RET $\to$ C-S-RET
|
||||
%\endexample
|
||||
|
||||
\section{Notes}
|
||||
$^1$ This is only a suggestion for a binding of this command. Choose
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
This directory contains files that are necessary or at least useful
|
||||
companions for Org-mode:
|
||||
|
||||
noutline.el Greg Chernov's port of the overlay-based implementation of
|
||||
outline-mode. This is requires, and until XEmacs uses
|
||||
this (or another port), you need to install it with Org-mode.
|
||||
|
||||
ps-print-invisible.el Greg Chernovs modification to ps-print, to
|
||||
honor invisible text properties during printing.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,225 @@
|
|||
;;; ps-print-invisible.el - addon to ps-print package that deals
|
||||
;; with invisible text printing in xemacs
|
||||
|
||||
;; Author: Greg Chernov
|
||||
;;
|
||||
;; 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
|
||||
;; the Free Software Foundation; either version 2, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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 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:
|
||||
;;
|
||||
;; Put ps-print-invisible.el on your load path.
|
||||
;; (require 'ps-print-invisible)
|
||||
;; ps-print-buffer-with-faces will not print invisible parts of the buffer.
|
||||
;; Work with invisible extents/text properties only
|
||||
;; (xemacs hideshow and noutline packages).
|
||||
|
||||
(defun ps-generate-postscript-with-faces (from to)
|
||||
;; Some initialization...
|
||||
(setq ps-current-effect 0)
|
||||
|
||||
;; Build the reference lists of faces if necessary.
|
||||
(when (or ps-always-build-face-reference
|
||||
ps-build-face-reference)
|
||||
(message "Collecting face information...")
|
||||
(ps-build-reference-face-lists))
|
||||
|
||||
;; Black/white printer.
|
||||
(setq ps-black-white-faces-alist nil)
|
||||
(and (eq ps-print-color-p 'black-white)
|
||||
(ps-extend-face-list ps-black-white-faces nil
|
||||
'ps-black-white-faces-alist))
|
||||
|
||||
;; Generate some PostScript.
|
||||
(save-restriction
|
||||
(narrow-to-region from to)
|
||||
(ps-print-ensure-fontified from to)
|
||||
(let ((face 'default)
|
||||
(position to))
|
||||
(cond
|
||||
((memq ps-print-emacs-type '(xemacs lucid))
|
||||
;; Build the list of extents...
|
||||
;;(debug)
|
||||
(let ((a (cons 'dummy nil))
|
||||
record type extent extent-list
|
||||
(list-invisible (ps-print-find-invisible-xmas from to)))
|
||||
(ps-x-map-extents 'ps-mapper nil from to a)
|
||||
(setq a (sort (cdr a) 'car-less-than-car)
|
||||
extent-list nil)
|
||||
|
||||
;; Loop through the extents...
|
||||
(while a
|
||||
(setq record (car a)
|
||||
position (car record)
|
||||
|
||||
record (cdr record)
|
||||
type (car record)
|
||||
|
||||
record (cdr record)
|
||||
extent (car record))
|
||||
|
||||
;; Plot up to this record.
|
||||
;; XEmacs 19.12: for some reason, we're getting into a
|
||||
;; situation in which some of the records have
|
||||
;; positions less than 'from'. Since we've narrowed
|
||||
;; the buffer, this'll generate errors. This is a hack,
|
||||
;; but don't call ps-plot-with-face unless from > point-min.
|
||||
(and (>= from (point-min))
|
||||
(ps-plot-with-face from (min position (point-max)) face))
|
||||
|
||||
(cond
|
||||
((eq type 'push)
|
||||
(and (or (ps-x-extent-face extent)
|
||||
(extent-property extent 'invisible))
|
||||
(setq extent-list (sort (cons extent extent-list)
|
||||
'ps-extent-sorter))))
|
||||
|
||||
((eq type 'pull)
|
||||
(setq extent-list (sort (delq extent extent-list)
|
||||
'ps-extent-sorter))))
|
||||
|
||||
|
||||
(setq face (if extent-list
|
||||
(let ((prop (extent-property (car extent-list) 'invisible)))
|
||||
(if (or (and (eq buffer-invisibility-spec t)
|
||||
(not (null prop)))
|
||||
(and (consp buffer-invisibility-spec)
|
||||
(or (memq prop buffer-invisibility-spec)
|
||||
(assq prop buffer-invisibility-spec))))
|
||||
'emacs--invisible--face
|
||||
(ps-x-extent-face (car extent-list))))
|
||||
'default)
|
||||
from position
|
||||
a (cdr a)))))
|
||||
|
||||
((eq ps-print-emacs-type 'emacs)
|
||||
(let ((property-change from)
|
||||
(overlay-change from)
|
||||
(save-buffer-invisibility-spec buffer-invisibility-spec)
|
||||
(buffer-invisibility-spec nil)
|
||||
before-string after-string)
|
||||
(while (< from to)
|
||||
(and (< property-change to) ; Don't search for property change
|
||||
; unless previous search succeeded.
|
||||
(setq property-change (next-property-change from nil to)))
|
||||
(and (< overlay-change to) ; Don't search for overlay change
|
||||
; unless previous search succeeded.
|
||||
(setq overlay-change (min (ps-e-next-overlay-change from)
|
||||
to)))
|
||||
(setq position (min property-change overlay-change)
|
||||
before-string nil
|
||||
after-string nil)
|
||||
;; The code below is not quite correct,
|
||||
;; because a non-nil overlay invisible property
|
||||
;; which is inactive according to the current value
|
||||
;; of buffer-invisibility-spec nonetheless overrides
|
||||
;; a face text property.
|
||||
(setq face
|
||||
(cond ((let ((prop (get-text-property from 'invisible)))
|
||||
;; Decide whether this invisible property
|
||||
;; really makes the text invisible.
|
||||
(if (eq save-buffer-invisibility-spec t)
|
||||
(not (null prop))
|
||||
(or (memq prop save-buffer-invisibility-spec)
|
||||
(assq prop save-buffer-invisibility-spec))))
|
||||
'emacs--invisible--face)
|
||||
((get-text-property from 'face))
|
||||
(t 'default)))
|
||||
(let ((overlays (ps-e-overlays-at from))
|
||||
(face-priority -1)) ; text-property
|
||||
(while (and overlays
|
||||
(not (eq face 'emacs--invisible--face)))
|
||||
(let* ((overlay (car overlays))
|
||||
(overlay-invisible
|
||||
(ps-e-overlay-get overlay 'invisible))
|
||||
(overlay-priority
|
||||
(or (ps-e-overlay-get overlay 'priority) 0)))
|
||||
(and (> overlay-priority face-priority)
|
||||
(setq before-string
|
||||
(or (ps-e-overlay-get overlay 'before-string)
|
||||
before-string)
|
||||
after-string
|
||||
(or (and (<= (ps-e-overlay-end overlay) position)
|
||||
(ps-e-overlay-get overlay 'after-string))
|
||||
after-string)
|
||||
face-priority overlay-priority
|
||||
face
|
||||
(cond
|
||||
((if (eq save-buffer-invisibility-spec t)
|
||||
(not (null overlay-invisible))
|
||||
(or (memq overlay-invisible
|
||||
save-buffer-invisibility-spec)
|
||||
(assq overlay-invisible
|
||||
save-buffer-invisibility-spec)))
|
||||
'emacs--invisible--face)
|
||||
((ps-e-overlay-get overlay 'face))
|
||||
(t face)
|
||||
))))
|
||||
(setq overlays (cdr overlays))))
|
||||
;; Plot up to this record.
|
||||
(and before-string
|
||||
(ps-plot-string before-string))
|
||||
(ps-plot-with-face from position face)
|
||||
(and after-string
|
||||
(ps-plot-string after-string))
|
||||
(setq from position)))))
|
||||
(ps-plot-with-face from to face))))
|
||||
|
||||
|
||||
(defun ps-print-find-invisible-xmas (from to)
|
||||
(let ((list nil))
|
||||
(map-extents '(lambda (ex ignored)
|
||||
(let ((prop (extent-property ex 'invisible)))
|
||||
(if (or (and (eq buffer-invisibility-spec t)
|
||||
(not (null prop)))
|
||||
(or (memq prop buffer-invisibility-spec)
|
||||
(assq prop buffer-invisibility-spec)))
|
||||
(setq list (cons (list
|
||||
(extent-start-position ex)
|
||||
(extent-end-position ex))
|
||||
list))))
|
||||
nil)
|
||||
(current-buffer)
|
||||
from to nil 'start-and-end-in-region 'invisible)
|
||||
(reverse list)))
|
||||
|
||||
|
||||
(defun ps-mapper (extent list)
|
||||
;;(debug)
|
||||
(let ((beg (ps-x-extent-start-position extent))
|
||||
(end (ps-x-extent-end-position extent))
|
||||
(inv-lst list-invisible)
|
||||
(found nil))
|
||||
(while (and inv-lst
|
||||
(not found))
|
||||
(let ((inv-beg (caar inv-lst))
|
||||
(inv-end (cadar inv-lst)))
|
||||
(if (and (>= beg inv-beg)
|
||||
(<= end inv-end)
|
||||
(not (extent-property extent 'invisible)))
|
||||
(setq found t))
|
||||
(setq inv-lst (cdr inv-lst))))
|
||||
(if (not found)
|
||||
(nconc list
|
||||
(list (list beg 'push extent)
|
||||
(list end 'pull extent)))))
|
||||
nil)
|
||||
|
||||
|
||||
(provide 'ps-print-invisible)
|
||||
|
||||
|
||||
;;; ps-print-invisible.el ends here
|
Loading…
Reference in New Issue