aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog9
-rw-r--r--etc/TUTORIAL.cn2
-rw-r--r--etc/orgcard.tex74
-rw-r--r--lisp/ChangeLog138
-rw-r--r--lisp/allout.el22
-rw-r--r--lisp/compare-w.el25
-rw-r--r--lisp/ediff-diff.el5
-rw-r--r--lisp/gnus/ChangeLog37
-rw-r--r--lisp/gnus/flow-fill.el10
-rw-r--r--lisp/gnus/message.el4
-rw-r--r--lisp/gnus/mm-util.el4
-rw-r--r--lisp/gnus/mm-view.el9
-rw-r--r--lisp/gnus/nnimap.el1
-rw-r--r--lisp/gnus/qp.el2
-rw-r--r--lisp/gnus/utf7.el2
-rw-r--r--lisp/help.el10
-rw-r--r--lisp/info.el12
-rw-r--r--lisp/progmodes/gdb-ui.el110
-rw-r--r--lisp/progmodes/glasses.el14
-rw-r--r--lisp/progmodes/gud.el15
-rw-r--r--lisp/textmodes/org.el804
-rw-r--r--lisp/textmodes/reftex-auc.el2
-rw-r--r--lisp/textmodes/reftex-cite.el2
-rw-r--r--lisp/textmodes/reftex-dcr.el108
-rw-r--r--lisp/textmodes/reftex-global.el2
-rw-r--r--lisp/textmodes/reftex-index.el2
-rw-r--r--lisp/textmodes/reftex-parse.el2
-rw-r--r--lisp/textmodes/reftex-ref.el2
-rw-r--r--lisp/textmodes/reftex-sel.el2
-rw-r--r--lisp/textmodes/reftex-toc.el2
-rw-r--r--lisp/textmodes/reftex-vars.el14
-rw-r--r--lisp/textmodes/reftex.el36
-rw-r--r--man/ChangeLog34
-rw-r--r--man/faq.texi349
-rw-r--r--man/org.texi158
-rw-r--r--man/reftex.texi9
-rw-r--r--src/ChangeLog53
-rw-r--r--src/dispnew.c13
-rw-r--r--src/indent.c3
-rw-r--r--src/macgui.h8
-rw-r--r--src/macmenu.c5
-rw-r--r--src/macterm.c90
-rw-r--r--src/window.c3
43 files changed, 1582 insertions, 626 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 8c1e5782db5..cfc2f3e9a04 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,12 @@
12006-02-23 Herbert Euler <herberteuler@hotmail.com> (tiny change)
2
3 * TUTORIAL.cn: Fix omission bug: Add dot (ASCII 0x2E) on first line.
4
52006-02-22 Carsten Dominik <dominik@science.uva.nl>
6
7 * orgcard.tex: (section{Links}): Rewritten to cover the modified
8 link system.
9
12006-02-18 Bill Wohler <wohler@newt.com> 102006-02-18 Bill Wohler <wohler@newt.com>
2 11
3 Release MH-E version 7.92. 12 Release MH-E version 7.92.
diff --git a/etc/TUTORIAL.cn b/etc/TUTORIAL.cn
index 2546b84e465..a1589aa0cd7 100644
--- a/etc/TUTORIAL.cn
+++ b/etc/TUTORIAL.cn
@@ -1,4 +1,4 @@
1Emacs 快速指南(查看版权声明请至本文末尾) 1Emacs 快速指南.(查看版权声明请至本文末尾)
2 2
3【注意:位于【】之间的内容是译注,比如本行,下同。】 3【注意:位于【】之间的内容是译注,比如本行,下同。】
4 4
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index 064d9decc95..75ff98514b5 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,11 +1,11 @@
1% Reference Card for Org Mode 4.04 1% Reference Card for Org Mode 4.06
2% 2%
3%**start of header 3%**start of header
4\newcount\columnsperpage 4\newcount\columnsperpage
5 5
6% This file can be printed with 1, 2, or 3 columns per page (see below). 6% This file can be printed with 1, 2, or 3 columns per page (see below).
7% At the moment this card works quite nicely in 3 column format and 7% At the moment this card works quite nicely in 3 column format and
8% currently takes 2 full pages. It is thus suited to producing one 8% currently takes 2 full pages. It is thus suited to producing one
9% double-side page when printed. 9% double-side page when printed.
10 10
11% There are a couple of tweaks in the format of this card which make it work 11% There are a couple of tweaks in the format of this card which make it work
@@ -18,8 +18,7 @@
18 18
19\columnsperpage=3 19\columnsperpage=3
20 20
21% Copyright (C) 2005, 2006 Free Software Foundation, Inc. 21% Copyright (c) 2004 Philip Rooke, 2005, 2006 Free Software Foundation
22% Copyright (c) 2004 Philip Rooke
23 22
24% GNU Emacs is free software; you can redistribute it and/or modify 23% GNU Emacs is free software; you can redistribute it and/or modify
25% it under the terms of the GNU General Public License as published by 24% it under the terms of the GNU General Public License as published by
@@ -59,7 +58,7 @@
59% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik 58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
60% for their many good ideas. 59% for their many good ideas.
61 60
62\def\orgversionnumber{4.04} 61\def\orgversionnumber{4.06}
63\def\year{2006} 62\def\year{2006}
64 63
65\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
@@ -89,7 +88,7 @@ are preserved on all copies.
89 88
90\def\ncolumns{\the\columnsperpage} 89\def\ncolumns{\the\columnsperpage}
91 90
92\message{[\ncolumns\space 91\message{[\ncolumns\space
93 column\if 1\ncolumns\else s\fi\space per page]} 92 column\if 1\ncolumns\else s\fi\space per page]}
94 93
95\def\scaledmag#1{ scaled \magstep #1} 94\def\scaledmag#1{ scaled \magstep #1}
@@ -174,7 +173,7 @@ are preserved on all copies.
174 \def\bye{\par\vfill\supereject 173 \def\bye{\par\vfill\supereject
175 \if a\abc \else\null\vfill\eject\fi 174 \if a\abc \else\null\vfill\eject\fi
176 \if a\abc \else\null\vfill\eject\fi 175 \if a\abc \else\null\vfill\eject\fi
177 \end} 176 \end}
178\fi 177\fi
179 178
180% we won't be using math mode much, so redefine some of the characters 179% we won't be using math mode much, so redefine some of the characters
@@ -356,18 +355,8 @@ To set archive location for current file, add a line like$^3$:
356\key{raise priority of current item}{S-UP$^4$} 355\key{raise priority of current item}{S-UP$^4$}
357\key{lower priority of current item}{S-DOWN$^4$} 356\key{lower priority of current item}{S-DOWN$^4$}
358 357
359\vskip 1mm 358\key{\kbd{\#+SEQ_TODO: TODO TRY BLUFF DONE}}{\rm todo workflow}
360per-file TODO workflow states: add line(s) like$^3$: 359\key{\kbd{\#+TYP_TODO: Phil home work DONE}}{\rm todo types}
361\vskip -1mm
362\beginexample%
363\#+SEQ_TODO: TODO PROCRASTINATE BLUFF DONE
364\endexample
365\vskip -1mm
366per-file TODO keywords: add line(s) like$^3$:
367\vskip -1mm
368\beginexample%
369\#+TYP_TODO: Phil home work DONE
370\endexample
371 360
372\section{Timestamps} 361\section{Timestamps}
373 362
@@ -398,21 +387,26 @@ per-file TODO keywords: add line(s) like$^3$:
398\key{insert a link (TAB completes stored links)}{C-c C-l} 387\key{insert a link (TAB completes stored links)}{C-c C-l}
399\key{insert file link with file name completion}{C-u C-c C-l} 388\key{insert file link with file name completion}{C-u C-c C-l}
400 389
401\key{open link at point}{C-c C-o} 390\key{open file links in emacs (\kbd{C-u} : in emacs)}{C-c C-o}
402\key{open file links in emacs}{C-u C-c C-o} 391\key{open link at point (3: in emacs)}{mouse-2/3}
403\key{open link at point}{mouse-2} 392%\key{open file links in emacs}{mouse-3}
404\key{open file links in emacs}{mouse-3} 393\key{record a position in mark ring}{C-c \%}
394\key{jump back to last followed link(s)}{C-c \&}
395
396{\bf Internal Links}
397
398\key{\kbd{<<My Target>>}}{\rm target}
399\key{\kbd{<<<My Target>>>}}{\rm radio target$^3$}
400\key{\kbd{[[*this text]]}}{\rm find headline}
401\metax{\kbd{[[this text]]}}{\rm find target or text in buffer}
405 402
406{\bf Link types} 403{\bf External Links}
407 404
408\key{\kbd{*CamelCaseWord}}{\rm search headline}
409\key{\kbd{CamelCaseWord}}{\rm search in buffer}
410\key{\kbd{<file:/home/dominik/img/mars.jpg>}}{\rm file, absolute} 405\key{\kbd{<file:/home/dominik/img/mars.jpg>}}{\rm file, absolute}
411\key{\kbd{<file:papers/last.pdf>}}{\rm file, relative} 406\key{\kbd{<file:papers/last.pdf>}}{\rm file, relative}
412\key{\kbd{<file:~/code/main.c:255>}}{\rm file with line nr.} 407\key{\kbd{<file:projects.org::*that text>}}{\rm find headline}
413\key{\kbd{<file:projects.org::*CamelCaseWord>}}{\rm search headline} 408\key{\kbd{<file:projects.org::find me>}}{\rm find tgt/string}
414\key{\kbd{<file:projects.org::find me>}}{\rm search string} 409\key{\kbd{<file:projects.org::/regexp/>}}{\rm regexp search}
415\key{\kbd{<file:projects.org::/regexp/>}}{\rm search regexp}
416\key{\kbd{<http://www.astro.uva.nl/~dominik>}}{\rm on the web} 410\key{\kbd{<http://www.astro.uva.nl/~dominik>}}{\rm on the web}
417\key{\kbd{<mailto:adent@galaxy.net>}}{\rm EMail address} 411\key{\kbd{<mailto:adent@galaxy.net>}}{\rm EMail address}
418\key{\kbd{<news:comp.emacs>}}{\rm Usenet group} 412\key{\kbd{<news:comp.emacs>}}{\rm Usenet group}
@@ -420,15 +414,9 @@ per-file TODO keywords: add line(s) like$^3$:
420\key{\kbd{<shell:ls *.org>}}{\rm shell command} 414\key{\kbd{<shell:ls *.org>}}{\rm shell command}
421\key{\kbd{<gnus:group>}}{\rm GNUS group} 415\key{\kbd{<gnus:group>}}{\rm GNUS group}
422\key{\kbd{<gnus:group\#id>}}{\rm GNUS message} 416\key{\kbd{<gnus:group\#id>}}{\rm GNUS message}
423\key{\kbd{<vm:folder>}}{\rm VM folder} 417\key{\kbd{<vm|wl|mhe|rmail:folder>}}{\rm Mail folder}
424\key{\kbd{<vm:folder\#id>}}{\rm VM message} 418\key{\kbd{<vm|wl|mhe|rmail:folder\#id>}}{\rm Mail message}
425% FIXME: would like to get this back in.
426%\key{\kbd{<vm://myself@some.where.org/folder\#id>}}{\rm VM remote} 419%\key{\kbd{<vm://myself@some.where.org/folder\#id>}}{\rm VM remote}
427Wanderlust \kbd{<wl:...>} and RMAIL \kbd{<rmail:...>} like VM
428%\key{\kbd{<wl:folder>}}{\rm Wanderlust f.}
429%\key{\kbd{<wl:folder\#id>}}{\rm Wanderlust m.}
430%\key{\kbd{<rmail:folder>}}{\rm RMAIL folder}
431%\key{\kbd{<rmail:folder\#id>}}{\rm RMAIL msg}
432 420
433\section{Tables} 421\section{Tables}
434 422
@@ -711,7 +699,7 @@ an org file. In the file, find a location with:
711\key{next heading}{DOWN} 699\key{next heading}{DOWN}
712\key{previous heading}{UP} 700\key{previous heading}{UP}
713 701
714Insert the note with one of the following: 702Insert the note with one of the following:
715 703
716\key{as sublevel of heading at cursor}{RET} 704\key{as sublevel of heading at cursor}{RET}
717\key{right here (cursor not on heading)}{RET} 705\key{right here (cursor not on heading)}{RET}
@@ -741,8 +729,8 @@ Emacs, or an XEmacs package.
741$^2$ This is only a suggestion for a binding of this command. Choose 729$^2$ This is only a suggestion for a binding of this command. Choose
742you own key as shown under INSTALLATION. 730you own key as shown under INSTALLATION.
743 731
744$^3$ After changing a \kbd{\#+KEYWORD} line, press \kbd{C-c C-c} with 732$^3$ After changing a \kbd{\#+KEYWORD} or \kbd{<<<target>>>} line,
745the cursor still in a line to make Org-mode notice the change. 733press \kbd{C-c C-c} with the cursor still in the line to update.
746 734
747$^4$ Keybinding affected by {\tt org-CUA-compatibility}. 735$^4$ Keybinding affected by {\tt org-CUA-compatibility}.
748 736
@@ -753,7 +741,7 @@ $^4$ Keybinding affected by {\tt org-CUA-compatibility}.
753 741
754% arch-tag: 139f6750-5cfc-49ca-92b5-237fe5795290 742% arch-tag: 139f6750-5cfc-49ca-92b5-237fe5795290
755 743
756%%% Local Variables: 744%%% Local Variables:
757%%% mode: latex 745%%% mode: latex
758%%% TeX-master: t 746%%% TeX-master: t
759%%% End: 747%%% End:
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6b91115cd67..8101c48f10b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,135 @@
12006-02-24 Juanma Barranquero <lekktu@gmail.com>
2
3 * help.el (help): Revert last part of 2006-02-23 change (deletion
4 of the `provide' call).
5
62006-02-23 Juri Linkov <juri@jurta.org>
7
8 * compare-w.el (compare-windows-highlight): Add new value
9 `persistent' and change :type from `boolean' to `choice'.
10 (compare-windows-overlays1, compare-windows-overlays2):
11 New internal variables.
12 (compare-windows-highlight): If compare-windows-highlight is
13 `persistent', add current overlays to compare-windows-overlays[12]
14 instead of adding compare-windows-dehighlight to pre-command-hook.
15 (compare-windows-dehighlight): Delete all overlays from
16 compare-windows-overlays[12].
17
18 * info.el (Info-search): Don't bind search-spaces-regexp to
19 Info-search-whitespace-regexp in non-regexp isearch mode.
20
212006-02-23 Stefan Monnier <monnier@iro.umontreal.ca>
22
23 * help.el (describe-mode): Pass `mode-name' to format-mode-line.
24
252006-02-23 Juanma Barranquero <lekktu@gmail.com>
26
27 * textmodes/org.el (org-xemacs-p)
28 (org-export-html-show-new-buffer, org-table-may-need-update)
29 (org-insert-item, org-mhe-get-message-real-folder)
30 (org-mhe-get-message-folder-from-index)
31 (org-mhe-get-message-folder, org-mhe-get-message-num)
32 (org-mhe-get-header, org-make-org-heading-search-string)
33 (org-make-org-heading-camel, org-table-sort-lines)
34 (org-format-org-table-html, org-format-table-table-html):
35 Fix typos in docstrings.
36
3712006-02-23 Carsten Dominik <dominik@science.uva.nl>
38
39 * textmodes/org.el (org-cleaned-string-for-export)
40 (org-solidify-link-text): New function.
41 (org-add-hook): Use `add-local-hook' instead of `make-local-hook' for
42 XEmacs, just to silence the compiler.
43 (org-export-as-ascii, org-export-as-html-and-open):
44 Use `org-cleaned-string-for-export' and create internal links.
45 (org-follow-mhe-link): Require mh-e, use folder.
46
472006-02-23 Nick Roberts <nickrob@snap.net.nz>
48
49 * progmodes/gud.el (gud-speedbar-buttons): Use shadow face properly.
50
51 * progmodes/gdb-ui.el (gdb-debug-ring-max): Rename from
52 gdb-debug-log-length.
53 (gdb-debug-ring): Rename from gdb-debug-log-ring. Don't make
54 it a real ring but...
55 (gud-gdba-marker-filter): ...make it work like mark-ring.
56 (gdb-enable-debug): Rename from gdb-enable-debug-log.
57 (gdb-mouse-jump): New function. Add bindings.
58
592006-02-23 Nick Roberts <nickrob@snap.net.nz>
60
61 * progmodes/gdb-ui.el (gdb-signalled): New variable and function.
62 (gdb-debug-log-ring): Rename from gdb-debug-log and make a ring.
63 (gdb-send, gdb-send-item, gud-gdba-marker-filter): Use it.
64 (gdb-debug-log-length): Customize it's length.
65 (gud-watch, gdb-var-create-handler): Display function::var format
66 but don't use to create variable object.
67 (gdb-var-create-handler): Use message-box in place of message.
68 (gdb-stopped): Call gdb-exited if signalled.
69
702006-02-22 Carsten Dominik <dominik@science.uva.nl>
71
72 * textmodes/reftex.el (reftex-locate-file): Remove duplicate function.
73
74 * textmodes/reftex-vars.el (reftex-try-all-extensions): New option.
75
76 * textmodes/reftex.el (reftex-locate-file): Search all extensions
77 if `reftex-try-all-extensions' is set.
78
79 * textmodes/org.el (org-mark-ring-push, org-mark-ring-goto):
80 New commands.
81 (org-mark-ring): New variable.
82 (org-mark-ring-length): New option.
83 (org-open-at-point, org-goto, org-open-file): Push old position
84 onto the mark ring.
85 (org-add-hook): New function.
86 (org-export-table-remove-special-lines): New option.
87 (org-skip-comments, org-format-org-table-html): Respect new
88 option `org-export-table-remove-special-lines'.
89 (org-open-file): Allow special command configuration for
90 directory link.
91 (org-file-apps): Fix bugs in customize type, added setting
92 for directories.
93 (org-activate-tags, org-format-agenda-item, org-complete)
94 (org-get-tags-at, org-scan-tags, org-make-tags-matcher)
95 (org-get-tags, org-get-buffer-tags, org-open-at-point)
96 (org-link-search, org-make-org-heading-search-string)
97 (org-make-org-heading-camel): Allow @ and 0-9 as tags characters.
98 (org-radio-targets, org-file-link-context-use-camel-case)
99 (org-activate-camels): New options.
100 (org-update-radio-target-regexp, org-all-targets)
101 (org-make-target-link-regexp, org-activate-target-links):
102 New functions.
103 (org-make-org-heading-search-string): New function.
104 (org-store-link, org-insert-link): Use new option
105 `org-file-link-context-use-camel-case'.
106 (org-activate-camels): Use new option `org-activate-camels'.
107 (org-link-regexp): Add mhe prefix.
108 (org-open-at-point, org-store-link): Support for mhe links.
109 (org-mhe-get-message-real-folder, org-mhe-get-message-folder)
110 (org-mhe-get-message-folder-from-index, org-mhe-get-message-num)
111 (org-mhe-get-header, org-follow-mhe-link): New functions.
112 (org-remove-angle-brackets, org-add-angle-brackets):
113 New functions.
114 (org-bracket-link-regexp): New constant.
115 (org-read-date): Fix bug that was rejecting all typed dates.
116 (org-link-search): Make hierarchy above visible after a match.
117 (org-follow-bbdb-link): Inhibit electric mode for BBDB.
118 (org-store-link): Fix bug with link creation when cursor is in
119 an empty line.
120 (org-open-at-point): Fix bug with matching a link.
121 Fixed buggy argument sequence in call to `org-view-tags'.
122 (org-compile-prefix-format): Set `org-prefix-has-tag'.
123 (org-prefix-has-tag): New variable.
124 (org-format-agenda-item): Remove tags from headline
125 if appropriate.
126 (org-agenda-remove-tags-when-in-prefix): New option.
127
1282006-02-21 Michael Kifer <kifer@cs.stonybrook.edu>
129
130 * ediff-diff.el (ediff-setup-diff-regions, ediff-setup-diff-regions3):
131 Fix the regular expressions.
132
12006-02-21 Richard M. Stallman <rms@gnu.org> 1332006-02-21 Richard M. Stallman <rms@gnu.org>
2 134
3 * progmodes/sh-script.el (sh-mode): Set shell type based on file name 135 * progmodes/sh-script.el (sh-mode): Set shell type based on file name
@@ -49,8 +181,8 @@
49 181
502006-02-20 Chong Yidong <cyd@stupidchicken.com> 1822006-02-20 Chong Yidong <cyd@stupidchicken.com>
51 183
52 * custom.el (customize-mark-to-save, customize-mark-as-set): Load 184 * custom.el (customize-mark-to-save, customize-mark-as-set):
53 the symbol first. 185 Load the symbol first.
54 186
552006-02-20 Juanma Barranquero <lekktu@gmail.com> 1872006-02-20 Juanma Barranquero <lekktu@gmail.com>
56 188
@@ -163,7 +295,7 @@
163 * progmodes/gdb-ui.el (gdb-var-evaluate-expression-handler) 295 * progmodes/gdb-ui.el (gdb-var-evaluate-expression-handler)
164 (gdb-var-update-handler): Detect out of scope variables with pre 296 (gdb-var-update-handler): Detect out of scope variables with pre
165 GDB 6.4 too. 297 GDB 6.4 too.
166 (gdb-post-prompt): Revert changet 2006-02-17 (force update). 298 (gdb-post-prompt): Revert change from 2006-02-17 (force update).
167 Reset status of variable objects to nil in update handlers. 299 Reset status of variable objects to nil in update handlers.
168 (gdb-var-update-handler-1): Detect when a variable object comes 300 (gdb-var-update-handler-1): Detect when a variable object comes
169 in scope. setcar on var changes gdb-var-list directly. 301 in scope. setcar on var changes gdb-var-list directly.
diff --git a/lisp/allout.el b/lisp/allout.el
index 69d72506fce..edce1e8d61e 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -1,7 +1,7 @@
1;;; allout.el --- extensive outline mode for use alone and with other modes 1;;; allout.el --- extensive outline mode for use alone and with other modes
2 2
3;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, 3;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004,
4;; 2005 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Ken Manheimer <ken dot manheimer at gmail dot com> 6;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
7;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com> 7;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
@@ -5811,14 +5811,14 @@ the point does not move. To ignore field boundaries bind
5811(provide 'allout) 5811(provide 'allout)
5812 5812
5813;;;_* Local emacs vars. 5813;;;_* Local emacs vars.
5814;;; The following `allout-layout' local variable setting: 5814;; The following `allout-layout' local variable setting:
5815;;; - closes all topics from the first topic to just before the third-to-last, 5815;; - closes all topics from the first topic to just before the third-to-last,
5816;;; - shows the children of the third to last (config vars) 5816;; - shows the children of the third to last (config vars)
5817;;; - and the second to last (code section), 5817;; - and the second to last (code section),
5818;;; - and closes the last topic (this local-variables section). 5818;; - and closes the last topic (this local-variables section).
5819;;;Local variables: 5819;;Local variables:
5820;;;allout-layout: (0 : -1 -1 0) 5820;;allout-layout: (0 : -1 -1 0)
5821;;;End: 5821;;End:
5822 5822
5823;;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c 5823;; arch-tag: cf38fbc3-c044-450f-8bff-afed8ba5681c
5824;;; allout.el ends here 5824;;; allout.el ends here
diff --git a/lisp/compare-w.el b/lisp/compare-w.el
index 2d23de8c54c..e61f24a0c7c 100644
--- a/lisp/compare-w.el
+++ b/lisp/compare-w.el
@@ -117,8 +117,14 @@ and the value `((4) (4))' for horizontally split windows."
117 :version "22.1") 117 :version "22.1")
118 118
119(defcustom compare-windows-highlight t 119(defcustom compare-windows-highlight t
120 "*Non-nil means compare-windows highlights the differences." 120 "*Non-nil means compare-windows highlights the differences.
121 :type 'boolean 121The value t removes highlighting immediately after invoking a command
122other than `compare-windows'.
123The value `persistent' leaves all highlighted differences. You can clear
124out all highlighting later with the command `compare-windows-dehighlight'."
125 :type '(choice (const :tag "No highlighting" nil)
126 (const :tag "Persistent highlighting" persistent)
127 (other :tag "Highlight until next command" t))
122 :group 'compare-w 128 :group 'compare-w
123 :version "22.1") 129 :version "22.1")
124 130
@@ -130,6 +136,8 @@ and the value `((4) (4))' for horizontally split windows."
130 136
131(defvar compare-windows-overlay1 nil) 137(defvar compare-windows-overlay1 nil)
132(defvar compare-windows-overlay2 nil) 138(defvar compare-windows-overlay2 nil)
139(defvar compare-windows-overlays1 nil)
140(defvar compare-windows-overlays2 nil)
133(defvar compare-windows-sync-point nil) 141(defvar compare-windows-sync-point nil)
134 142
135;;;###autoload 143;;;###autoload
@@ -351,13 +359,22 @@ on third call it again advances points to the next difference and so on."
351 (overlay-put compare-windows-overlay2 'face 'compare-windows) 359 (overlay-put compare-windows-overlay2 'face 'compare-windows)
352 (overlay-put compare-windows-overlay2 'priority 1000)) 360 (overlay-put compare-windows-overlay2 'priority 1000))
353 (overlay-put compare-windows-overlay2 'window w2) 361 (overlay-put compare-windows-overlay2 'window w2)
354 ;; Remove highlighting before next command is executed 362 (if (not (eq compare-windows-highlight 'persistent))
355 (add-hook 'pre-command-hook 'compare-windows-dehighlight))) 363 ;; Remove highlighting before next command is executed
364 (add-hook 'pre-command-hook 'compare-windows-dehighlight)
365 (when compare-windows-overlay1
366 (push (copy-overlay compare-windows-overlay1) compare-windows-overlays1)
367 (delete-overlay compare-windows-overlay1))
368 (when compare-windows-overlay2
369 (push (copy-overlay compare-windows-overlay2) compare-windows-overlays2)
370 (delete-overlay compare-windows-overlay2)))))
356 371
357(defun compare-windows-dehighlight () 372(defun compare-windows-dehighlight ()
358 "Remove highlighting created by `compare-windows-highlight'." 373 "Remove highlighting created by `compare-windows-highlight'."
359 (interactive) 374 (interactive)
360 (remove-hook 'pre-command-hook 'compare-windows-dehighlight) 375 (remove-hook 'pre-command-hook 'compare-windows-dehighlight)
376 (mapc 'delete-overlay compare-windows-overlays1)
377 (mapc 'delete-overlay compare-windows-overlays2)
361 (and compare-windows-overlay1 (delete-overlay compare-windows-overlay1)) 378 (and compare-windows-overlay1 (delete-overlay compare-windows-overlay1))
362 (and compare-windows-overlay2 (delete-overlay compare-windows-overlay2))) 379 (and compare-windows-overlay2 (delete-overlay compare-windows-overlay2)))
363 380
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 62a6386584e..013ed9073db 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -251,7 +251,8 @@ one optional arguments, diff-number to refine.")
251;; ediff-setup-diff-regions3, which takes 4 arguments. 251;; ediff-setup-diff-regions3, which takes 4 arguments.
252(defun ediff-setup-diff-regions (file-A file-B file-C) 252(defun ediff-setup-diff-regions (file-A file-B file-C)
253 ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options 253 ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options
254 (if (string-match "^-[ci]\\| -[ci]\\|-[^- ]+[ci]" ediff-diff-options) 254 (if (string-match "^-[ci]\\| -[ci]\\|\\(^\\| \\)-[^- ]+[ci]"
255 ediff-diff-options)
255 (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'")) 256 (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'"))
256 257
257 ;; create, if it doesn't exist 258 ;; create, if it doesn't exist
@@ -1215,7 +1216,7 @@ delimiter regions"))
1215;; or it is the ancestor file. 1216;; or it is the ancestor file.
1216(defun ediff-setup-diff-regions3 (file-A file-B file-C) 1217(defun ediff-setup-diff-regions3 (file-A file-B file-C)
1217 ;; looking for '-i' or a 'i' among clustered non-long options 1218 ;; looking for '-i' or a 'i' among clustered non-long options
1218 (if (string-match "^-i\\| -i\\|-[^- ]+i" ediff-diff-options) 1219 (if (string-match "^-i\\| -i\\|\\(^\\| \\)-[^- ]+i" ediff-diff-options)
1219 (error "Option `-i' is not allowed in `ediff-diff3-options'")) 1220 (error "Option `-i' is not allowed in `ediff-diff3-options'"))
1220 1221
1221 (or (ediff-buffer-live-p ediff-diff-buffer) 1222 (or (ediff-buffer-live-p ediff-diff-buffer)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c77c92d05c7..87327dde482 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,38 @@
12006-02-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * flow-fill.el (fill-flowed): Bind adaptive-fill-mode to nil.
4 Remove space stuffing, and only do quotes that actually start with
5 ">" at the beginning of the lines.
6 Merge of 2005-11-17 and 2004-07-25 from the trunk.
7
82006-02-23 Reiner Steib <Reiner.Steib@gmx.de>
9
10 * utf7.el (utf7-utf-16-coding-system): Fix comment. utf-16-be is
11 also available in Emacs 21.3.
12
13 * message.el (message-fix-before-sending): Change "Emacs 22" to
14 "Emacs 23 (unicode)" in comment.
15
16 * qp.el (quoted-printable-encode-region): Change "Emacs 22" to
17 "Emacs 23 (unicode)" in comment.
18
19 * mm-util.el: Change "Emacs 22" to "Emacs 23 (unicode)" in
20 comment.
21 (mm-coding-system-p): Add comment about no-MULE XEmacs.
22
23 * mm-view.el (mm-fill-flowed): Add :version.
24
252006-02-23 Ralf Angeli <angeli@iwi.uni-sb.de>
26
27 * mm-view.el (mm-fill-flowed): New variable.
28 (mm-inline-text): Use it.
29
302006-02-21 Wolfram Fenske <wolfram.fenske@student.uni-magdeburg.de>
31 (tiny change)
32
33 * nnimap.el (nnimap-request-move-article): Change folder back to
34 source group before deleting.
35
12006-02-20 Katsumi Yamaoka <yamaoka@jpl.org> 362006-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
2 37
3 * rfc2047.el (rfc2047-charset-to-coding-system): Don't check the 38 * rfc2047.el (rfc2047-charset-to-coding-system): Don't check the
@@ -1266,7 +1301,7 @@
1266 1301
1267 * gnus-topic.el (gnus-topic-mode): Ditto. 1302 * gnus-topic.el (gnus-topic-mode): Ditto.
1268 1303
12692005-07-08 Ralf Angeli <angeli@iwi.uni-sb.de> (tiny change) 13042005-07-08 Ralf Angeli <angeli@iwi.uni-sb.de>
1270 1305
1271 * gnus-art.el (gnus-article-next-page, gnus-article-next-page-1) 1306 * gnus-art.el (gnus-article-next-page, gnus-article-next-page-1)
1272 (gnus-article-prev-page): Take scroll-margin into consideration. 1307 (gnus-article-prev-page): Take scroll-margin into consideration.
diff --git a/lisp/gnus/flow-fill.el b/lisp/gnus/flow-fill.el
index c3f7f7bb20e..480505549c9 100644
--- a/lisp/gnus/flow-fill.el
+++ b/lisp/gnus/flow-fill.el
@@ -113,10 +113,15 @@ RFC 2646 suggests 66 characters for readability."
113 (save-excursion 113 (save-excursion
114 (set-buffer (or (current-buffer) buffer)) 114 (set-buffer (or (current-buffer) buffer))
115 (goto-char (point-min)) 115 (goto-char (point-min))
116 ;; Remove space stuffing.
117 (while (re-search-forward "^ " nil t)
118 (delete-char -1)
119 (forward-line 1))
120 (goto-char (point-min))
116 (while (re-search-forward " $" nil t) 121 (while (re-search-forward " $" nil t)
117 (when (save-excursion 122 (when (save-excursion
118 (beginning-of-line) 123 (beginning-of-line)
119 (looking-at "^\\(>*\\)\\( ?\\)")) 124 (looking-at "^\\(>+\\)\\( ?\\)"))
120 (let ((quote (match-string 1)) 125 (let ((quote (match-string 1))
121 sig) 126 sig)
122 (if (string= quote "") 127 (if (string= quote "")
@@ -146,7 +151,8 @@ RFC 2646 suggests 66 characters for readability."
146 (condition-case nil 151 (condition-case nil
147 (let ((fill-prefix (when quote (concat quote " "))) 152 (let ((fill-prefix (when quote (concat quote " ")))
148 (fill-column (eval fill-flowed-display-column)) 153 (fill-column (eval fill-flowed-display-column))
149 filladapt-mode) 154 filladapt-mode
155 adaptive-fill-mode)
150 (fill-region (fill-flowed-point-at-bol) 156 (fill-region (fill-flowed-point-at-bol)
151 (min (1+ (fill-flowed-point-at-eol)) 157 (min (1+ (fill-flowed-point-at-eol))
152 (point-max)) 158 (point-max))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index cf0dc5ea6fe..1bdc2f6a11f 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3615,8 +3615,8 @@ It should typically alter the sending method in some way or other."
3615 (when (let ((char (char-after))) 3615 (when (let ((char (char-after)))
3616 (or (< (mm-char-int char) 128) 3616 (or (< (mm-char-int char) 128)
3617 (and (mm-multibyte-p) 3617 (and (mm-multibyte-p)
3618 ;; Fixme: Wrong for Emacs 23 and for things 3618 ;; FIXME: Wrong for Emacs 23 (unicode) and for
3619 ;; like undectable utf-8. Should at least 3619 ;; things like undecable utf-8. Should at least
3620 ;; use find-coding-systems-region. 3620 ;; use find-coding-systems-region.
3621 (memq (char-charset char) 3621 (memq (char-charset char)
3622 '(eight-bit-control eight-bit-graphic 3622 '(eight-bit-control eight-bit-graphic
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 804a5b2294c..efb5aeef082 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -174,7 +174,7 @@ system object in XEmacs."
174 (if (fboundp 'coding-system-p) 174 (if (fboundp 'coding-system-p)
175 (when (coding-system-p cs) 175 (when (coding-system-p cs)
176 cs) 176 cs)
177 ;; Is this branch ever actually useful? 177 ;; no-MULE XEmacs:
178 (car (memq cs (mm-get-coding-system-list)))))) 178 (car (memq cs (mm-get-coding-system-list))))))
179 179
180(defvar mm-charset-synonym-alist 180(defvar mm-charset-synonym-alist
@@ -331,7 +331,7 @@ with Mule charsets. It is completely useless for Emacs."
331 cs mime mule alist) 331 cs mime mule alist)
332 (while css 332 (while css
333 (setq cs (pop css) 333 (setq cs (pop css)
334 mime (or (coding-system-get cs :mime-charset) ; Emacs 23 334 mime (or (coding-system-get cs :mime-charset); Emacs 23 (unicode)
335 (coding-system-get cs 'mime-charset))) 335 (coding-system-get cs 'mime-charset)))
336 (when (and mime 336 (when (and mime
337 (not (eq t (setq mule 337 (not (eq t (setq mule
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 43d6bddf194..c2b4e19f806 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -72,6 +72,12 @@
72 (html2text html2text)) 72 (html2text html2text))
73 "The attributes of washer types for text/html.") 73 "The attributes of washer types for text/html.")
74 74
75(defcustom mm-fill-flowed t
76 "If non-nil an format=flowed article will be displayed flowed."
77 :type 'boolean
78 :version "22.1"
79 :group 'mime-display)
80
75;;; Internal variables. 81;;; Internal variables.
76 82
77;;; 83;;;
@@ -407,7 +413,8 @@
407 (mm-insert-part handle) 413 (mm-insert-part handle)
408 (goto-char (point-max))) 414 (goto-char (point-max)))
409 (insert (mm-decode-string (mm-get-part handle) charset))) 415 (insert (mm-decode-string (mm-get-part handle) charset)))
410 (when (and (equal type "plain") 416 (when (and mm-fill-flowed
417 (equal type "plain")
411 (equal (cdr (assoc 'format (mm-handle-type handle))) 418 (equal (cdr (assoc 'format (mm-handle-type handle)))
412 "flowed")) 419 "flowed"))
413 (save-restriction 420 (save-restriction
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 26c0f8901ee..3c05b3713ea 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1492,6 +1492,7 @@ function is generally only called when Gnus is shutting down."
1492 (setq result (eval accept-form)) 1492 (setq result (eval accept-form))
1493 (kill-buffer buf) 1493 (kill-buffer buf)
1494 result) 1494 result)
1495 (nnimap-possibly-change-group group server)
1495 (imap-message-flags-add 1496 (imap-message-flags-add
1496 (imap-range-to-message-set (list article)) 1497 (imap-range-to-message-set (list article))
1497 "\\Deleted" 'silent nnimap-server-buffer)) 1498 "\\Deleted" 'silent nnimap-server-buffer))
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el
index afd6ad72b4d..15914922d1c 100644
--- a/lisp/gnus/qp.el
+++ b/lisp/gnus/qp.el
@@ -118,7 +118,7 @@ encode lines starting with \"From\"."
118 (not (eobp))) 118 (not (eobp)))
119 (insert 119 (insert
120 (prog1 120 (prog1
121 ;; To unibyte in case of Emacs 23 eight-bit. 121 ;; To unibyte in case of Emacs 23 (unicode) eight-bit.
122 (format "=%02X" (mm-multibyte-char-to-unibyte (char-after))) 122 (format "=%02X" (mm-multibyte-char-to-unibyte (char-after)))
123 (delete-char 1)))) 123 (delete-char 1))))
124 ;; Encode white space at the end of lines. 124 ;; Encode white space at the end of lines.
diff --git a/lisp/gnus/utf7.el b/lisp/gnus/utf7.el
index 7347259a35c..a1b7fdc6702 100644
--- a/lisp/gnus/utf7.el
+++ b/lisp/gnus/utf7.el
@@ -80,7 +80,7 @@
80(defconst utf7-utf-16-coding-system 80(defconst utf7-utf-16-coding-system
81 (cond ((mm-coding-system-p 'utf-16-be-no-signature) ; Mule-UCS 81 (cond ((mm-coding-system-p 'utf-16-be-no-signature) ; Mule-UCS
82 'utf-16-be-no-signature) 82 'utf-16-be-no-signature)
83 ((and (mm-coding-system-p 'utf-16-be) ; Emacs 23.1 83 ((and (mm-coding-system-p 'utf-16-be) ; Emacs 21.3, Emacs 22
84 ;; Avoid versions with BOM. 84 ;; Avoid versions with BOM.
85 (= 2 (length (encode-coding-string "a" 'utf-16-be)))) 85 (= 2 (length (encode-coding-string "a" 'utf-16-be))))
86 'utf-16-be) 86 'utf-16-be)
diff --git a/lisp/help.el b/lisp/help.el
index f74293b8dd6..bed25366aab 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -835,8 +835,9 @@ follows the description of the major mode.)\n\n"))
835 ;; Document the major mode. 835 ;; Document the major mode.
836 (let ((mode mode-name)) 836 (let ((mode mode-name))
837 (with-current-buffer standard-output 837 (with-current-buffer standard-output
838 (insert mode) 838 (let ((start (point)))
839 (add-text-properties (- (point) (length mode)) (point) '(face bold)))) 839 (insert (format-mode-line mode))
840 (add-text-properties start (point) '(face bold)))))
840 (princ " mode:\n") 841 (princ " mode:\n")
841 (princ (documentation major-mode))) 842 (princ (documentation major-mode)))
842 (print-help-return-message)))) 843 (print-help-return-message))))
@@ -932,7 +933,7 @@ is currently activated with completion."
932;;; Automatic resizing of temporary buffers. 933;;; Automatic resizing of temporary buffers.
933 934
934(defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2)) 935(defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2))
935 "*Maximum height of a window displaying a temporary buffer. 936 "Maximum height of a window displaying a temporary buffer.
936This is the maximum height (in text lines) which `resize-temp-buffer-window' 937This is the maximum height (in text lines) which `resize-temp-buffer-window'
937will give to a window displaying a temporary buffer. 938will give to a window displaying a temporary buffer.
938It can also be a function which will be called with the object corresponding 939It can also be a function which will be called with the object corresponding
@@ -971,8 +972,7 @@ out of view."
971 (funcall temp-buffer-max-height (current-buffer)) 972 (funcall temp-buffer-max-height (current-buffer))
972 temp-buffer-max-height)))) 973 temp-buffer-max-height))))
973 974
974;; Provide this for the sake of define-minor-mode which generates 975
975;; defcustoms which require 'help'.
976(provide 'help) 976(provide 'help)
977 977
978;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423 978;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423
diff --git a/lisp/info.el b/lisp/info.el
index e9d7f5ca2de..43ee5cabcbc 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1642,7 +1642,9 @@ If DIRECTION is `backward', search in the reverse direction."
1642 (and (search-backward "\^_" nil t) 1642 (and (search-backward "\^_" nil t)
1643 (looking-at 1643 (looking-at
1644 "\^_\n\\(Tag Table\\|Local Variables\\)")))))) 1644 "\^_\n\\(Tag Table\\|Local Variables\\)"))))))
1645 (let ((search-spaces-regexp Info-search-whitespace-regexp)) 1645 (let ((search-spaces-regexp
1646 (if (or (not isearch-mode) isearch-regexp)
1647 Info-search-whitespace-regexp)))
1646 (if (if backward 1648 (if (if backward
1647 (re-search-backward regexp bound t) 1649 (re-search-backward regexp bound t)
1648 (re-search-forward regexp bound t)) 1650 (re-search-forward regexp bound t))
@@ -1660,7 +1662,9 @@ If DIRECTION is `backward', search in the reverse direction."
1660 ;; If no subfiles, give error now. 1662 ;; If no subfiles, give error now.
1661 (if give-up 1663 (if give-up
1662 (if (null Info-current-subfile) 1664 (if (null Info-current-subfile)
1663 (let ((search-spaces-regexp Info-search-whitespace-regexp)) 1665 (let ((search-spaces-regexp
1666 (if (or (not isearch-mode) isearch-regexp)
1667 Info-search-whitespace-regexp)))
1664 (if backward 1668 (if backward
1665 (re-search-backward regexp) 1669 (re-search-backward regexp)
1666 (re-search-forward regexp))) 1670 (re-search-forward regexp)))
@@ -1731,7 +1735,9 @@ If DIRECTION is `backward', search in the reverse direction."
1731 (and (search-backward "\^_" nil t) 1735 (and (search-backward "\^_" nil t)
1732 (looking-at 1736 (looking-at
1733 "\^_\n\\(Tag Table\\|Local Variables\\)")))))) 1737 "\^_\n\\(Tag Table\\|Local Variables\\)"))))))
1734 (let ((search-spaces-regexp Info-search-whitespace-regexp)) 1738 (let ((search-spaces-regexp
1739 (if (or (not isearch-mode) isearch-regexp)
1740 Info-search-whitespace-regexp)))
1735 (if (if backward 1741 (if (if backward
1736 (re-search-backward regexp nil t) 1742 (re-search-backward regexp nil t)
1737 (re-search-forward regexp nil t)) 1743 (re-search-forward regexp nil t))
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index df603dc0d74..db79d43d321 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -123,6 +123,7 @@ and #define directives otherwise.")
123(defvar gdb-macro-info nil 123(defvar gdb-macro-info nil
124 "Non-nil if GDB knows that the inferior includes preprocessor macro info.") 124 "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
125(defvar gdb-buffer-fringe-width nil) 125(defvar gdb-buffer-fringe-width nil)
126(defvar gdb-signalled nil)
126 127
127(defvar gdb-buffer-type nil 128(defvar gdb-buffer-type nil
128 "One of the symbols bound in `gdb-buffer-rules'.") 129 "One of the symbols bound in `gdb-buffer-rules'.")
@@ -258,11 +259,19 @@ detailed description of this mode.
258 (gdb command-line) 259 (gdb command-line)
259 (gdb-init-1)) 260 (gdb-init-1))
260 261
261(defvar gdb-debug-log nil) 262(defcustom gdb-debug-ring-max 128
263 "Maximum size of `gdb-debug-ring'."
264 :group 'gud
265 :type 'integer
266 :version "22.1")
267
268(defvar gdb-debug-ring nil
269 "List of commands, most recent first, sent to and replies received from GDB.
270This variable is used to debug GDB-UI.")
262 271
263;;;###autoload 272;;;###autoload
264(defcustom gdb-enable-debug-log nil 273(defcustom gdb-enable-debug nil
265 "Non-nil means record the process input and output in `gdb-debug-log'." 274 "Non-nil means record the process input and output in `gdb-debug-ring'."
266 :type 'boolean 275 :type 'boolean
267 :group 'gud 276 :group 'gud
268 :version "22.1") 277 :version "22.1")
@@ -390,7 +399,6 @@ With arg, use separate IO iff arg is positive."
390 expr)) 399 expr))
391 400
392(defun gdb-init-1 () 401(defun gdb-init-1 ()
393 (setq gdb-debug-log nil)
394 (set (make-local-variable 'gud-minor-mode) 'gdba) 402 (set (make-local-variable 'gud-minor-mode) 'gdba)
395 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) 403 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
396 ;; 404 ;;
@@ -436,11 +444,21 @@ With arg, use separate IO iff arg is positive."
436 'gdb-mouse-set-clear-breakpoint) 444 'gdb-mouse-set-clear-breakpoint)
437 (define-key gud-minor-mode-map [left-fringe mouse-2] 445 (define-key gud-minor-mode-map [left-fringe mouse-2]
438 'gdb-mouse-until) 446 'gdb-mouse-until)
447 (define-key gud-minor-mode-map [left-margin drag-mouse-1]
448 'gdb-mouse-until)
439 (define-key gud-minor-mode-map [left-fringe drag-mouse-1] 449 (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
440 'gdb-mouse-until) 450 'gdb-mouse-until)
441 (define-key gud-minor-mode-map [left-margin mouse-2] 451 (define-key gud-minor-mode-map [left-margin mouse-2]
442 'gdb-mouse-until) 452 'gdb-mouse-until)
443 (define-key gud-minor-mode-map [left-margin mouse-3] 453 (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
454 'gdb-mouse-jump)
455 (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
456 'gdb-mouse-jump)
457 (define-key gud-minor-mode-map [left-fringe C-mouse-2]
458 'gdb-mouse-jump)
459 (define-key gud-minor-mode-map [left-margin C-mouse-2]
460 'gdb-mouse-jump)
461 (define-key gud-minor-mode-map [left-margin mouse-3]
444 'gdb-mouse-toggle-breakpoint-margin) 462 'gdb-mouse-toggle-breakpoint-margin)
445 (define-key gud-minor-mode-map [left-fringe mouse-3] 463 (define-key gud-minor-mode-map [left-fringe mouse-3]
446 'gdb-mouse-toggle-breakpoint-fringe) 464 'gdb-mouse-toggle-breakpoint-fringe)
@@ -469,14 +487,15 @@ With arg, use separate IO iff arg is positive."
469 gdb-source-file-list nil 487 gdb-source-file-list nil
470 gdb-error nil 488 gdb-error nil
471 gdb-macro-info nil 489 gdb-macro-info nil
472 gdb-buffer-fringe-width (car (window-fringes))) 490 gdb-buffer-fringe-width (car (window-fringes))
491 gdb-debug-ring nil
492 gdb-signalled nil)
473 493
474 (setq gdb-buffer-type 'gdba) 494 (setq gdb-buffer-type 'gdba)
475 495
476 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io)) 496 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
477 497
478 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4) 498 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
479 (setq gdb-version nil)
480 (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n" 499 (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
481 'gdb-get-version))) 500 'gdb-get-version)))
482 501
@@ -516,7 +535,9 @@ With arg, use separate IO iff arg is positive."
516 (gdb-init-2)) 535 (gdb-init-2))
517 536
518(defun gdb-mouse-until (event) 537(defun gdb-mouse-until (event)
519 "Execute source lines by dragging the overlay arrow (fringe) with the mouse." 538 "Continue running until a source line past the current line.
539The destination source line can be selected either by clicking with mouse-2
540on the fringe/margin or dragging the arrow with mouse-1 (default bindings)."
520 (interactive "e") 541 (interactive "e")
521 (if gud-overlay-arrow-position 542 (if gud-overlay-arrow-position
522 (let ((start (event-start event)) 543 (let ((start (event-start event))
@@ -542,6 +563,40 @@ With arg, use separate IO iff arg is positive."
542 (forward-char 2) 563 (forward-char 2)
543 (gud-call (concat "until *%a"))))))))) 564 (gud-call (concat "until *%a")))))))))
544 565
566(defun gdb-mouse-jump (event)
567 "Set execution address/line.
568The destination source line can be selected either by clicking with mouse-2
569on the fringe/margin or dragging the arrow with mouse-1 (default bindings).
570Unlike gdb-mouse-until the destination address can be before the current
571line, and no execution takes place."
572 (interactive "e")
573 (if gud-overlay-arrow-position
574 (let ((start (event-start event))
575 (end (event-end event))
576 (buffer (marker-buffer gud-overlay-arrow-position)) (line))
577 (if (not (string-match "Machine" mode-name))
578 (if (equal buffer (window-buffer (posn-window end)))
579 (with-current-buffer buffer
580 (when (or (equal start end)
581 (equal (posn-point start)
582 (marker-position
583 gud-overlay-arrow-position)))
584 (setq line (line-number-at-pos (posn-point end)))
585 (progn (gud-call (concat "tbreak " (number-to-string line)))
586 (gud-call (concat "jump " (number-to-string line)))))))
587 (if (equal (marker-buffer gdb-overlay-arrow-position)
588 (window-buffer (posn-window end)))
589 (when (or (equal start end)
590 (equal (posn-point start)
591 (marker-position
592 gdb-overlay-arrow-position)))
593 (save-excursion
594 (goto-line (line-number-at-pos (posn-point end)))
595 (forward-char 2)
596 (progn
597 (gud-call (concat "tbreak *%a"))
598 (gud-call (concat "jump *%a"))))))))))
599
545(defcustom gdb-speedbar-auto-raise nil 600(defcustom gdb-speedbar-auto-raise nil
546 "If non-nil raise speedbar every time display of watch expressions is\ 601 "If non-nil raise speedbar every time display of watch expressions is\
547 updated." 602 updated."
@@ -573,9 +628,6 @@ With arg, automatically raise speedbar iff arg is positive."
573 (require 'tooltip) 628 (require 'tooltip)
574 (save-selected-window 629 (save-selected-window
575 (let ((expr (tooltip-identifier-from-point (point)))) 630 (let ((expr (tooltip-identifier-from-point (point))))
576 (if (and (string-equal gdb-current-language "c")
577 gdb-use-colon-colon-notation gdb-selected-frame)
578 (setq expr (concat gdb-selected-frame "::" expr)))
579 (catch 'already-watched 631 (catch 'already-watched
580 (dolist (var gdb-var-list) 632 (dolist (var gdb-var-list)
581 (if (string-equal expr (car var)) (throw 'already-watched nil))) 633 (if (string-equal expr (car var)) (throw 'already-watched nil)))
@@ -593,11 +645,15 @@ With arg, automatically raise speedbar iff arg is positive."
593(defun gdb-var-create-handler (expr) 645(defun gdb-var-create-handler (expr)
594 (goto-char (point-min)) 646 (goto-char (point-min))
595 (if (re-search-forward gdb-var-create-regexp nil t) 647 (if (re-search-forward gdb-var-create-regexp nil t)
596 (let ((var (list expr 648 (let ((var (list
597 (match-string 1) 649 (if (and (string-equal gdb-current-language "c")
598 (match-string 2) 650 gdb-use-colon-colon-notation gdb-selected-frame)
599 (match-string 3) 651 (setq expr (concat gdb-selected-frame "::" expr))
600 nil nil))) 652 expr)
653 (match-string 1)
654 (match-string 2)
655 (match-string 3)
656 nil nil)))
601 (push var gdb-var-list) 657 (push var gdb-var-list)
602 (speedbar 1) 658 (speedbar 1)
603 (unless (string-equal 659 (unless (string-equal
@@ -613,7 +669,7 @@ With arg, automatically raise speedbar iff arg is positive."
613 ,(nth 1 var) nil))))) 669 ,(nth 1 var) nil)))))
614 (if (search-forward "Undefined command" nil t) 670 (if (search-forward "Undefined command" nil t)
615 (message-box "Watching expressions requires gdb 6.0 onwards") 671 (message-box "Watching expressions requires gdb 6.0 onwards")
616 (message "No symbol \"%s\" in current context." expr)))) 672 (message-box "No symbol \"%s\" in current context." expr))))
617 673
618(defun gdb-var-evaluate-expression-handler (varnum changed) 674(defun gdb-var-evaluate-expression-handler (varnum changed)
619 (goto-char (point-min)) 675 (goto-char (point-min))
@@ -864,7 +920,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
864 "*")) 920 "*"))
865 921
866(defun gdb-display-separate-io-buffer () 922(defun gdb-display-separate-io-buffer ()
867 "Display IO of inferior in a separate window." 923 "Display IO of debugged program in a separate window."
868 (interactive) 924 (interactive)
869 (if gdb-use-separate-io-buffer 925 (if gdb-use-separate-io-buffer
870 (gdb-display-buffer 926 (gdb-display-buffer
@@ -963,7 +1019,7 @@ This filter may simply queue input for a later time."
963 (let ((item (concat string "\n"))) 1019 (let ((item (concat string "\n")))
964 (if gud-running 1020 (if gud-running
965 (progn 1021 (progn
966 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log)) 1022 (if gdb-enable-debug (push (cons 'send item) gdb-debug-ring))
967 (process-send-string proc item)) 1023 (process-send-string proc item))
968 (gdb-enqueue-input item)))) 1024 (gdb-enqueue-input item))))
969 1025
@@ -986,7 +1042,7 @@ This filter may simply queue input for a later time."
986 1042
987(defun gdb-send-item (item) 1043(defun gdb-send-item (item)
988 (setq gdb-flush-pending-output nil) 1044 (setq gdb-flush-pending-output nil)
989 (if gdb-enable-debug-log (push (cons 'send-item item) gdb-debug-log)) 1045 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-ring))
990 (setq gdb-current-item item) 1046 (setq gdb-current-item item)
991 (let ((process (get-buffer-process gud-comint-buffer))) 1047 (let ((process (get-buffer-process gud-comint-buffer)))
992 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 1048 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
@@ -1039,7 +1095,7 @@ This filter may simply queue input for a later time."
1039 ("source" gdb-source) 1095 ("source" gdb-source)
1040 ("starting" gdb-starting) 1096 ("starting" gdb-starting)
1041 ("exited" gdb-exited) 1097 ("exited" gdb-exited)
1042 ("signalled" gdb-exited) 1098 ("signalled" gdb-signalled)
1043 ("signal" gdb-stopping) 1099 ("signal" gdb-stopping)
1044 ("breakpoint" gdb-stopping) 1100 ("breakpoint" gdb-stopping)
1045 ("watchpoint" gdb-stopping) 1101 ("watchpoint" gdb-stopping)
@@ -1156,6 +1212,9 @@ directives."
1156 (setq gdb-overlay-arrow-position nil) 1212 (setq gdb-overlay-arrow-position nil)
1157 (gdb-stopping ignored)) 1213 (gdb-stopping ignored))
1158 1214
1215(defun gdb-signalled (ignored)
1216 (setq gdb-signalled t))
1217
1159(defun gdb-frame-begin (ignored) 1218(defun gdb-frame-begin (ignored)
1160 (let ((sink gdb-output-sink)) 1219 (let ((sink gdb-output-sink))
1161 (cond 1220 (cond
@@ -1172,7 +1231,6 @@ directives."
1172It is just like `gdb-stopping', except that if we already set the output 1231It is just like `gdb-stopping', except that if we already set the output
1173sink to `user' in `gdb-stopping', that is fine." 1232sink to `user' in `gdb-stopping', that is fine."
1174 (setq gud-running nil) 1233 (setq gud-running nil)
1175 (setq gdb-active-process t)
1176 (let ((sink gdb-output-sink)) 1234 (let ((sink gdb-output-sink))
1177 (cond 1235 (cond
1178 ((eq sink 'inferior) 1236 ((eq sink 'inferior)
@@ -1180,7 +1238,8 @@ sink to `user' in `gdb-stopping', that is fine."
1180 ((eq sink 'user) t) 1238 ((eq sink 'user) t)
1181 (t 1239 (t
1182 (gdb-resync) 1240 (gdb-resync)
1183 (error "Unexpected stopped annotation"))))) 1241 (error "Unexpected stopped annotation"))))
1242 (if gdb-signalled (gdb-exited ignored)))
1184 1243
1185(defun gdb-error (ignored) 1244(defun gdb-error (ignored)
1186 (setq gdb-error (not gdb-error))) 1245 (setq gdb-error (not gdb-error)))
@@ -1233,7 +1292,10 @@ happens to be appropriate."
1233 "A gud marker filter for gdb. Handle a burst of output from GDB." 1292 "A gud marker filter for gdb. Handle a burst of output from GDB."
1234 (if gdb-flush-pending-output 1293 (if gdb-flush-pending-output
1235 nil 1294 nil
1236 (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) 1295 (when gdb-enable-debug
1296 (push (cons 'recv string) gdb-debug-ring)
1297 (if (> (length gdb-debug-ring) gdb-debug-ring-max)
1298 (setcdr (nthcdr (1- gdb-debug-ring-max) gdb-debug-ring) nil)))
1237 ;; Recall the left over gud-marker-acc from last time. 1299 ;; Recall the left over gud-marker-acc from last time.
1238 (setq gud-marker-acc (concat gud-marker-acc string)) 1300 (setq gud-marker-acc (concat gud-marker-acc string))
1239 ;; Start accumulating output for the GUD buffer. 1301 ;; Start accumulating output for the GUD buffer.
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el
index a8d2d8b8fe1..dadc9cffc7a 100644
--- a/lisp/progmodes/glasses.el
+++ b/lisp/progmodes/glasses.el
@@ -67,7 +67,7 @@
67 67
68 68
69(defcustom glasses-separator "_" 69(defcustom glasses-separator "_"
70 "*String to be displayed as a visual separator in identifiers. 70 "String to be displayed as a visual separator in identifiers.
71It is used both for adding missing separators and for replacing separators 71It is used both for adding missing separators and for replacing separators
72defined by `glasses-original-separator'. If you don't want to add missing 72defined by `glasses-original-separator'. If you don't want to add missing
73separators, set `glasses-separator' to an empty string. If you don't want to 73separators, set `glasses-separator' to an empty string. If you don't want to
@@ -93,7 +93,7 @@ performed."
93 93
94 94
95(defcustom glasses-face nil 95(defcustom glasses-face nil
96 "*Face to be put on capitals of an identifier looked through glasses. 96 "Face to be put on capitals of an identifier looked through glasses.
97If it is nil, no face is placed at the capitalized letter. 97If it is nil, no face is placed at the capitalized letter.
98 98
99For example, you can set `glasses-separator' to an empty string and 99For example, you can set `glasses-separator' to an empty string and
@@ -106,13 +106,13 @@ but will have their capitals in bold."
106 106
107 107
108(defcustom glasses-separate-parentheses-p t 108(defcustom glasses-separate-parentheses-p t
109 "*If non-nil, ensure space between an identifier and an opening parenthesis." 109 "If non-nil, ensure space between an identifier and an opening parenthesis."
110 :group 'glasses 110 :group 'glasses
111 :type 'boolean) 111 :type 'boolean)
112 112
113 113
114(defcustom glasses-uncapitalize-p nil 114(defcustom glasses-uncapitalize-p nil
115 "*If non-nil, downcase embedded capital letters in identifiers. 115 "If non-nil, downcase embedded capital letters in identifiers.
116Only identifiers starting with lower case letters are affected, letters inside 116Only identifiers starting with lower case letters are affected, letters inside
117other identifiers are unchanged." 117other identifiers are unchanged."
118 :group 'glasses 118 :group 'glasses
@@ -122,7 +122,7 @@ other identifiers are unchanged."
122 122
123 123
124(defcustom glasses-uncapitalize-regexp "[a-z]" 124(defcustom glasses-uncapitalize-regexp "[a-z]"
125 "*Regexp matching beginnings of words to be uncapitalized. 125 "Regexp matching beginnings of words to be uncapitalized.
126Only words starting with this regexp are uncapitalized. 126Only words starting with this regexp are uncapitalized.
127The regexp is case sensitive. 127The regexp is case sensitive.
128It has any effect only when `glasses-uncapitalize-p' is non-nil." 128It has any effect only when `glasses-uncapitalize-p' is non-nil."
@@ -133,7 +133,7 @@ It has any effect only when `glasses-uncapitalize-p' is non-nil."
133 133
134 134
135(defcustom glasses-convert-on-write-p nil 135(defcustom glasses-convert-on-write-p nil
136 "*If non-nil, remove separators when writing glasses buffer to a file. 136 "If non-nil, remove separators when writing glasses buffer to a file.
137If you are confused by glasses so much, that you write the separators into code 137If you are confused by glasses so much, that you write the separators into code
138during coding, set this variable to t. The separators will be removed on each 138during coding, set this variable to t. The separators will be removed on each
139file write then. 139file write then.
@@ -313,5 +313,5 @@ at places they belong to."
313(provide 'glasses) 313(provide 'glasses)
314 314
315 315
316;;; arch-tag: a3515167-c89e-484f-90a1-d85143e52b12 316;; arch-tag: a3515167-c89e-484f-90a1-d85143e52b12
317;;; glasses.el ends here 317;;; glasses.el ends here
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index ea2586a31d6..5a09d5dd196 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -456,7 +456,8 @@ required by the caller."
456 (while var-list 456 (while var-list
457 (let* (char (depth 0) (start 0) (var (car var-list)) 457 (let* (char (depth 0) (start 0) (var (car var-list))
458 (expr (car var)) (varnum (nth 1 var)) 458 (expr (car var)) (varnum (nth 1 var))
459 (type (nth 3 var)) (status (nth 5 var))) 459 (type (nth 3 var)) (value (nth 4 var))
460 (status (nth 5 var)))
460 (put-text-property 461 (put-text-property
461 0 (length expr) 'face font-lock-variable-name-face expr) 462 0 (length expr) 'face font-lock-variable-name-face expr)
462 (put-text-property 463 (put-text-property
@@ -470,7 +471,7 @@ required by the caller."
470 (string-match "char \\*$" type))) 471 (string-match "char \\*$" type)))
471 (speedbar-make-tag-line 472 (speedbar-make-tag-line
472 'bracket ?? nil nil 473 'bracket ?? nil nil
473 (concat expr "\t" (nth 4 var)) 474 (concat expr "\t" value)
474 (if (or parent (eq status 'out-of-scope)) 475 (if (or parent (eq status 'out-of-scope))
475 nil 'gdb-edit-value) 476 nil 'gdb-edit-value)
476 nil 477 nil
@@ -491,14 +492,12 @@ required by the caller."
491 (speedbar-make-tag-line 492 (speedbar-make-tag-line
492 'bracket char 493 'bracket char
493 'gdb-speedbar-expand-node varnum 494 'gdb-speedbar-expand-node varnum
494 (concat expr "\t" 495 (concat expr "\t" type "\t" value)
495 type "\t" 496 (if (or parent status)
496 (nth 4 var))
497 (if (or parent status 'out-of-scope)
498 nil 'gdb-edit-value) 497 nil 'gdb-edit-value)
499 nil 498 nil
500 (if (and (or parent status) gdb-show-changed-values) 499 (if (and (or parent (eq status 'out-of-scope))
501 'shadow t) 500 gdb-show-changed-values) 'shadow t)
502 depth) 501 depth)
503 (speedbar-make-tag-line 502 (speedbar-make-tag-line
504 'bracket char 503 'bracket char
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 3c70314703b..cecfe7f5164 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 4.04 8;; Version: 4.06
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -81,6 +81,21 @@
81;; 81;;
82;; Changes since version 4.00: 82;; Changes since version 4.00:
83;; --------------------------- 83;; ---------------------------
84;; Version 4.06
85;; - HTML exporter treats targeted internal links.
86;; - Bug fixes.
87;;
88;; Version 4.05
89;; - Changes to internal link system (thanks to David Wainberg for ideas).
90;; - in-file links: [[Search String]] instead of <file:::Search String>
91;; - automatic links to "radio targets".
92;; - CamelCase not longer active by default, configure org-activate-camels
93;; if you want to turn it back on.
94;; - After following a link, `C-c &' jumps back to it.
95;; - MH-E link support (thanks to Thomas Baumann).
96;; - Special table lines are no longer exported.
97;; - Bug fixes and minor improvements.
98;;
84;; Version 4.04 99;; Version 4.04
85;; - Cleanup tags display in agenda. 100;; - Cleanup tags display in agenda.
86;; - Bug fixes. 101;; - Bug fixes.
@@ -115,7 +130,7 @@
115 130
116;;; Customization variables 131;;; Customization variables
117 132
118(defvar org-version "4.04" 133(defvar org-version "4.06"
119 "The version number of the file org.el.") 134 "The version number of the file org.el.")
120(defun org-version () 135(defun org-version ()
121 (interactive) 136 (interactive)
@@ -125,7 +140,7 @@
125;; versions (Emacs versus XEmacs) and with different versions of outline.el. 140;; versions (Emacs versus XEmacs) and with different versions of outline.el.
126;; The compatibility code in org.el is based on these two constants. 141;; The compatibility code in org.el is based on these two constants.
127(defconst org-xemacs-p (featurep 'xemacs) 142(defconst org-xemacs-p (featurep 'xemacs)
128 "Are we running xemacs?") 143 "Are we running XEmacs?")
129(defconst org-noutline-p (featurep 'noutline) 144(defconst org-noutline-p (featurep 'noutline)
130 "Are we using the new outline mode?") 145 "Are we using the new outline mode?")
131 146
@@ -775,7 +790,7 @@ as possible."
775(defcustom org-level-color-stars-only nil 790(defcustom org-level-color-stars-only nil
776 "Non-nil means fontify only the stars in each headline. 791 "Non-nil means fontify only the stars in each headline.
777When nil, the entire headline is fontified. 792When nil, the entire headline is fontified.
778Changing it requires a restart of Emacs to become effective." 793Changing it requires restart of Emacs to become effective."
779 :group 'org-structure 794 :group 'org-structure
780 :type 'boolean) 795 :type 'boolean)
781 796
@@ -930,6 +945,12 @@ Needs to be set before org.el is loaded."
930 :group 'org-link 945 :group 'org-link
931 :type 'boolean) 946 :type 'boolean)
932 947
948(defcustom org-mark-ring-length 4
949 "Number of different positions to be recorded in the ring
950Changing this requires a restart of Emacs to work correctly."
951 :group 'org-link
952 :type 'interger)
953
933(defcustom org-link-format "<%s>" 954(defcustom org-link-format "<%s>"
934 "Default format for linkes in the buffer. 955 "Default format for linkes in the buffer.
935This is a format string for printf, %s will be replaced by the link text. 956This is a format string for printf, %s will be replaced by the link text.
@@ -948,13 +969,27 @@ recommend an additional URL: prefix, so the format would be \"<URL:%s>\"."
948When nil, it becomes possible to put several links into a line. 969When nil, it becomes possible to put several links into a line.
949Note that in tables, a link never extends accross fields, so in a table 970Note that in tables, a link never extends accross fields, so in a table
950it is always possible to put several links into a line. 971it is always possible to put several links into a line.
951Changing this variable requires a restart of Emacs to become effective." 972Changing this variable requires a restart of Emacs of become effective."
973 :group 'org-link
974 :type 'boolean)
975
976(defcustom org-radio-targets t
977 "Non-nil means activate text matching a link target.
978Radio targets are strings in triple angular brackets, like <<<My Target>>>.
979When this option is set, any occurrence of \"my target\" in normal text
980becomes a link."
981 :group 'org-link
982 :type 'boolean)
983
984(defcustom org-activate-camels nil
985 "Non-nil means, treat words in CamelCase as in-file links.
986Changing this requires restart of Emacs to become effective."
952 :group 'org-link 987 :group 'org-link
953 :type 'boolean) 988 :type 'boolean)
954 989
955(defcustom org-context-in-file-links t 990(defcustom org-context-in-file-links t
956 "Non-nil means, file links from `org-store-link' contain context. 991 "Non-nil means, file links from `org-store-link' contain context.
957The line number will be added to the file name with :: as separator and 992A search string will be added to the file name with :: as separator and
958used to find the context when the link is activated by the command 993used to find the context when the link is activated by the command
959`org-open-at-point'. 994`org-open-at-point'.
960Using a prefix arg to the command \\[org-store-link] (`org-store-link') 995Using a prefix arg to the command \\[org-store-link] (`org-store-link')
@@ -962,6 +997,12 @@ negates this setting for the duration of the command."
962 :group 'org-link 997 :group 'org-link
963 :type 'boolean) 998 :type 'boolean)
964 999
1000(defcustom org-file-link-context-use-camel-case nil
1001 "Non-nil means, use CamelCase to store a search context in a file link.
1002When nil, the search string simply consists of the words of the string."
1003 :group 'org-link
1004 :type 'boolean)
1005
965(defcustom org-keep-stored-link-after-insertion nil 1006(defcustom org-keep-stored-link-after-insertion nil
966 "Non-nil means, keep link in list for entire session. 1007 "Non-nil means, keep link in list for entire session.
967 1008
@@ -1082,13 +1123,15 @@ For more examples, see the system specific constants
1082`org-file-apps-defaults-gnu'." 1123`org-file-apps-defaults-gnu'."
1083 :group 'org-link 1124 :group 'org-link
1084 :type '(repeat 1125 :type '(repeat
1085 (cons (string :tag "Extension") 1126 (cons (choice :value ""
1127 (string :tag "Extension")
1128 (const :tag "Default for unrecognized files" t)
1129 (const :tag "Links to a directory" directory))
1086 (choice :value "" 1130 (choice :value ""
1087 (const :tag "Visit with Emacs" 'emacs) 1131 (const :tag "Visit with Emacs" emacs)
1088 (const :tag "Use system default" 'default) 1132 (const :tag "Use system default" default)
1089 (string :tag "Command") 1133 (string :tag "Command")
1090 (sexp :tag "Lisp form"))))) 1134 (sexp :tag "Lisp form")))))
1091
1092 1135
1093(defgroup org-remember nil 1136(defgroup org-remember nil
1094 "Options concerning interaction with remember.el." 1137 "Options concerning interaction with remember.el."
@@ -1508,6 +1551,15 @@ This option can also be set with the +OPTIONS line, e.g. \"|:nil\"."
1508 :group 'org-export 1551 :group 'org-export
1509 :type 'boolean) 1552 :type 'boolean)
1510 1553
1554(defcustom org-export-table-remove-special-lines t
1555 "Remove special lines and marking characters in calculating tables.
1556This removes the special marking character column from tables that are set
1557up for spreadsheet calculations. It also removes the entire lines
1558marked with `!', `_', or `^'. The lines with `$' are kept, because
1559the values of constants may be useful to have."
1560 :group 'org-export
1561 :type 'boolean)
1562
1511(defcustom org-export-prefer-native-exporter-for-tables nil 1563(defcustom org-export-prefer-native-exporter-for-tables nil
1512 "Non-nil means, always export tables created with table.el natively. 1564 "Non-nil means, always export tables created with table.el natively.
1513Natively means, use the HTML code generator in table.el. 1565Natively means, use the HTML code generator in table.el.
@@ -1599,7 +1651,7 @@ Otherwise the buffer will just be saved to a file and stay hidden."
1599 :type 'boolean) 1651 :type 'boolean)
1600 1652
1601(defcustom org-export-html-show-new-buffer nil 1653(defcustom org-export-html-show-new-buffer nil
1602 "Non-nil means, popup buffer containing the exported html text. 1654 "Non-nil means, popup buffer containing the exported HTML text.
1603Otherwise, the buffer will just be saved to a file and stay hidden." 1655Otherwise, the buffer will just be saved to a file and stay hidden."
1604 :group 'org-export 1656 :group 'org-export
1605 :type 'boolean) 1657 :type 'boolean)
@@ -1923,6 +1975,10 @@ When this is non-nil, the headline after the keyword is set to the
1923 (defvar gnus-group-name) 1975 (defvar gnus-group-name)
1924 (defvar gnus-article-current) 1976 (defvar gnus-article-current)
1925 (defvar w3m-current-url) 1977 (defvar w3m-current-url)
1978 (defvar mh-progs)
1979 (defvar mh-current-folder)
1980 (defvar mh-show-folder-buffer)
1981 (defvar mh-index-folder)
1926 (defvar org-selected-point) 1982 (defvar org-selected-point)
1927 (defvar calendar-mode-map) 1983 (defvar calendar-mode-map)
1928 (defvar remember-save-after-remembering) 1984 (defvar remember-save-after-remembering)
@@ -1943,8 +1999,8 @@ When this is non-nil, the headline after the keyword is set to the
1943;; an update. 1999;; an update.
1944(defvar org-table-may-need-update t 2000(defvar org-table-may-need-update t
1945 "Indicates that a table might need an update. 2001 "Indicates that a table might need an update.
1946This variable is set by `org-before-change-function'. `org-table-align' 2002This variable is set by `org-before-change-function'.
1947sets it back to nil.") 2003`org-table-align'sets it back to nil.")
1948(defvar org-mode-hook nil) 2004(defvar org-mode-hook nil)
1949(defvar org-inhibit-startup nil) ; Dynamically-scoped param. 2005(defvar org-inhibit-startup nil) ; Dynamically-scoped param.
1950(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param. 2006(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param.
@@ -1981,17 +2037,11 @@ The following commands are available:
1981 'org-unfontify-region) 2037 'org-unfontify-region)
1982 ;; Activate before-change-function 2038 ;; Activate before-change-function
1983 (set (make-local-variable 'org-table-may-need-update) t) 2039 (set (make-local-variable 'org-table-may-need-update) t)
1984 (make-local-hook 'before-change-functions) ;; needed for XEmacs 2040 (org-add-hook 'before-change-functions 'org-before-change-function nil
1985 (add-hook 'before-change-functions 'org-before-change-function nil 2041 'local)
1986 'local)
1987 ;; FIXME: The following does not work because isearch-mode-end-hook
1988 ;; is called *before* the visibility overlays as removed.
1989 ;; There should be another hook then for me to be used.
1990;; (make-local-hook 'isearch-mode-end-hook) ;; needed for XEmacs
1991;; (add-hook 'isearch-mode-end-hook 'org-show-hierarchy-above nil
1992;; 'local)
1993 ;; Paragraphs and auto-filling 2042 ;; Paragraphs and auto-filling
1994 (org-set-autofill-regexps) 2043 (org-set-autofill-regexps)
2044 (org-update-radio-target-regexp)
1995 ;; Settings for Calc embedded mode 2045 ;; Settings for Calc embedded mode
1996 (set (make-local-variable 'calc-embedded-open-formula) "|\\|\n") 2046 (set (make-local-variable 'calc-embedded-open-formula) "|\\|\n")
1997 (set (make-local-variable 'calc-embedded-close-formula) "|\\|\n") 2047 (set (make-local-variable 'calc-embedded-close-formula) "|\\|\n")
@@ -2053,9 +2103,9 @@ The following commands are available:
2053(defconst org-link-regexp 2103(defconst org-link-regexp
2054 (if org-allow-space-in-links 2104 (if org-allow-space-in-links
2055 (concat 2105 (concat
2056 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^" org-non-link-chars "]+[^ " org-non-link-chars "]\\)") 2106 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|mhe\\|rmail\\|gnus\\|shell\\):\\([^" org-non-link-chars "]+[^ " org-non-link-chars "]\\)")
2057 (concat 2107 (concat
2058 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|rmail\\|gnus\\|shell\\):\\([^ " org-non-link-chars "]+\\)") 2108 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|mhe\\|rmail\\|gnus\\|shell\\):\\([^ " org-non-link-chars "]+\\)")
2059 ) 2109 )
2060 "Regular expression for matching links.") 2110 "Regular expression for matching links.")
2061(defconst org-link-maybe-angles-regexp 2111(defconst org-link-maybe-angles-regexp
@@ -2065,6 +2115,10 @@ The following commands are available:
2065 (concat "\000" org-link-regexp "\000") 2115 (concat "\000" org-link-regexp "\000")
2066 "Matches a link and optionally surrounding angle brackets.") 2116 "Matches a link and optionally surrounding angle brackets.")
2067 2117
2118(defconst org-bracket-link-regexp
2119 "\\[\\[\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]"
2120 "Matches a link in double brackets.")
2121
2068(defconst org-ts-lengths 2122(defconst org-ts-lengths
2069 (cons (length (format-time-string (car org-time-stamp-formats))) 2123 (cons (length (format-time-string (car org-time-stamp-formats)))
2070 (length (format-time-string (cdr org-time-stamp-formats)))) 2124 (length (format-time-string (cdr org-time-stamp-formats))))
@@ -2092,6 +2146,15 @@ The following commands are available:
2092 'keymap org-mouse-map)) 2146 'keymap org-mouse-map))
2093 t))) 2147 t)))
2094 2148
2149(defun org-activate-links2 (limit)
2150 "Run through the buffer and add overlays to links."
2151 (if (re-search-forward org-bracket-link-regexp limit t)
2152 (progn
2153 (add-text-properties (match-beginning 0) (match-end 0)
2154 (list 'mouse-face 'highlight
2155 'keymap org-mouse-map))
2156 t)))
2157
2095(defun org-activate-dates (limit) 2158(defun org-activate-dates (limit)
2096 "Run through the buffer and add overlays to dates." 2159 "Run through the buffer and add overlays to dates."
2097 (if (re-search-forward org-tsr-regexp limit t) 2160 (if (re-search-forward org-tsr-regexp limit t)
@@ -2101,19 +2164,75 @@ The following commands are available:
2101 'keymap org-mouse-map)) 2164 'keymap org-mouse-map))
2102 t))) 2165 t)))
2103 2166
2167(defvar org-target-link-regexp nil
2168 "Regular expression matching radio targets in plain text.")
2169(defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>"
2170 "Regular expression matching a link target.")
2171(defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>"
2172 "Regular expression matching a link target.")
2173
2174(defun org-activate-target-links (limit)
2175 "Run through the buffer and add overlays to target matches."
2176 (when org-radio-targets
2177 (let ((case-fold-search t))
2178 (if (re-search-forward org-target-link-regexp limit t)
2179 (progn
2180 (add-text-properties (match-beginning 0) (match-end 0)
2181 (list 'mouse-face 'highlight
2182 'keymap org-mouse-map
2183 'org-linked-text t))
2184 t)))))
2185
2186(defun org-update-radio-target-regexp ()
2187 "Find all radio targets in this file and update the regular expression."
2188 (interactive)
2189 (when org-radio-targets
2190 (setq org-target-link-regexp
2191 (org-make-target-link-regexp (org-all-targets 'radio)))
2192 (font-lock-mode -1)
2193 (font-lock-mode 1)))
2194
2195(defun org-all-targets (&optional radio)
2196 "Return a list of all targets in this file.
2197With optional argument RADIO, only find radio targets."
2198 (let ((re (if radio org-radio-target-regexp org-target-regexp))
2199 rtn)
2200 (save-excursion
2201 (goto-char (point-min))
2202 (while (re-search-forward re nil t)
2203 (add-to-list 'rtn (downcase (match-string-no-properties 1))))
2204 rtn)))
2205
2206(defun org-make-target-link-regexp (targets)
2207 "Make regular expression matching all strings in TARGETS.
2208The regular expression finds the targets also if there is a line break
2209between words."
2210 (concat
2211 "\\<\\("
2212 (mapconcat
2213 (lambda (x)
2214 (while (string-match " +" x)
2215 (setq x (replace-match "\\s-+" t t x)))
2216 x)
2217 targets
2218 "\\|")
2219 "\\)\\>"))
2220
2104(defvar org-camel-regexp "\\*?\\<[A-Z]+[a-z]+[A-Z][a-zA-Z]*\\>" 2221(defvar org-camel-regexp "\\*?\\<[A-Z]+[a-z]+[A-Z][a-zA-Z]*\\>"
2105 "Matches CamelCase words, possibly with a star before it.") 2222 "Matches CamelCase words, possibly with a star before it.")
2223
2106(defun org-activate-camels (limit) 2224(defun org-activate-camels (limit)
2107 "Run through the buffer and add overlays to dates." 2225 "Run through the buffer and add overlays to dates."
2108 (if (re-search-forward org-camel-regexp limit t) 2226 (if org-activate-camels
2109 (progn 2227 (if (re-search-forward org-camel-regexp limit t)
2110 (add-text-properties (match-beginning 0) (match-end 0) 2228 (progn
2111 (list 'mouse-face 'highlight 2229 (add-text-properties (match-beginning 0) (match-end 0)
2112 'keymap org-mouse-map)) 2230 (list 'mouse-face 'highlight
2113 t))) 2231 'keymap org-mouse-map))
2232 t))))
2114 2233
2115(defun org-activate-tags (limit) 2234(defun org-activate-tags (limit)
2116 (if (re-search-forward "[ \t]\\(:[A-Za-z_:]+:\\)[ \r\n]" limit t) 2235 (if (re-search-forward "[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \r\n]" limit t)
2117 (progn 2236 (progn
2118 (add-text-properties (match-beginning 1) (match-end 1) 2237 (add-text-properties (match-beginning 1) (match-end 1)
2119 (list 'mouse-face 'highlight 2238 (list 'mouse-face 'highlight
@@ -2138,6 +2257,8 @@ The following commands are available:
2138 (let ((org-font-lock-extra-keywords 2257 (let ((org-font-lock-extra-keywords
2139 (list 2258 (list
2140 '(org-activate-links (0 'org-link t)) 2259 '(org-activate-links (0 'org-link t))
2260 '(org-activate-links2 (0 'org-link t))
2261 '(org-activate-target-links (0 'org-link t))
2141 '(org-activate-dates (0 'org-link t)) 2262 '(org-activate-dates (0 'org-link t))
2142 '(org-activate-camels (0 'org-link t)) 2263 '(org-activate-camels (0 'org-link t))
2143 '(org-activate-tags (1 'org-link t)) 2264 '(org-activate-tags (1 'org-link t))
@@ -2199,7 +2320,8 @@ The following commands are available:
2199 (inhibit-read-only t) (inhibit-point-motion-hooks t) 2320 (inhibit-read-only t) (inhibit-point-motion-hooks t)
2200 (inhibit-modification-hooks t) 2321 (inhibit-modification-hooks t)
2201 deactivate-mark buffer-file-name buffer-file-truename) 2322 deactivate-mark buffer-file-name buffer-file-truename)
2202 (remove-text-properties beg end '(mouse-face nil keymap nil)))) 2323 (remove-text-properties beg end
2324 '(mouse-face nil keymap nil org-linked-text nil))))
2203 2325
2204;;; Visibility cycling 2326;;; Visibility cycling
2205 2327
@@ -2433,8 +2555,10 @@ to the new location, making it and the headline hierarchy above it visible."
2433 (org-get-location (current-buffer) org-goto-help))) 2555 (org-get-location (current-buffer) org-goto-help)))
2434 (if selected-point 2556 (if selected-point
2435 (progn 2557 (progn
2558 (org-mark-ring-push org-goto-start-pos)
2436 (goto-char selected-point) 2559 (goto-char selected-point)
2437 (if (org-invisible-p) (org-show-hierarchy-above))) 2560 (if (or (org-invisible-p) (org-invisible-p2))
2561 (org-show-hierarchy-above)))
2438 (error "Quit")))) 2562 (error "Quit"))))
2439 2563
2440(defun org-get-location (buf help) 2564(defun org-get-location (buf help)
@@ -2536,7 +2660,7 @@ or nil."
2536 2660
2537(defun org-insert-item () 2661(defun org-insert-item ()
2538 "Insert a new item at the current level. 2662 "Insert a new item at the current level.
2539Return t when tings worked, nil when we are not in an item." 2663Return t when things worked, nil when we are not in an item."
2540 (when (save-excursion 2664 (when (save-excursion
2541 (condition-case nil 2665 (condition-case nil
2542 (progn 2666 (progn
@@ -3213,7 +3337,7 @@ At all other locations, this simply calls `ispell-complete-word'."
3213 (let* ((end (point)) 3337 (let* ((end (point))
3214 (beg1 (save-excursion 3338 (beg1 (save-excursion
3215 (if (equal (char-before (point)) ?\ ) (backward-char 1)) 3339 (if (equal (char-before (point)) ?\ ) (backward-char 1))
3216 (skip-chars-backward "a-zA-Z_") 3340 (skip-chars-backward "a-zA-Z_@0-9")
3217 (point))) 3341 (point)))
3218 (beg (save-excursion 3342 (beg (save-excursion
3219 (if (equal (char-before (point)) ?\ ) (backward-char 1)) 3343 (if (equal (char-before (point)) ?\ ) (backward-char 1))
@@ -3247,7 +3371,11 @@ At all other locations, this simply calls `ispell-complete-word'."
3247 (save-excursion 3371 (save-excursion
3248 (goto-char (point-min)) 3372 (goto-char (point-min))
3249 (while (re-search-forward org-todo-line-regexp nil t) 3373 (while (re-search-forward org-todo-line-regexp nil t)
3250 (push (list (org-make-org-heading-camel (match-string 3))) 3374 (push (list
3375 (if org-file-link-context-use-camel-case
3376 (org-make-org-heading-camel (match-string 3) t)
3377 (org-make-org-heading-search-string
3378 (match-string 3) t)))
3251 tbl))) 3379 tbl)))
3252 tbl) 3380 tbl)
3253 (tag (setq type :tag beg beg1) 3381 (tag (setq type :tag beg beg1)
@@ -3475,9 +3603,8 @@ that the match should indeed be shown."
3475 (setq cnt (1+ cnt)) 3603 (setq cnt (1+ cnt))
3476 (org-highlight-new-match (match-beginning 0) (match-end 0)) 3604 (org-highlight-new-match (match-beginning 0) (match-end 0))
3477 (org-show-hierarchy-above)))) 3605 (org-show-hierarchy-above))))
3478 (make-local-hook 'before-change-functions) ; needed for XEmacs 3606 (org-add-hook 'before-change-functions 'org-remove-occur-highlights
3479 (add-hook 'before-change-functions 'org-remove-occur-highlights 3607 nil 'local)
3480 nil 'local)
3481 (run-hooks 'org-occur-hook) 3608 (run-hooks 'org-occur-hook)
3482 (if (interactive-p) 3609 (if (interactive-p)
3483 (message "%d match(es) for regexp %s" cnt regexp)) 3610 (message "%d match(es) for regexp %s" cnt regexp))
@@ -3488,7 +3615,8 @@ that the match should indeed be shown."
3488 (catch 'exit 3615 (catch 'exit
3489 (if (org-on-heading-p t) 3616 (if (org-on-heading-p t)
3490 (org-flag-heading nil) ; only show the heading 3617 (org-flag-heading nil) ; only show the heading
3491 (and (org-invisible-p) (org-show-hidden-entry))) ; show entire entry 3618 (and (or (org-invisible-p) (org-invisible-p2))
3619 (org-show-hidden-entry))) ; show entire entry
3492 (save-excursion 3620 (save-excursion
3493 (and org-show-following-heading 3621 (and org-show-following-heading
3494 (outline-next-heading) 3622 (outline-next-heading)
@@ -3765,7 +3893,8 @@ used to insert the time stamp into the buffer to include the time."
3765 (progn 3893 (progn
3766 (use-local-map map) 3894 (use-local-map map)
3767 (setq ans (read-string prompt "" nil nil)) 3895 (setq ans (read-string prompt "" nil nil))
3768 (setq ans (or ans1 ans2 ans))) 3896 (if (not (string-match "\\S-" ans)) (setq ans nil))
3897 (setq ans (or ans1 ans ans2)))
3769 (use-local-map old-map))))) 3898 (use-local-map old-map)))))
3770 ;; Naked prompt only 3899 ;; Naked prompt only
3771 (setq ans (read-string prompt "" nil timestr))) 3900 (setq ans (read-string prompt "" nil timestr)))
@@ -4133,10 +4262,8 @@ The following commands are available:
4133 (use-local-map org-agenda-mode-map) 4262 (use-local-map org-agenda-mode-map)
4134 (easy-menu-add org-agenda-menu) 4263 (easy-menu-add org-agenda-menu)
4135 (if org-startup-truncated (setq truncate-lines t)) 4264 (if org-startup-truncated (setq truncate-lines t))
4136 (make-local-hook 'post-command-hook) ; Needed for XEmacs 4265 (org-add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
4137 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) 4266 (org-add-hook 'pre-command-hook 'org-unhighlight nil 'local)
4138 (make-local-hook 'pre-command-hook) ; Needed for XEmacs
4139 (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
4140 (unless org-agenda-keep-modes 4267 (unless org-agenda-keep-modes
4141 (setq org-agenda-follow-mode nil 4268 (setq org-agenda-follow-mode nil
4142 org-agenda-show-log nil)) 4269 org-agenda-show-log nil))
@@ -5285,27 +5412,6 @@ the documentation of `org-diary'."
5285 (throw 'exit t))) 5412 (throw 'exit t)))
5286 nil))) 5413 nil)))
5287 5414
5288(defun org-get-tags-at (&optional pos)
5289 "Get a list of all headline targs applicable at POS.
5290POS defaults to point. If tags are inherited, the list contains
5291the targets in the same sequence as the headlines appear, i.e.
5292the tags of the current headline come last."
5293 (interactive)
5294 (let (tags)
5295 (save-excursion
5296 (goto-char (or pos (point)))
5297 (save-match-data
5298 (org-back-to-heading t)
5299 (condition-case nil
5300 (while t
5301 (if (looking-at "[^\r\n]+?:\\([a-zA-Z_:]+\\):[ \t]*\\([\n\r]\\|\\'\\)")
5302 (setq tags (append (org-split-string (match-string 1) ":") tags)))
5303 (or org-use-tag-inheritance (error ""))
5304 (org-up-heading-all 1))
5305 (error nil))))
5306 (message "%s" tags)
5307 tags))
5308
5309(defun org-agenda-get-todos () 5415(defun org-agenda-get-todos ()
5310 "Return the TODO information for agenda display." 5416 "Return the TODO information for agenda display."
5311 (let* ((props (list 'face nil 5417 (let* ((props (list 'face nil
@@ -5726,7 +5832,7 @@ only the correctly processes TXT should be returned - this is used by
5726 (when (and (or (eq org-agenda-remove-tags-when-in-prefix t) 5832 (when (and (or (eq org-agenda-remove-tags-when-in-prefix t)
5727 (and org-agenda-remove-tags-when-in-prefix 5833 (and org-agenda-remove-tags-when-in-prefix
5728 org-prefix-has-tag)) 5834 org-prefix-has-tag))
5729 (string-match ":[a-zA-Z_:]+:[ \t]*$" txt)) 5835 (string-match ":[a-zA-Z_@0-9:]+:[ \t]*$" txt))
5730 (setq txt (replace-match "" t t txt))) 5836 (setq txt (replace-match "" t t txt)))
5731 5837
5732 ;; Create the final string 5838 ;; Create the final string
@@ -6076,6 +6182,27 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6076 (org-agenda-change-all-lines newhead hdmarker) 6182 (org-agenda-change-all-lines newhead hdmarker)
6077 (beginning-of-line 1))) 6183 (beginning-of-line 1)))
6078 6184
6185(defun org-get-tags-at (&optional pos)
6186 "Get a list of all headline targs applicable at POS.
6187POS defaults to point. If tags are inherited, the list contains
6188the targets in the same sequence as the headlines appear, i.e.
6189the tags of the current headline come last."
6190 (interactive)
6191 (let (tags)
6192 (save-excursion
6193 (goto-char (or pos (point)))
6194 (save-match-data
6195 (org-back-to-heading t)
6196 (condition-case nil
6197 (while t
6198 (if (looking-at "[^\r\n]+?:\\([a-zA-Z_@0-9:]+\\):[ \t]*\\([\n\r]\\|\\'\\)")
6199 (setq tags (append (org-split-string (match-string 1) ":") tags)))
6200 (or org-use-tag-inheritance (error ""))
6201 (org-up-heading-all 1))
6202 (error nil))))
6203 (message "%s" tags)
6204 tags))
6205
6079(defun org-agenda-set-tags () 6206(defun org-agenda-set-tags ()
6080 "Set tags for the current headline." 6207 "Set tags for the current headline."
6081 (interactive) 6208 (interactive)
@@ -6298,7 +6425,7 @@ are included in the output."
6298 (mapconcat 'regexp-quote 6425 (mapconcat 'regexp-quote
6299 (nreverse (cdr (reverse org-todo-keywords))) 6426 (nreverse (cdr (reverse org-todo-keywords)))
6300 "\\|") 6427 "\\|")
6301 "\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_:]+:\\)?[ \t]*[\n\r]")) 6428 "\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_@0-9:]+:\\)?[ \t]*[\n\r]"))
6302 (props (list 'face nil 6429 (props (list 'face nil
6303 'done-face 'org-done 6430 'done-face 'org-done
6304 'undone-face nil 6431 'undone-face nil
@@ -6386,7 +6513,7 @@ MATCH can contain positive and negative selection of tags, like
6386 (let ((match0 match) minus tag mm matcher orterms term orlist) 6513 (let ((match0 match) minus tag mm matcher orterms term orlist)
6387 (setq orterms (org-split-string match "|")) 6514 (setq orterms (org-split-string match "|"))
6388 (while (setq term (pop orterms)) 6515 (while (setq term (pop orterms))
6389 (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_]+\\)" term) 6516 (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term)
6390 (setq minus (and (match-end 1) 6517 (setq minus (and (match-end 1)
6391 (equal (match-string 1 term) "-")) 6518 (equal (match-string 1 term) "-"))
6392 tag (match-string 2 term) 6519 tag (match-string 2 term)
@@ -6481,7 +6608,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6481 (re (concat "^" outline-regexp)) 6608 (re (concat "^" outline-regexp))
6482 (col (current-column)) 6609 (col (current-column))
6483 (current (org-get-tags)) 6610 (current (org-get-tags))
6484 tags hd empty) 6611 tags hd empty invis)
6485 (if arg 6612 (if arg
6486 (save-excursion 6613 (save-excursion
6487 (goto-char (point-min)) 6614 (goto-char (point-min))
@@ -6505,19 +6632,23 @@ With prefix ARG, realign all tags in headings in the current buffer."
6505 (if (equal current "") 6632 (if (equal current "")
6506 (progn 6633 (progn
6507 (end-of-line 1) 6634 (end-of-line 1)
6508 (or empty (insert " "))) 6635 (or empty (insert-before-markers " ")))
6509 (beginning-of-line 1) 6636 (beginning-of-line 1)
6637 (setq invis (org-invisible-p))
6510 (looking-at (concat "\\(.*\\)\\(" (regexp-quote current) "\\)[ \t]*")) 6638 (looking-at (concat "\\(.*\\)\\(" (regexp-quote current) "\\)[ \t]*"))
6511 (setq hd (match-string 1)) 6639 (setq hd (match-string 1))
6512 (delete-region (match-beginning 0) (match-end 0)) 6640 (delete-region (match-beginning 0) (match-end 0))
6513 (insert (org-trim hd) (if empty "" " "))) 6641 (insert-before-markers (org-trim hd) (if empty "" " ")))
6642 ;; FIXME: What happens when adding a new tag??? Seems OK!!!
6514 (unless (equal tags "") 6643 (unless (equal tags "")
6515 (move-to-column (max (current-column) 6644 (move-to-column (max (current-column)
6516 (if (> org-tags-column 0) 6645 (if (> org-tags-column 0)
6517 org-tags-column 6646 org-tags-column
6518 (- (- org-tags-column) (length tags)))) 6647 (- (- org-tags-column) (length tags))))
6519 t) 6648 t)
6520 (insert tags)) 6649 (insert-before-markers tags)
6650 (if (and (not invis) (org-invisible-p))
6651 (outline-flag-region (point-at-bol) (point) nil)))
6521 (move-to-column col)))) 6652 (move-to-column col))))
6522 6653
6523(defun org-tags-completion-function (string predicate &optional flag) 6654(defun org-tags-completion-function (string predicate &optional flag)
@@ -6551,7 +6682,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6551 (error "Not on a heading")) 6682 (error "Not on a heading"))
6552 (save-excursion 6683 (save-excursion
6553 (beginning-of-line 1) 6684 (beginning-of-line 1)
6554 (if (looking-at ".*[ \t]\\(:[A-Za-z_:]+:\\)[ \t]*\\(\r\\|$\\)") 6685 (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)")
6555 (match-string 1) 6686 (match-string 1)
6556 ""))) 6687 "")))
6557 6688
@@ -6560,7 +6691,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6560 (let (tags) 6691 (let (tags)
6561 (save-excursion 6692 (save-excursion
6562 (goto-char (point-min)) 6693 (goto-char (point-min))
6563 (while (re-search-forward "[ \t]:\\([A-Za-z_:]+\\):[ \t\r\n]" nil t) 6694 (while (re-search-forward "[ \t]:\\([A-Za-z_@0-9:]+\\):[ \t\r\n]" nil t)
6564 (mapc (lambda (x) (add-to-list 'tags x)) 6695 (mapc (lambda (x) (add-to-list 'tags x))
6565 (org-split-string (match-string 1) ":")))) 6696 (org-split-string (match-string 1) ":"))))
6566 (mapcar 'list tags))) 6697 (mapcar 'list tags)))
@@ -6591,9 +6722,34 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6591 (org-agenda-list nil (time-to-days (org-time-string-to-time 6722 (org-agenda-list nil (time-to-days (org-time-string-to-time
6592 (substring (match-string 1) 0 10))) 6723 (substring (match-string 1) 0 10)))
6593 1) 6724 1)
6594 (let (type path line search (pos (point))) 6725 (let (type path link line search (pos (point)))
6595 (catch 'match 6726 (catch 'match
6596 (save-excursion 6727 (save-excursion
6728 (skip-chars-forward "^]\n\r")
6729 (when (and (re-search-backward "\\[\\[" nil t)
6730 (looking-at org-bracket-link-regexp)
6731 (<= (match-beginning 0) pos)
6732 (>= (match-end 0) pos))
6733 (setq link (match-string 1))
6734 (while (string-match " *\n *" link)
6735 (setq link (replace-match " " t t link)))
6736 (if (string-match org-link-regexp link)
6737 (setq type (match-string 1)
6738 path (match-string 2))
6739 (setq type "thisfile"
6740 path link))
6741 (throw 'match t)))
6742
6743 (when (get-text-property (point) 'org-linked-text)
6744 (setq type "thisfile"
6745 pos (if (get-text-property (1+ (point)) 'org-linked-text)
6746 (1+ (point)) (point))
6747 path (buffer-substring
6748 (previous-single-property-change pos 'org-linked-text)
6749 (next-single-property-change pos 'org-linked-text)))
6750 (throw 'match t))
6751
6752 (save-excursion
6597 (skip-chars-backward 6753 (skip-chars-backward
6598 (concat (if org-allow-space-in-links "^" "^ ") 6754 (concat (if org-allow-space-in-links "^" "^ ")
6599 org-non-link-chars)) 6755 org-non-link-chars))
@@ -6606,7 +6762,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6606 (throw 'match t))) 6762 (throw 'match t)))
6607 (save-excursion 6763 (save-excursion
6608 (skip-chars-backward "^ \t\n\r") 6764 (skip-chars-backward "^ \t\n\r")
6609 (when (looking-at "\\(:[A-Za-z_:]+\\):[ \t\r\n]") 6765 (when (looking-at "\\(:[A-Za-z_@0-9:]+\\):[ \t\r\n]")
6610 (setq type "tags" 6766 (setq type "tags"
6611 path (match-string 1)) 6767 path (match-string 1))
6612 (while (string-match ":" path) 6768 (while (string-match ":" path)
@@ -6614,7 +6770,8 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6614 (throw 'match t))) 6770 (throw 'match t)))
6615 (save-excursion 6771 (save-excursion
6616 (skip-chars-backward "a-zA-Z_") 6772 (skip-chars-backward "a-zA-Z_")
6617 (when (looking-at org-camel-regexp) 6773 (when (and org-activate-camels
6774 (looking-at org-camel-regexp))
6618 (setq type "camel" path (match-string 0)) 6775 (setq type "camel" path (match-string 0))
6619 (if (equal (char-before) ?*) 6776 (if (equal (char-before) ?*)
6620 (setq path (concat "*" path)))) 6777 (setq path (concat "*" path))))
@@ -6639,7 +6796,9 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6639 6796
6640 ((string= type "tags") 6797 ((string= type "tags")
6641 (org-tags-view in-emacs path)) 6798 (org-tags-view in-emacs path))
6642 ((string= type "camel") 6799 ((or (string= type "camel")
6800 (string= type "thisfile"))
6801 (org-mark-ring-push)
6643 (org-link-search 6802 (org-link-search
6644 path 6803 path
6645 (cond ((equal in-emacs '(4)) 'occur) 6804 (cond ((equal in-emacs '(4)) 'occur)
@@ -6686,6 +6845,14 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6686 article (match-string 3 path)) 6845 article (match-string 3 path))
6687 (org-follow-wl-link folder article))) 6846 (org-follow-wl-link folder article)))
6688 6847
6848 ((string= type "mhe")
6849 (let (folder article)
6850 (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
6851 (error "Error in MHE link"))
6852 (setq folder (match-string 1 path)
6853 article (match-string 3 path))
6854 (org-follow-mhe-link folder article)))
6855
6689 ((string= type "rmail") 6856 ((string= type "rmail")
6690 (let (folder article) 6857 (let (folder article)
6691 (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path)) 6858 (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
@@ -6717,11 +6884,19 @@ sparse tree. In ordinary files, `occur' will be used to list matches.
6717If the current buffer is in `dired-mode', grep will be used to search 6884If the current buffer is in `dired-mode', grep will be used to search
6718in all files." 6885in all files."
6719 (let ((case-fold-search t) 6886 (let ((case-fold-search t)
6720 (s0 s) 6887 (s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
6721 (pos (point)) 6888 (pos (point))
6722 (pre "") (post "") 6889 (pre "") (post "")
6723 words re0 re1 re2 re3 re4 re5 reall) 6890 words re0 re1 re2 re3 re4 re5 reall camel)
6724 (cond ((string-match "^/\\(.*\\)/$" s) 6891 (cond ((save-excursion
6892 (goto-char (point-min))
6893 (and
6894 (re-search-forward
6895 (concat "<<" (regexp-quote s0) ">>") nil t)
6896 (setq pos (match-beginning 0))))
6897 ;; There is an exact target for this
6898 (goto-char pos))
6899 ((string-match "^/\\(.*\\)/$" s)
6725 ;; A regular expression 6900 ;; A regular expression
6726 (cond 6901 (cond
6727 ((eq major-mode 'org-mode) 6902 ((eq major-mode 'org-mode)
@@ -6729,17 +6904,22 @@ in all files."
6729 ;;((eq major-mode 'dired-mode) 6904 ;;((eq major-mode 'dired-mode)
6730 ;; (grep (concat "grep -n -e '" (match-string 1 s) "' *"))) 6905 ;; (grep (concat "grep -n -e '" (match-string 1 s) "' *")))
6731 (t (org-do-occur (match-string 1 s))))) 6906 (t (org-do-occur (match-string 1 s)))))
6732 ((string-match (concat "^" org-camel-regexp) s) 6907 ((or (setq camel (string-match (concat "^" org-camel-regexp "$") s))
6733 ;; A camel 6908 t)
6734 (if (equal (string-to-char s) ?*) 6909 ;; A camel or a normal search string
6735 (setq pre "^\\*+[ \t]*\\(\\sw+\\)?[ \t]*" 6910 (when (equal (string-to-char s) ?*)
6736 post "[ \t]*$" 6911 ;; Anchor on headlines, post may include tags.
6737 s (substring s 1))) 6912 (setq pre "^\\*+[ \t]*\\(\\sw+\\)?[ \t]*"
6913 post "[ \t]*\\([ \t]+:[a-zA-Z_@0-9:+]:[ \t]*\\)?$"
6914 s (substring s 1)))
6738 (remove-text-properties 6915 (remove-text-properties
6739 0 (length s) 6916 0 (length s)
6740 '(face nil mouse-face nil keymap nil fontified nil) s) 6917 '(face nil mouse-face nil keymap nil fontified nil) s)
6741 ;; Make a series of regular expressions to find a match 6918 ;; Make a series of regular expressions to find a match
6742 (setq words (org-camel-to-words s) 6919 (setq words
6920 (if camel
6921 (org-camel-to-words s)
6922 (org-split-string s "[ \n\r\t]+"))
6743 re0 (concat "<<" (regexp-quote s0) ">>") 6923 re0 (concat "<<" (regexp-quote s0) ">>")
6744 re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>") 6924 re2 (concat "\\<" (mapconcat 'downcase words "[ \t]+") "\\>")
6745 re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>") 6925 re4 (concat "\\<" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\>")
@@ -6770,7 +6950,8 @@ in all files."
6770 (goto-char (point-min)) 6950 (goto-char (point-min))
6771 (if (search-forward s nil t) 6951 (if (search-forward s nil t)
6772 (goto-char (match-beginning 0)) 6952 (goto-char (match-beginning 0))
6773 (error "No match")))))) 6953 (error "No match"))))
6954 (and (eq major-mode 'org-mode) (org-show-hierarchy-above))))
6774 6955
6775(defun org-do-occur (regexp &optional cleanup) 6956(defun org-do-occur (regexp &optional cleanup)
6776 "Call the Emacs command `occur'. 6957 "Call the Emacs command `occur'.
@@ -6791,6 +6972,47 @@ to read."
6791 (goto-char (point-min)) 6972 (goto-char (point-min))
6792 (select-window cwin)))) 6973 (select-window cwin))))
6793 6974
6975(defvar org-mark-ring nil
6976 "Mark ring for positions before jumps in Org-mode.")
6977(defvar org-mark-ring-last-goto nil
6978 "Last position in the mark ring used to go back.")
6979;; Fill and close the ring
6980(setq org-mark-ring nil org-mark-ring-last-goto nil) ;; in case file is reloaded
6981(loop for i from 1 to org-mark-ring-length do
6982 (push (make-marker) org-mark-ring))
6983(setcdr (nthcdr (1- org-mark-ring-length) org-mark-ring)
6984 org-mark-ring)
6985
6986(defun org-mark-ring-push (&optional pos buffer)
6987 "Put the current position or POS into the mark ring and rotate it."
6988 (interactive)
6989 (setq pos (or pos (point)))
6990 (setq org-mark-ring (nthcdr (1- org-mark-ring-length) org-mark-ring))
6991 (move-marker (car org-mark-ring)
6992 (or pos (point))
6993 (or buffer (current-buffer)))
6994 (message
6995 (substitute-command-keys
6996 "Position saved to mark ring, go back with \\[org-mark-ring-goto].")))
6997
6998(defun org-mark-ring-goto (&optional n)
6999 "Jump to the previous position in the mark ring.
7000With prefix arg N, jump back that many stored positions. When
7001called several times in succession, walk through the entire ring.
7002Org-mode commands jumping to a different position in the current file,
7003or to another Org-mode file, automatically push the old position
7004onto the ring."
7005 (interactive "p")
7006 (let (p m)
7007 (if (eq last-command this-command)
7008 (setq p (nthcdr n (or org-mark-ring-last-goto org-mark-ring)))
7009 (setq p org-mark-ring))
7010 (setq org-mark-ring-last-goto p)
7011 (setq m (car p))
7012 (switch-to-buffer (marker-buffer m))
7013 (goto-char m)
7014 (if (or (org-invisible-p) (org-invisible-p2)) (org-show-hierarchy-above))))
7015
6794(defun org-camel-to-words (s) 7016(defun org-camel-to-words (s)
6795 "Split \"CamelCaseWords\" to (\"Camel\" \"Case\" \"Words\")." 7017 "Split \"CamelCaseWords\" to (\"Camel\" \"Case\" \"Words\")."
6796 (let ((case-fold-search nil) 7018 (let ((case-fold-search nil)
@@ -6800,10 +7022,20 @@ to read."
6800 (setq s (substring s (1+ (match-beginning 0))))) 7022 (setq s (substring s (1+ (match-beginning 0)))))
6801 (nreverse (cons s words)))) 7023 (nreverse (cons s words))))
6802 7024
7025(defun org-remove-angle-brackets (s)
7026 (if (equal (substring s 0 1) "<") (setq s (substring s 1)))
7027 (if (equal (substring s -1) ">") (setq s (substring s 0 -1)))
7028 s)
7029(defun org-add-angle-brackets (s)
7030 (if (equal (substring s 0 1) "<") nil (setq s (concat "<" s)))
7031 (if (equal (substring s -1) ">") nil (setq s (concat s ">")))
7032 s)
7033
6803(defun org-follow-bbdb-link (name) 7034(defun org-follow-bbdb-link (name)
6804 "Follow a BBDB link to NAME." 7035 "Follow a BBDB link to NAME."
6805 (require 'bbdb) 7036 (require 'bbdb)
6806 (let ((inhibit-redisplay t)) 7037 (let ((inhibit-redisplay t)
7038 (bbdb-electric-p nil))
6807 (catch 'exit 7039 (catch 'exit
6808 ;; Exact match on name 7040 ;; Exact match on name
6809 (bbdb-name (concat "\\`" name "\\'") nil) 7041 (bbdb-name (concat "\\`" name "\\'") nil)
@@ -6839,6 +7071,7 @@ to read."
6839(defun org-follow-vm-link (&optional folder article readonly) 7071(defun org-follow-vm-link (&optional folder article readonly)
6840 "Follow a VM link to FOLDER and ARTICLE." 7072 "Follow a VM link to FOLDER and ARTICLE."
6841 (require 'vm) 7073 (require 'vm)
7074 (setq article (org-add-angle-brackets article))
6842 (if (string-match "^//\\([a-zA-Z]+@\\)?\\([^:]+\\):\\(.*\\)" folder) 7075 (if (string-match "^//\\([a-zA-Z]+@\\)?\\([^:]+\\):\\(.*\\)" folder)
6843 ;; ange-ftp or efs or tramp access 7076 ;; ange-ftp or efs or tramp access
6844 (let ((user (or (match-string 1 folder) (user-login-name))) 7077 (let ((user (or (match-string 1 folder) (user-login-name)))
@@ -6872,12 +7105,14 @@ to read."
6872 7105
6873(defun org-follow-wl-link (folder article) 7106(defun org-follow-wl-link (folder article)
6874 "Follow a Wanderlust link to FOLDER and ARTICLE." 7107 "Follow a Wanderlust link to FOLDER and ARTICLE."
7108 (setq article (org-add-angle-brackets article))
6875 (wl-summary-goto-folder-subr folder 'no-sync t nil t) 7109 (wl-summary-goto-folder-subr folder 'no-sync t nil t)
6876 (if article (wl-summary-jump-to-msg-by-message-id article)) 7110 (if article (wl-summary-jump-to-msg-by-message-id article ">"))
6877 (wl-summary-redisplay)) 7111 (wl-summary-redisplay))
6878 7112
6879(defun org-follow-rmail-link (folder article) 7113(defun org-follow-rmail-link (folder article)
6880 "Follow an RMAIL link to FOLDER and ARTICLE." 7114 "Follow an RMAIL link to FOLDER and ARTICLE."
7115 (setq article (org-add-angle-brackets article))
6881 (let (message-number) 7116 (let (message-number)
6882 (save-excursion 7117 (save-excursion
6883 (save-window-excursion 7118 (save-window-excursion
@@ -6898,6 +7133,106 @@ to read."
6898 message-number) 7133 message-number)
6899 (error "Message not found")))) 7134 (error "Message not found"))))
6900 7135
7136;; mh-e integration based on planner-mode
7137(defun org-mhe-get-message-real-folder ()
7138 "Return the name of the current message real folder, so if you use
7139sequences, it will now work."
7140 (save-excursion
7141 (let* ((folder
7142 (if (equal major-mode 'mh-folder-mode)
7143 mh-current-folder
7144 ;; Refer to the show buffer
7145 mh-show-folder-buffer))
7146 (end-index
7147 (if (boundp 'mh-index-folder)
7148 (min (length mh-index-folder) (length folder))))
7149 )
7150 ;; a simple test on mh-index-data does not work, because
7151 ;; mh-index-data is always nil in a show buffer.
7152 (if (and (boundp 'mh-index-folder)
7153 (string= mh-index-folder (substring folder 0 end-index)))
7154 (if (equal major-mode 'mh-show-mode)
7155 (save-window-excursion
7156 (when (buffer-live-p (get-buffer folder))
7157 (progn
7158 (pop-to-buffer folder)
7159 (org-mhe-get-message-folder-from-index)
7160 )
7161 ))
7162 (org-mhe-get-message-folder-from-index)
7163 )
7164 folder
7165 )
7166 )))
7167
7168(defun org-mhe-get-message-folder-from-index ()
7169 "Returns the name of the message folder in a index folder buffer."
7170 (save-excursion
7171 (mh-index-previous-folder)
7172 (if (not (re-search-forward "^\\(+.*\\)$" nil t))
7173 (message "Problem getting folder from index.")
7174 (message (match-string 1)))))
7175
7176(defun org-mhe-get-message-folder ()
7177 "Return the name of the current message folder. Be careful if you
7178use sequences."
7179 (save-excursion
7180 (if (equal major-mode 'mh-folder-mode)
7181 mh-current-folder
7182 ;; Refer to the show buffer
7183 mh-show-folder-buffer)))
7184
7185(defun org-mhe-get-message-num ()
7186 "Return the number of the current message. Be careful if you
7187use sequences."
7188 (save-excursion
7189 (if (equal major-mode 'mh-folder-mode)
7190 (mh-get-msg-num nil)
7191 ;; Refer to the show buffer
7192 (mh-show-buffer-message-number))))
7193
7194(defun org-mhe-get-header (header)
7195 "Return a header of the message in folder mode. This will create a
7196show buffer for the corresponding message. If you have a more clever
7197idea..."
7198 (let* ((folder (org-mhe-get-message-folder))
7199 (num (org-mhe-get-message-num))
7200 (buffer (get-buffer-create (concat "show-" folder)))
7201 (header-field))
7202 (with-current-buffer buffer
7203 (mh-display-msg num folder)
7204 (if (equal major-mode 'mh-folder-mode)
7205 (mh-header-display)
7206 (mh-show-header-display))
7207 (set-buffer buffer)
7208 (setq header-field (mh-get-header-field header))
7209 (if (equal major-mode 'mh-folder-mode)
7210 (mh-show)
7211 (mh-show-show))
7212 header-field)))
7213
7214(defun org-follow-mhe-link (folder article)
7215 "Follow an MHE link to FOLDER and ARTICLE."
7216 (setq article (org-add-angle-brackets article))
7217 (require 'mh-e)
7218 (mh-find-path)
7219 (let* ((show-buf (concat "show-" folder)))
7220 (mh-visit-folder folder)
7221 (get-buffer-create show-buf)
7222 (mh-show-msg
7223 (string-to-number
7224 (car (split-string
7225 (with-temp-buffer
7226 (call-process
7227 (expand-file-name "pick" mh-progs)
7228 nil t nil
7229 folder
7230 "--message-id"
7231 article)
7232 (buffer-string))
7233 "\n"))))
7234 (pop-to-buffer show-buf)))
7235
6901(defun org-open-file (path &optional in-emacs line search) 7236(defun org-open-file (path &optional in-emacs line search)
6902 "Open the file at PATH. 7237 "Open the file at PATH.
6903First, this expands any special file name abbreviations. Then the 7238First, this expands any special file name abbreviations. Then the
@@ -6913,7 +7248,11 @@ If the file does not exist, an error is thrown."
6913 (let* ((file (if (equal path "") 7248 (let* ((file (if (equal path "")
6914 (buffer-file-name) 7249 (buffer-file-name)
6915 (convert-standard-filename (org-expand-file-name path)))) 7250 (convert-standard-filename (org-expand-file-name path))))
7251 (dirp (file-directory-p file))
6916 (dfile (downcase file)) 7252 (dfile (downcase file))
7253 (old-buffer (current-buffer))
7254 (old-pos (point))
7255 (old-mode major-mode)
6917 ext cmd apps) 7256 ext cmd apps)
6918 (if (and (not (file-exists-p file)) 7257 (if (and (not (file-exists-p file))
6919 (not org-open-non-existing-files)) 7258 (not org-open-non-existing-files))
@@ -6925,7 +7264,8 @@ If the file does not exist, an error is thrown."
6925 (setq apps (append org-file-apps (org-default-apps))) 7264 (setq apps (append org-file-apps (org-default-apps)))
6926 (if in-emacs 7265 (if in-emacs
6927 (setq cmd 'emacs) 7266 (setq cmd 'emacs)
6928 (setq cmd (or (cdr (assoc ext apps)) 7267 (setq cmd (or (and dirp (cdr (assoc 'directory apps)))
7268 (cdr (assoc ext apps))
6929 (cdr (assoc t apps))))) 7269 (cdr (assoc t apps)))))
6930 (when (eq cmd 'mailcap) 7270 (when (eq cmd 'mailcap)
6931 (require 'mailcap) 7271 (require 'mailcap)
@@ -6948,7 +7288,11 @@ If the file does not exist, an error is thrown."
6948 (if search (org-link-search search)))) 7288 (if search (org-link-search search))))
6949 ((consp cmd) 7289 ((consp cmd)
6950 (eval cmd)) 7290 (eval cmd))
6951 (t (funcall (cdr (assq 'file org-link-frame-setup)) file))))) 7291 (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
7292 (and (eq major-mode 'org-mode) (eq old-mode 'org-mode)
7293 (or (not (equal old-buffer (current-buffer)))
7294 (not (equal old-pos (point))))
7295 (org-mark-ring-push old-pos old-buffer))))
6952 7296
6953(defun org-default-apps () 7297(defun org-default-apps ()
6954 "Return the default applications for this operating system." 7298 "Return the default applications for this operating system."
@@ -6979,7 +7323,7 @@ For some link types, a prefix arg is interpreted:
6979For links to usenet articles, arg negates `org-usenet-links-prefer-google'. 7323For links to usenet articles, arg negates `org-usenet-links-prefer-google'.
6980For file links, arg negates `org-context-in-file-links'." 7324For file links, arg negates `org-context-in-file-links'."
6981 (interactive "P") 7325 (interactive "P")
6982 (let (link cpltxt) 7326 (let (link cpltxt txt (pos (point)))
6983 (cond 7327 (cond
6984 7328
6985 ((eq major-mode 'bbdb-mode) 7329 ((eq major-mode 'bbdb-mode)
@@ -7009,6 +7353,7 @@ For file links, arg negates `org-context-in-file-links'."
7009 (subject (vm-su-subject message)) 7353 (subject (vm-su-subject message))
7010 (author (vm-su-full-name message)) 7354 (author (vm-su-full-name message))
7011 (message-id (vm-su-message-id message))) 7355 (message-id (vm-su-message-id message)))
7356 (setq message-id (org-remove-angle-brackets message-id))
7012 (setq folder (abbreviate-file-name folder)) 7357 (setq folder (abbreviate-file-name folder))
7013 (if (string-match (concat "^" (regexp-quote vm-folder-directory)) 7358 (if (string-match (concat "^" (regexp-quote vm-folder-directory))
7014 folder) 7359 folder)
@@ -7026,12 +7371,25 @@ For file links, arg negates `org-context-in-file-links'."
7026 msgnum (wl-summary-buffer-msgdb))) 7371 msgnum (wl-summary-buffer-msgdb)))
7027 (author (wl-summary-line-from)) ; FIXME: how to get author name? 7372 (author (wl-summary-line-from)) ; FIXME: how to get author name?
7028 (subject "???")) ; FIXME: How to get subject of email? 7373 (subject "???")) ; FIXME: How to get subject of email?
7374 (setq message-id (org-remove-angle-brackets message-id))
7029 (setq cpltxt (concat author " on: " subject)) 7375 (setq cpltxt (concat author " on: " subject))
7030 (setq link (concat cpltxt "\n " 7376 (setq link (concat cpltxt "\n "
7031 (org-make-link 7377 (org-make-link
7032 "wl:" wl-summary-buffer-folder-name 7378 "wl:" wl-summary-buffer-folder-name
7033 "#" message-id))))) 7379 "#" message-id)))))
7034 7380
7381 ((or (equal major-mode 'mh-folder-mode)
7382 (equal major-mode 'mh-show-mode))
7383 (let ((from-header (org-mhe-get-header "From:"))
7384 (to-header (org-mhe-get-header "To:"))
7385 (subject (org-mhe-get-header "Subject:")))
7386 (setq cpltxt (concat from-header " on: " subject))
7387 (setq link (concat cpltxt "\n "
7388 (org-make-link
7389 "mhe:" (org-mhe-get-message-real-folder) "#"
7390 (org-remove-angle-brackets
7391 (org-mhe-get-header "Message-Id:")))))))
7392
7035 ((eq major-mode 'rmail-mode) 7393 ((eq major-mode 'rmail-mode)
7036 (save-excursion 7394 (save-excursion
7037 (save-restriction 7395 (save-restriction
@@ -7040,6 +7398,7 @@ For file links, arg negates `org-context-in-file-links'."
7040 (message-id (mail-fetch-field "message-id")) 7398 (message-id (mail-fetch-field "message-id"))
7041 (author (mail-fetch-field "from")) 7399 (author (mail-fetch-field "from"))
7042 (subject (mail-fetch-field "subject"))) 7400 (subject (mail-fetch-field "subject")))
7401 (setq message-id (org-remove-angle-brackets message-id))
7043 (setq cpltxt (concat author " on: " subject)) 7402 (setq cpltxt (concat author " on: " subject))
7044 (setq link (concat cpltxt "\n " 7403 (setq link (concat cpltxt "\n "
7045 (org-make-link 7404 (org-make-link
@@ -7093,19 +7452,26 @@ For file links, arg negates `org-context-in-file-links'."
7093 (abbreviate-file-name (buffer-file-name)))) 7452 (abbreviate-file-name (buffer-file-name))))
7094 ;; Add a context search string 7453 ;; Add a context search string
7095 (when (org-xor org-context-in-file-links arg) 7454 (when (org-xor org-context-in-file-links arg)
7455 ;; Check if we are on a target
7096 (if (save-excursion 7456 (if (save-excursion
7097 (skip-chars-backward "a-zA-Z<") 7457 (skip-chars-forward "^>\n\r")
7098 (looking-at (concat "<<\\(" org-camel-regexp "\\)>>"))) 7458 (and (re-search-backward "<<" nil t)
7459 (looking-at "<<\\(.*?\\)>>")
7460 (<= (match-beginning 0) pos)
7461 (>= (match-end 0) pos)))
7099 (setq cpltxt (concat cpltxt "::" (match-string 1))) 7462 (setq cpltxt (concat cpltxt "::" (match-string 1)))
7463 (setq txt (cond
7464 ((org-on-heading-p) nil)
7465 ((org-region-active-p)
7466 (buffer-substring (region-beginning) (region-end)))
7467 (t (buffer-substring (point-at-bol) (point-at-eol)))))
7100 (setq cpltxt 7468 (setq cpltxt
7101 (concat cpltxt "::" 7469 (concat cpltxt "::"
7102 (org-make-org-heading-camel 7470 (if org-file-link-context-use-camel-case
7103 (cond 7471 (org-make-org-heading-camel txt)
7104 ((org-on-heading-p) nil) 7472 (org-make-org-heading-search-string txt))))))
7105 ((org-region-active-p) 7473 (if (string-match "::\\'" cpltxt)
7106 (buffer-substring (region-beginning) (region-end))) 7474 (setq cpltxt (substring cpltxt 0 -2)))
7107 (t (buffer-substring (point-at-bol) (point-at-eol))))
7108 )))))
7109 (setq link (org-make-link cpltxt))) 7475 (setq link (org-make-link cpltxt)))
7110 7476
7111 ((buffer-file-name) 7477 ((buffer-file-name)
@@ -7114,12 +7480,14 @@ For file links, arg negates `org-context-in-file-links'."
7114 (abbreviate-file-name (buffer-file-name)))) 7480 (abbreviate-file-name (buffer-file-name))))
7115 ;; Add a context string 7481 ;; Add a context string
7116 (when (org-xor org-context-in-file-links arg) 7482 (when (org-xor org-context-in-file-links arg)
7483 (setq txt (if (org-region-active-p)
7484 (buffer-substring (region-beginning) (region-end))
7485 (buffer-substring (point-at-bol) (point-at-eol))))
7117 (setq cpltxt 7486 (setq cpltxt
7118 (concat cpltxt "::" 7487 (concat cpltxt "::"
7119 (org-make-org-heading-camel 7488 (if org-file-link-context-use-camel-case
7120 (if (org-region-active-p) 7489 (org-make-org-heading-camel txt)
7121 (buffer-substring (region-beginning) (region-end)) 7490 (org-make-org-heading-search-string txt)))))
7122 (buffer-substring (point-at-bol) (point-at-eol)))))))
7123 (setq link (org-make-link cpltxt))) 7491 (setq link (org-make-link cpltxt)))
7124 7492
7125 ((interactive-p) 7493 ((interactive-p)
@@ -7134,14 +7502,37 @@ For file links, arg negates `org-context-in-file-links'."
7134 (message "Stored: %s" (or cpltxt link))) 7502 (message "Stored: %s" (or cpltxt link)))
7135 link))) 7503 link)))
7136 7504
7137(defun org-make-org-heading-camel (&optional string) 7505(defun org-make-org-heading-search-string (&optional string heading)
7138 "Make a CamelCase string for S or the current headline." 7506 "Make search string for STRING or current headline."
7139 (interactive) 7507 (interactive)
7140 (let ((s (or string (org-get-heading)))) 7508 (let ((s (or string (org-get-heading))))
7141 (unless string 7509 (unless (and string (not heading))
7142 ;; We are using a headline, clean up garbage in there. 7510 ;; We are using a headline, clean up garbage in there.
7143 (if (string-match org-todo-regexp s) 7511 (if (string-match org-todo-regexp s)
7144 (setq s (replace-match "" t t s))) 7512 (setq s (replace-match "" t t s)))
7513 (if (string-match ":[a-zA-Z_@0-9:]+:[ \t]*$" s)
7514 (setq s (replace-match "" t t s)))
7515 (setq s (org-trim s))
7516 (if (string-match (concat "^\\(" org-quote-string "\\|"
7517 org-comment-string "\\)") s)
7518 (setq s (replace-match "" t t s)))
7519 (while (string-match org-ts-regexp s)
7520 (setq s (replace-match "" t t s))))
7521 (while (string-match "[^a-zA-Z_0-9 \t]+" s)
7522 (setq s (replace-match " " t t s)))
7523 (or string (setq s (concat "*" s))) ; Add * for headlines
7524 (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
7525
7526(defun org-make-org-heading-camel (&optional string heading)
7527 "Make a CamelCase string for STRING or the current headline."
7528 (interactive)
7529 (let ((s (or string (org-get-heading))))
7530 (unless (and string (not heading))
7531 ;; We are using a headline, clean up garbage in there.
7532 (if (string-match org-todo-regexp s)
7533 (setq s (replace-match "" t t s)))
7534 (if (string-match ":[a-zA-Z_@0-9:]+:[ \t]*$" s)
7535 (setq s (replace-match "" t t s)))
7145 (setq s (org-trim s)) 7536 (setq s (org-trim s))
7146 (if (string-match (concat "^\\(" org-quote-string "\\|" 7537 (if (string-match (concat "^\\(" org-quote-string "\\|"
7147 org-comment-string "\\)") s) 7538 org-comment-string "\\)") s)
@@ -7157,6 +7548,12 @@ For file links, arg negates `org-context-in-file-links'."
7157 "Concatenate STRINGS, format resulting string with `org-link-format'." 7548 "Concatenate STRINGS, format resulting string with `org-link-format'."
7158 (format org-link-format (apply 'concat strings))) 7549 (format org-link-format (apply 'concat strings)))
7159 7550
7551(defun org-make-link2 (link &optional description)
7552 "Make a link with brackets."
7553 (concat "[[" link "]"
7554 (if description (concat "[" description "]") "")
7555 "]"))
7556
7160(defun org-xor (a b) 7557(defun org-xor (a b)
7161 "Exclusive or." 7558 "Exclusive or."
7162 (if a (not b) b)) 7559 (if a (not b) b))
@@ -7245,15 +7642,18 @@ is in the current directory or below."
7245 (let* ((path (match-string 1 link)) 7642 (let* ((path (match-string 1 link))
7246 (case-fold-search nil) 7643 (case-fold-search nil)
7247 (search (match-string 2 link))) 7644 (search (match-string 2 link)))
7248 (when (save-match-data 7645 (when (save-match-data
7249 (equal (file-truename (buffer-file-name)) 7646 (equal (file-truename (buffer-file-name))
7250 (file-truename path))) 7647 (file-truename path)))
7251 (if (save-match-data 7648 ;; We are linking to this same file
7252 (string-match (concat "^" org-camel-regexp "$") search)) 7649 (if (and org-file-link-context-use-camel-case
7253 (setq link (replace-match search t t link) 7650 (save-match-data
7254 matched t) 7651 (string-match (concat "^" org-camel-regexp "$") search)))
7255 (setq link (replace-match (concat "<file:::" search ">") 7652 (setq link (replace-match search t t link)
7256 t t link)))))) 7653 matched t)
7654 (setq link (replace-match (concat "[[" search "]]")
7655 t t link)
7656 matched t)))))
7257 (let ((lines (org-split-string link "\n"))) 7657 (let ((lines (org-split-string link "\n")))
7258 (insert (car lines)) 7658 (insert (car lines))
7259 (setq matched (or matched (string-match org-link-regexp (car lines)))) 7659 (setq matched (or matched (string-match org-link-regexp (car lines))))
@@ -8241,8 +8641,8 @@ Point and mark define the first and last line to include. Both point and
8241mark should be in the column that is used for sorting. For example, to 8641mark should be in the column that is used for sorting. For example, to
8242sort according to column 3, put the mark in the first line to sort, in 8642sort according to column 3, put the mark in the first line to sort, in
8243table column 3. Put point into the last line to be included in the sorting, 8643table column 3. Put point into the last line to be included in the sorting,
8244also in table column 3. The command will prompt for the sorting method (n for 8644also in table column 3. The command will prompt for the sorting method
8245numerical, a for alphanumeric)." 8645\(n for numerical, a for alphanumeric)."
8246 (interactive "r\nsSorting method: [n]=numeric [a]=alpha: ") 8646 (interactive "r\nsSorting method: [n]=numeric [a]=alpha: ")
8247 (setq numericp (string-match "[nN]" numericp)) 8647 (setq numericp (string-match "[nN]" numericp))
8248 (org-table-align) ;; Just to be safe 8648 (org-table-align) ;; Just to be safe
@@ -9081,8 +9481,8 @@ not overwrite the stored one."
9081 (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n)) 9481 (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n))
9082 (setq modes (org-set-calc-mode 9482 (setq modes (org-set-calc-mode
9083 'calc-float-format 9483 'calc-float-format
9084 (list (cdr (assoc c '((?n. float) (?f. fix) 9484 (list (cdr (assoc c '((?n . float) (?f . fix)
9085 (?s. sci) (?e. eng)))) 9485 (?s . sci) (?e . eng))))
9086 n)))) 9486 n))))
9087 (setq fmt (replace-match "" t t fmt))) 9487 (setq fmt (replace-match "" t t fmt)))
9088 (while (string-match "[DRFS]" fmt) 9488 (while (string-match "[DRFS]" fmt)
@@ -9467,9 +9867,8 @@ table editor in arbitrary modes.")
9467 (and c (setq minor-mode-map-alist 9867 (and c (setq minor-mode-map-alist
9468 (cons c (delq c minor-mode-map-alist))))) 9868 (cons c (delq c minor-mode-map-alist)))))
9469 (set (make-local-variable (quote org-table-may-need-update)) t) 9869 (set (make-local-variable (quote org-table-may-need-update)) t)
9470 (make-local-hook (quote before-change-functions)) ; needed for XEmacs 9870 (org-add-hook 'before-change-functions 'org-before-change-function
9471 (add-hook 'before-change-functions 'org-before-change-function 9871 nil 'local)
9472 nil 'local)
9473 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) 9872 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp)
9474 auto-fill-inhibit-regexp) 9873 auto-fill-inhibit-regexp)
9475 (set (make-local-variable 'auto-fill-inhibit-regexp) 9874 (set (make-local-variable 'auto-fill-inhibit-regexp)
@@ -9734,6 +10133,10 @@ a reduced column width."
9734 ((string-match "^#" line) 10133 ((string-match "^#" line)
9735 ;; an ordinary comment line 10134 ;; an ordinary comment line
9736 ) 10135 )
10136 ((and org-export-table-remove-special-lines
10137 (string-match "^[ \t]*| *[!_^] *|" line))
10138 ;; a special table line that should be removed
10139 )
9737 (t (setq rtn (cons line rtn))))) 10140 (t (setq rtn (cons line rtn)))))
9738 (nreverse rtn))) 10141 (nreverse rtn)))
9739 10142
@@ -10040,6 +10443,45 @@ The list contains HTML entities for Latin-1, Greek and other symbols.
10040It is supplemented by a number of commonly used TeX macros with appropriate 10443It is supplemented by a number of commonly used TeX macros with appropriate
10041translations. There is currently no way for users to extend this.") 10444translations. There is currently no way for users to extend this.")
10042 10445
10446(defun org-cleaned-string-for-export (string)
10447 "Cleanup a buffer substring so that links can be created safely."
10448 (interactive)
10449 (let* ((cb (current-buffer))
10450 (re-radio (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)"))
10451 rtn)
10452 (save-excursion
10453 (set-buffer (get-buffer-create " org-mode-tmp"))
10454 (erase-buffer)
10455 (insert string)
10456 (org-mode)
10457 ;; Find targets in comments and move them out of comments
10458 (goto-char (point-min))
10459 (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t)
10460 (replace-match "\\1"))
10461 ;; Find matches for radio targets and turn them into links
10462 (goto-char (point-min))
10463 (while (re-search-forward re-radio nil t)
10464 (replace-match "\\1[[\\2]]"))
10465 ;; Find all links that contain a newline and put them into a single line
10466 (goto-char (point-min))
10467 (while (re-search-forward "\\(\\[\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\]\\)" nil t)
10468 (replace-match "\\1 \\2")
10469 (goto-char (match-beginning 0)))
10470 ;; Remove comments
10471 (goto-char (point-min))
10472 (while (re-search-forward "^#.*\n?" nil t)
10473 (replace-match ""))
10474 (setq rtn (buffer-string)))
10475 (kill-buffer " org-mode-tmp")
10476 rtn))
10477
10478(defun org-solidify-link-text (s)
10479 "Take link text and make a safe target out of it."
10480 (save-match-data
10481 (mapconcat
10482 'identity
10483 (org-split-string s "[ \t\r\n]+") "--")))
10484
10043(defvar org-last-level nil) ; dynamically scoped variable 10485(defvar org-last-level nil) ; dynamically scoped variable
10044 10486
10045(defun org-export-as-ascii (arg) 10487(defun org-export-as-ascii (arg)
@@ -10054,7 +10496,10 @@ underlined headlines. The default is 3."
10054 (if (org-region-active-p) (region-beginning) (point-min)) 10496 (if (org-region-active-p) (region-beginning) (point-min))
10055 (if (org-region-active-p) (region-end) (point-max)))) 10497 (if (org-region-active-p) (region-end) (point-max))))
10056 (lines (org-export-find-first-heading-line 10498 (lines (org-export-find-first-heading-line
10057 (org-skip-comments (org-split-string region "[\r\n]")))) 10499 (org-skip-comments
10500 (org-split-string
10501 (org-cleaned-string-for-export region)
10502 "[\r\n]"))))
10058 (org-startup-with-deadline-check nil) 10503 (org-startup-with-deadline-check nil)
10059 (level 0) line txt 10504 (level 0) line txt
10060 (umax nil) 10505 (umax nil)
@@ -10143,6 +10588,14 @@ underlined headlines. The default is 3."
10143 (while (setq line (pop lines)) 10588 (while (setq line (pop lines))
10144 ;; Remove the quoted HTML tags. 10589 ;; Remove the quoted HTML tags.
10145 (setq line (org-html-expand-for-ascii line)) 10590 (setq line (org-html-expand-for-ascii line))
10591 ;; Remove targets
10592 (while (string-match "<<<?[^<>]*>>>?[ \t]*\n?" line)
10593 (setq line (replace-match "" t t line)))
10594 ;; Replace internal links
10595 (while (string-match org-bracket-link-regexp line)
10596 (setq line (replace-match
10597 (if (match-end 3) "[\\3]" "[\\1]")
10598 t nil line)))
10146 (cond 10599 (cond
10147 ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) 10600 ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line)
10148 ;; a Headline 10601 ;; a Headline
@@ -10381,7 +10834,9 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10381 (if region-p (region-beginning) (point-min)) 10834 (if region-p (region-beginning) (point-min))
10382 (if region-p (region-end) (point-max)))) 10835 (if region-p (region-end) (point-max))))
10383 (all_lines 10836 (all_lines
10384 (org-skip-comments (org-split-string region "[\r\n]"))) 10837 (org-skip-comments (org-split-string
10838 (org-cleaned-string-for-export region)
10839 "[\r\n]")))
10385 (lines (org-export-find-first-heading-line all_lines)) 10840 (lines (org-export-find-first-heading-line all_lines))
10386 (level 0) (line "") (origline "") txt todo 10841 (level 0) (line "") (origline "") txt todo
10387 (umax nil) 10842 (umax nil)
@@ -10544,7 +10999,26 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10544 (insert "</pre>\n")) 10999 (insert "</pre>\n"))
10545 (throw 'nextline nil)) 11000 (throw 'nextline nil))
10546 11001
10547 ;; Protect the links 11002
11003 ;; make targets to anchors
11004 (while (string-match "<<<?\\([^<>]*\\)>>>?[ \t]*\n?" line)
11005 (setq line (replace-match
11006 (concat "@<a name=\""
11007 (org-solidify-link-text (match-string 1 line))
11008 "\">\\nbsp@</a>")
11009 t t line)))
11010 ;; Replace internal links
11011 (while (string-match org-bracket-link-regexp line)
11012 (setq line (replace-match
11013 (concat
11014 "@<a href=\"#"
11015 (org-solidify-link-text (match-string 1 line))
11016 "\">"
11017 (match-string (if (match-end 3) 3 1) line)
11018 "@</a>")
11019 t t line)))
11020
11021 ;; Protect the external links
10548 (setq start 0) 11022 (setq start 0)
10549 (while (string-match org-link-maybe-angles-regexp line start) 11023 (while (string-match org-link-maybe-angles-regexp line start)
10550 (setq start (match-end 0)) 11024 (setq start (match-end 0))
@@ -10587,7 +11061,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10587 (concat "<a href=\"" thefile "\">\\1:\\2</a>")) 11061 (concat "<a href=\"" thefile "\">\\1:\\2</a>"))
10588 nil nil line)))) 11062 nil nil line))))
10589 11063
10590 ((member type '("bbdb" "vm" "wl" "rmail" "gnus" "shell")) 11064 ((member type '("bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell"))
10591 (setq line (replace-match 11065 (setq line (replace-match
10592 "<i>&lt;\\1:\\2&gt;</i>" nil nil line))))) 11066 "<i>&lt;\\1:\\2&gt;</i>" nil nil line)))))
10593 11067
@@ -10722,11 +11196,34 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10722 (org-format-table-table-html-using-table-generate-source olines))))) 11196 (org-format-table-table-html-using-table-generate-source olines)))))
10723 11197
10724(defun org-format-org-table-html (lines) 11198(defun org-format-org-table-html (lines)
10725 "Format a table into html." 11199 "Format a table into HTML."
10726 (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines))) 11200 (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
10727 (setq lines (nreverse lines)) 11201 (setq lines (nreverse lines))
10728 (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines))) 11202 (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
10729 (setq lines (nreverse lines)) 11203 (setq lines (nreverse lines))
11204 (when org-export-table-remove-special-lines
11205 ;; Check if the table has a marking column. If yes remove the
11206 ;; column and the special lines
11207 (let* ((special
11208 (not
11209 (memq nil
11210 (mapcar
11211 (lambda (x)
11212 (or (string-match "^[ \t]*|-" x)
11213 (string-match "^[ \t]*| *\\([#!$*_^ ]\\) *|" x)))
11214 lines)))))
11215 (if special
11216 (setq lines
11217 (delq nil
11218 (mapcar
11219 (lambda (x)
11220 (if (string-match "^[ \t]*| *[!_^] *|" x)
11221 nil ; ignore this line
11222 (and (or (string-match "^[ \t]*|-+\\+" x)
11223 (string-match "^[ \t]*|[^|]*|" x))
11224 (replace-match "|" t t x))))
11225 lines))))))
11226
10730 (let ((head (and org-export-highlight-first-table-line 11227 (let ((head (and org-export-highlight-first-table-line
10731 (delq nil (mapcar 11228 (delq nil (mapcar
10732 (lambda (x) (string-match "^[ \t]*|-" x)) 11229 (lambda (x) (string-match "^[ \t]*|-" x))
@@ -10765,7 +11262,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
10765 newstr)) 11262 newstr))
10766 11263
10767(defun org-format-table-table-html (lines) 11264(defun org-format-table-table-html (lines)
10768 "Format a table generated by table.el into html. 11265 "Format a table generated by table.el into HTML.
10769This conversion does *not* use `table-generate-source' from table.el. 11266This conversion does *not* use `table-generate-source' from table.el.
10770This has the advantage that Org-mode's HTML conversions can be used. 11267This has the advantage that Org-mode's HTML conversions can be used.
10771But it has the disadvantage, that no cell- or row-spanning is allowed." 11268But it has the disadvantage, that no cell- or row-spanning is allowed."
@@ -11210,10 +11707,10 @@ a time), or the day by one (if it does not contain a time)."
11210 11707
11211;; - Bindings in Org-mode map are currently 11708;; - Bindings in Org-mode map are currently
11212;; 0123456789abcdefghijklmnopqrstuvwxyz!?@#$%^&-+*/=()_{}[]:;"|,.<>~`'\t the alphabet 11709;; 0123456789abcdefghijklmnopqrstuvwxyz!?@#$%^&-+*/=()_{}[]:;"|,.<>~`'\t the alphabet
11213;; abcd fgh j lmnopqrstuvwxyz!? #$ -+*/= [] ; |,.<>~ \t necessary bindings 11710;; abcd fgh j lmnopqrstuvwxyz!? #$ ^ -+*/= [] ; |,.<>~ '\t necessary bindings
11214;; e (?) useful from outline-mode 11711;; e (?) useful from outline-mode
11215;; i k @ expendable from outline-mode 11712;; i k @ expendable from outline-mode
11216;; 0123456789 %^& ()_{} " `' free 11713;; 0123456789 % & ()_{} " ` free
11217 11714
11218;; Make `C-c C-x' a prefix key 11715;; Make `C-c C-x' a prefix key
11219(define-key org-mode-map "\C-c\C-x" (make-sparse-keymap)) 11716(define-key org-mode-map "\C-c\C-x" (make-sparse-keymap))
@@ -11281,6 +11778,8 @@ a time), or the day by one (if it does not contain a time)."
11281(define-key org-mode-map "\M-\C-m" 'org-insert-heading) 11778(define-key org-mode-map "\M-\C-m" 'org-insert-heading)
11282(define-key org-mode-map "\C-c\C-l" 'org-insert-link) 11779(define-key org-mode-map "\C-c\C-l" 'org-insert-link)
11283(define-key org-mode-map "\C-c\C-o" 'org-open-at-point) 11780(define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
11781(define-key org-mode-map "\C-c%" 'org-mark-ring-push)
11782(define-key org-mode-map "\C-c&" 'org-mark-ring-goto)
11284(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding 11783(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding
11285(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved 11784(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved
11286(define-key org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r. 11785(define-key org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r.
@@ -11594,6 +12093,7 @@ If the cursor is on a #+TBLFM line, re-apply the formulae to the table."
11594 (interactive "P") 12093 (interactive "P")
11595 (let ((org-enable-table-editor t)) 12094 (let ((org-enable-table-editor t))
11596 (cond 12095 (cond
12096 ((org-on-target-p) (org-update-radio-target-regexp))
11597 ((org-on-heading-p) (org-set-tags arg)) 12097 ((org-on-heading-p) (org-set-tags arg))
11598 ((org-at-table.el-p) 12098 ((org-at-table.el-p)
11599 (require 'table) 12099 (require 'table)
@@ -11935,6 +12435,12 @@ work correctly."
11935 12435
11936;; Functions needed for Emacs/XEmacs region compatibility 12436;; Functions needed for Emacs/XEmacs region compatibility
11937 12437
12438(defun org-add-hook (hook function &optional append local)
12439 "Add-hook, compatible with both Emacsen."
12440 (if (and local org-xemacs-p)
12441 (add-local-hook hook function append)
12442 (add-hook hook function append local)))
12443
11938(defun org-region-active-p () 12444(defun org-region-active-p ()
11939 "Is `transient-mark-mode' on and the region active? 12445 "Is `transient-mark-mode' on and the region active?
11940Works on both Emacs and XEmacs." 12446Works on both Emacs and XEmacs."
@@ -12030,6 +12536,19 @@ to a visible line beginning. This makes the function of C-a more intuitive."
12030 (skip-chars-backward "^\r\n") 12536 (skip-chars-backward "^\r\n")
12031 (equal (char-before) ?\r)))) 12537 (equal (char-before) ?\r))))
12032 12538
12539(defun org-invisible-p2 ()
12540 "Check if point is at a character currently not visible."
12541 (save-excursion
12542 (if org-noutline-p
12543 (progn
12544 (if (and (eolp) (not (bobp))) (backward-char 1))
12545 ;; Early versions of noutline don't have `outline-invisible-p'.
12546 (if (fboundp 'outline-invisible-p)
12547 (outline-invisible-p)
12548 (get-char-property (point) 'invisible)))
12549 (skip-chars-backward "^\r\n")
12550 (equal (char-before) ?\r))))
12551
12033(defun org-back-to-heading (&optional invisible-ok) 12552(defun org-back-to-heading (&optional invisible-ok)
12034 "Move to previous heading line, or beg of this line if it's a heading. 12553 "Move to previous heading line, or beg of this line if it's a heading.
12035Only visible heading lines are considered, unless INVISIBLE-OK is non-nil." 12554Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
@@ -12058,6 +12577,16 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
12058 (bobp) 12577 (bobp)
12059 (equal (char-before) ?\n)))))) 12578 (equal (char-before) ?\n))))))
12060 12579
12580(defun org-on-target-p ()
12581 (let ((pos (point)))
12582 (save-excursion
12583 (skip-chars-forward "<")
12584 (and (re-search-backward "<<" nil t)
12585 (or (looking-at org-target-regexp)
12586 (looking-at org-radio-target-regexp))
12587 (<= (match-beginning 0) pos)
12588 (>= (match-end 0) pos)))))
12589
12061(defun org-up-heading-all (arg) 12590(defun org-up-heading-all (arg)
12062 "Move to the heading line of which the present line is a subheading. 12591 "Move to the heading line of which the present line is a subheading.
12063This function considers both visible and invisible heading lines. 12592This function considers both visible and invisible heading lines.
@@ -12195,4 +12724,3 @@ Show the heading too, if it is currently invisible."
12195;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 12724;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
12196;;; org.el ends here 12725;;; org.el ends here
12197 12726
12198
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index ff044230803..394a0b52b19 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index c6f43a07d26..ced44757ffd 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 7546c654f70..1e60b8e663e 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7;; 7;;
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -33,7 +33,7 @@
33(require 'reftex) 33(require 'reftex)
34;;; 34;;;
35 35
36(defun reftex-view-crossref (&optional arg auto-how) 36(defun reftex-view-crossref (&optional arg auto-how fail-quietly)
37 "View cross reference of macro at point. Point must be on the KEY 37 "View cross reference of macro at point. Point must be on the KEY
38argument. When at at `\\ref' macro, show corresponding `\\label' 38argument. When at at `\\ref' macro, show corresponding `\\label'
39definition, also in external documents (`xr'). When on a label, show 39definition, also in external documents (`xr'). When on a label, show
@@ -56,52 +56,53 @@ to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'."
56 dw) 56 dw)
57 57
58 (if (or (null macro) (reftex-in-comment)) 58 (if (or (null macro) (reftex-in-comment))
59 (error "Not on a crossref macro argument")) 59 (or fail-quietly
60 60 (error "Not on a crossref macro argument"))
61 (setq reftex-call-back-to-this-buffer (current-buffer)) 61
62 62 (setq reftex-call-back-to-this-buffer (current-buffer))
63 (cond 63
64 ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro) 64 (cond
65 ;; A citation macro: search for bibitems or BibTeX entries 65 ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro)
66 (setq dw (reftex-view-cr-cite arg key auto-how))) 66 ;; A citation macro: search for bibitems or BibTeX entries
67 ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro) 67 (setq dw (reftex-view-cr-cite arg key auto-how)))
68 ;; A reference macro: search for labels 68 ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro)
69 (setq dw (reftex-view-cr-ref arg key auto-how))) 69 ;; A reference macro: search for labels
70 (auto-how nil) ;; No further action for automatic display (speed) 70 (setq dw (reftex-view-cr-ref arg key auto-how)))
71 ((or (equal macro "\\label") 71 (auto-how nil) ;; No further action for automatic display (speed)
72 (member macro reftex-macros-with-labels)) 72 ((or (equal macro "\\label")
73 ;; A label macro: search for reference macros 73 (member macro reftex-macros-with-labels))
74 (reftex-access-scan-info arg) 74 ;; A label macro: search for reference macros
75 (setq dw (reftex-view-regexp-match 75 (reftex-access-scan-info arg)
76 (format reftex-find-reference-format (regexp-quote key)) 76 (setq dw (reftex-view-regexp-match
77 4 nil nil))) 77 (format reftex-find-reference-format (regexp-quote key))
78 ((equal macro "\\bibitem") 78 4 nil nil)))
79 ;; A bibitem macro: search for citations 79 ((equal macro "\\bibitem")
80 (reftex-access-scan-info arg) 80 ;; A bibitem macro: search for citations
81 (setq dw (reftex-view-regexp-match 81 (reftex-access-scan-info arg)
82 (format reftex-find-citation-regexp-format (regexp-quote key)) 82 (setq dw (reftex-view-regexp-match
83 4 nil nil))) 83 (format reftex-find-citation-regexp-format (regexp-quote key))
84 ((member macro reftex-macros-with-index) 84 4 nil nil)))
85 (reftex-access-scan-info arg) 85 ((member macro reftex-macros-with-index)
86 (setq dw (reftex-view-regexp-match 86 (reftex-access-scan-info arg)
87 (format reftex-find-index-entry-regexp-format 87 (setq dw (reftex-view-regexp-match
88 (regexp-quote key)) 88 (format reftex-find-index-entry-regexp-format
89 3 nil nil))) 89 (regexp-quote key))
90 (t 90 3 nil nil)))
91 (reftex-access-scan-info arg) 91 (t
92 (catch 'exit 92 (reftex-access-scan-info arg)
93 (let ((list reftex-view-crossref-extra) 93 (catch 'exit
94 entry mre action group) 94 (let ((list reftex-view-crossref-extra)
95 (while (setq entry (pop list)) 95 entry mre action group)
96 (setq mre (car entry) 96 (while (setq entry (pop list))
97 action (nth 1 entry) 97 (setq mre (car entry)
98 group (nth 2 entry)) 98 action (nth 1 entry)
99 (when (string-match mre macro) 99 group (nth 2 entry))
100 (setq dw (reftex-view-regexp-match 100 (when (string-match mre macro)
101 (format action key) group nil nil)) 101 (setq dw (reftex-view-regexp-match
102 (throw 'exit t)))) 102 (format action key) group nil nil))
103 (error "Not on a crossref macro argument")))) 103 (throw 'exit t))))
104 (if (and (eq arg 2) (windowp dw)) (select-window dw)))) 104 (error "Not on a crossref macro argument"))))
105 (if (and (eq arg 2) (windowp dw)) (select-window dw)))))
105 106
106(defun reftex-view-cr-cite (arg key how) 107(defun reftex-view-cr-cite (arg key how)
107 ;; View crossreference of a ref cite. HOW can have the values 108 ;; View crossreference of a ref cite. HOW can have the values
@@ -243,7 +244,7 @@ With argument, actually select the window showing the cross reference."
243 (not (memq last-command '(reftex-view-crossref 244 (not (memq last-command '(reftex-view-crossref
244 reftex-mouse-view-crossref))) 245 reftex-mouse-view-crossref)))
245 ;; Quick precheck if this might be a relevant spot 246 ;; Quick precheck if this might be a relevant spot
246 ;; FIXME: Can fail with backslash in comment 247 ;; `reftex-view-crossref' will do a more thorough check.
247 (save-excursion 248 (save-excursion
248 (search-backward "\\" nil t) 249 (search-backward "\\" nil t)
249 (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)")) 250 (looking-at "\\\\[a-zA-Z]*\\(cite\\|ref\\|bibentry\\)"))
@@ -252,9 +253,9 @@ With argument, actually select the window showing the cross reference."
252 (let ((current-prefix-arg nil)) 253 (let ((current-prefix-arg nil))
253 (cond 254 (cond
254 ((eq reftex-auto-view-crossref t) 255 ((eq reftex-auto-view-crossref t)
255 (reftex-view-crossref -1 'echo)) 256 (reftex-view-crossref -1 'echo 'quiet))
256 ((eq reftex-auto-view-crossref 'window) 257 ((eq reftex-auto-view-crossref 'window)
257 (reftex-view-crossref -1 'tmp-window)) 258 (reftex-view-crossref -1 'tmp-window 'quiet))
258 (t nil))) 259 (t nil)))
259 (error nil)))) 260 (error nil))))
260 261
@@ -267,7 +268,8 @@ With argument, actually select the window showing the cross reference."
267 ;; Display crossref info in echo area. 268 ;; Display crossref info in echo area.
268 (cond 269 (cond
269 ((null docstruct) 270 ((null docstruct)
270 (message "%s" (substitute-command-keys (format reftex-no-info-message "ref")))) 271 (message "%s"
272 (substitute-command-keys (format reftex-no-info-message "ref"))))
271 ((null entry) 273 ((null entry)
272 (message "ref: unknown label: %s" label)) 274 (message "ref: unknown label: %s" label))
273 (t 275 (t
@@ -301,7 +303,7 @@ With argument, actually select the window showing the cross reference."
301 (if (and files (= (length all-files) (length files))) 303 (if (and files (= (length all-files) (length files)))
302 (message "cite: no such database entry: %s" key) 304 (message "cite: no such database entry: %s" key)
303 (message "%s" (substitute-command-keys 305 (message "%s" (substitute-command-keys
304 (format reftex-no-info-message "cite")))) 306 (format reftex-no-info-message "cite"))))
305 nil))) 307 nil)))
306 (when entry 308 (when entry
307 (if item 309 (if item
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index fafc1a30998..e1ae98a59df 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index a7e7203a639..f005e7a3b87 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index ce43840c888..76eb7c31df8 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7;; 7;;
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index f1a8d6d3965..a850da3042e 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 9aa7edbf438..69a893ff177 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index f9eb3cfef82..9b710b92a67 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index b8eddcd0386..e866b03626f 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
@@ -1555,6 +1555,18 @@ TeX-file-extensions."
1555 :type '(repeat (cons (string :tag "File type") 1555 :type '(repeat (cons (string :tag "File type")
1556 (repeat (string :tag "Extension"))))) 1556 (repeat (string :tag "Extension")))))
1557 1557
1558(defcustom reftex-try-all-extensions nil
1559 "Non-nil means, try all extensions listed in `reftex-file-extensions'.
1560When searching for a file, LaTeX uses only the default extension. However,
1561if you are working with a noweb system that produces the .tex files from
1562some other file, and you want RefTeX to scan the web file instead of the
1563tex file, you need to set this option. You also need to make the noweb
1564extension the default extension, i.e. the first in the list in
1565`reftex-file-extensions'.
1566Note that if you are using external file finders, this option has no effect."
1567 :group 'reftex-finding-files
1568 :type 'boolean)
1569
1558(defcustom reftex-search-unrecursed-path-first t 1570(defcustom reftex-search-unrecursed-path-first t
1559 "*Non-nil means, search all specified directories before trying recursion. 1571 "*Non-nil means, search all specified directories before trying recursion.
1560Thus, in a path \".//:/tex/\", search first \"./\", then \"/tex/\" and then 1572Thus, in a path \".//:/tex/\", search first \"./\", then \"/tex/\" and then
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index cb2e960225d..d759aff8774 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -3,7 +3,7 @@
3;; 2006 Free Software Foundation, Inc. 3;; 2006 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <dominik@science.uva.nl> 5;; Author: Carsten Dominik <dominik@science.uva.nl>
6;; Version: VERSIONTAG 6;; Version: 4.31
7;; Keywords: tex 7;; Keywords: tex
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -301,7 +301,7 @@
301;;; Define the formal stuff for a minor mode named RefTeX. 301;;; Define the formal stuff for a minor mode named RefTeX.
302;;; 302;;;
303 303
304(defconst reftex-version "RefTeX version VERSIONTAG" 304(defconst reftex-version "RefTeX version 4.31"
305 "Version string for RefTeX.") 305 "Version string for RefTeX.")
306 306
307(defvar reftex-mode nil 307(defvar reftex-mode nil
@@ -1437,14 +1437,17 @@ When DIE is non-nil, throw an error if file not found."
1437 "\\)\\'")) 1437 "\\)\\'"))
1438 (files (if (string-match ext-re file) 1438 (files (if (string-match ext-re file)
1439 (cons file nil) 1439 (cons file nil)
1440 (cons (concat file def-ext) file))) 1440 (if reftex-try-all-extensions
1441 path old-path file1) 1441 (append (mapcar (lambda (x) (concat file x))
1442 extensions)
1443 (list file))
1444 (list (concat file def-ext) file))))
1445 path old-path file1 f fs)
1442 (cond 1446 (cond
1443 ((file-name-absolute-p file) 1447 ((file-name-absolute-p file)
1444 (setq file1 1448 (while (setq f (pop files))
1445 (or 1449 (if (file-regular-p f)
1446 (and (car files) (file-regular-p (car files)) (car files)) 1450 (setq file1 f files nil))))
1447 (and (cdr files) (file-regular-p (cdr files)) (cdr files)))))
1448 ((and reftex-use-external-file-finders 1451 ((and reftex-use-external-file-finders
1449 (assoc type reftex-external-file-finders)) 1452 (assoc type reftex-external-file-finders))
1450 (setq file1 (reftex-find-file-externally file type master-dir))) 1453 (setq file1 (reftex-find-file-externally file type master-dir)))
@@ -1452,16 +1455,13 @@ When DIE is non-nil, throw an error if file not found."
1452 (while (and (null file1) rec-values) 1455 (while (and (null file1) rec-values)
1453 (setq path (reftex-access-search-path 1456 (setq path (reftex-access-search-path
1454 type (pop rec-values) master-dir file)) 1457 type (pop rec-values) master-dir file))
1455 (if (or (null old-path) 1458 (setq fs files)
1456 (not (eq old-path path))) 1459 (while (and (null file1) (setq f (pop fs)))
1457 (setq old-path path 1460 (when (or (null old-path)
1458 path (cons master-dir path) 1461 (not (eq old-path path)))
1459 file1 (or (and (car files) 1462 (setq old-path path
1460 (reftex-find-file-on-path 1463 path (cons master-dir path))
1461 (car files) path master-dir)) 1464 (setq file1 (reftex-find-file-on-path f path master-dir)))))))
1462 (and (cdr files)
1463 (reftex-find-file-on-path
1464 (cdr files) path master-dir))))))))
1465 (cond (file1 file1) 1465 (cond (file1 file1)
1466 (die (error "No such file: %s" file) nil) 1466 (die (error "No such file: %s" file) nil)
1467 (t (message "No such file: %s (ignored)" file) nil)))) 1467 (t (message "No such file: %s (ignored)" file) nil))))
diff --git a/man/ChangeLog b/man/ChangeLog
index 764e22eca15..e2d948aef35 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,37 @@
12006-02-23 Juri Linkov <juri@jurta.org>
2
3 * faq.texi (Common requests): Move `Turning on auto-fill by
4 default' after `Wrapping words automatically'. Move `Working with
5 unprintable characters' before `Searching for/replacing newlines'.
6 Move `Replacing highlighted text' after `Highlighting a region'.
7 Merge `Repeating commands' and `Repeating a command as many times
8 as possible' into the former.
9 (Packages that do not come with Emacs): Add refs to Gmane and
10 etc/MORE.STUFF.
11
122006-02-23 Juri Linkov <juri@jurta.org>
13
14 * faq.texi (Newsgroup archives): Update URLs of GNU mail archives.
15 (Reporting bugs): Suggest using `M-x report-emacs-bug'.
16 Add xref to `(emacs)Reporting Bugs'.
17 (Getting a printed manual): Add URL to other formats of the manual.
18 (Common requests): Fix menu.
19 (Highlighting a region): Remove ref to `Turning on syntax highlighting'.
20 (Horizontal scrolling): Mention `truncate-partial-width-windows'.
21 (Inserting text at the beginning of each line): Add pxref to
22 `Changing the included text prefix'.
23 (Forcing the cursor to remain in the same column): Mention `track-eol'
24 and `set-goal-column'. Add pxref to `(emacs)Moving Point'.
25 (Replacing text across multiple files): Add keybinding `Q' for
26 `dired-do-query-replace'.
27
282006-02-22 Carsten Dominik <dominik@science.uva.nl>
29
30 * reftex.texi: Version number and date change only.
31
32 * org.texi: (Internal Links): Rewritten to cover the modified
33 linking system.
34
12006-02-21 Nick Roberts <nickrob@snap.net.nz> 352006-02-21 Nick Roberts <nickrob@snap.net.nz>
2 36
3 * building.texi (Watch Expressions): Update and describe 37 * building.texi (Watch Expressions): Update and describe
diff --git a/man/faq.texi b/man/faq.texi
index 01becae0c87..0c4838d9019 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -423,14 +423,17 @@ years, although there may be some unintentional gaps in coverage. The
423archive is not particularly well organized or easy to retrieve 423archive is not particularly well organized or easy to retrieve
424individual postings from, but pretty much everything is there. 424individual postings from, but pretty much everything is there.
425 425
426The archive is at @uref{ftp://ftp-mailing-list-archives.gnu.org}. 426The archive is at @uref{ftp://lists.gnu.org/}.
427 427
428The archive can be browsed over the web at 428The archive can be browsed over the web at
429@uref{http://mail.gnu.org/archive/html/, the GNU mail archive}. 429@uref{http://lists.gnu.org/archive/html/, the GNU mail archive}.
430 430
431Web-based Usenet search services, such as 431Web-based Usenet search services, such as
432@uref{http://groups.google.com, Google}, also archive the 432@uref{http://groups.google.com/groups/dir?sel=33592484, Google}, also
433@code{gnu.*} groups. 433archive the @code{gnu.*} groups.
434
435You can read the archives of the @code{gnu.*} groups and post new
436messages at @uref{http://gmane.org/, Gmane}.
434 437
435@node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions 438@node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions
436@section Where should I report bugs and other problems with Emacs? 439@section Where should I report bugs and other problems with Emacs?
@@ -439,16 +442,19 @@ Web-based Usenet search services, such as
439@cindex How to submit a bug report 442@cindex How to submit a bug report
440@cindex Reporting bugs 443@cindex Reporting bugs
441 444
442The correct way to report Emacs bugs is by e-mail to 445The correct way to report Emacs bugs is to use the command
443@email{bug-gnu-emacs@@gnu.org}. Anything sent here also appears in the 446@kbd{M-x report-emacs-bug}. It sets up a mail buffer with the
447essential information and the correct e-mail address which is
448@email{bug-gnu-emacs@@gnu.org} for the released versions of Emacs.
449Anything sent to @email{bug-gnu-emacs@@gnu.org} also appears in the
444newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of 450newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
445news to submit the bug report. This ensures a reliable return address 451news to submit the bug report. This ensures a reliable return address
446so you can be contacted for further details. 452so you can be contacted for further details.
447 453
448Be sure to read the ``Bugs'' section of the Emacs manual before reporting 454Be sure to read the ``Bugs'' section of the Emacs manual before reporting
449a bug to bug-gnu-emacs! The manual describes in detail how to submit a 455a bug! The manual describes in detail how to submit a useful bug
450useful bug report. (@xref{On-line manual}, if you don't know how to read the 456report (@pxref{Bugs, , Reporting Bugs, emacs, The GNU Emacs Manual}).
451manual.) 457(@xref{On-line manual}, if you don't know how to read the manual.)
452 458
453RMS says: 459RMS says:
454 460
@@ -674,6 +680,10 @@ An HTML version of the manual is at
674 680
675@uref{http://www.gnu.org/software/emacs/manual/emacs.html} 681@uref{http://www.gnu.org/software/emacs/manual/emacs.html}
676 682
683The manual is available in other formats at
684
685@uref{http://www.gnu.org/software/emacs/manual/}
686
677@xref{Learning how to do something}, for how to view the manual on-line. 687@xref{Learning how to do something}, for how to view the manual on-line.
678 688
679@node Emacs Lisp documentation, Installing Texinfo documentation, Getting a printed manual, Getting help 689@node Emacs Lisp documentation, Installing Texinfo documentation, Getting a printed manual, Getting help
@@ -763,12 +773,19 @@ privileges, you have several options:
763 773
764@itemize @bullet 774@itemize @bullet
765@item 775@item
766Info files don't actually need to be installed before being used. You 776Info files don't actually need to be installed before being used.
767can feed a file name to the @code{Info-goto-node} command (invoked by 777You can use a prefix argument for the @code{info} command and specify
768pressing @key{g} in Info mode) by typing the name of the file in 778the name of the Info file in the minibuffer. This goes to the node
769parentheses. This goes to the node named ``Top'' in that file. For 779named @samp{Top} in that file. For example, to view a Info file named
770example, to view a Info file named @file{@var{info-file}} in your home 780@file{@var{info-file}} in your home directory, you can type this:
771directory, you can type this: 781
782@example
783@kbd{C-u C-h i ~/@var{info-file} @key{RET}}
784@end example
785
786Alternatively, you can feed a file name to the @code{Info-goto-node}
787command (invoked by pressing @key{g} in Info mode) by typing the name
788of the file in parentheses, like this:
772 789
773@example 790@example
774@kbd{C-h i g (~/@var{info-file}) @key{RET}} 791@kbd{C-h i g (~/@var{info-file}) @key{RET}}
@@ -1074,7 +1091,7 @@ conventions}).
1074 1091
1075Emacs @value{VER} is the current version as of this writing. 1092Emacs @value{VER} is the current version as of this writing.
1076 1093
1077@node New in Emacs 20, New in Emacs 21, Latest version of Emacs, Status of Emacs 1094@node New in Emacs 20, New in Emacs 21, Latest version of Emacs, Status of Emacs
1078@section What is different about Emacs 20? 1095@section What is different about Emacs 20?
1079@cindex Differences between Emacs 19 and Emacs 20 1096@cindex Differences between Emacs 19 and Emacs 20
1080@cindex Emacs 20, new features in 1097@cindex Emacs 20, new features in
@@ -1122,7 +1139,7 @@ In addition, Emacs 21 supports faces on text-only terminals. This means
1122that you can now have colors when you run Emacs on a GNU/Linux console 1139that you can now have colors when you run Emacs on a GNU/Linux console
1123and on @code{xterm} with @kbd{emacs -nw}. 1140and on @code{xterm} with @kbd{emacs -nw}.
1124 1141
1125@node New in Emacs 22, , New in Emacs 21, Status of Emacs 1142@node New in Emacs 22, , New in Emacs 21, Status of Emacs
1126@section What is different about Emacs 22? 1143@section What is different about Emacs 22?
1127@cindex Differences between Emacs 21 and Emacs 22 1144@cindex Differences between Emacs 21 and Emacs 22
1128@cindex Emacs 22, new features in 1145@cindex Emacs 22, new features in
@@ -1163,19 +1180,20 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
1163@menu 1180@menu
1164* Setting up a customization file:: 1181* Setting up a customization file::
1165* Using Customize:: 1182* Using Customize::
1166* Debugging a customization file::
1167* Colors on a TTY:: 1183* Colors on a TTY::
1184* Debugging a customization file::
1168* Displaying the current line or column:: 1185* Displaying the current line or column::
1169* Displaying the current file name in the titlebar:: 1186* Displaying the current file name in the titlebar::
1170* Turning on abbrevs by default:: 1187* Turning on abbrevs by default::
1171* Turning on auto-fill by default::
1172* Associating modes with files:: 1188* Associating modes with files::
1173* Working with unprintable characters::
1174* Highlighting a region:: 1189* Highlighting a region::
1190* Replacing highlighted text::
1175* Controlling case sensitivity:: 1191* Controlling case sensitivity::
1176* Wrapping words automatically:: 1192* Working with unprintable characters::
1177* Searching for/replacing newlines:: 1193* Searching for/replacing newlines::
1178* Yanking text in isearch:: 1194* Yanking text in isearch::
1195* Wrapping words automatically::
1196* Turning on auto-fill by default::
1179* Spell-checkers:: 1197* Spell-checkers::
1180* Checking TeX and *roff documents:: 1198* Checking TeX and *roff documents::
1181* Changing load-path:: 1199* Changing load-path::
@@ -1196,7 +1214,6 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
1196* Changing the length of a Tab:: 1214* Changing the length of a Tab::
1197* Inserting text at the beginning of each line:: 1215* Inserting text at the beginning of each line::
1198* Underlining paragraphs:: 1216* Underlining paragraphs::
1199* Repeating a command as many times as possible::
1200* Forcing the cursor to remain in the same column:: 1217* Forcing the cursor to remain in the same column::
1201* Forcing Emacs to iconify itself:: 1218* Forcing Emacs to iconify itself::
1202* Using regular expressions:: 1219* Using regular expressions::
@@ -1209,7 +1226,6 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
1209* Deleting menus and menu options:: 1226* Deleting menus and menu options::
1210* Turning on syntax highlighting:: 1227* Turning on syntax highlighting::
1211* Scrolling only one line:: 1228* Scrolling only one line::
1212* Replacing highlighted text::
1213* Editing MS-DOS files:: 1229* Editing MS-DOS files::
1214* Filling paragraphs with a single space:: 1230* Filling paragraphs with a single space::
1215* Escape sequences in shell output:: 1231* Escape sequences in shell output::
@@ -1387,7 +1403,7 @@ in your @file{.emacs}:
1387(setq frame-title-format "%b") 1403(setq frame-title-format "%b")
1388@end lisp 1404@end lisp
1389 1405
1390@node Turning on abbrevs by default, Turning on auto-fill by default, Displaying the current file name in the titlebar, Common requests 1406@node Turning on abbrevs by default, Associating modes with files, Displaying the current file name in the titlebar, Common requests
1391@section How do I turn on abbrevs by default just in mode @var{mymode}? 1407@section How do I turn on abbrevs by default just in mode @var{mymode}?
1392@cindex Abbrevs, turning on by default 1408@cindex Abbrevs, turning on by default
1393 1409
@@ -1406,30 +1422,7 @@ Put this in your @file{.emacs} file:
1406Starting with Emacs 22, the standard abbrevs file is read automatically 1422Starting with Emacs 22, the standard abbrevs file is read automatically
1407at startup, so the first of these two forms becomes unnecessary. 1423at startup, so the first of these two forms becomes unnecessary.
1408 1424
1409@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests 1425@node Associating modes with files, Highlighting a region, Turning on abbrevs by default, Common requests
1410@section How do I turn on @code{auto-fill-mode} by default?
1411@cindex @code{auto-fill-mode}, activating automatically
1412@cindex Filling automatically
1413@cindex Automatic entry to @code{auto-fill-mode}
1414
1415To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x
1416auto-fill-mode}.
1417
1418To turn it on for every buffer in a certain mode, you must use the hook
1419for that mode. For example, to turn on @code{auto-fill} mode for all
1420text buffers, including the following in your @file{.emacs} file:
1421
1422@lisp
1423(add-hook 'text-mode-hook 'turn-on-auto-fill)
1424@end lisp
1425
1426If you want @code{auto-fill} mode on in all major modes, do this:
1427
1428@lisp
1429(setq-default auto-fill-function 'do-auto-fill)
1430@end lisp
1431
1432@node Associating modes with files, Working with unprintable characters, Turning on auto-fill by default, Common requests
1433@section How do I make Emacs use a certain major mode for certain files? 1426@section How do I make Emacs use a certain major mode for certain files?
1434@cindex Associating modes with files 1427@cindex Associating modes with files
1435@cindex File extensions and modes 1428@cindex File extensions and modes
@@ -1459,7 +1452,81 @@ the script.) This feature only applies when the file name doesn't
1459indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x 1452indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x
1460describe-variable}) on @code{interpreter-mode-alist} to learn more. 1453describe-variable}) on @code{interpreter-mode-alist} to learn more.
1461 1454
1462@node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests 1455@node Highlighting a region, Replacing highlighted text, Associating modes with files, Common requests
1456@section How can I highlight a region of text in Emacs?
1457@cindex Highlighting text
1458@cindex Text, highlighting
1459@cindex @code{transient-mark-mode}
1460@cindex Region, highlighting a
1461
1462You can cause the region to be highlighted when the mark is active by
1463including
1464
1465@lisp
1466(transient-mark-mode t)
1467@end lisp
1468
1469@noindent
1470in your @file{.emacs} file.
1471
1472@node Replacing highlighted text, Controlling case sensitivity, Highlighting a region, Common requests
1473@section How can I replace highlighted text with what I type?
1474@cindex @code{delete-selection-mode}
1475@cindex Replacing highlighted text
1476@cindex Highlighting and replacing text
1477
1478Use @code{delete-selection-mode}, which you can start automatically by
1479placing the following Lisp form in your @file{.emacs} file:
1480
1481@lisp
1482(delete-selection-mode 1)
1483@end lisp
1484
1485According to the documentation string for @code{delete-selection-mode}
1486(which you can read using @kbd{M-x describe-function @key{RET}
1487delete-selection-mode @key{RET}}):
1488
1489@quotation
1490When ON, typed text replaces the selection if the selection is active.
1491When OFF, typed text is just inserted at point.
1492@end quotation
1493
1494This mode also allows you to delete (not kill) the highlighted region by
1495pressing @key{DEL}.
1496
1497@node Controlling case sensitivity, Working with unprintable characters, Replacing highlighted text, Common requests
1498@section How do I control Emacs's case-sensitivity when searching/replacing?
1499@cindex @code{case-fold-search}
1500@cindex Case sensitivity of searches
1501@cindex Searching without case sensitivity
1502@cindex Ignoring case in searches
1503
1504For searching, the value of the variable @code{case-fold-search}
1505determines whether they are case sensitive:
1506
1507@lisp
1508(setq case-fold-search nil) ; make searches case sensitive
1509(setq case-fold-search t) ; make searches case insensitive
1510@end lisp
1511
1512@cindex Case sensitivity in replacements
1513@cindex Replacing, and case sensitivity
1514@cindex @code{case-replace}
1515Similarly, for replacing, the variable @code{case-replace} determines
1516whether replacements preserve case.
1517
1518You can also toggle case sensitivity at will in isearch with @kbd{M-c}.
1519
1520To change the case sensitivity just for one major mode, use the major
1521mode's hook. For example:
1522
1523@lisp
1524(add-hook '@var{foo}-mode-hook
1525 (lambda ()
1526 (setq case-fold-search nil)))
1527@end lisp
1528
1529@node Working with unprintable characters, Searching for/replacing newlines, Controlling case sensitivity, Common requests
1463@section How do I search for, delete, or replace unprintable (eight-bit or control) characters? 1530@section How do I search for, delete, or replace unprintable (eight-bit or control) characters?
1464@cindex Unprintable characters, working with 1531@cindex Unprintable characters, working with
1465@cindex Working with unprintable characters 1532@cindex Working with unprintable characters
@@ -1507,65 +1574,7 @@ characters with a colon, use:
1507 1574
1508M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET} 1575M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET}
1509 1576
1510@itemize @bullet 1577@node Searching for/replacing newlines, Yanking text in isearch, Working with unprintable characters, Common requests
1511
1512@item
1513You don't need to quote @key{TAB} with either isearch or typing
1514something in the minibuffer.
1515
1516@end itemize
1517
1518@node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests
1519@section How can I highlight a region of text in Emacs?
1520@cindex Highlighting text
1521@cindex Text, highlighting
1522@cindex @code{transient-mark-mode}
1523@cindex Region, highlighting a
1524
1525You can cause the region to be highlighted when the mark is active by
1526including
1527
1528@lisp
1529(transient-mark-mode t)
1530@end lisp
1531
1532@noindent
1533in your @file{.emacs} file. (Also see @ref{Turning on syntax
1534highlighting}.)
1535
1536@node Controlling case sensitivity, Searching for/replacing newlines, Highlighting a region, Common requests
1537@section How do I control Emacs's case-sensitivity when searching/replacing?
1538@cindex @code{case-fold-search}
1539@cindex Case sensitivity of searches
1540@cindex Searching without case sensitivity
1541@cindex Ignoring case in searches
1542
1543For searching, the value of the variable @code{case-fold-search}
1544determines whether they are case sensitive:
1545
1546@lisp
1547(setq case-fold-search nil) ; make searches case sensitive
1548(setq case-fold-search t) ; make searches case insensitive
1549@end lisp
1550
1551@cindex Case sensitivity in replacements
1552@cindex Replacing, and case sensitivity
1553@cindex @code{case-replace}
1554Similarly, for replacing, the variable @code{case-replace} determines
1555whether replacements preserve case.
1556
1557You can also toggle case sensitivity at will in isearch with @kbd{M-c}.
1558
1559To change the case sensitivity just for one major mode, use the major
1560mode's hook. For example:
1561
1562@lisp
1563(add-hook '@var{foo}-mode-hook
1564 (lambda ()
1565 (setq case-fold-search nil)))
1566@end lisp
1567
1568@node Searching for/replacing newlines, Yanking text in isearch, Controlling case sensitivity, Common requests
1569@section How do I input a newline character in isearch or query-replace? 1578@section How do I input a newline character in isearch or query-replace?
1570@cindex Searching for newlines 1579@cindex Searching for newlines
1571@cindex Replacing newlines 1580@cindex Replacing newlines
@@ -1581,7 +1590,7 @@ Special Input for Incremental Search, emacs}.
1581 1590
1582Use @kbd{M-y}. @inforef{Isearch Yank, Isearch Yanking, emacs}. 1591Use @kbd{M-y}. @inforef{Isearch Yank, Isearch Yanking, emacs}.
1583 1592
1584@node Wrapping words automatically, Spell-checkers, Yanking text in isearch, Common requests 1593@node Wrapping words automatically, Turning on auto-fill by default, Yanking text in isearch, Common requests
1585@section How do I make Emacs wrap words for me? 1594@section How do I make Emacs wrap words for me?
1586@cindex Wrapping word automatically 1595@cindex Wrapping word automatically
1587@cindex Wrapping lines 1596@cindex Wrapping lines
@@ -1595,7 +1604,30 @@ The default maximum line width is 70, determined by the variable
1595@code{fill-column}. To learn how to turn this on automatically, see 1604@code{fill-column}. To learn how to turn this on automatically, see
1596@ref{Turning on auto-fill by default}. 1605@ref{Turning on auto-fill by default}.
1597 1606
1598@node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests 1607@node Turning on auto-fill by default, Spell-checkers, Wrapping words automatically, Common requests
1608@section How do I turn on @code{auto-fill-mode} by default?
1609@cindex @code{auto-fill-mode}, activating automatically
1610@cindex Filling automatically
1611@cindex Automatic entry to @code{auto-fill-mode}
1612
1613To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x
1614auto-fill-mode}.
1615
1616To turn it on for every buffer in a certain mode, you must use the hook
1617for that mode. For example, to turn on @code{auto-fill} mode for all
1618text buffers, including the following in your @file{.emacs} file:
1619
1620@lisp
1621(add-hook 'text-mode-hook 'turn-on-auto-fill)
1622@end lisp
1623
1624If you want @code{auto-fill} mode on in all major modes, do this:
1625
1626@lisp
1627(setq-default auto-fill-function 'do-auto-fill)
1628@end lisp
1629
1630@node Spell-checkers, Checking TeX and *roff documents, Turning on auto-fill by default, Common requests
1599@section Where can I get a better spelling checker for Emacs? 1631@section Where can I get a better spelling checker for Emacs?
1600@cindex Checking spelling 1632@cindex Checking spelling
1601@cindex Spelling, checking text documents 1633@cindex Spelling, checking text documents
@@ -1845,6 +1877,10 @@ In Emacs 21 and later, this is on by default: if the variable
1845automatically scrolls the display horizontally when point moves off the 1877automatically scrolls the display horizontally when point moves off the
1846left or right edge of the window. 1878left or right edge of the window.
1847 1879
1880Note that this is overridden by the variable
1881@code{truncate-partial-width-windows} if that variable is non-nil
1882and the current buffer is not full-frame width.
1883
1848In Emacs 20, use the @code{hscroll-mode}. Here is some information from 1884In Emacs 20, use the @code{hscroll-mode}. Here is some information from
1849the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}: 1885the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}:
1850 1886
@@ -2035,14 +2071,11 @@ parenthesis, it simply inserts a % like normal.
2035to investigate @file{cpp.el}, which is distributed with Emacs. 2071to investigate @file{cpp.el}, which is distributed with Emacs.
2036 2072
2037@node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests 2073@node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests
2038@section Is there an equivalent to the @code{.} (dot) command of vi? 2074@section How do I repeat a command as many times as possible?
2039@cindex Repeating commands as with @code{vi} 2075@cindex Repeating commands many times
2040@cindex Command, repeat last 2076@cindex Commands, repeating many times
2041@cindex @code{.}, equivalent to @code{vi} command 2077@cindex @code{.}, equivalent to @code{vi} command
2042 2078
2043(@code{.} is the redo command in @code{vi}. It redoes the last
2044insertion/deletion.)
2045
2046As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x z}) 2079As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x z})
2047that repeats the last command. If you preface it with a prefix 2080that repeats the last command. If you preface it with a prefix
2048argument, the prefix arg is applied to the command. 2081argument, the prefix arg is applied to the command.
@@ -2054,12 +2087,14 @@ type @kbd{M-p} and @kbd{M-n} (and also up-arrow and down-arrow, if your
2054keyboard has these keys) to scan through all the different complex 2087keyboard has these keys) to scan through all the different complex
2055commands you've typed. 2088commands you've typed.
2056 2089
2057To repeat a set of commands, use keyboard macros. (@inforef{Keyboard 2090To repeat a set of commands, use keyboard macros. Use @kbd{C-x (} and
2058Macros, Keyboard Macros, emacs}.) 2091@kbd{C-x )} to make a keyboard macro that invokes the command and then
2092type @kbd{C-x e}. (@inforef{Keyboard Macros, Keyboard Macros, emacs}.)
2059 2093
2060If you're really desperate for the @code{.} command, use VIPER, a 2094If you're really desperate for the @code{.} command in @code{vi} that
2061@code{vi} emulation mode which comes with Emacs, and which appears to 2095redoes the last insertion/deletion, use VIPER, a @code{vi} emulation
2062support it. (@xref{VIPER}.) 2096mode which comes with Emacs, and which appears to support it.
2097(@xref{VIPER}.)
2063 2098
2064@node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests 2099@node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests
2065@section What are the valid X resource settings (i.e., stuff in .Xdefaults)? 2100@section What are the valid X resource settings (i.e., stuff in .Xdefaults)?
@@ -2158,35 +2193,26 @@ If you are trying to prefix a yanked mail message with @samp{>}, you
2158might want to set the variable @code{mail-yank-prefix}. In Message 2193might want to set the variable @code{mail-yank-prefix}. In Message
2159buffers, you can even use @kbd{M-;} to cite yanked messages (@kbd{M-;} 2194buffers, you can even use @kbd{M-;} to cite yanked messages (@kbd{M-;}
2160runs the function @code{comment-region}, it is a general-purpose 2195runs the function @code{comment-region}, it is a general-purpose
2161mechanism to comment regions). 2196mechanism to comment regions) (@pxref{Changing the included text prefix}).
2162 2197
2163@node Underlining paragraphs, Repeating a command as many times as possible, Inserting text at the beginning of each line, Common requests 2198@node Underlining paragraphs, Forcing the cursor to remain in the same column, Inserting text at the beginning of each line, Common requests
2164@section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph? 2199@section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph?
2165@cindex Underlining a region of text 2200@cindex Underlining a region of text
2166@cindex @code{underline-region} 2201@cindex @code{underline-region}
2167 2202
2168Mark the region and then type @kbd{M-x underline-region @key{RET}}. 2203Mark the region and then type @kbd{M-x underline-region @key{RET}}.
2169 2204
2170@node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests 2205@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Underlining paragraphs, Common requests
2171@section How do I repeat a command as many times as possible?
2172@cindex Repeating commands many times
2173@cindex Commands, repeating many times
2174
2175Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes
2176the command and then type @kbd{M-0 C-x e}.
2177
2178Any messages your command prints in the echo area will be suppressed.
2179
2180If you need to repeat a command a small number of times, you can use
2181@kbd{C-x z} (@pxref{Repeating commands}) or @kbd{C-x e}.
2182
2183@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests
2184@section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short? 2206@section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short?
2185@cindex @code{picture-mode} 2207@cindex @code{picture-mode}
2186@cindex Remaining in the same column, regardless of contents 2208@cindex Remaining in the same column, regardless of contents
2187@cindex Vertical movement in empty documents 2209@cindex Vertical movement in empty documents
2188 2210
2189@kbd{M-x picture-mode}. 2211Use @kbd{M-x picture-mode}.
2212
2213See also the variable @code{track-eol} and the command
2214@code{set-goal-column} bound to @kbd{C-x C-n}
2215(@pxref{Moving Point, , , emacs, The GNU Emacs Manual}).
2190 2216
2191@node Forcing Emacs to iconify itself, Using regular expressions, Forcing the cursor to remain in the same column, Common requests 2217@node Forcing Emacs to iconify itself, Using regular expressions, Forcing the cursor to remain in the same column, Common requests
2192@section How do I tell Emacs to iconify itself? 2218@section How do I tell Emacs to iconify itself?
@@ -2240,8 +2266,8 @@ The ``tags'' feature of Emacs includes the command
2240files mentioned in the @file{TAGS} file. @inforef{Tags Search, Tags Search, 2266files mentioned in the @file{TAGS} file. @inforef{Tags Search, Tags Search,
2241emacs}. 2267emacs}.
2242 2268
2243As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x 2269As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x d})
2244d}) supports the command @code{dired-do-query-replace}, which allows 2270supports the command @code{dired-do-query-replace} (@kbd{Q}), which allows
2245users to replace regular expressions in multiple files. 2271users to replace regular expressions in multiple files.
2246 2272
2247@node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests 2273@node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
@@ -2537,7 +2563,7 @@ PostScript printer, or a PostScript interpreter such as Ghostscript;
2537consult the documentation of the variables @code{ps-printer-name}, 2563consult the documentation of the variables @code{ps-printer-name},
2538@code{ps-lpr-command}, and @code{ps-lpr-switches} for more details. 2564@code{ps-lpr-command}, and @code{ps-lpr-switches} for more details.
2539 2565
2540@node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests 2566@node Scrolling only one line, Editing MS-DOS files, Turning on syntax highlighting, Common requests
2541@section How can I force Emacs to scroll only one line when I move past the bottom of the screen? 2567@section How can I force Emacs to scroll only one line when I move past the bottom of the screen?
2542@cindex Scrolling only one line 2568@cindex Scrolling only one line
2543@cindex Reducing the increment when scrolling 2569@cindex Reducing the increment when scrolling
@@ -2553,32 +2579,7 @@ Alternatively, use the following Lisp form in your @file{.emacs}:
2553(setq scroll-conservatively most-positive-fixnum) 2579(setq scroll-conservatively most-positive-fixnum)
2554@end lisp 2580@end lisp
2555 2581
2556@node Replacing highlighted text, Editing MS-DOS files, Scrolling only one line, Common requests 2582@node Editing MS-DOS files, Filling paragraphs with a single space, Scrolling only one line, Common requests
2557@section How can I replace highlighted text with what I type?
2558@cindex @code{delete-selection-mode}
2559@cindex Replacing highlighted text
2560@cindex Highlighting and replacing text
2561
2562Use @code{delete-selection-mode}, which you can start automatically by
2563placing the following Lisp form in your @file{.emacs} file:
2564
2565@lisp
2566(delete-selection-mode 1)
2567@end lisp
2568
2569According to the documentation string for @code{delete-selection-mode}
2570(which you can read using @kbd{M-x describe-function @key{RET}
2571delete-selection-mode @key{RET}}):
2572
2573@quotation
2574When ON, typed text replaces the selection if the selection is active.
2575When OFF, typed text is just inserted at point.
2576@end quotation
2577
2578This mode also allows you to delete (not kill) the highlighted region by
2579pressing @key{DEL}.
2580
2581@node Editing MS-DOS files, Filling paragraphs with a single space, Replacing highlighted text, Common requests
2582@section How can I edit MS-DOS files using Emacs? 2583@section How can I edit MS-DOS files using Emacs?
2583@cindex Editing MS-DOS files 2584@cindex Editing MS-DOS files
2584@cindex MS-DOS files, editing 2585@cindex MS-DOS files, editing
@@ -2601,7 +2602,7 @@ If you are running a version of Emacs before 20.1, get @code{crypt++}
2601and saved, allowing you to ignore the different conventions that Unix 2602and saved, allowing you to ignore the different conventions that Unix
2602and MS-DOS have for delineating the end of a line. 2603and MS-DOS have for delineating the end of a line.
2603 2604
2604@node Filling paragraphs with a single space, Escape sequences in shell output, Editing MS-DOS files, Common requests 2605@node Filling paragraphs with a single space, Escape sequences in shell output, Editing MS-DOS files, Common requests
2605@section How can I tell Emacs to fill paragraphs with a single space after each period? 2606@section How can I tell Emacs to fill paragraphs with a single space after each period?
2606@cindex One space following periods 2607@cindex One space following periods
2607@cindex Single space following periods 2608@cindex Single space following periods
@@ -2613,7 +2614,7 @@ Add the following line to your @file{.emacs} file:
2613(setq sentence-end-double-space nil) 2614(setq sentence-end-double-space nil)
2614@end lisp 2615@end lisp
2615 2616
2616@node Escape sequences in shell output, , Filling paragraphs with a single space, Common requests 2617@node Escape sequences in shell output, , Filling paragraphs with a single space, Common requests
2617@section Why these strange escape sequences from @code{ls} from the Shell mode? 2618@section Why these strange escape sequences from @code{ls} from the Shell mode?
2618@cindex Escape sequences in @code{ls} output 2619@cindex Escape sequences in @code{ls} output
2619@cindex @code{ls} in Shell mode 2620@cindex @code{ls} in Shell mode
@@ -3478,7 +3479,8 @@ the @file{ell} package}.
3478 3479
3479Many authors post their packages to the @uref{news:gnu.emacs.sources, 3480Many authors post their packages to the @uref{news:gnu.emacs.sources,
3480Emacs sources newsgroup}. You can search the archives of this 3481Emacs sources newsgroup}. You can search the archives of this
3481group with @uref{http://groups.google.com, Google}, for example. 3482group with @uref{http://groups.google.com/group/gnu.emacs.sources, Google},
3483or @uref{http://dir.gmane.org/gmane.emacs.sources, Gmane}, for example.
3482 3484
3483Several packages are stored in 3485Several packages are stored in
3484@uref{http://emacswiki.org/elisp/, the Lisp area of the Emacs Wiki}. 3486@uref{http://emacswiki.org/elisp/, the Lisp area of the Emacs Wiki}.
@@ -3489,6 +3491,9 @@ although you can still access the old files at
3489 3491
3490@uref{ftp://ftp.cis.ohio-state.edu/pub/emacs-lisp/WWW/index.html} 3492@uref{ftp://ftp.cis.ohio-state.edu/pub/emacs-lisp/WWW/index.html}
3491 3493
3494Read the file @file{etc/MORE.STUFF} for more information about
3495external packages.
3496
3492@node Current GNU distributions, Difference between Emacs and XEmacs, Packages that do not come with Emacs, Finding Emacs and related packages 3497@node Current GNU distributions, Difference between Emacs and XEmacs, Packages that do not come with Emacs, Finding Emacs and related packages
3493@section Where can I get other up-to-date GNU stuff? 3498@section Where can I get other up-to-date GNU stuff?
3494@cindex Current GNU distributions 3499@cindex Current GNU distributions
@@ -3715,7 +3720,7 @@ Beginning with version 22.1, Emacs supports Mac OS X natively.
3715Up-to-date information about GNU software (including Emacs) for VMS is 3720Up-to-date information about GNU software (including Emacs) for VMS is
3716available at @uref{http://vms.gnu.org/}. 3721available at @uref{http://vms.gnu.org/}.
3717 3722
3718@node Modes for various languages, , Emacs for VMS and DECwindows, Finding Emacs and related packages 3723@node Modes for various languages, , Emacs for VMS and DECwindows, Finding Emacs and related packages
3719@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk? 3724@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk?
3720@cindex Awk, mode for 3725@cindex Awk, mode for
3721@cindex @code{awk-mode} 3726@cindex @code{awk-mode}
@@ -4782,7 +4787,7 @@ xmodmap -e 'remove mod1 = Mode_switch'
4782This will disable the use of the extra keysyms systemwide, which may be 4787This will disable the use of the extra keysyms systemwide, which may be
4783undesirable if you actually intend to use them. 4788undesirable if you actually intend to use them.
4784 4789
4785@node SPC no longer completes file names, , ExtendChar key does not work as Meta, Key bindings 4790@node SPC no longer completes file names, , ExtendChar key does not work as Meta, Key bindings
4786@section Why doesn't SPC complete file names anymore? 4791@section Why doesn't SPC complete file names anymore?
4787@cindex @kbd{SPC} file name completion 4792@cindex @kbd{SPC} file name completion
4788 4793
diff --git a/man/org.texi b/man/org.texi
index cf0881ff3ff..ecb3480efa1 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -4,8 +4,8 @@
4@setfilename ../info/org 4@setfilename ../info/org
5@settitle Org Mode Manual 5@settitle Org Mode Manual
6 6
7@set VERSION 4.04 7@set VERSION 4.06
8@set DATE January 2006 8@set DATE February 2006
9 9
10@dircategory Emacs 10@dircategory Emacs
11@direntry 11@direntry
@@ -35,7 +35,7 @@
35@copying 35@copying
36This manual is for Org-mode (version @value{VERSION}). 36This manual is for Org-mode (version @value{VERSION}).
37 37
38Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation, Inc. 38Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation
39 39
40@quotation 40@quotation
41Permission is granted to copy, distribute and/or modify this document 41Permission is granted to copy, distribute and/or modify this document
@@ -126,12 +126,17 @@ Calculations in tables
126 126
127Hyperlinks 127Hyperlinks
128 128
129* Internal Links:: CamelCaseWords as internal links 129* Internal Links:: Links to other places in the current file
130* External Links:: URL-like links to the world 130* External Links:: URL-like links to the world
131* Managing links:: Creating, inserting and following 131* Managing links:: Creating, inserting and following
132* Search Options:: Linking to a specific location 132* Search Options:: Linking to a specific location
133* Remember:: Org-trees store quick notes 133* Remember:: Org-trees store quick notes
134 134
135Internal Links
136
137* Radio targets:: Make targets trigger links in plain text.
138* CamelCase links:: Activating CamelCase words as links
139
135TODO items 140TODO items
136 141
137* TODO basics:: Marking and displaying TODO entries 142* TODO basics:: Marking and displaying TODO entries
@@ -155,12 +160,12 @@ Agenda Views
155* Agenda files:: Files being searched for agenda information 160* Agenda files:: Files being searched for agenda information
156* Agenda dispatcher:: Keyboard access to agenda views 161* Agenda dispatcher:: Keyboard access to agenda views
157* Weekly/Daily Agenda:: The calendar page with current tasks 162* Weekly/Daily Agenda:: The calendar page with current tasks
158* Global TODO list:: All infinished action items 163* Global TODO list:: All unfinished action items
159* Matching headline tags:: Structured information with fine-tuned search 164* Matching headline tags:: Structured information with fine-tuned search
160* Timeline:: Time-sorted view for single file 165* Timeline:: Time-sorted view for single file
161* Agenda commands:: Remote editing of org trees 166* Agenda commands:: Remote editing of org trees
162 167
163Weekly/Daily Agenda 168The weekly/daily agenda
164 169
165* Categories:: Not all tasks are equal 170* Categories:: Not all tasks are equal
166* Time-of-day specifications:: How the agenda knows the time 171* Time-of-day specifications:: How the agenda knows the time
@@ -1314,7 +1319,8 @@ example in mail mode, use
1314 1319
1315Complex ASCII tables with automatic line wrapping, column- and 1320Complex ASCII tables with automatic line wrapping, column- and
1316row-spanning, and alignment can be created using the Emacs table 1321row-spanning, and alignment can be created using the Emacs table
1317package by Takaaki Ota (@uref{http://sourceforge.net/projects/table}). 1322package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
1323and also part of Emacs 22).
1318When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode 1324When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org-mode
1319will call @command{table-recognize-table} and move the cursor into the 1325will call @command{table-recognize-table} and move the cursor into the
1320table. Inside a table, the keymap of Org-mode is inactive. In order 1326table. Inside a table, the keymap of Org-mode is inactive. In order
@@ -1343,7 +1349,7 @@ Just like HMTL, Org-mode provides links inside a file, and external
1343links to other files, Usenet articles, emails and much more. 1349links to other files, Usenet articles, emails and much more.
1344 1350
1345@menu 1351@menu
1346* Internal Links:: CamelCaseWords as internal links 1352* Internal Links:: Links to other places in the current file
1347* External Links:: URL-like links to the world 1353* External Links:: URL-like links to the world
1348* Managing links:: Creating, inserting and following 1354* Managing links:: Creating, inserting and following
1349* Search Options:: Linking to a specific location 1355* Search Options:: Linking to a specific location
@@ -1356,44 +1362,73 @@ links to other files, Usenet articles, emails and much more.
1356@cindex links, internal 1362@cindex links, internal
1357@cindex CamelCase links 1363@cindex CamelCase links
1358 1364
1359Similar to Wiki implementations, Org-mode interprets words spelled in 1365Strings inside double brackets like @samp{[[My Target]]} are links
1360CamelCase (i.e. mixed case with at least one capital letter following 1366that lead to a text search in the current file. The link can be
1361on a small letter inside the word) as links. While in Wiki these 1367followed with @kbd{C-c C-o} or with a mouse click (@pxref{Managing
1362links usually point to another file, in Org-mode they point to a 1368links}). The preferred match for such a link is a dedicated target:
1363target in the current file. Targets are CamelCased words in double 1369The same string in double angular brackets. Targets may be located
1364angular brackets, and may be located anywhere, also in a comment line. 1370anywhere, often it is convenient to put them into a comment line, for
1365For example 1371example
1366@example 1372@example
1367# <<MyTarget>> 1373# <<My Target>>
1368@end example 1374@end example
1369 1375
1370Each occurrence of @samp{MyTarget} in the file is an active link that 1376If no dedicated target exists, Org-mode will search for the words in
1371can be followed with @kbd{C-c C-o} or with a mouse click 1377the link, in the above example for @samp{my target}. Links starting
1372(@pxref{Managing links}). If no dedicated target exists, org-mode will 1378with a star like @samp{*My Target} restrict the search to headlines.
1373search for the words in the link separated by white space, in the 1379When searching, Org-mode will first try an exact match, but then move
1374above example for @samp{my target}. If the link starts with a star 1380on to more and more lenient searches. For example, the link
1375like @samp{*MyTarget}, the search is restricted to headlines. 1381@samp{[[*My Targets]]} will find any of the following
1376Org-mode will first try an exact match of a full headline, but then
1377move on to more and more lenient searches. The link @samp{*MyTargets}
1378will find any of the following
1379@example 1382@example
1380** My targets 1383** My targets
1381** TODO my targets are bright 1384** TODO my targets are bright
1382** my 20 targets are 1385** my 20 targets are
1383@end example 1386@end example
1387It is therefore often not necessary to set a dedicated target. To
1388insert a link targeting a headline, in-buffer completion can be used.
1389Just type a star followed by a few optional letters into the buffer
1390and press @kbd{M-@key{TAB}}. All headlines in the current buffer will
1391be offered as completions. @xref{Managing links}, for more commands
1392creating links.
1393
1394Following a link pushes a mark onto Org-mode's own mark ring. You can
1395return to the previous position with @kbd{C-c &}. Using this command
1396several times in direct succession goes back to positions recorded
1397earlier.
1398
1399@menu
1400* Radio targets:: Make targets trigger links in plain text.
1401* CamelCase links:: Activating CamelCase words as links
1402@end menu
1403
1404@node Radio targets, CamelCase links, Internal Links, Internal Links
1405@subsection Radio targets
1406
1407You can configure Org-mode to link any occurrences of certain target
1408names in normal text. So without explicitly creating a link, the text
1409connects to the target radioing its position. Radio targets are
1410enclosed by triple angular brackets. For example, a target
1411@samp{<<<My Target>>>} causes each occurrence of @samp{my target} in
1412normal text to become activated as a link. The Org-mode file is
1413scanned automatically for radio targets only when the file is first
1414loaded into Emacs. To update the target list during editing, press
1415@kbd{C-c C-c} with the cursor on or at a target.
1416
1417@node CamelCase links, , Radio targets, Internal Links
1418@subsection CamelCase words as links
1384@cindex completion, of CamelCase links 1419@cindex completion, of CamelCase links
1385@cindex CamelCase links, completion of 1420@cindex CamelCase links, completion of
1386It is therefore often not even necessary to set a dedicated target. 1421
1387The link will automatically find a target. If you want to see what 1422As an alternative to @samp{[[...]]} links, Org-mode also supports
1388lines in the current buffer are matched by a given CamelCase link, 1423CamelCase words as links. This feature is not turned on by default
1389open the link with @kbd{C-u C-c C-o}. Even if there are several 1424because of the occasional inconsistencies this system suffers from.
1390matches, org-mode will usually find the right one since it tries 1425To activate CamelCase words as links, and to make headline completion
1391targets and exact matches first. To insert links targeting a 1426offer CamelCase version of headlines, the following customization is
1392headline, in-buffer completion can be used. Just type a star followed 1427needed:
1393by a few optional letters into the buffer and press @kbd{M-@key{TAB}}. 1428@lisp
1394CamelCased versions of all headlines in the current buffer will be 1429(setq org-activate-camels t
1395offered as completions. @xref{Managing links}, for more commands 1430 org-file-link-context-use-camel-case t)
1396creating links. 1431@end lisp
1397 1432
1398@node External Links, Managing links, Internal Links, Hyperlinks 1433@node External Links, Managing links, Internal Links, Hyperlinks
1399@section External Links 1434@section External Links
@@ -1407,6 +1442,7 @@ creating links.
1407@cindex VM links 1442@cindex VM links
1408@cindex RMAIL links 1443@cindex RMAIL links
1409@cindex WANDERLUST links 1444@cindex WANDERLUST links
1445@cindex MH-E links
1410@cindex USENET links 1446@cindex USENET links
1411@cindex SHELL links 1447@cindex SHELL links
1412 1448
@@ -1426,6 +1462,8 @@ shows examples for each link type.
1426<vm://myself@@some.where.org/folder#id> @r{VM on remote machine} 1462<vm://myself@@some.where.org/folder#id> @r{VM on remote machine}
1427<wl:folder> @r{WANDERLUST folder link} 1463<wl:folder> @r{WANDERLUST folder link}
1428<wl:folder#id> @r{WANDERLUST message link} 1464<wl:folder#id> @r{WANDERLUST message link}
1465<mhe:folder> @r{MH-E folder link}
1466<mhe:folder#id> @r{MH-E message link}
1429<rmail:folder> @r{RMAIL folder link} 1467<rmail:folder> @r{RMAIL folder link}
1430<rmail:folder#id> @r{RMAIL message link} 1468<rmail:folder#id> @r{RMAIL message link}
1431<gnus:group> @r{GNUS group link} 1469<gnus:group> @r{GNUS group link}
@@ -1458,7 +1496,7 @@ VM, RMAIL, WANDERLUST, GNUS and BBDB buffers, the link will point to
1458the current article/entry. For W3 and W3M buffer, the link goes to 1496the current article/entry. For W3 and W3M buffer, the link goes to
1459the current URL. For Org-mode files, the current headline is 1497the current URL. For Org-mode files, the current headline is
1460targeted. For any other files, the link will point to the file, with 1498targeted. For any other files, the link will point to the file, with
1461a CamelCase (@pxref{Search Options}) search string pointing to the 1499a search string (@pxref{Search Options}) pointing to the
1462contents of the current line. If there is an active region, the 1500contents of the current line. If there is an active region, the
1463selected words will form the basis of the search string. The key 1501selected words will form the basis of the search string. The key
1464binding @kbd{C-c l} is only a suggestion - see @ref{Installation and 1502binding @kbd{C-c l} is only a suggestion - see @ref{Installation and
@@ -1510,6 +1548,20 @@ On links, @kbd{mouse-2} will open the link just like @kbd{C-c C-o} would.
1510@kindex mouse-3 1548@kindex mouse-3
1511@item mouse-3 1549@item mouse-3
1512Like @kbd{mouse-2}, but force file links to be opened with Emacs. 1550Like @kbd{mouse-2}, but force file links to be opened with Emacs.
1551
1552@cindex mark ring
1553@kindex C-c %
1554@item C-c %
1555Push the current position onto the mark ring, to be able to return
1556easily. Commands following an internal link do this automatically.
1557
1558@cindex links, returning to
1559@kindex C-c &
1560@item C-c &
1561Jump back to a recorded position. A position is recorded by the
1562commands following internal links, and by @kbd{C-c %}. Using this
1563command several times in direct succession moves through a ring of
1564previously recorded positions.
1513@end table 1565@end table
1514 1566
1515 1567
@@ -1525,8 +1577,8 @@ compatibility, line numbers can also follow a single colon.} colon.
1525For example: 1577For example:
1526@example 1578@example
1527<file:~/code/main.c::255> 1579<file:~/code/main.c::255>
1528<file:~/xx.org::MyTarget> 1580<file:~/xx.org::My Target>
1529<file:~/xx.org::find me> 1581<file:~/xx.org::*My Target>
1530<file:~/xx.org::/regexp/> 1582<file:~/xx.org::/regexp/>
1531@end example 1583@end example
1532@noindent Here is what these options do. 1584@noindent Here is what these options do.
@@ -1534,12 +1586,12 @@ For example:
1534@table @code 1586@table @code
1535@item 255 1587@item 255
1536Jump to line 255. 1588Jump to line 255.
1537@item MyGoal 1589@item My Target
1538Search for a link target with name MyGoal, or do a text search for 1590Search for a link target @samp{<<My Target>>}, or do a text search for
1539@samp{my target}, similar to the CamelCase search in internal links, 1591@samp{my target}, similar to the search in internal links, see
1540see @ref{Internal Links}. 1592@ref{Internal Links}.
1541@item find me 1593@item *My Target
1542Do a normal text search for the text @samp{find me}. 1594In an Org-mode file, restrict search to headlines.
1543@item /regexp/ 1595@item /regexp/
1544Do a regular expression search for @code{regexp}. This uses the Emacs 1596Do a regular expression search for @code{regexp}. This uses the Emacs
1545command @code{occur} to list all matches in a separate window. If the 1597command @code{occur} to list all matches in a separate window. If the
@@ -1549,10 +1601,10 @@ sparse tree with the matches.
1549@c @code{grep} will be used to search all files in the directory. 1601@c @code{grep} will be used to search all files in the directory.
1550@end table 1602@end table
1551 1603
1552To use the search options also for a search in the current file, a 1604As a degenerate case, a file link with an empty file name can be used
1553file link with an empty file name can be used. For example, 1605to search the current file. For example, @code{<file:::find me>} does
1554@code{<file:::find me>} does a search for @samp{find me} in the 1606a search for @samp{find me} in the current file, just like
1555current file. 1607@samp{[[find me]]} would.
1556 1608
1557@node Remember, , Search Options, Hyperlinks 1609@node Remember, , Search Options, Hyperlinks
1558@section Remember 1610@section Remember
@@ -3248,6 +3300,8 @@ Org-mode would not be what it is without your input.
3248 3300
3249@itemize @bullet 3301@itemize @bullet
3250@item 3302@item
3303Thomas Baumann contributed the code for links to the MH-E email system.
3304@item
3251Pavel Chalmoviansky reported bugs and suggested improvements 3305Pavel Chalmoviansky reported bugs and suggested improvements
3252related to the agenda treatment of items with specified time. 3306related to the agenda treatment of items with specified time.
3253@item 3307@item
@@ -3267,7 +3321,7 @@ Emacs-Lisp compiler happy.
3267Tim O'Callaghan suggested in-file links, search options for 3321Tim O'Callaghan suggested in-file links, search options for
3268general file links, and TAGS. 3322general file links, and TAGS.
3269@item 3323@item
3270Oliver Oppitz made useful suggestions. 3324Oliver Oppitz suggested multi-state TODO items.
3271@item 3325@item
3272Pete Phillips helped the development of the TAGS feature with beta 3326Pete Phillips helped the development of the TAGS feature with beta
3273testing and suggestions. 3327testing and suggestions.
@@ -3289,8 +3343,8 @@ Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
3289Juergen Vollmer contributed code generating the table of contents 3343Juergen Vollmer contributed code generating the table of contents
3290in HTML output, and other export improvements. 3344in HTML output, and other export improvements.
3291@item 3345@item
3292David Wainberg suggested to implement an archiving mechanism and helped 3346David Wainberg suggested the archiving mechanism and shaped the
3293testing. 3347internal link system with many suggestions and ideas.
3294@item 3348@item
3295Scheduling TODO items was inspired by John Wiegley's @file{planner.el}. 3349Scheduling TODO items was inspired by John Wiegley's @file{planner.el}.
3296@item 3350@item
diff --git a/man/reftex.texi b/man/reftex.texi
index 890d5b5064d..a32a0aff543 100644
--- a/man/reftex.texi
+++ b/man/reftex.texi
@@ -7,9 +7,9 @@
7@syncodeindex fn cp 7@syncodeindex fn cp
8 8
9@c Version and Contact Info 9@c Version and Contact Info
10@set VERSION 4.30 10@set VERSION 4.31
11@set EDITION 4.30 11@set EDITION 4.31
12@set DATE September 2005 12@set DATE February 2006
13@set AUCTEXSITE @uref{http://www.nongnu.org/auctex/,AUCTeX distribution site} 13@set AUCTEXSITE @uref{http://www.nongnu.org/auctex/,AUCTeX distribution site}
14@set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/,maintainers webpage} 14@set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/,maintainers webpage}
15@set MAINTAINER Carsten Dominik 15@set MAINTAINER Carsten Dominik
@@ -25,8 +25,7 @@ citations and indices for LaTeX documents with Emacs.
25This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for 25This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for
26@b{Ref@TeX{}} @value{VERSION} 26@b{Ref@TeX{}} @value{VERSION}
27 27
28Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 28Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
29 2006 Free Software Foundation, Inc.
30 29
31@quotation 30@quotation
32Permission is granted to copy, distribute and/or modify this document 31Permission is granted to copy, distribute and/or modify this document
diff --git a/src/ChangeLog b/src/ChangeLog
index 2547e146e46..829ca27c585 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,43 @@
12006-02-23 Zhang Wei <id.brep@gmail.com> (tiny change)
2
3 * xfns.c (Fx_file_dialog): Return a decoded file name.
4
52006-02-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6
7 * dispnew.c (update_text_area): Avoid needless redraw of rightmost
8 glyph whose face is extended to the text area end.
9
10 * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control
11 values if control is not visible or values are not changed.
12
132006-02-22 Stefan Monnier <monnier@iro.umontreal.ca>
14
15 * window.c (Fwindow_list): Check `window' before doing XWINDOW.
16 The default `window' should not be "on a different frame".
17
182006-02-22 Kim F. Storm <storm@cua.dk>
19
20 * indent.c (Fvertical_motion): Only try to move back if we can.
21
222006-02-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23
24 * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member
25 n_clip_rects.
26
27 * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for
28 xmenu.c.
29
30 * macterm.c (GC_CLIP_REGION): Remove macro.
31 (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION.
32 All uses changed. Don't do clipping if n_clip_rects is zero.
33 (mac_set_clip_rectangles): Use xassert instead of abort.
34 Set n_clip_rects. Don't make clip_region empty when number of
35 clipping rectangles is zero.
36 (mac_reset_clip_rectangles): Set n_clip_rects directly instead of
37 calling mac_set_clip_rectangles.
38 (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to
39 avoid multiple redraws.
40
12006-02-22 Kim F. Storm <storm@cua.dk> 412006-02-22 Kim F. Storm <storm@cua.dk>
2 42
3 * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display. 43 * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display.
@@ -22,8 +62,8 @@
22 BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero. 62 BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero.
23 (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH. 63 (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH.
24 [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from 64 [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from
25 mac_draw_string_cg. New arg BG_WIDTH. All uses changed. Draw 65 mac_draw_string_cg. New arg BG_WIDTH. All uses changed.
26 background if BG_WIDTH is not zero. Use float constants as 66 Draw background if BG_WIDTH is not zero. Use float constants as
27 divisors instead of double. Use alloca instead of xmalloc/xfree. 67 divisors instead of double. Use alloca instead of xmalloc/xfree.
28 (x_draw_glyph_string_background, x_draw_glyph_string_foreground) 68 (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
29 [!MAC_OS8 || USE_ATSUI]: Background may be drawn using 69 [!MAC_OS8 || USE_ATSUI]: Background may be drawn using
@@ -34,6 +74,11 @@
34 (mac_set_clip_rectangles): When resetting clip region, make it 74 (mac_set_clip_rectangles): When resetting clip region, make it
35 empty instead of disposing of it. 75 empty instead of disposing of it.
36 76
772006-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
78
79 * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
80 Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8).
81
372006-02-20 Kim F. Storm <storm@cua.dk> 822006-02-20 Kim F. Storm <storm@cua.dk>
38 83
39 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. 84 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
@@ -59,10 +104,10 @@
59 (left_curly_arrow_bits): Rename from continuation_bits. 104 (left_curly_arrow_bits): Rename from continuation_bits.
60 (right_curly_arrow_bits): Rename from continued_bits. 105 (right_curly_arrow_bits): Rename from continued_bits.
61 (left_triangle_bits): Rename from ov_bits. 106 (left_triangle_bits): Rename from ov_bits.
62 (right_triangle_bits): Added. 107 (right_triangle_bits): Add.
63 (filled_rectangle_bits): Rename from filled_box_cursor_bits. 108 (filled_rectangle_bits): Rename from filled_box_cursor_bits.
64 (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. 109 (hollow_rectangle_bits): Rename from hollow_box_cursor_bits.
65 (filled_square_bits): Added. 110 (filled_square_bits): Add.
66 (vertical_bar_bits): Rename from bar_cursor_bits. 111 (vertical_bar_bits): Rename from bar_cursor_bits.
67 (horizontal_bar_bits): Rename from hbar_cursor_bits. 112 (horizontal_bar_bits): Rename from hbar_cursor_bits.
68 (empty_line_bits): Rename from zv_bits. 113 (empty_line_bits): Rename from zv_bits.
diff --git a/src/dispnew.c b/src/dispnew.c
index 18f949ebe2d..999877001d2 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4344,10 +4344,14 @@ update_text_area (w, vpos)
4344 int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; 4344 int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p;
4345 int desired_stop_pos = desired_row->used[TEXT_AREA]; 4345 int desired_stop_pos = desired_row->used[TEXT_AREA];
4346 4346
4347 /* If the desired row extends its face to the text area end, 4347 /* If the desired row extends its face to the text area end, and
4348 unless the current row also does so at the same position,
4348 make sure we write at least one glyph, so that the face 4349 make sure we write at least one glyph, so that the face
4349 extension actually takes place. */ 4350 extension actually takes place. */
4350 if (MATRIX_ROW_EXTENDS_FACE_P (desired_row)) 4351 if (MATRIX_ROW_EXTENDS_FACE_P (desired_row)
4352 && (desired_stop_pos < current_row->used[TEXT_AREA]
4353 || (desired_stop_pos == current_row->used[TEXT_AREA]
4354 && !MATRIX_ROW_EXTENDS_FACE_P (current_row))))
4351 --desired_stop_pos; 4355 --desired_stop_pos;
4352 4356
4353 stop = min (current_row->used[TEXT_AREA], desired_stop_pos); 4357 stop = min (current_row->used[TEXT_AREA], desired_stop_pos);
@@ -4466,7 +4470,10 @@ update_text_area (w, vpos)
4466 has to be cleared, if and only if we did a write_glyphs 4470 has to be cleared, if and only if we did a write_glyphs
4467 above. This is made sure by setting desired_stop_pos 4471 above. This is made sure by setting desired_stop_pos
4468 appropriately above. */ 4472 appropriately above. */
4469 xassert (i < desired_row->used[TEXT_AREA]); 4473 xassert (i < desired_row->used[TEXT_AREA]
4474 || ((desired_row->used[TEXT_AREA]
4475 == current_row->used[TEXT_AREA])
4476 && MATRIX_ROW_EXTENDS_FACE_P (current_row)));
4470 } 4477 }
4471 else if (MATRIX_ROW_EXTENDS_FACE_P (current_row)) 4478 else if (MATRIX_ROW_EXTENDS_FACE_P (current_row))
4472 { 4479 {
diff --git a/src/indent.c b/src/indent.c
index 22b6fc37669..ae28fa3791d 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2107,7 +2107,8 @@ whether or not it is currently displayed in some window. */)
2107 it.vpos = 0; 2107 it.vpos = 0;
2108 /* Do this even if LINES is 0, so that we move back 2108 /* Do this even if LINES is 0, so that we move back
2109 to the beginning of the current line as we ought. */ 2109 to the beginning of the current line as we ought. */
2110 move_it_by_lines (&it, XINT (lines), 0); 2110 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
2111 move_it_by_lines (&it, XINT (lines), 0);
2111 2112
2112 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2113 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2113 } 2114 }
diff --git a/src/macgui.h b/src/macgui.h
index cfe35e82945..a84fea1ae91 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -217,13 +217,13 @@ typedef struct _XGC
217 RGBColor back_color; 217 RGBColor back_color;
218 218
219#define MAX_CLIP_RECTS 2 219#define MAX_CLIP_RECTS 2
220 /* QuickDraw clipping region. */ 220 /* Number of clipping rectangles. */
221 int n_clip_rects;
222
223 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */
221 RgnHandle clip_region; 224 RgnHandle clip_region;
222 225
223#if defined (MAC_OSX) && USE_ATSUI 226#if defined (MAC_OSX) && USE_ATSUI
224 /* Number of clipping rectangles used in Quartz 2D drawing. */
225 int n_clip_rects;
226
227 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate 227 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
228 is in QuickDraw's. */ 228 is in QuickDraw's. */
229 CGRect clip_rects[MAX_CLIP_RECTS]; 229 CGRect clip_rects[MAX_CLIP_RECTS];
diff --git a/src/macmenu.c b/src/macmenu.c
index fccbbe6402c..8cce41114de 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1257,8 +1257,11 @@ digest_single_submenu (start, end, top_level_items)
1257 wv->enabled = 1; 1257 wv->enabled = 1;
1258 wv->button_type = BUTTON_TYPE_NONE; 1258 wv->button_type = BUTTON_TYPE_NONE;
1259 wv->help = Qnil; 1259 wv->help = Qnil;
1260 save_wv = wv;
1260 } 1261 }
1261 save_wv = wv; 1262 else
1263 save_wv = first_wv;
1264
1262 prev_wv = 0; 1265 prev_wv = 0;
1263 i += MENU_ITEMS_PANE_LENGTH; 1266 i += MENU_ITEMS_PANE_LENGTH;
1264 } 1267 }
diff --git a/src/macterm.c b/src/macterm.c
index 78ea90bfc8b..5f7c5dac637 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -269,14 +269,13 @@ extern void menubar_selection_callback (FRAME_PTR, int);
269#define GC_FORE_COLOR(gc) (&(gc)->fore_color) 269#define GC_FORE_COLOR(gc) (&(gc)->fore_color)
270#define GC_BACK_COLOR(gc) (&(gc)->back_color) 270#define GC_BACK_COLOR(gc) (&(gc)->back_color)
271#define GC_FONT(gc) ((gc)->xgcv.font) 271#define GC_FONT(gc) ((gc)->xgcv.font)
272#define GC_CLIP_REGION(gc) ((gc)->clip_region)
273#define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) 272#define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc)
274 273
275static RgnHandle saved_port_clip_region = NULL; 274static RgnHandle saved_port_clip_region = NULL;
276 275
277static void 276static void
278mac_begin_clip (region) 277mac_begin_clip (gc)
279 RgnHandle region; 278 GC gc;
280{ 279{
281 static RgnHandle new_region = NULL; 280 static RgnHandle new_region = NULL;
282 281
@@ -285,19 +284,19 @@ mac_begin_clip (region)
285 if (new_region == NULL) 284 if (new_region == NULL)
286 new_region = NewRgn (); 285 new_region = NewRgn ();
287 286
288 if (region && !EmptyRgn (region)) 287 if (gc->n_clip_rects)
289 { 288 {
290 GetClip (saved_port_clip_region); 289 GetClip (saved_port_clip_region);
291 SectRgn (saved_port_clip_region, region, new_region); 290 SectRgn (saved_port_clip_region, gc->clip_region, new_region);
292 SetClip (new_region); 291 SetClip (new_region);
293 } 292 }
294} 293}
295 294
296static void 295static void
297mac_end_clip (region) 296mac_end_clip (gc)
298 RgnHandle region; 297 GC gc;
299{ 298{
300 if (region && !EmptyRgn (region)) 299 if (gc->n_clip_rects)
301 SetClip (saved_port_clip_region); 300 SetClip (saved_port_clip_region);
302} 301}
303 302
@@ -325,10 +324,10 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
325 324
326 RGBForeColor (GC_FORE_COLOR (gc)); 325 RGBForeColor (GC_FORE_COLOR (gc));
327 326
328 mac_begin_clip (GC_CLIP_REGION (gc)); 327 mac_begin_clip (gc);
329 MoveTo (x1, y1); 328 MoveTo (x1, y1);
330 LineTo (x2, y2); 329 LineTo (x2, y2);
331 mac_end_clip (GC_CLIP_REGION (gc)); 330 mac_end_clip (gc);
332} 331}
333 332
334void 333void
@@ -369,9 +368,9 @@ mac_erase_rectangle (f, gc, x, y, width, height)
369 RGBBackColor (GC_BACK_COLOR (gc)); 368 RGBBackColor (GC_BACK_COLOR (gc));
370 SetRect (&r, x, y, x + width, y + height); 369 SetRect (&r, x, y, x + width, y + height);
371 370
372 mac_begin_clip (GC_CLIP_REGION (gc)); 371 mac_begin_clip (gc);
373 EraseRect (&r); 372 EraseRect (&r);
374 mac_end_clip (GC_CLIP_REGION (gc)); 373 mac_end_clip (gc);
375 374
376 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 375 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
377} 376}
@@ -434,7 +433,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
434 RGBBackColor (GC_BACK_COLOR (gc)); 433 RGBBackColor (GC_BACK_COLOR (gc));
435 SetRect (&r, x, y, x + width, y + height); 434 SetRect (&r, x, y, x + width, y + height);
436 435
437 mac_begin_clip (GC_CLIP_REGION (gc)); 436 mac_begin_clip (gc);
438#if TARGET_API_MAC_CARBON 437#if TARGET_API_MAC_CARBON
439 { 438 {
440 CGrafPtr port; 439 CGrafPtr port;
@@ -449,7 +448,7 @@ mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p)
449 CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r, 448 CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r,
450 overlay_p ? srcOr : srcCopy, 0); 449 overlay_p ? srcOr : srcCopy, 0);
451#endif /* not TARGET_API_MAC_CARBON */ 450#endif /* not TARGET_API_MAC_CARBON */
452 mac_end_clip (GC_CLIP_REGION (gc)); 451 mac_end_clip (gc);
453 452
454 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 453 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
455} 454}
@@ -581,9 +580,9 @@ mac_fill_rectangle (f, gc, x, y, width, height)
581 RGBForeColor (GC_FORE_COLOR (gc)); 580 RGBForeColor (GC_FORE_COLOR (gc));
582 SetRect (&r, x, y, x + width, y + height); 581 SetRect (&r, x, y, x + width, y + height);
583 582
584 mac_begin_clip (GC_CLIP_REGION (gc)); 583 mac_begin_clip (gc);
585 PaintRect (&r); /* using foreground color of gc */ 584 PaintRect (&r); /* using foreground color of gc */
586 mac_end_clip (GC_CLIP_REGION (gc)); 585 mac_end_clip (gc);
587} 586}
588 587
589 588
@@ -603,9 +602,9 @@ mac_draw_rectangle (f, gc, x, y, width, height)
603 RGBForeColor (GC_FORE_COLOR (gc)); 602 RGBForeColor (GC_FORE_COLOR (gc));
604 SetRect (&r, x, y, x + width + 1, y + height + 1); 603 SetRect (&r, x, y, x + width + 1, y + height + 1);
605 604
606 mac_begin_clip (GC_CLIP_REGION (gc)); 605 mac_begin_clip (gc);
607 FrameRect (&r); /* using foreground color of gc */ 606 FrameRect (&r); /* using foreground color of gc */
608 mac_end_clip (GC_CLIP_REGION (gc)); 607 mac_end_clip (gc);
609} 608}
610 609
611 610
@@ -720,7 +719,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
720 if (!mac_use_core_graphics) 719 if (!mac_use_core_graphics)
721 { 720 {
722#endif 721#endif
723 mac_begin_clip (GC_CLIP_REGION (gc)); 722 mac_begin_clip (gc);
724 RGBForeColor (GC_FORE_COLOR (gc)); 723 RGBForeColor (GC_FORE_COLOR (gc));
725 if (bg_width) 724 if (bg_width)
726 { 725 {
@@ -736,7 +735,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
736 ATSUDrawText (text_layout, 735 ATSUDrawText (text_layout,
737 kATSUFromTextBeginning, kATSUToTextEnd, 736 kATSUFromTextBeginning, kATSUToTextEnd,
738 kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); 737 kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
739 mac_end_clip (GC_CLIP_REGION (gc)); 738 mac_end_clip (gc);
740#ifdef MAC_OSX 739#ifdef MAC_OSX
741 } 740 }
742 else 741 else
@@ -809,7 +808,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
809 if (mac_use_core_graphics) 808 if (mac_use_core_graphics)
810 savedFlags = SwapQDTextFlags (kQDUseCGTextRendering); 809 savedFlags = SwapQDTextFlags (kQDUseCGTextRendering);
811#endif 810#endif
812 mac_begin_clip (GC_CLIP_REGION (gc)); 811 mac_begin_clip (gc);
813 RGBForeColor (GC_FORE_COLOR (gc)); 812 RGBForeColor (GC_FORE_COLOR (gc));
814#ifdef MAC_OS8 813#ifdef MAC_OS8
815 if (bg_width) 814 if (bg_width)
@@ -845,7 +844,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
845 DrawText (buf, 0, nchars * bytes_per_char); 844 DrawText (buf, 0, nchars * bytes_per_char);
846 if (bg_width) 845 if (bg_width)
847 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 846 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
848 mac_end_clip (GC_CLIP_REGION (gc)); 847 mac_end_clip (gc);
849 848
850#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 849#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
851 if (mac_use_core_graphics) 850 if (mac_use_core_graphics)
@@ -1187,7 +1186,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
1187 ForeColor (blackColor); 1186 ForeColor (blackColor);
1188 BackColor (whiteColor); 1187 BackColor (whiteColor);
1189 1188
1190 mac_begin_clip (GC_CLIP_REGION (gc)); 1189 mac_begin_clip (gc);
1191 LockPixels (GetGWorldPixMap (src)); 1190 LockPixels (GetGWorldPixMap (src));
1192#if TARGET_API_MAC_CARBON 1191#if TARGET_API_MAC_CARBON
1193 { 1192 {
@@ -1205,7 +1204,7 @@ mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y)
1205 &src_r, &dest_r, srcCopy, 0); 1204 &src_r, &dest_r, srcCopy, 0);
1206#endif /* not TARGET_API_MAC_CARBON */ 1205#endif /* not TARGET_API_MAC_CARBON */
1207 UnlockPixels (GetGWorldPixMap (src)); 1206 UnlockPixels (GetGWorldPixMap (src));
1208 mac_end_clip (GC_CLIP_REGION (gc)); 1207 mac_end_clip (gc);
1209 1208
1210 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1209 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1211} 1210}
@@ -1231,7 +1230,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
1231 ForeColor (blackColor); 1230 ForeColor (blackColor);
1232 BackColor (whiteColor); 1231 BackColor (whiteColor);
1233 1232
1234 mac_begin_clip (GC_CLIP_REGION (gc)); 1233 mac_begin_clip (gc);
1235 LockPixels (GetGWorldPixMap (src)); 1234 LockPixels (GetGWorldPixMap (src));
1236 LockPixels (GetGWorldPixMap (mask)); 1235 LockPixels (GetGWorldPixMap (mask));
1237#if TARGET_API_MAC_CARBON 1236#if TARGET_API_MAC_CARBON
@@ -1251,7 +1250,7 @@ mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y,
1251#endif /* not TARGET_API_MAC_CARBON */ 1250#endif /* not TARGET_API_MAC_CARBON */
1252 UnlockPixels (GetGWorldPixMap (mask)); 1251 UnlockPixels (GetGWorldPixMap (mask));
1253 UnlockPixels (GetGWorldPixMap (src)); 1252 UnlockPixels (GetGWorldPixMap (src));
1254 mac_end_clip (GC_CLIP_REGION (gc)); 1253 mac_end_clip (gc);
1255 1254
1256 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1255 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1257} 1256}
@@ -1289,9 +1288,9 @@ mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y)
1289 color mapping in CopyBits. Otherwise, it will be slow. */ 1288 color mapping in CopyBits. Otherwise, it will be slow. */
1290 ForeColor (blackColor); 1289 ForeColor (blackColor);
1291 BackColor (whiteColor); 1290 BackColor (whiteColor);
1292 mac_begin_clip (GC_CLIP_REGION (gc)); 1291 mac_begin_clip (gc);
1293 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); 1292 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
1294 mac_end_clip (GC_CLIP_REGION (gc)); 1293 mac_end_clip (gc);
1295 1294
1296 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 1295 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
1297#endif /* not TARGET_API_MAC_CARBON */ 1296#endif /* not TARGET_API_MAC_CARBON */
@@ -1427,14 +1426,10 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1427{ 1426{
1428 int i; 1427 int i;
1429 1428
1430 if (n < 0 || n > MAX_CLIP_RECTS) 1429 xassert (n >= 0 && n <= MAX_CLIP_RECTS);
1431 abort (); 1430
1432 if (n == 0) 1431 gc->n_clip_rects = n;
1433 { 1432 if (n > 0)
1434 if (gc->clip_region)
1435 SetEmptyRgn (gc->clip_region);
1436 }
1437 else
1438 { 1433 {
1439 if (gc->clip_region == NULL) 1434 if (gc->clip_region == NULL)
1440 gc->clip_region = NewRgn (); 1435 gc->clip_region = NewRgn ();
@@ -1452,8 +1447,6 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1452 } 1447 }
1453 } 1448 }
1454#if defined (MAC_OSX) && USE_ATSUI 1449#if defined (MAC_OSX) && USE_ATSUI
1455 gc->n_clip_rects = n;
1456
1457 for (i = 0; i < n; i++) 1450 for (i = 0; i < n; i++)
1458 { 1451 {
1459 Rect *rect = rectangles + i; 1452 Rect *rect = rectangles + i;
@@ -1473,7 +1466,7 @@ mac_reset_clip_rectangles (display, gc)
1473 Display *display; 1466 Display *display;
1474 GC gc; 1467 GC gc;
1475{ 1468{
1476 mac_set_clip_rectangles (display, gc, NULL, 0); 1469 gc->n_clip_rects = 0;
1477} 1470}
1478 1471
1479 1472
@@ -4538,7 +4531,6 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4538 int portion, position, whole; 4531 int portion, position, whole;
4539{ 4532{
4540 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4533 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4541
4542 int value, viewsize, maximum; 4534 int value, viewsize, maximum;
4543 4535
4544 if (whole == 0 || XINT (bar->track_height) == 0) 4536 if (whole == 0 || XINT (bar->track_height) == 0)
@@ -4552,10 +4544,20 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
4552 4544
4553 BLOCK_INPUT; 4545 BLOCK_INPUT;
4554 4546
4555 SetControl32BitMinimum (ch, 0); 4547 if (IsControlVisible (ch)
4556 SetControl32BitMaximum (ch, maximum); 4548 && (GetControlViewSize (ch) != viewsize
4557 SetControl32BitValue (ch, value); 4549 || GetControl32BitValue (ch) != value
4558 SetControlViewSize (ch, viewsize); 4550 || GetControl32BitMaximum (ch) != maximum))
4551 {
4552 /* Temporarily hide the scroll bar to avoid multiple redraws. */
4553 SetControlVisibility (ch, false, false);
4554
4555 SetControl32BitMaximum (ch, maximum);
4556 SetControl32BitValue (ch, value);
4557 SetControlViewSize (ch, viewsize);
4558
4559 SetControlVisibility (ch, true, true);
4560 }
4559 4561
4560 UNBLOCK_INPUT; 4562 UNBLOCK_INPUT;
4561} 4563}
diff --git a/src/window.c b/src/window.c
index bd5a393b599..e4c8d0612cb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1861,7 +1861,8 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
1861 Lisp_Object frame, minibuf, window; 1861 Lisp_Object frame, minibuf, window;
1862{ 1862{
1863 if (NILP (window)) 1863 if (NILP (window))
1864 window = selected_window; 1864 window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window;
1865 CHECK_WINDOW (window);
1865 if (NILP (frame)) 1866 if (NILP (frame))
1866 frame = selected_frame; 1867 frame = selected_frame;
1867 1868