From 6786a1071ab8f468cc5919914ce98c2c3692213e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 9 Apr 2006 01:59:45 +0000 Subject: [PATCH 001/141] (boyer_moore): Test ch >= 0400, not >. --- src/search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index b92812597d5..dfbf66fc7ed 100644 --- a/src/search.c +++ b/src/search.c @@ -1720,7 +1720,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, ch = -1; } - if (ch > 0400) + if (ch >= 0400) j = ((unsigned char) ch) | 0200; else j = *ptr; @@ -1739,7 +1739,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, while (1) { TRANSLATE (ch, inverse_trt, ch); - if (ch > 0400) + if (ch >= 0400) j = ((unsigned char) ch) | 0200; else j = (unsigned char) ch; From 404be028b9f33058aa357e3ebc85890de853511b Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 9 Apr 2006 09:03:44 +0000 Subject: [PATCH 002/141] * puresize.h (pure_write_error): Mark as NO_RETURN. * lisp.h (args_out_of_range, args_out_of_range_3): Likewise. --- src/ChangeLog | 6 ++++++ src/lisp.h | 5 +++-- src/puresize.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e91028e54e2..d5c53ff7a02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-04-09 Dan Nicolaescu + + * puresize.h (pure_write_error): Mark as NO_RETURN. + + * lisp.h (args_out_of_range, args_out_of_range_3): Likewise. + 2006-04-08 Eli Zaretskii * w32fns.c (w32_wnd_proc) : Ignore mouse movements diff --git a/src/lisp.h b/src/lisp.h index f088ccb8341..5d1b3266a0d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2243,8 +2243,9 @@ EXFUN (Fmake_variable_buffer_local, 1); extern Lisp_Object indirect_variable P_ ((Lisp_Object)); extern Lisp_Object long_to_cons P_ ((unsigned long)); extern unsigned long cons_to_long P_ ((Lisp_Object)); -extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)); -extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); +extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; +extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, + Lisp_Object)) NO_RETURN; extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)); extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object, Lisp_Object, struct buffer *)); diff --git a/src/puresize.h b/src/puresize.h index 93dac70c123..7d0e868b8aa 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -65,7 +65,7 @@ Boston, MA 02110-1301, USA. */ { if (PURE_P (obj)) \ pure_write_error (); } -extern void pure_write_error P_ ((void)); +extern void pure_write_error P_ ((void)) NO_RETURN; /* Define PURE_P. */ From 4ca412ecd00a3d6540b909c579ef0911b0b3869c Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 9 Apr 2006 09:18:47 +0000 Subject: [PATCH 003/141] (args_out_of_range, args_out_of_range_3) (Fkill_buffer): Likewise. --- src/ChangeLog | 4 +++- src/lisp.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d5c53ff7a02..a4bad57e4c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,7 +2,9 @@ * puresize.h (pure_write_error): Mark as NO_RETURN. - * lisp.h (args_out_of_range, args_out_of_range_3): Likewise. + * lisp.h (args_out_of_range, args_out_of_range_3) + (Fkill_buffer): Likewise. + 2006-04-08 Eli Zaretskii diff --git a/src/lisp.h b/src/lisp.h index 5d1b3266a0d..049fb989cc8 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3032,7 +3032,7 @@ extern void syms_of_frame P_ ((void)); extern Lisp_Object decode_env_path P_ ((char *, char *)); extern Lisp_Object Vinvocation_name, Vinvocation_directory; extern Lisp_Object Vinstallation_directory, empty_string; -EXFUN (Fkill_emacs, 1); +EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale P_ ((void)); void synchronize_system_messages_locale P_ ((void)); From af26e6739b17f39b0e85ec9b6948ddd9534c345e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Apr 2006 17:45:55 +0000 Subject: [PATCH 004/141] move @contents to the front --- man/ChangeLog | 5 +++++ man/emacs.texi | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 8bddc6c1c9f..290541324fa 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-04-09 Karl Berry + + * emacs.texi: move @summarycontents and @contents to the beginning + of the file. + 2006-04-07 Reiner Steib * gnus.texi (Summary Buffer Lines): Add `*'. diff --git a/man/emacs.texi b/man/emacs.texi index 79149152416..44a718c9911 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -73,7 +73,12 @@ Boston, MA 02110-1301 USA Cover art by Etienne Suvasa. @end titlepage -@page + + +@summarycontents +@contents + + @ifnottex @node Top, Distrib, (dir), (dir) @top The Emacs Editor @@ -1604,8 +1609,6 @@ Public License instead of this License. @unnumbered Concept Index @printindex cp -@summarycontents -@contents @bye @ignore From ba7e3f51f264729f3ef2b91e11c0cee46ad67509 Mon Sep 17 00:00:00 2001 From: Roland Winkler Date: Sun, 9 Apr 2006 18:25:53 +0000 Subject: [PATCH 005/141] (bibtex-find-text-internal): Add new element string-const to return value. (bibtex-remove-delimiters): Use it. --- lisp/textmodes/bibtex.el | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index daca0502454..a70ab1591ca 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3613,17 +3613,20 @@ interactive calls." (defun bibtex-find-text-internal (&optional noerror subfield comma) "Find text part of current BibTeX field or entry head. -Return list (NAME START-TEXT END-TEXT END) with field or entry name, -start and end of text and end of field or entry head, or nil if not found. -If optional arg NOERROR is non-nil, an error message is suppressed if text -is not found. If optional arg SUBFIELD is non-nil START-TEXT and END-TEXT -correspond to the current subfield delimited by #. +Return list (NAME START-TEXT END-TEXT END STRING-CONST) with field +or entry name, start and end of text, and end of field or entry head. +STRING-CONST is a flag which is non-nil if current subfield delimited by # +is a BibTeX string constant. Return value is nil if field or entry head +are not found. +If optional arg NOERROR is non-nil, an error message is suppressed +if text is not found. If optional arg SUBFIELD is non-nil START-TEXT +and END-TEXT correspond to the current subfield delimited by #. Optional arg COMMA is as in `bibtex-enclosing-field'." (save-excursion (let ((pnt (point)) (bounds (bibtex-enclosing-field comma t)) (case-fold-search t) - name start-text end-text end failure done no-sub) + name start-text end-text end failure done no-sub string-const) (bibtex-beginning-of-entry) (cond (bounds (setq name (bibtex-name-in-field bounds t) @@ -3667,9 +3670,11 @@ Optional arg COMMA is as in `bibtex-enclosing-field'." (goto-char start-text) (while (not done) (if (or (prog1 (looking-at bibtex-field-const) - (setq end-text (match-end 0))) + (setq end-text (match-end 0) + string-const t)) (prog1 (setq bounds (bibtex-parse-field-string)) - (setq end-text (cdr bounds)))) + (setq end-text (cdr bounds) + string-const nil))) (progn (if (and (<= start-text pnt) (<= pnt end-text)) (setq done t) @@ -3678,7 +3683,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'." (setq start-text (goto-char (match-end 0))))) (setq done t failure t))))) (cond ((not failure) - (list name start-text end-text end)) + (list name start-text end-text end string-const)) ((and no-sub (not noerror)) (error "Not on text part of BibTeX field")) ((not noerror) (error "Not on BibTeX field")))))) @@ -3712,13 +3717,10 @@ is as in `bibtex-enclosing-field'. It is t for interactive calls." Optional arg COMMA is as in `bibtex-enclosing-field'. It is t for interactive calls." (interactive (list t)) - (let* ((bounds (bibtex-find-text-internal nil t comma)) - (start (nth 1 bounds)) - (end (nth 2 bounds))) - (if (memq (char-before end) '(?\} ?\")) - (delete-region (1- end) end)) - (if (memq (char-after start) '(?\{ ?\")) - (delete-region start (1+ start))))) + (let ((bounds (bibtex-find-text-internal nil t comma))) + (unless (nth 4 bounds) + (delete-region (1- (nth 2 bounds)) (nth 2 bounds)) + (delete-region (nth 1 bounds) (1+ (nth 1 bounds)))))) (defun bibtex-kill-field (&optional copy-only comma) "Kill the entire enclosing BibTeX field. From 5ad23234d6988b65a4b71ecb10d1570facf84ea2 Mon Sep 17 00:00:00 2001 From: Roland Winkler Date: Sun, 9 Apr 2006 18:29:19 +0000 Subject: [PATCH 006/141] (bibtex-entry-update): New optional arg entry-type. Add field delimiters to numerical fields if they are not present. --- lisp/textmodes/bibtex.el | 50 ++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a70ab1591ca..ff1c1e48eb0 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -2856,25 +2856,45 @@ is non-nil." (bibtex-autofill-entry)) (run-hooks 'bibtex-add-entry-hook))) -(defun bibtex-entry-update () +(defun bibtex-entry-update (&optional entry-type) "Update an existing BibTeX entry. In the BibTeX entry at point, make new fields for those items that may occur -according to `bibtex-field-list', but are not yet present." - (interactive) +according to `bibtex-field-list', but are not yet present. +Also, add field delimiters to numerical fields if they are not present. +If ENTRY-TYPE is non-nil, change first the entry type to ENTRY-TYPE. +When called interactively with a prefix arg, query for a value of ENTRY-TYPE." + (interactive + (list (if current-prefix-arg + (let ((completion-ignore-case t)) + (completing-read "New entry type: " bibtex-entry-field-alist + nil t nil 'bibtex-entry-type-history))))) (save-excursion (bibtex-beginning-of-entry) - ;; For inserting new fields, we use the fact that - ;; `bibtex-parse-entry' moves point to the end of the last field. - (let* ((fields-alist (bibtex-parse-entry)) - (field-list (bibtex-field-list - (cdr (assoc "=type=" fields-alist))))) - (skip-chars-backward " \t\n") - (dolist (field (car field-list)) - (unless (assoc-string (car field) fields-alist t) - (bibtex-make-field field))) - (dolist (field (cdr field-list)) - (unless (assoc-string (car field) fields-alist t) - (bibtex-make-optional-field field)))))) + (when (looking-at bibtex-entry-maybe-empty-head) + (goto-char (match-end 0)) + (if entry-type + (save-excursion + (replace-match (concat "@" entry-type) nil nil nil 1)) + (setq entry-type (bibtex-type-in-head))) + (let* ((field-list (bibtex-field-list entry-type)) + (required (copy-tree (car field-list))) + (optional (copy-tree (cdr field-list))) + bounds) + (while (setq bounds (bibtex-parse-field)) + (let ((fname (bibtex-name-in-field bounds t)) + (end (copy-marker (bibtex-end-of-field bounds) t))) + (setq required (delete (assoc-string fname required t) required) + optional (delete (assoc-string fname optional t) optional)) + (when (string-match "\\`[0-9]+\\'" + (bibtex-text-in-field-bounds bounds)) + (goto-char (bibtex-end-of-text-in-field bounds)) + (insert (bibtex-field-right-delimiter)) + (goto-char (bibtex-start-of-text-in-field bounds)) + (insert (bibtex-field-left-delimiter))) + (goto-char end))) + (skip-chars-backward " \t\n") + (dolist (field required) (bibtex-make-field field)) + (dolist (field optional) (bibtex-make-optional-field field)))))) (defun bibtex-parse-entry (&optional content) "Parse entry at point, return an alist. From a86a2f6d7e27c24717c29f24d7fef1d984bd4207 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:32:11 +0000 Subject: [PATCH 007/141] Remove extraneous newline. --- src/ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a4bad57e4c0..7f32acb8d6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,7 +4,6 @@ * lisp.h (args_out_of_range, args_out_of_range_3) (Fkill_buffer): Likewise. - 2006-04-08 Eli Zaretskii From 88e51189904831e2dc35695b2ec14da194991ba9 Mon Sep 17 00:00:00 2001 From: Roland Winkler Date: Sun, 9 Apr 2006 18:32:18 +0000 Subject: [PATCH 008/141] *** empty log message *** --- lisp/ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11834490dc0..be7923765ce 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2006-04-09 Roland Winkler + + * textmodes/bibtex.el (bibtex-entry-update): New optional arg + entry-type. Add field delimiters to numerical fields if they are + not present. + +2006-04-09 Roland Winkler + + * textmodes/bibtex.el (bibtex-find-text-internal): Add new element + string-const to return value. + (bibtex-remove-delimiters): Use it. + 2006-04-08 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-form): Don't call From b6063442a6579bc47c539fa5b9ded58430c2801b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:35:58 +0000 Subject: [PATCH 009/141] Fix last lisp.h entry. --- src/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7f32acb8d6c..80213f252a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,7 +3,7 @@ * puresize.h (pure_write_error): Mark as NO_RETURN. * lisp.h (args_out_of_range, args_out_of_range_3) - (Fkill_buffer): Likewise. + (Fkill_emacs): Likewise. 2006-04-08 Eli Zaretskii From 72617295dc968145ead32f9eedabe02535838e85 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:43:41 +0000 Subject: [PATCH 010/141] (Formula syntax): Typo in node name of calc-eval xref. --- man/org.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/org.texi b/man/org.texi index 60259e2834c..2c7a4ef8289 100644 --- a/man/org.texi +++ b/man/org.texi @@ -1064,7 +1064,7 @@ A formula can be any algebraic expression understood by the Emacs @file{calc} package. Note that @file{calc} has the slightly non-standard conversion that @samp{/} has lower precedence than @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before -evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp +evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs Calc Manual}), variable substitution takes place: From f61afad3659acc58a868f7dbbec818fee1b034e8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:44:06 +0000 Subject: [PATCH 011/141] (Mail Sending): In send-mail-function @pxref smtpmail, put info and printed manual names the right way around. --- man/sending.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/sending.texi b/man/sending.texi index fb7235b3c11..0c0c249ba5d 100644 --- a/man/sending.texi +++ b/man/sending.texi @@ -459,7 +459,7 @@ user agent sends mail. It should be set to a function. The default is @code{sendmail-send-it}, which delivers mail using the Sendmail installation on the local host. To send mail through a SMTP server, set it to @code{smtpmail-send-it} and set up the Emacs SMTP library -(@pxref{Top,,Emacs SMTP Library, Sending mail via SMTP,smtpmail}). A +(@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}). A third option is @code{feedmail-send-it}, see the commentary section of the @file{feedmail.el} package for more information. From 0462a47d1c02c0532aeda37875eada012528e93e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:45:35 +0000 Subject: [PATCH 012/141] (Command-Line Arguments): Update xref to emacs manual "Command Arguments" -> "Emacs Invocation", per change there. --- lispref/os.texi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lispref/os.texi b/lispref/os.texi index 475a8bd8687..f8b43cfa7f0 100644 --- a/lispref/os.texi +++ b/lispref/os.texi @@ -404,8 +404,9 @@ remaining command-line arguments in the variable arguments is in @code{command-line-args}.) The command-line arguments are parsed by the @code{command-line-1} -function in the @file{startup.el} file. See also @ref{Command -Arguments, , Command Line Arguments, emacs, The GNU Emacs Manual}. +function in the @file{startup.el} file. See also @ref{Emacs +Invocation, , Command Line Arguments for Emacs Invocation, emacs, The +GNU Emacs Manual}. @end defvar @defvar command-line-args From d82eac8f941aa6c031fea14bd2dc812e4258acdd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 9 Apr 2006 18:46:26 +0000 Subject: [PATCH 013/141] *** empty log message *** --- lispref/ChangeLog | 5 +++++ man/ChangeLog | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 511e011bcd9..b42cbcad5a1 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2006-04-08 Kevin Ryde + + * os.texi (Command-Line Arguments): Update xref to emacs manual + "Command Arguments" -> "Emacs Invocation", per change there. + 2006-04-08 Thien-Thi Nguyen * display.texi (Other Display Specs): Arrange a @code{DOTTED-LIST} to diff --git a/man/ChangeLog b/man/ChangeLog index 290541324fa..48712e9c81a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,10 @@ +2006-04-09 Kevin Ryde + + * org.texi (Formula syntax): Typo in node name of calc-eval xref. + + * sending.texi (Mail Sending): In send-mail-function @pxref smtpmail, + put info and printed manual names the right way around. + 2006-04-09 Karl Berry * emacs.texi: move @summarycontents and @contents to the beginning From 2af34f255bb23763847da2d90558d658cd3e52eb Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 9 Apr 2006 19:20:02 +0000 Subject: [PATCH 014/141] (lm-font-lock-face-O, lm-font-lock-face-X): Make them faces. (lm-font-lock-keywords): Update appropriately. --- lisp/play/landmark.el | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index 63d7a9fe33a..7ec6f9bb187 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -211,22 +211,24 @@ (defvar lm-emacs-won () "*For making font-lock use the winner's face for the line.") -(defvar lm-font-lock-face-O - (if (display-color-p) - (list (facemenu-get-face 'fg:red) 'bold)) - "*Face to use for Emacs' O.") +(defface lm-font-lock-face-O '((((class color)) :foreground "red") + (t :weight bold)) + "*Face to use for Emacs' O." + :version "22.1" + :group 'lm) -(defvar lm-font-lock-face-X - (if (display-color-p) - (list (facemenu-get-face 'fg:green) 'bold)) - "*Face to use for your X.") +(defface lm-font-lock-face-X '((((class color)) :foreground "green") + (t :weight bold)) + "*Face to use for your X." + :version "22.1" + :group 'lm) (defvar lm-font-lock-keywords - '(("O" . lm-font-lock-face-O) - ("X" . lm-font-lock-face-X) + '(("O" . 'lm-font-lock-face-O) + ("X" . 'lm-font-lock-face-X) ("[-|/\\]" 0 (if lm-emacs-won - lm-font-lock-face-O - lm-font-lock-face-X))) + 'lm-font-lock-face-O + 'lm-font-lock-face-X))) "*Font lock rules for Lm.") (put 'lm-mode 'front-sticky From 2a8da5551cef30845096a5ac370233e80af9a1aa Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 9 Apr 2006 19:56:27 +0000 Subject: [PATCH 015/141] Undo previous change. --- src/ChangeLog | 9 ++++++++- src/lisp.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 80213f252a7..d5e4d20111e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,16 @@ +2006-04-09 Richard Stallman + + * lisp.h (Fkill_emacs): Undo previous change. + +2006-04-08 Richard Stallman + + * search.c (boyer_moore): Test ch >= 0400, not >. + 2006-04-09 Dan Nicolaescu * puresize.h (pure_write_error): Mark as NO_RETURN. * lisp.h (args_out_of_range, args_out_of_range_3) - (Fkill_emacs): Likewise. 2006-04-08 Eli Zaretskii diff --git a/src/lisp.h b/src/lisp.h index 049fb989cc8..5d1b3266a0d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3032,7 +3032,7 @@ extern void syms_of_frame P_ ((void)); extern Lisp_Object decode_env_path P_ ((char *, char *)); extern Lisp_Object Vinvocation_name, Vinvocation_directory; extern Lisp_Object Vinstallation_directory, empty_string; -EXFUN (Fkill_emacs, 1) NO_RETURN; +EXFUN (Fkill_emacs, 1); #if HAVE_SETLOCALE void fixup_locale P_ ((void)); void synchronize_system_messages_locale P_ ((void)); From e691d082f60d28aed73d3ec02ea9557794fa285a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Apr 2006 22:40:34 +0000 Subject: [PATCH 016/141] move MS-DOS material to emacs-xtra.texi --- man/ChangeLog | 6 + man/building.texi | 2 +- man/emacs-xtra.texi | 682 ++++++++++++++++++++++++++++++++++++++++++++ man/emacs.texi | 19 +- man/frames.texi | 2 +- man/gnu.texi | 2 +- man/macos.texi | 2 +- man/msdog.texi | 678 +------------------------------------------ man/mule.texi | 2 +- man/trouble.texi | 3 +- 10 files changed, 714 insertions(+), 684 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 48712e9c81a..c6ad56970a6 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -7,6 +7,12 @@ 2006-04-09 Karl Berry + * msdog.texi, emacs-xtra.texi: move all the MS-DOS material to + emacs-xtra.texi, leaving only MS Windows information. + * building.texi, emacs.texi, frames.texi, gnu.texi, macos.texi, + msdog.texi, mule.texi, trouble.texi: change cross-references and + node names. + * emacs.texi: move @summarycontents and @contents to the beginning of the file. diff --git a/man/building.texi b/man/building.texi index ccabf22b549..ec44b828022 100644 --- a/man/building.texi +++ b/man/building.texi @@ -323,7 +323,7 @@ method to conditionalize them. subprocesses; to work around this lack, @kbd{M-x compile} runs the compilation command synchronously on MS-DOS. As a consequence, you must wait until the command finishes before you can do anything else in -Emacs. @xref{MS-DOS}. +Emacs. @xref{MS-DOS,,,emacs-xtra,Specialized Emacs Features}. @node Grep Searching @section Searching with Grep under Emacs diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi index 4aff9716f75..7f7574d05e5 100644 --- a/man/emacs-xtra.texi +++ b/man/emacs-xtra.texi @@ -64,6 +64,7 @@ license to the document, as described in section 6 of the license. * Picture Mode:: Editing pictures made up of characters using the quarter-plane screen model. * Fortran:: Fortran mode and its special features. +* MS-DOG:: * Index:: @end menu @@ -2406,6 +2407,687 @@ to @samp{continue}, provided Abbrev mode is enabled.@refill Type @samp{;?} or @samp{;C-h} to display a list of all the built-in Fortran abbrevs and what they stand for. + +@node MS-DOG +@chapter Emacs and MS-DOS +@cindex MS-DOG +@cindex MS-DOS peculiarities + + This section briefly describes the peculiarities of using Emacs on +the MS-DOS ``operating system'' (also known as ``MS-DOG''). +Information about Emacs and Microsoft's current operating system +Windows (also known as ``Losedows) is in the main Emacs manual +(@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}). + + If you build Emacs for MS-DOS, the binary will also run on Windows +3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS +application; all of this chapter applies for all of those systems, if +you use an Emacs that was built for MS-DOS. + + @xref{Text and Binary,,,emacs, the Emacs Manual}, for information +about Emacs' special handling of text files under MS-DOS (and +Windows). + +@menu +* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. +* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. +* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. +* Files: MS-DOS File Names. File name conventions on MS-DOS. +* Printing: MS-DOS Printing. How to specify the printer on MS-DOS. +* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. +* Processes: MS-DOS Processes. Running subprocesses on MS-DOS. +@end menu + +@node MS-DOS Keyboard +@section Keyboard Usage on MS-DOS + +@kindex DEL @r{(MS-DOS)} +@kindex BS @r{(MS-DOS)} + The key that is called @key{DEL} in Emacs (because that's how it is +designated on most workstations) is known as @key{BS} (backspace) on a +PC. That is why the PC-specific terminal initialization remaps the +@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act +as @kbd{C-d} for the same reasons. + +@kindex C-g @r{(MS-DOS)} +@kindex C-BREAK @r{(MS-DOS)} +@cindex quitting on MS-DOS + Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit +character, just like @kbd{C-g}. This is because Emacs cannot detect +that you have typed @kbd{C-g} until it is ready for more input. As a +consequence, you cannot use @kbd{C-g} to stop a running command +(@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast, +@kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as +@kbd{C-g} is on other systems), so it can be used to stop a running +command and for emergency escape (@pxref{Emergency Escape,,,emacs, the +Emacs Manual}). + +@cindex Meta (under MS-DOS) +@cindex Hyper (under MS-DOS) +@cindex Super (under MS-DOS) +@vindex dos-super-key +@vindex dos-hyper-key + The PC keyboard maps use the left @key{ALT} key as the @key{META} key. +You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: +choose either the right @key{CTRL} key or the right @key{ALT} key by +setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 +or 2 respectively. If neither @code{dos-super-key} nor +@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is +also mapped to the @key{META} key. However, if the MS-DOS international +keyboard support program @file{KEYB.COM} is installed, Emacs will +@emph{not} map the right @key{ALT} to @key{META}, since it is used for +accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard +layouts; in this case, you may only use the left @key{ALT} as @key{META} +key. + +@kindex C-j @r{(MS-DOS)} +@vindex dos-keypad-mode + The variable @code{dos-keypad-mode} is a flag variable that controls +what key codes are returned by keys in the numeric keypad. You can also +define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the +following line into your @file{_emacs} file: + +@smallexample +;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.} +(define-key function-key-map [kp-enter] [?\C-j]) +@end smallexample + +@node MS-DOS Mouse +@section Mouse Usage on MS-DOS + +@cindex mouse support under MS-DOS + Emacs on MS-DOS supports a mouse (on the default terminal only). +The mouse commands work as documented, including those that use menus +and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll +bars don't work in MS-DOS Emacs. PC mice usually have only two +buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you +press both of them together, that has the effect of @kbd{Mouse-3}. If +the mouse does have 3 buttons, Emacs detects that at startup, and all +the 3 buttons function normally, as on X. + + Help strings for menu-bar and pop-up menus are displayed in the echo +area when the mouse pointer moves across the menu items. Highlighting +of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs +Manual}) is also supported. + +@cindex mouse, set number of buttons +@findex msdos-set-mouse-buttons + Some versions of mouse drivers don't report the number of mouse +buttons correctly. For example, mice with a wheel report that they +have 3 buttons, but only 2 of them are passed to Emacs; the clicks on +the wheel, which serves as the middle button, are not passed. In +these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command +to tell Emacs how many mouse buttons to expect. You could make such a +setting permanent by adding this fragment to your @file{_emacs} init +file: + +@example +;; @r{Treat the mouse like a 2-button mouse.} +(msdos-set-mouse-buttons 2) +@end example + +@cindex Windows clipboard support + Emacs built for MS-DOS supports clipboard operations when it runs on +Windows. Commands that put text on the kill ring, or yank text from +the ring, check the Windows clipboard first, just as Emacs does on the +X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}). +Only the primary selection and the cut buffer are supported by MS-DOS +Emacs on Windows; the secondary selection always appears as empty. + + Due to the way clipboard access is implemented by Windows, the +length of text you can put into the clipboard is limited by the amount +of free DOS memory that is available to Emacs. Usually, up to 620KB of +text can be put into the clipboard, but this limit depends on the system +configuration and is lower if you run Emacs as a subprocess of +another program. If the killed text does not fit, Emacs outputs a +message saying so, and does not put the text into the clipboard. + + Null characters also cannot be put into the Windows clipboard. If the +killed text includes null characters, Emacs does not put such text into +the clipboard, and displays in the echo area a message to that effect. + +@vindex dos-display-scancodes + The variable @code{dos-display-scancodes}, when non-@code{nil}, +directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of +each keystroke; this feature serves as a complement to the +@code{view-lossage} command, for debugging. + +@node MS-DOS Display +@section Display on MS-DOS +@cindex faces under MS-DOS +@cindex fonts, emulating under MS-DOS + + Display on MS-DOS cannot use font variants, like bold or italic, but +it does support multiple faces, each of which can specify a foreground +and a background color. Therefore, you can get the full functionality +of Emacs packages that use fonts (such as @code{font-lock}, Enriched +Text mode, and others) by defining the relevant faces to use different +colors. Use the @code{list-colors-display} command (@pxref{Frame +Parameters,,,emacs, the Emacs Manual}) and the +@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs +Manual}) to see what colors and faces are available and what they look +like. + + @xref{MS-DOS and MULE}, later in this chapter, for information on +how Emacs displays glyphs and characters that aren't supported by the +native font built into the DOS display. + +@cindex cursor shape on MS-DOS + When Emacs starts, it changes the cursor shape to a solid box. This +is for compatibility with other systems, where the box cursor is the +default in Emacs. This default shape can be changed to a bar by +specifying the @code{cursor-type} parameter in the variable +@code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs +Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor, +so the bar cursor is horizontal, and the @code{@var{width}} parameter, +if specified by the frame parameters, actually determines its height. +For this reason, the @code{bar} and @code{hbar} cursor types produce +the same effect on MS-DOS. As an extension, the bar cursor +specification can include the starting scan line of the cursor as well +as its width, like this: + +@example + '(cursor-type bar @var{width} . @var{start}) +@end example + +@noindent +In addition, if the @var{width} parameter is negative, the cursor bar +begins at the top of the character cell. + +@cindex frames on MS-DOS + The MS-DOS terminal can only display a single frame at a time. The +Emacs frame facilities work on MS-DOS much as they do on text-only +terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run +Emacs from a DOS window on MS-Windows, you can make the visible frame +smaller than the full screen, but Emacs still cannot display more than +a single frame at a time. + +@cindex frame size under MS-DOS +@findex mode4350 +@findex mode25 + The @code{mode4350} command switches the display to 43 or 50 +lines, depending on your hardware; the @code{mode25} command switches +to the default 80x25 screen size. + + By default, Emacs only knows how to set screen sizes of 80 columns by +25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has +special video modes that will switch the display to other sizes, you can +have Emacs support those too. When you ask Emacs to switch the frame to +@var{n} rows by @var{m} columns dimensions, it checks if there is a +variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, +uses its value (which must be an integer) as the video mode to switch +to. (Emacs switches to that video mode by calling the BIOS @code{Set +Video Mode} function with the value of +@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) +For example, suppose your adapter will switch to 66x80 dimensions when +put into video mode 85. Then you can make Emacs support this screen +size by putting the following into your @file{_emacs} file: + +@example +(setq screen-dimensions-66x80 85) +@end example + + Since Emacs on MS-DOS can only set the frame size to specific +supported dimensions, it cannot honor every possible frame resizing +request. When an unsupported size is requested, Emacs chooses the next +larger supported size beyond the specified size. For example, if you +ask for 36x80 frame, you will get 40x80 instead. + + The variables @code{screen-dimensions-@var{n}x@var{m}} are used only +when they exactly match the specified size; the search for the next +larger supported size ignores them. In the above example, even if your +VGA supports 38x80 dimensions and you define a variable +@code{screen-dimensions-38x80} with a suitable value, you will still get +40x80 screen when you ask for a 36x80 frame. If you want to get the +38x80 size in this case, you can do it by setting the variable named +@code{screen-dimensions-36x80} with the same video mode value as +@code{screen-dimensions-38x80}. + + Changing frame dimensions on MS-DOS has the effect of changing all the +other frames to the new dimensions. + +@node MS-DOS File Names +@section File Names on MS-DOS +@cindex file names under MS-DOS +@cindex init file, default name under MS-DOS + + MS-DOS normally uses a backslash, @samp{\}, to separate name units +within a file name, instead of the slash used on other systems. Emacs +on MS-DOS permits use of either slash or backslash, and also knows +about drive letters in file names. + + On MS-DOS, file names are case-insensitive and limited to eight +characters, plus optionally a period and three more characters. Emacs +knows enough about these limitations to handle file names that were +meant for other operating systems. For instance, leading dots +@samp{.} in file names are invalid in MS-DOS, so Emacs transparently +converts them to underscores @samp{_}; thus your default init file +(@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs} +on MS-DOS. Excess characters before or after the period are generally +ignored by MS-DOS itself; thus, if you visit the file +@file{LongFileName.EvenLongerExtension}, you will silently get +@file{longfile.eve}, but Emacs will still display the long file name +on the mode line. Other than that, it's up to you to specify file +names which are valid under MS-DOS; the transparent conversion as +described above only works on file names built into Emacs. + +@cindex backup file names on MS-DOS + The above restrictions on the file names on MS-DOS make it almost +impossible to construct the name of a backup file (@pxref{Backup +Names,,,emacs, the Emacs Manual}) without losing some of the original +file name characters. For example, the name of a backup file for +@file{docs.txt} is @file{docs.tx~} even if single backup is used. + +@cindex file names under Windows 95/NT +@cindex long file names in DOS box under Windows 95/NT + If you run Emacs as a DOS application under Windows 9X, Windows ME, or +Windows 2000, you can turn on support for long file names. If you do +that, Emacs doesn't truncate file names or convert them to lower case; +instead, it uses the file names that you specify, verbatim. To enable +long file name support, set the environment variable @env{LFN} to +@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow +DOS programs to access long file names, so Emacs built for MS-DOS will +only see their short 8+3 aliases. + +@cindex @env{HOME} directory under MS-DOS + MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends +that the directory where it is installed is the value of the @env{HOME} +environment variable. That is, if your Emacs binary, +@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then +Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In +particular, that is where Emacs looks for the init file @file{_emacs}. +With this in mind, you can use @samp{~} in file names as an alias for +the home directory, as you would on GNU or Unix. You can also set +@env{HOME} variable in the environment before starting Emacs; its +value will then override the above default behavior. + + Emacs on MS-DOS handles the directory name @file{/dev} specially, +because of a feature in the emulator libraries of DJGPP that pretends +I/O devices have names in that directory. We recommend that you avoid +using an actual directory named @file{/dev} on any disk. + +@node MS-DOS Printing +@section Printing and MS-DOS + + Printing commands, such as @code{lpr-buffer} +(@pxref{Printing,,,emacs, the Emacs Manual }) and +@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}) +can work in MS-DOS and MS-Windows by sending the output to one of the +printer ports, if a Posix-style @code{lpr} program is unavailable. +The same Emacs variables control printing on all systems, but in some +cases they have different default values on MS-DOS and MS-Windows. + +@vindex printer-name @r{(MS-DOS)} + If you want to use your local printer, printing on it in the usual DOS +manner, then set the Lisp variable @code{lpr-command} to @code{""} (its +default value) and @code{printer-name} to the name of the printer +port---for example, @code{"PRN"}, the usual local printer port (that's +the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer. +You can also set @code{printer-name} to a file name, in which case +``printed'' output is actually appended to that file. If you set +@code{printer-name} to @code{"NUL"}, printed output is silently +discarded (sent to the system null device). + + On MS-Windows, when the Windows network software is installed, you can +also use a printer shared by another machine by setting +@code{printer-name} to the UNC share name for that printer---for example, +@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward +slashes or backslashes here.) To find out the names of shared printers, +run the command @samp{net view} at a DOS command prompt to obtain a list +of servers, and @samp{net view @var{server-name}} to see the names of printers +(and directories) shared by that server. Alternatively, click the +@samp{Network Neighborhood} icon on your desktop, and look for machines +which share their printers via the network. + +@cindex @samp{net use}, and printing on MS-Windows +@cindex networked printers (MS-Windows) + If the printer doesn't appear in the output of @samp{net view}, or +if setting @code{printer-name} to the UNC share name doesn't produce a +hardcopy on that printer, you can use the @samp{net use} command to +connect a local print port such as @code{"LPT2"} to the networked +printer. For example, typing @kbd{net use LPT2: +\\joes_pc\hp4si}@footnote{ +Note that the @samp{net use} command requires the UNC share name to be +typed with the Windows-style backslashes, while the value of +@code{printer-name} can be set with either forward- or backslashes.} +causes Windows to @dfn{capture} the LPT2 port and redirect the printed +material to the printer connected to the machine @code{joes_pc}. +After this command, setting @code{printer-name} to @code{"LPT2"} +should produce the hardcopy on the networked printer. + + With some varieties of Windows network software, you can instruct +Windows to capture a specific printer port such as @code{"LPT2"}, and +redirect it to a networked printer via the @w{@code{Control +Panel->Printers}} applet instead of @samp{net use}. + + Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even +though they are connected to a Windows machine which uses a different +encoding for the same locale. For example, in the Latin-1 locale, DOS +uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and +MULE}. When you print to such printers from Windows, you can use the +@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before +@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS +codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET +M-x lpr-region RET} will print the region while converting it to the +codepage 850 encoding. You may need to create the @code{cp@var{nnn}} +coding system with @kbd{M-x codepage-setup}. + + If you set @code{printer-name} to a file name, it's best to use an +absolute file name. Emacs changes the working directory according to +the default directory of the current buffer, so if the file name in +@code{printer-name} is relative, you will end up with several such +files, each one in the directory of the buffer from which the printing +was done. + +@findex print-buffer @r{(MS-DOS)} +@findex print-region @r{(MS-DOS)} +@vindex lpr-headers-switches @r{(MS-DOS)} + The commands @code{print-buffer} and @code{print-region} call the +@code{pr} program, or use special switches to the @code{lpr} program, to +produce headers on each printed page. MS-DOS and MS-Windows don't +normally have these programs, so by default, the variable +@code{lpr-headers-switches} is set so that the requests to print page +headers are silently ignored. Thus, @code{print-buffer} and +@code{print-region} produce the same output as @code{lpr-buffer} and +@code{lpr-region}, respectively. If you do have a suitable @code{pr} +program (for example, from GNU Textutils), set +@code{lpr-headers-switches} to @code{nil}; Emacs will then call +@code{pr} to produce the page headers, and print the resulting output as +specified by @code{printer-name}. + +@vindex print-region-function @r{(MS-DOS)} +@cindex lpr usage under MS-DOS +@vindex lpr-command @r{(MS-DOS)} +@vindex lpr-switches @r{(MS-DOS)} + Finally, if you do have an @code{lpr} work-alike, you can set the +variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use +@code{lpr} for printing, as on other systems. (If the name of the +program isn't @code{lpr}, set @code{lpr-command} to specify where to +find it.) The variable @code{lpr-switches} has its standard meaning +when @code{lpr-command} is not @code{""}. If the variable +@code{printer-name} has a string value, it is used as the value for the +@code{-P} option to @code{lpr}, as on Unix. + +@findex ps-print-buffer @r{(MS-DOS)} +@findex ps-spool-buffer @r{(MS-DOS)} +@vindex ps-printer-name @r{(MS-DOS)} +@vindex ps-lpr-command @r{(MS-DOS)} +@vindex ps-lpr-switches @r{(MS-DOS)} + A parallel set of variables, @code{ps-lpr-command}, +@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript +Variables,,,emacs, the Emacs Manual}), defines how PostScript files +should be printed. These variables are used in the same way as the +corresponding variables described above for non-PostScript printing. +Thus, the value of @code{ps-printer-name} is used as the name of the +device (or file) to which PostScript output is sent, just as +@code{printer-name} is used for non-PostScript printing. (There are +two distinct sets of variables in case you have two printers attached +to two different ports, and only one of them is a PostScript printer.) + + The default value of the variable @code{ps-lpr-command} is @code{""}, +which causes PostScript output to be sent to the printer port specified +by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to +the name of a program which will accept PostScript files. Thus, if you +have a non-PostScript printer, you can set this variable to the name of +a PostScript interpreter program (such as Ghostscript). Any switches +that need to be passed to the interpreter program are specified using +@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a +string, it will be added to the list of switches as the value for the +@code{-P} option. This is probably only useful if you are using +@code{lpr}, so when using an interpreter typically you would set +@code{ps-printer-name} to something other than a string so it is +ignored.) + + For example, to use Ghostscript for printing on an Epson printer +connected to the @samp{LPT2} port, put this in your @file{_emacs} file: + +@example +(setq ps-printer-name t) ; Ghostscript doesn't understand -P +(setq ps-lpr-command "c:/gs/gs386") +(setq ps-lpr-switches '("-q" "-dNOPAUSE" + "-sDEVICE=epson" + "-r240x72" + "-sOutputFile=LPT2" + "-Ic:/gs")) +@end example + +@noindent +(This assumes that Ghostscript is installed in the @file{"c:/gs"} +directory.) + +@vindex dos-printer +@vindex dos-ps-printer + For backwards compatibility, the value of @code{dos-printer} +(@code{dos-ps-printer}), if it has a value, overrides the value of +@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows +only. + + +@node MS-DOS and MULE +@section International Support on MS-DOS +@cindex international support @r{(MS-DOS)} + + Emacs on MS-DOS supports the same international character sets as it +does on GNU, Unix and other platforms (@pxref{International,,,emacs, +the Emacs Manual}), including coding systems for converting between +the different character sets. However, due to incompatibilities +between MS-DOS/MS-Windows and other systems, there are several +DOS-specific aspects of this support that you should be aware of. +This section describes these aspects. + + The description below is largely specific to the MS-DOS port of +Emacs, especially where it talks about practical implications for +Emacs users. For other operating systems, see the @file{code-pages.el} +package, which implements support for MS-DOS- and MS-Windows-specific +encodings for all platforms other than MS-DOS. + +@table @kbd +@item M-x dos-codepage-setup +Set up Emacs display and coding systems as appropriate for the current +DOS codepage. + +@item M-x codepage-setup +Create a coding system for a certain DOS codepage. +@end table + +@cindex codepage, MS-DOS +@cindex DOS codepages + MS-DOS is designed to support one character set of 256 characters at +any given time, but gives you a variety of character sets to choose +from. The alternative character sets are known as @dfn{DOS codepages}. +Each codepage includes all 128 @acronym{ASCII} characters, but the other 128 +characters (codes 128 through 255) vary from one codepage to another. +Each DOS codepage is identified by a 3-digit number, such as 850, 862, +etc. + + In contrast to X, which lets you use several fonts at the same time, +MS-DOS normally doesn't allow use of several codepages in a single +session. MS-DOS was designed to load a single codepage at system +startup, and require you to reboot in order to change +it@footnote{Normally, one particular codepage is burnt into the +display memory, while other codepages can be installed by modifying +system configuration files, such as @file{CONFIG.SYS}, and rebooting. +While there is third-party software that allows changing the codepage +without rebooting, we describe here how a stock MS-DOS system +behaves.}. Much the same limitation applies when you run DOS +executables on other systems such as MS-Windows. + +@cindex unibyte operation @r{(MS-DOS)} + If you invoke Emacs on MS-DOS with the @samp{--unibyte} option +(@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not +perform any conversion of non-@acronym{ASCII} characters. Instead, it +reads and writes any non-@acronym{ASCII} characters verbatim, and +sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs +on MS-DOS supports the current codepage, whatever it may be, but +cannot even represent any other characters. + +@vindex dos-codepage + For multibyte operation on MS-DOS, Emacs needs to know which +characters the chosen DOS codepage can display. So it queries the +system shortly after startup to get the chosen codepage number, and +stores the number in the variable @code{dos-codepage}. Some systems +return the default value 437 for the current codepage, even though the +actual codepage is different. (This typically happens when you use the +codepage built into the display hardware.) You can specify a different +codepage for Emacs to use by setting the variable @code{dos-codepage} in +your init file. + +@cindex language environment, automatic selection on @r{MS-DOS} + Multibyte Emacs supports only certain DOS codepages: those which can +display Far-Eastern scripts, like the Japanese codepage 932, and those +that encode a single ISO 8859 character set. + + The Far-Eastern codepages can directly display one of the MULE +character sets for these countries, so Emacs simply sets up to use the +appropriate terminal coding system that is supported by the codepage. +The special features described in the rest of this section mostly +pertain to codepages that encode ISO 8859 character sets. + + For the codepages which correspond to one of the ISO character sets, +Emacs knows the character set name based on the codepage number. Emacs +automatically creates a coding system to support reading and writing +files that use the current codepage, and uses this coding system by +default. The name of this coding system is @code{cp@var{nnn}}, where +@var{nnn} is the codepage number.@footnote{The standard Emacs coding +systems for ISO 8859 are not quite right for the purpose, because +typically the DOS codepage does not match the standard ISO character +codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has +code 231 in the standard Latin-1 character set, but the corresponding +DOS codepage 850 uses code 135 for this glyph.} + +@cindex mode line @r{(MS-DOS)} + All the @code{cp@var{nnn}} coding systems use the letter @samp{D} +(for ``DOS'') as their mode-line mnemonic. Since both the terminal +coding system and the default coding system for file I/O are set to +the proper @code{cp@var{nnn}} coding system at startup, it is normal +for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode +Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use +the @code{cp@var{nnn}} coding systems, and thus their initial mode +line looks like the Emacs default. + + Since the codepage number also indicates which script you are using, +Emacs automatically runs @code{set-language-environment} to select the +language environment for that script (@pxref{Language +Environments,,,emacs, the Emacs Manual}). + + If a buffer contains a character belonging to some other ISO 8859 +character set, not the one that the chosen DOS codepage supports, Emacs +displays it using a sequence of @acronym{ASCII} characters. For example, if the +current codepage doesn't have a glyph for the letter @samp{@`o} (small +@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where +the braces serve as a visual indication that this is a single character. +(This may look awkward for some non-Latin characters, such as those from +Greek or Hebrew alphabets, but it is still readable by a person who +knows the language.) Even though the character may occupy several +columns on the screen, it is really still just a single character, and +all Emacs commands treat it as one. + +@cindex IBM graphics characters (MS-DOS) +@cindex box-drawing characters (MS-DOS) +@cindex line-drawing characters (MS-DOS) + Not all characters in DOS codepages correspond to ISO 8859 +characters---some are used for other purposes, such as box-drawing +characters and other graphics. Emacs maps these characters to two +special character sets called @code{eight-bit-control} and +@code{eight-bit-graphic}, and displays them as their IBM glyphs. +However, you should be aware that other systems might display these +characters differently, so you should avoid them in text that might be +copied to a different operating system, or even to another DOS machine +that uses a different codepage. + +@vindex dos-unsupported-character-glyph + Emacs supports many other characters sets aside from ISO 8859, but it +cannot display them on MS-DOS. So if one of these multibyte characters +appears in a buffer, Emacs on MS-DOS displays them as specified by the +@code{dos-unsupported-character-glyph} variable; by default, this glyph +is an empty triangle. Use the @kbd{C-u C-x =} command to display the +actual code and character set of such characters. @xref{Position +Info,,,emacs, the Emacs Manual}. + +@findex codepage-setup + By default, Emacs defines a coding system to support the current +codepage. To define a coding system for some other codepage (e.g., to +visit a file written on a DOS machine in another country), use the +@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of +the codepage, with completion, then creates the coding system for the +specified codepage. You can then use the new coding system to read and +write files, but you must specify it explicitly for the file command +when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}). + + These coding systems are also useful for visiting a file encoded using +a DOS codepage, using Emacs running on some other operating system. + +@cindex MS-Windows codepages + MS-Windows provides its own codepages, which are different from the +DOS codepages for the same locale. For example, DOS codepage 850 +supports the same character set as Windows codepage 1252; DOS codepage +855 supports the same character set as Windows codepage 1251, etc. +The MS-Windows version of Emacs uses the current codepage for display +when invoked with the @samp{-nw} option. Support for codepages in the +Windows port of Emacs is part of the @file{code-pages.el} package. + +@node MS-DOS Processes +@section Subprocesses on MS-DOS + +@cindex compilation under MS-DOS +@cindex inferior processes under MS-DOS +@findex compile @r{(MS-DOS)} +@findex grep @r{(MS-DOS)} + Because MS-DOS is a single-process ``operating system,'' +asynchronous subprocesses are not available. In particular, Shell +mode and its variants do not work. Most Emacs features that use +asynchronous subprocesses also don't work on MS-DOS, including +Shell mode and GUD. When in doubt, try and see; commands that +don't work output an error message saying that asynchronous processes +aren't supported. + + Compilation under Emacs with @kbd{M-x compile}, searching files with +@kbd{M-x grep} and displaying differences between files with @kbd{M-x +diff} do work, by running the inferior processes synchronously. This +means you cannot do any more editing until the inferior process +finishes. + + Spell checking also works, by means of special support for synchronous +invocation of the @code{ispell} program. This is slower than the +asynchronous invocation on other platforms + + Instead of the Shell mode, which doesn't work on MS-DOS, you can use +the @kbd{M-x eshell} command. This invokes the Eshell package that +implements a Posix-like shell entirely in Emacs Lisp. + + By contrast, Emacs compiled as a native Windows application +@strong{does} support asynchronous subprocesses. @xref{Windows +Processes,,,emacs, the Emacs Manual}. + +@cindex printing under MS-DOS + Printing commands, such as @code{lpr-buffer} +(@pxref{Printing,,,emacs, the Emacs Manual}) and +@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}), +work in MS-DOS by sending the output to one of the printer ports. +@xref{MS-DOS Printing,,,emacs, the Emacs Manual}. + + When you run a subprocess synchronously on MS-DOS, make sure the +program terminates and does not try to read keyboard input. If the +program does not terminate on its own, you will be unable to terminate +it, because MS-DOS provides no general way to terminate a process. +Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these +cases. + + Accessing files on other machines is not supported on MS-DOS. Other +network-oriented commands such as sending mail, Web browsing, remote +login, etc., don't work either, unless network access is built into +MS-DOS with some network redirector. + +@cindex directory listing on MS-DOS +@vindex dired-listing-switches @r{(MS-DOS)} + Dired on MS-DOS uses the @code{ls-lisp} package where other +platforms use the system @code{ls} command. Therefore, Dired on +MS-DOS supports only some of the possible options you can mention in +the @code{dired-listing-switches} variable. The options that work are +@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, +@samp{-s}, @samp{-t}, and @samp{-u}. + + @node Index @unnumbered Index diff --git a/man/emacs.texi b/man/emacs.texi index 44a718c9911..0dc04945e9f 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -127,7 +127,7 @@ and Sending Mail and Registers and Minibuffer. * Glossary:: The glossary. * Antinews:: Information about Emacs version 21. * Mac OS:: Using Emacs in the Mac. -* MS-DOS:: Using Emacs on MS-DOS and Microsoft Windows. +* Emacs and Microsoft Windows:: Using Emacs on Microsoft Windows. * Manifesto:: What's GNU? Gnu's Not Unix! * Acknowledgments:: Major contributors to GNU Emacs. @@ -860,16 +860,9 @@ Emacs and Mac OS * Mac Font Specs:: Specifying fonts on Mac. * Mac Functions:: Mac-specific Lisp functions. -MS-DOS and Windows 95/98/NT +Emacs and Microsoft Windows -* MS-DOS Keyboard:: Keyboard usage on MS-DOS. -* MS-DOS Mouse:: Mouse usage on MS-DOS. -* MS-DOS Display:: Fonts, frames and display size on MS-DOS. -* MS-DOS File Names:: File-name conventions on MS-DOS. * Text and Binary:: Text files on MS-DOS use CRLF to separate lines. -* MS-DOS Printing:: How to specify the printer on MS-DOS. -* MS-DOS and MULE:: Support for internationalization on MS-DOS. -* MS-DOS Processes:: Running subprocesses on MS-DOS. * Windows Processes:: Running subprocesses on Windows. * Windows System Menu:: Controlling what the ALT key does. @end menu @@ -931,10 +924,10 @@ This edition of the manual is intended for use with GNU Emacs installed on GNU and Unix systems. GNU Emacs can also be used on VMS, MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems. Those systems use different file name syntax; in addition, VMS and -MS-DOS do not support all GNU Emacs features. @xref{MS-DOS}, for -information about using Emacs on MS-DOS and Windows. @xref{Mac OS}, -for information about using Emacs on Macintosh. We don't try to -describe VMS usage in this manual. +MS-DOS do not support all GNU Emacs features. @xref{Emacs and +Microsoft Windows}, for information about using Emacs on Windows. +@xref{Mac OS}, for information about using Emacs on Macintosh. We +don't try to describe VMS usage in this manual. @end iftex @node Distrib, Intro, Top, Top diff --git a/man/frames.texi b/man/frames.texi index b5ec21533b7..c11d6f74685 100644 --- a/man/frames.texi +++ b/man/frames.texi @@ -27,7 +27,7 @@ it terminates all the frames. To delete just one frame, use @kbd{C-x 5 Emacs compiled for MS-DOS emulates some windowing functionality, so that you can use many of the features described in this chapter. -@xref{MS-DOS Mouse}, for more information. +@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}. @menu * Mouse Commands:: Moving, cutting, and pasting, with the mouse. diff --git a/man/gnu.texi b/man/gnu.texi index c2652d09a7b..6b050d7839a 100644 --- a/man/gnu.texi +++ b/man/gnu.texi @@ -2,7 +2,7 @@ @c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004, @c 2005, 2006 Free Software Foundation, Inc. @ifclear justgnu -@node Manifesto,, MS-DOS, Top +@node Manifesto,, Emacs and Microsoft Windows, Top @unnumbered The GNU Manifesto @end ifclear @ifset justgnu diff --git a/man/macos.texi b/man/macos.texi index ba0f9e995ca..89ce13d1d1b 100644 --- a/man/macos.texi +++ b/man/macos.texi @@ -2,7 +2,7 @@ @c Copyright (C) 2000, 2001, 2002, 2003, 2004, @c 2005, 2006 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node Mac OS, MS-DOS, Antinews, Top +@node Mac OS, Emacs and Microsoft Windows, Antinews, Top @appendix Emacs and Mac OS @cindex Mac OS @cindex Macintosh diff --git a/man/msdog.texi b/man/msdog.texi index 434427b49b4..3bdc9051a71 100644 --- a/man/msdog.texi +++ b/man/msdog.texi @@ -2,307 +2,28 @@ @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, @c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node MS-DOS, Manifesto, Mac OS, Top -@appendix Emacs and Microsoft Systems -@cindex MS-DOG +@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top +@appendix Emacs and Microsoft Windows @cindex Microsoft Windows -@cindex MS-DOS peculiarities - This section briefly describes the peculiarities of using Emacs on -the MS-DOS ``operating system'' (also known as ``MS-DOG'') and on -Microsoft Windows. + This section describes peculiarities of using Emacs on Microsoft +Windows. Information about Emacs and Microsoft's older MS-DOS +``operating system'' (also known as ``MS-DOG'') is now in a separate +manual (@inforef{MS-DOG,, emacs-xtra}). - If you build Emacs for MS-DOS, the binary will also run on Windows -3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS -application; all the of this chapter applies for all of those systems, -if you use an Emacs that was built for MS-DOS. - - However, if you want to use Emacs on Windows, you would normally -build Emacs specifically for Windows. If you do that, most of this -chapter does not apply; instead, you get behavior much closer to what -is documented in the rest of the manual, including support for long -file names, multiple frames, scroll bars, mouse menus, and -subprocesses. However, the section on text files and binary files -does still apply. There are also two sections at the end of this -chapter which apply specifically for the Windows version. + Iif you want to use Emacs on Windows, you would normally build Emacs +specifically for Windows. If you do that, the behavior is reasonably +similar to what is documented in the rest of the manual, including +support for long file names, multiple frames, scroll bars, mouse +menus, and subprocesses. However, a few special considerations apply, +and they are described here. @menu -* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. -* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. -* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. -* Files: MS-DOS File Names. File name conventions on MS-DOS. -* Text and Binary:: Text files on MS-DOS use CRLF to separate lines. -* Printing: MS-DOS Printing. How to specify the printer on MS-DOS. -* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. -* Processes: MS-DOS Processes. Running subprocesses on MS-DOS. +* Text and Binary:: Text files use CRLF to terminate lines. * Windows Processes:: Running subprocesses on Windows. * Windows System Menu:: Controlling what the ALT key does. @end menu -@node MS-DOS Keyboard -@section Keyboard Usage on MS-DOS - -@kindex DEL @r{(MS-DOS)} -@kindex BS @r{(MS-DOS)} - The key that is called @key{DEL} in Emacs (because that's how it is -designated on most workstations) is known as @key{BS} (backspace) on a -PC. That is why the PC-specific terminal initialization remaps the -@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act -as @kbd{C-d} for the same reasons. - -@kindex C-g @r{(MS-DOS)} -@kindex C-BREAK @r{(MS-DOS)} -@cindex quitting on MS-DOS - Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit -character, just like @kbd{C-g}. This is because Emacs cannot detect -that you have typed @kbd{C-g} until it is ready for more input. As a -consequence, you cannot use @kbd{C-g} to stop a running command -(@pxref{Quitting}). By contrast, @kbd{C-@key{BREAK}} @emph{is} detected -as soon as you type it (as @kbd{C-g} is on other systems), so it can be -used to stop a running command and for emergency escape -(@pxref{Emergency Escape}). - -@cindex Meta (under MS-DOS) -@cindex Hyper (under MS-DOS) -@cindex Super (under MS-DOS) -@vindex dos-super-key -@vindex dos-hyper-key - The PC keyboard maps use the left @key{ALT} key as the @key{META} key. -You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: -choose either the right @key{CTRL} key or the right @key{ALT} key by -setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 -or 2 respectively. If neither @code{dos-super-key} nor -@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is -also mapped to the @key{META} key. However, if the MS-DOS international -keyboard support program @file{KEYB.COM} is installed, Emacs will -@emph{not} map the right @key{ALT} to @key{META}, since it is used for -accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard -layouts; in this case, you may only use the left @key{ALT} as @key{META} -key. - -@kindex C-j @r{(MS-DOS)} -@vindex dos-keypad-mode - The variable @code{dos-keypad-mode} is a flag variable that controls -what key codes are returned by keys in the numeric keypad. You can also -define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the -following line into your @file{_emacs} file: - -@smallexample -;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.} -(define-key function-key-map [kp-enter] [?\C-j]) -@end smallexample - -@node MS-DOS Mouse -@section Mouse Usage on MS-DOS - -@cindex mouse support under MS-DOS - Emacs on MS-DOS supports a mouse (on the default terminal only). -The mouse commands work as documented, including those that use menus -and the menu bar (@pxref{Menu Bar}). Scroll bars don't work in -MS-DOS Emacs. PC mice usually have only two buttons; these act as -@kbd{Mouse-1} and @kbd{Mouse-2}, but if you press both of them -together, that has the effect of @kbd{Mouse-3}. If the mouse does have -3 buttons, Emacs detects that at startup, and all the 3 buttons function -normally, as on X. - - Help strings for menu-bar and pop-up menus are displayed in the echo -area when the mouse pointer moves across the menu items. -Highlighting of mouse-sensitive text (@pxref{Mouse References}) is also -supported. - -@cindex mouse, set number of buttons -@findex msdos-set-mouse-buttons - Some versions of mouse drivers don't report the number of mouse -buttons correctly. For example, mice with a wheel report that they -have 3 buttons, but only 2 of them are passed to Emacs; the clicks on -the wheel, which serves as the middle button, are not passed. In -these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command -to tell Emacs how many mouse buttons to expect. You could make such a -setting permanent by adding this fragment to your @file{_emacs} init -file: - -@example -;; @r{Treat the mouse like a 2-button mouse.} -(msdos-set-mouse-buttons 2) -@end example - -@cindex Windows clipboard support - Emacs built for MS-DOS supports clipboard operations when it runs on -Windows. Commands that put text on the kill ring, or yank text from the -ring, check the Windows clipboard first, just as Emacs does on the X -Window System (@pxref{Mouse Commands}). Only the primary selection and -the cut buffer are supported by MS-DOS Emacs on Windows; the secondary -selection always appears as empty. - - Due to the way clipboard access is implemented by Windows, the -length of text you can put into the clipboard is limited by the amount -of free DOS memory that is available to Emacs. Usually, up to 620KB of -text can be put into the clipboard, but this limit depends on the system -configuration and is lower if you run Emacs as a subprocess of -another program. If the killed text does not fit, Emacs outputs a -message saying so, and does not put the text into the clipboard. - - Null characters also cannot be put into the Windows clipboard. If the -killed text includes null characters, Emacs does not put such text into -the clipboard, and displays in the echo area a message to that effect. - -@vindex dos-display-scancodes - The variable @code{dos-display-scancodes}, when non-@code{nil}, -directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of -each keystroke; this feature serves as a complement to the -@code{view-lossage} command, for debugging. - -@node MS-DOS Display -@section Display on MS-DOS -@cindex faces under MS-DOS -@cindex fonts, emulating under MS-DOS - - Display on MS-DOS cannot use font variants, like bold or italic, -but it does support -multiple faces, each of which can specify a foreground and a background -color. Therefore, you can get the full functionality of Emacs packages -that use fonts (such as @code{font-lock}, Enriched Text mode, and -others) by defining the relevant faces to use different colors. Use the -@code{list-colors-display} command (@pxref{Frame Parameters}) and the -@code{list-faces-display} command (@pxref{Faces}) to see what colors and -faces are available and what they look like. - - @xref{MS-DOS and MULE}, later in this chapter, for information on -how Emacs displays glyphs and characters that aren't supported by the -native font built into the DOS display. - -@cindex cursor shape on MS-DOS - When Emacs starts, it changes the cursor shape to a solid box. This -is for compatibility with other systems, where the box cursor is the -default in Emacs. This default shape can be changed to a bar by -specifying the @code{cursor-type} parameter in the variable -@code{default-frame-alist} (@pxref{Creating Frames}). The MS-DOS -terminal doesn't support a vertical-bar cursor, so the bar cursor is -horizontal, and the @code{@var{width}} parameter, if specified by the -frame parameters, actually determines its height. For this reason, -the @code{bar} and @code{hbar} cursor types produce the same effect on -MS-DOS. As an extension, the bar cursor specification can include the -starting scan line of the cursor as well as its width, like this: - -@example - '(cursor-type bar @var{width} . @var{start}) -@end example - -@noindent -In addition, if the @var{width} parameter is negative, the cursor bar -begins at the top of the character cell. - -@cindex frames on MS-DOS - The MS-DOS terminal can only display a single frame at a time. The -Emacs frame facilities work on MS-DOS much as they do on text-only -terminals (@pxref{Frames}). When you run Emacs from a DOS window on -MS-Windows, you can make the visible frame smaller than the full -screen, but Emacs still cannot display more than a single frame at a -time. - -@cindex frame size under MS-DOS -@findex mode4350 -@findex mode25 - The @code{mode4350} command switches the display to 43 or 50 -lines, depending on your hardware; the @code{mode25} command switches -to the default 80x25 screen size. - - By default, Emacs only knows how to set screen sizes of 80 columns by -25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has -special video modes that will switch the display to other sizes, you can -have Emacs support those too. When you ask Emacs to switch the frame to -@var{n} rows by @var{m} columns dimensions, it checks if there is a -variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, -uses its value (which must be an integer) as the video mode to switch -to. (Emacs switches to that video mode by calling the BIOS @code{Set -Video Mode} function with the value of -@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) -For example, suppose your adapter will switch to 66x80 dimensions when -put into video mode 85. Then you can make Emacs support this screen -size by putting the following into your @file{_emacs} file: - -@example -(setq screen-dimensions-66x80 85) -@end example - - Since Emacs on MS-DOS can only set the frame size to specific -supported dimensions, it cannot honor every possible frame resizing -request. When an unsupported size is requested, Emacs chooses the next -larger supported size beyond the specified size. For example, if you -ask for 36x80 frame, you will get 40x80 instead. - - The variables @code{screen-dimensions-@var{n}x@var{m}} are used only -when they exactly match the specified size; the search for the next -larger supported size ignores them. In the above example, even if your -VGA supports 38x80 dimensions and you define a variable -@code{screen-dimensions-38x80} with a suitable value, you will still get -40x80 screen when you ask for a 36x80 frame. If you want to get the -38x80 size in this case, you can do it by setting the variable named -@code{screen-dimensions-36x80} with the same video mode value as -@code{screen-dimensions-38x80}. - - Changing frame dimensions on MS-DOS has the effect of changing all the -other frames to the new dimensions. - -@node MS-DOS File Names -@section File Names on MS-DOS -@cindex file names under MS-DOS -@cindex init file, default name under MS-DOS - - MS-DOS normally uses a backslash, @samp{\}, to separate name units -within a file name, instead of the slash used on other systems. Emacs -on MS-DOS permits use of either slash or backslash, and also knows -about drive letters in file names. - - On MS-DOS, file names are case-insensitive and limited to eight -characters, plus optionally a period and three more characters. Emacs -knows enough about these limitations to handle file names that were -meant for other operating systems. For instance, leading dots @samp{.} -in file names are invalid in MS-DOS, so Emacs transparently converts -them to underscores @samp{_}; thus your default init file (@pxref{Init -File}) is called @file{_emacs} on MS-DOS. Excess characters before or -after the period are generally ignored by MS-DOS itself; thus, if you -visit the file @file{LongFileName.EvenLongerExtension}, you will -silently get @file{longfile.eve}, but Emacs will still display the long -file name on the mode line. Other than that, it's up to you to specify -file names which are valid under MS-DOS; the transparent conversion as -described above only works on file names built into Emacs. - -@cindex backup file names on MS-DOS - The above restrictions on the file names on MS-DOS make it almost -impossible to construct the name of a backup file (@pxref{Backup -Names}) without losing some of the original file name characters. For -example, the name of a backup file for @file{docs.txt} is -@file{docs.tx~} even if single backup is used. - -@cindex file names under Windows 95/NT -@cindex long file names in DOS box under Windows 95/NT - If you run Emacs as a DOS application under Windows 9X, Windows ME, or -Windows 2000, you can turn on support for long file names. If you do -that, Emacs doesn't truncate file names or convert them to lower case; -instead, it uses the file names that you specify, verbatim. To enable -long file name support, set the environment variable @env{LFN} to -@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow -DOS programs to access long file names, so Emacs built for MS-DOS will -only see their short 8+3 aliases. - -@cindex @env{HOME} directory under MS-DOS - MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends -that the directory where it is installed is the value of the @env{HOME} -environment variable. That is, if your Emacs binary, -@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then -Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In -particular, that is where Emacs looks for the init file @file{_emacs}. -With this in mind, you can use @samp{~} in file names as an alias for -the home directory, as you would on GNU or Unix. You can also set -@env{HOME} variable in the environment before starting Emacs; its -value will then override the above default behavior. - - Emacs on MS-DOS handles the directory name @file{/dev} specially, -because of a feature in the emulator libraries of DJGPP that pretends -I/O devices have names in that directory. We recommend that you avoid -using an actual directory named @file{/dev} on any disk. - @node Text and Binary @section Text Files and Binary Files @cindex text and binary files on MS-DOS/MS-Windows @@ -419,379 +140,6 @@ always writes those files with DOS-style EOLs. the file-name patterns in @code{file-name-buffer-file-type-alist}, the EOL conversion is determined by @code{file-name-buffer-file-type-alist}. -@node MS-DOS Printing -@section Printing and MS-DOS - - Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and -@code{ps-print-buffer} (@pxref{PostScript}) can work in MS-DOS and -MS-Windows by sending the output to one of the printer ports, if a -Posix-style @code{lpr} program is unavailable. The same Emacs -variables control printing on all systems, but in some cases they have -different default values on MS-DOS and MS-Windows. - -@vindex printer-name @r{(MS-DOS)} - If you want to use your local printer, printing on it in the usual DOS -manner, then set the Lisp variable @code{lpr-command} to @code{""} (its -default value) and @code{printer-name} to the name of the printer -port---for example, @code{"PRN"}, the usual local printer port (that's -the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer. -You can also set @code{printer-name} to a file name, in which case -``printed'' output is actually appended to that file. If you set -@code{printer-name} to @code{"NUL"}, printed output is silently -discarded (sent to the system null device). - - On MS-Windows, when the Windows network software is installed, you can -also use a printer shared by another machine by setting -@code{printer-name} to the UNC share name for that printer---for example, -@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward -slashes or backslashes here.) To find out the names of shared printers, -run the command @samp{net view} at a DOS command prompt to obtain a list -of servers, and @samp{net view @var{server-name}} to see the names of printers -(and directories) shared by that server. Alternatively, click the -@samp{Network Neighborhood} icon on your desktop, and look for machines -which share their printers via the network. - -@cindex @samp{net use}, and printing on MS-Windows -@cindex networked printers (MS-Windows) - If the printer doesn't appear in the output of @samp{net view}, or -if setting @code{printer-name} to the UNC share name doesn't produce a -hardcopy on that printer, you can use the @samp{net use} command to -connect a local print port such as @code{"LPT2"} to the networked -printer. For example, typing @kbd{net use LPT2: -\\joes_pc\hp4si}@footnote{ -Note that the @samp{net use} command requires the UNC share name to be -typed with the Windows-style backslashes, while the value of -@code{printer-name} can be set with either forward- or backslashes.} -causes Windows to @dfn{capture} the LPT2 port and redirect the printed -material to the printer connected to the machine @code{joes_pc}. -After this command, setting @code{printer-name} to @code{"LPT2"} -should produce the hardcopy on the networked printer. - - With some varieties of Windows network software, you can instruct -Windows to capture a specific printer port such as @code{"LPT2"}, and -redirect it to a networked printer via the @w{@code{Control -Panel->Printers}} applet instead of @samp{net use}. - - Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even -though they are connected to a Windows machine which uses a different -encoding for the same locale. For example, in the Latin-1 locale, DOS -uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and -MULE}. When you print to such printers from Windows, you can use the -@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before -@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS -codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET -M-x lpr-region RET} will print the region while converting it to the -codepage 850 encoding. You may need to create the @code{cp@var{nnn}} -coding system with @kbd{M-x codepage-setup}. - - If you set @code{printer-name} to a file name, it's best to use an -absolute file name. Emacs changes the working directory according to -the default directory of the current buffer, so if the file name in -@code{printer-name} is relative, you will end up with several such -files, each one in the directory of the buffer from which the printing -was done. - -@findex print-buffer @r{(MS-DOS)} -@findex print-region @r{(MS-DOS)} -@vindex lpr-headers-switches @r{(MS-DOS)} - The commands @code{print-buffer} and @code{print-region} call the -@code{pr} program, or use special switches to the @code{lpr} program, to -produce headers on each printed page. MS-DOS and MS-Windows don't -normally have these programs, so by default, the variable -@code{lpr-headers-switches} is set so that the requests to print page -headers are silently ignored. Thus, @code{print-buffer} and -@code{print-region} produce the same output as @code{lpr-buffer} and -@code{lpr-region}, respectively. If you do have a suitable @code{pr} -program (for example, from GNU Textutils), set -@code{lpr-headers-switches} to @code{nil}; Emacs will then call -@code{pr} to produce the page headers, and print the resulting output as -specified by @code{printer-name}. - -@vindex print-region-function @r{(MS-DOS)} -@cindex lpr usage under MS-DOS -@vindex lpr-command @r{(MS-DOS)} -@vindex lpr-switches @r{(MS-DOS)} - Finally, if you do have an @code{lpr} work-alike, you can set the -variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use -@code{lpr} for printing, as on other systems. (If the name of the -program isn't @code{lpr}, set @code{lpr-command} to specify where to -find it.) The variable @code{lpr-switches} has its standard meaning -when @code{lpr-command} is not @code{""}. If the variable -@code{printer-name} has a string value, it is used as the value for the -@code{-P} option to @code{lpr}, as on Unix. - -@findex ps-print-buffer @r{(MS-DOS)} -@findex ps-spool-buffer @r{(MS-DOS)} -@vindex ps-printer-name @r{(MS-DOS)} -@vindex ps-lpr-command @r{(MS-DOS)} -@vindex ps-lpr-switches @r{(MS-DOS)} - A parallel set of variables, @code{ps-lpr-command}, -@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript -Variables}), defines how PostScript files should be printed. These -variables are used in the same way as the corresponding variables -described above for non-PostScript printing. Thus, the value of -@code{ps-printer-name} is used as the name of the device (or file) to -which PostScript output is sent, just as @code{printer-name} is used for -non-PostScript printing. (There are two distinct sets of variables in -case you have two printers attached to two different ports, and only one -of them is a PostScript printer.) - - The default value of the variable @code{ps-lpr-command} is @code{""}, -which causes PostScript output to be sent to the printer port specified -by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to -the name of a program which will accept PostScript files. Thus, if you -have a non-PostScript printer, you can set this variable to the name of -a PostScript interpreter program (such as Ghostscript). Any switches -that need to be passed to the interpreter program are specified using -@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a -string, it will be added to the list of switches as the value for the -@code{-P} option. This is probably only useful if you are using -@code{lpr}, so when using an interpreter typically you would set -@code{ps-printer-name} to something other than a string so it is -ignored.) - - For example, to use Ghostscript for printing on an Epson printer -connected to the @samp{LPT2} port, put this in your @file{_emacs} file: - -@example -(setq ps-printer-name t) ; Ghostscript doesn't understand -P -(setq ps-lpr-command "c:/gs/gs386") -(setq ps-lpr-switches '("-q" "-dNOPAUSE" - "-sDEVICE=epson" - "-r240x72" - "-sOutputFile=LPT2" - "-Ic:/gs")) -@end example - -@noindent -(This assumes that Ghostscript is installed in the @file{"c:/gs"} -directory.) - -@vindex dos-printer -@vindex dos-ps-printer - For backwards compatibility, the value of @code{dos-printer} -(@code{dos-ps-printer}), if it has a value, overrides the value of -@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows -only. - - -@node MS-DOS and MULE -@section International Support on MS-DOS -@cindex international support @r{(MS-DOS)} - - Emacs on MS-DOS supports the same international character sets as it -does on GNU, Unix and other platforms (@pxref{International}), including -coding systems for converting between the different character sets. -However, due to incompatibilities between MS-DOS/MS-Windows and other systems, -there are several DOS-specific aspects of this support that you should -be aware of. This section describes these aspects. - - The description below is largely specific to the MS-DOS port of -Emacs, especially where it talks about practical implications for -Emacs users. For other operating systems, see the @file{code-pages.el} -package, which implements support for MS-DOS- and MS-Windows-specific -encodings for all platforms other than MS-DOS. - -@table @kbd -@item M-x dos-codepage-setup -Set up Emacs display and coding systems as appropriate for the current -DOS codepage. - -@item M-x codepage-setup -Create a coding system for a certain DOS codepage. -@end table - -@cindex codepage, MS-DOS -@cindex DOS codepages - MS-DOS is designed to support one character set of 256 characters at -any given time, but gives you a variety of character sets to choose -from. The alternative character sets are known as @dfn{DOS codepages}. -Each codepage includes all 128 @acronym{ASCII} characters, but the other 128 -characters (codes 128 through 255) vary from one codepage to another. -Each DOS codepage is identified by a 3-digit number, such as 850, 862, -etc. - - In contrast to X, which lets you use several fonts at the same time, -MS-DOS normally doesn't allow use of several codepages in a single -session. MS-DOS was designed to load a single codepage at system -startup, and require you to reboot in order to change -it@footnote{Normally, one particular codepage is burnt into the -display memory, while other codepages can be installed by modifying -system configuration files, such as @file{CONFIG.SYS}, and rebooting. -While there is third-party software that allows changing the codepage -without rebooting, we describe here how a stock MS-DOS system -behaves.}. Much the same limitation applies when you run DOS -executables on other systems such as MS-Windows. - -@cindex unibyte operation @r{(MS-DOS)} - If you invoke Emacs on MS-DOS with the @samp{--unibyte} option -(@pxref{Initial Options}), Emacs does not perform any conversion of -non-@acronym{ASCII} characters. Instead, it reads and writes any non-@acronym{ASCII} -characters verbatim, and sends their 8-bit codes to the display -verbatim. Thus, unibyte Emacs on MS-DOS supports the current codepage, -whatever it may be, but cannot even represent any other characters. - -@vindex dos-codepage - For multibyte operation on MS-DOS, Emacs needs to know which -characters the chosen DOS codepage can display. So it queries the -system shortly after startup to get the chosen codepage number, and -stores the number in the variable @code{dos-codepage}. Some systems -return the default value 437 for the current codepage, even though the -actual codepage is different. (This typically happens when you use the -codepage built into the display hardware.) You can specify a different -codepage for Emacs to use by setting the variable @code{dos-codepage} in -your init file. - -@cindex language environment, automatic selection on @r{MS-DOS} - Multibyte Emacs supports only certain DOS codepages: those which can -display Far-Eastern scripts, like the Japanese codepage 932, and those -that encode a single ISO 8859 character set. - - The Far-Eastern codepages can directly display one of the MULE -character sets for these countries, so Emacs simply sets up to use the -appropriate terminal coding system that is supported by the codepage. -The special features described in the rest of this section mostly -pertain to codepages that encode ISO 8859 character sets. - - For the codepages which correspond to one of the ISO character sets, -Emacs knows the character set name based on the codepage number. Emacs -automatically creates a coding system to support reading and writing -files that use the current codepage, and uses this coding system by -default. The name of this coding system is @code{cp@var{nnn}}, where -@var{nnn} is the codepage number.@footnote{The standard Emacs coding -systems for ISO 8859 are not quite right for the purpose, because -typically the DOS codepage does not match the standard ISO character -codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has -code 231 in the standard Latin-1 character set, but the corresponding -DOS codepage 850 uses code 135 for this glyph.} - -@cindex mode line @r{(MS-DOS)} - All the @code{cp@var{nnn}} coding systems use the letter @samp{D} (for -``DOS'') as their mode-line mnemonic. Since both the terminal coding -system and the default coding system for file I/O are set to the proper -@code{cp@var{nnn}} coding system at startup, it is normal for the mode -line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode Line}. -Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding -systems, and thus their initial mode line looks like the Emacs default. - - Since the codepage number also indicates which script you are using, -Emacs automatically runs @code{set-language-environment} to select the -language environment for that script (@pxref{Language Environments}). - - If a buffer contains a character belonging to some other ISO 8859 -character set, not the one that the chosen DOS codepage supports, Emacs -displays it using a sequence of @acronym{ASCII} characters. For example, if the -current codepage doesn't have a glyph for the letter @samp{@`o} (small -@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where -the braces serve as a visual indication that this is a single character. -(This may look awkward for some non-Latin characters, such as those from -Greek or Hebrew alphabets, but it is still readable by a person who -knows the language.) Even though the character may occupy several -columns on the screen, it is really still just a single character, and -all Emacs commands treat it as one. - -@cindex IBM graphics characters (MS-DOS) -@cindex box-drawing characters (MS-DOS) -@cindex line-drawing characters (MS-DOS) - Not all characters in DOS codepages correspond to ISO 8859 -characters---some are used for other purposes, such as box-drawing -characters and other graphics. Emacs maps these characters to two -special character sets called @code{eight-bit-control} and -@code{eight-bit-graphic}, and displays them as their IBM glyphs. -However, you should be aware that other systems might display these -characters differently, so you should avoid them in text that might be -copied to a different operating system, or even to another DOS machine -that uses a different codepage. - -@vindex dos-unsupported-character-glyph - Emacs supports many other characters sets aside from ISO 8859, but it -cannot display them on MS-DOS. So if one of these multibyte characters -appears in a buffer, Emacs on MS-DOS displays them as specified by the -@code{dos-unsupported-character-glyph} variable; by default, this glyph -is an empty triangle. Use the @kbd{C-u C-x =} command to display the -actual code and character set of such characters. @xref{Position Info}. - -@findex codepage-setup - By default, Emacs defines a coding system to support the current -codepage. To define a coding system for some other codepage (e.g., to -visit a file written on a DOS machine in another country), use the -@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of -the codepage, with completion, then creates the coding system for the -specified codepage. You can then use the new coding system to read and -write files, but you must specify it explicitly for the file command -when you want to use it (@pxref{Text Coding}). - - These coding systems are also useful for visiting a file encoded using -a DOS codepage, using Emacs running on some other operating system. - -@cindex MS-Windows codepages - MS-Windows provides its own codepages, which are different from the -DOS codepages for the same locale. For example, DOS codepage 850 -supports the same character set as Windows codepage 1252; DOS codepage -855 supports the same character set as Windows codepage 1251, etc. -The MS-Windows version of Emacs uses the current codepage for display -when invoked with the @samp{-nw} option. Support for codepages in the -Windows port of Emacs is part of the @file{code-pages.el} package. - -@node MS-DOS Processes -@section Subprocesses on MS-DOS - -@cindex compilation under MS-DOS -@cindex inferior processes under MS-DOS -@findex compile @r{(MS-DOS)} -@findex grep @r{(MS-DOS)} - Because MS-DOS is a single-process ``operating system,'' -asynchronous subprocesses are not available. In particular, Shell -mode and its variants do not work. Most Emacs features that use -asynchronous subprocesses also don't work on MS-DOS, including -Shell mode and GUD. When in doubt, try and see; commands that -don't work output an error message saying that asynchronous processes -aren't supported. - - Compilation under Emacs with @kbd{M-x compile}, searching files with -@kbd{M-x grep} and displaying differences between files with @kbd{M-x -diff} do work, by running the inferior processes synchronously. This -means you cannot do any more editing until the inferior process -finishes. - - Spell checking also works, by means of special support for synchronous -invocation of the @code{ispell} program. This is slower than the -asynchronous invocation on other platforms - - Instead of the Shell mode, which doesn't work on MS-DOS, you can use -the @kbd{M-x eshell} command. This invokes the Eshell package that -implements a Posix-like shell entirely in Emacs Lisp. - - By contrast, Emacs compiled as a native Windows application -@strong{does} support asynchronous subprocesses. @xref{Windows -Processes}. - -@cindex printing under MS-DOS - Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and -@code{ps-print-buffer} (@pxref{PostScript}), work in MS-DOS by sending -the output to one of the printer ports. @xref{MS-DOS Printing}. - - When you run a subprocess synchronously on MS-DOS, make sure the -program terminates and does not try to read keyboard input. If the -program does not terminate on its own, you will be unable to terminate -it, because MS-DOS provides no general way to terminate a process. -Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these -cases. - - Accessing files on other machines is not supported on MS-DOS. Other -network-oriented commands such as sending mail, Web browsing, remote -login, etc., don't work either, unless network access is built into -MS-DOS with some network redirector. - -@cindex directory listing on MS-DOS -@vindex dired-listing-switches @r{(MS-DOS)} - Dired on MS-DOS uses the @code{ls-lisp} package where other -platforms use the system @code{ls} command. Therefore, Dired on -MS-DOS supports only some of the possible options you can mention in -the @code{dired-listing-switches} variable. The options that work are -@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, -@samp{-s}, @samp{-t}, and @samp{-u}. - @node Windows Processes @section Subprocesses on Windows 9X/ME and Windows NT/2K diff --git a/man/mule.texi b/man/mule.texi index 4b63fb90d4e..91c5aaaf47e 100644 --- a/man/mule.texi +++ b/man/mule.texi @@ -605,7 +605,7 @@ system; for example, to visit a file encoded in codepage 850, type @key{RET}}@footnote{ In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}} coding system with @kbd{M-x codepage-setup}, before you can use it. -@xref{MS-DOS and MULE}.}. +@xref{MS-DOS and MULE,,,emacs-extra,Specialized Emacs Features}.}. In addition to converting various representations of non-@acronym{ASCII} characters, a coding system can perform end-of-line conversion. Emacs diff --git a/man/trouble.texi b/man/trouble.texi index 6298e24805a..f44862598c4 100644 --- a/man/trouble.texi +++ b/man/trouble.texi @@ -58,7 +58,8 @@ Search}). like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to recognize @kbd{C-g} while a command is running, between interactions with the user. By contrast, it @emph{is} feasible to recognize -@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard}. +@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard,,,emacs-xtra, +Specialized Emacs Features}. @findex keyboard-quit @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t} From 398c9ffba6c6bbb593929e268bdae77bdfdc1288 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:03:48 +0000 Subject: [PATCH 017/141] (filter-buffer-substring): Add NOPROPS arg, so it can also replace buffer-substring-no-properties. --- lisp/simple.el | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 0b8ad7e4fb0..daf297d5fe2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2332,7 +2332,7 @@ return value of `filter-buffer-substring'. If this variable is nil, no filtering is performed.") -(defun filter-buffer-substring (beg end &optional delete) +(defun filter-buffer-substring (beg end &optional delete noprops) "Return the buffer substring between BEG and END, after filtering. The buffer substring is passed through each of the filter functions in `buffer-substring-filters', and the value from the @@ -2342,21 +2342,36 @@ is nil, the buffer substring is returned unaltered. If DELETE is non-nil, the text between BEG and END is deleted from the buffer. +If NOPROPS is non-nil, final string returned does not include +text properties, while the string passed to the filters still +includes text properties from the buffer text. + Point is temporarily set to BEG before calling `buffer-substring-filters', in case the functions need to know where the text came from. -This function should be used instead of `buffer-substring' or -`delete-and-extract-region' when you want to allow filtering to -take place. For example, major or minor modes can use -`buffer-substring-filters' to extract characters that are special -to a buffer, and should not be copied into other buffers." - (save-excursion - (goto-char beg) - (let ((string (if delete (delete-and-extract-region beg end) - (buffer-substring beg end)))) - (dolist (filter buffer-substring-filters string) - (setq string (funcall filter string)))))) +This function should be used instead of `buffer-substring', +`buffer-substring-no-properties', or `delete-and-extract-region' +when you want to allow filtering to take place. For example, +major or minor modes can use `buffer-substring-filters' to +extract characters that are special to a buffer, and should not +be copied into other buffers." + (cond + ((or delete buffer-substring-filters) + (save-excursion + (goto-char beg) + (let ((string (if delete (delete-and-extract-region beg end) + (buffer-substring beg end)))) + (dolist (filter buffer-substring-filters) + (setq string (funcall filter string))) + (if noprops + (set-text-properties 0 (length string) nil string)) + string))) + (noprops + (buffer-substring-no-properties beg end)) + (t + (buffer-substring beg end)))) + ;;;; Window system cut and paste hooks. @@ -3742,7 +3757,7 @@ If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (interactive "p") (or arg (setq arg 1)) - + (let ((orig (point))) ;; Move by lines, if ARG is not 1 (the default). From cf2114043632d3b1979c66f7a9da99c4d1c60590 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:04:07 +0000 Subject: [PATCH 018/141] (cua-delete-region, cua-paste) (cua-repeat-replace-region): Use filter-buffer-substring. --- lisp/emulation/cua-base.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index e7888dbdb0e..2d169e889cd 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -769,7 +769,7 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil." (let ((start (mark)) (end (point))) (or (<= start end) (setq start (prog1 end (setq end start)))) - (setq cua--last-deleted-region-text (buffer-substring start end)) + (setq cua--last-deleted-region-text (filter-buffer-substring start end)) (if cua-delete-copy-to-register-0 (set-register ?0 cua--last-deleted-region-text)) (delete-region start end) @@ -858,7 +858,7 @@ If global mark is active, copy from register or one character." (if regtxt (cua--insert-at-global-mark regtxt) (when (not (eobp)) - (cua--insert-at-global-mark (buffer-substring (point) (+ (point) count))) + (cua--insert-at-global-mark (filter-buffer-substring (point) (+ (point) count))) (forward-char count)))) (buffer-read-only (message "Cannot paste into a read-only buffer")) @@ -875,7 +875,7 @@ If global mark is active, copy from register or one character." (setq paste-lines (cua--delete-rectangle)) (if (= paste-lines 1) (setq paste-lines nil))) ;; paste all - (if (string= (buffer-substring (point) (mark)) + (if (string= (filter-buffer-substring (point) (mark)) (car kill-ring)) (current-kill 1)) (cua-delete-region))) @@ -950,7 +950,7 @@ of text." (setq s (car u) e (cdr u))))))) (setq cua--repeat-replace-text (cond ((and s e (<= s e) (= s (mark t))) - (buffer-substring-no-properties s e)) + (filter-buffer-substring s e nil t)) ((and (null s) (eq u elt)) ;; nothing inserted "") (t From 15ac4d58250bcd7502a48aaeb6ba14204c6d362d Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:04:22 +0000 Subject: [PATCH 019/141] (cua--extract-rectangle) (cua-incr-rectangle, cua--rectangle-aux-replace): Use filter-buffer-substring. --- lisp/emulation/cua-rect.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 53056d667fb..43a66fd0e3e 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -631,7 +631,7 @@ If command is repeated at same position, delete the rectangle." (if (not (cua--rectangle-virtual-edges)) (cua--rectangle-operation nil nil nil nil nil ; do not tabify '(lambda (s e l r) - (setq rect (cons (buffer-substring-no-properties s e) rect)))) + (setq rect (cons (filter-buffer-substring s e nil t) rect)))) (cua--rectangle-operation nil 1 nil nil nil ; do not tabify '(lambda (s e l r v) (let ((copy t) (bs 0) (as 0) row) @@ -649,7 +649,7 @@ If command is repeated at same position, delete the rectangle." (setq as (- r (max (current-column) l)) e (point))) (setq row (if (and copy (> e s)) - (buffer-substring-no-properties s e) + (filter-buffer-substring s e nil t) "")) (when (> bs 0) (setq row (concat (make-string bs ?\s) row))) @@ -1127,12 +1127,12 @@ The length of STRING need not be the same as the rectangle width." '(lambda (s e l r) (cond ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t) - (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1))) + (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t)) (n (string-to-number txt 16)) (fmt (format "0x%%0%dx" (length txt)))) (replace-match (format fmt (+ n increment))))) ((re-search-forward "\\( *-?[0-9]+\\)" e t) - (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1))) + (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t)) (prefix (if (= (aref txt 0) ?0) "0" "")) (n (string-to-number txt 10)) (fmt (format "%%%s%dd" prefix (length txt)))) @@ -1213,7 +1213,7 @@ The numbers are formatted according to the FORMAT string." (when replace (goto-char (point-min)) (while (not (eobp)) - (setq z (cons (buffer-substring (point) (line-end-position)) z)) + (setq z (cons (filter-buffer-substring (point) (line-end-position)) z)) (forward-line 1)))) (if (not cua--debug) (kill-buffer auxbuf)) From a4dad45a786371837a5e6030a874858fc2ecbc4a Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:04:33 +0000 Subject: [PATCH 020/141] (cua-copy-region-to-global-mark) (cua-cut-region-to-global-mark): Use filter-buffer-substring. --- lisp/emulation/cua-gmrk.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el index c3e6727ab65..842ee9ce0e3 100644 --- a/lisp/emulation/cua-gmrk.el +++ b/lisp/emulation/cua-gmrk.el @@ -143,7 +143,7 @@ With prefix argument, don't jump to global mark when cancelling it." (let ((src-buf (current-buffer))) (save-excursion (if (equal (marker-buffer cua--global-mark-marker) src-buf) - (let ((text (buffer-substring-no-properties start end))) + (let ((text (filter-buffer-substring start end nil t))) (goto-char (marker-position cua--global-mark-marker)) (insert text)) (set-buffer (marker-buffer cua--global-mark-marker)) @@ -167,7 +167,7 @@ With prefix argument, don't jump to global mark when cancelling it." (if (and (< start (marker-position cua--global-mark-marker)) (< (marker-position cua--global-mark-marker) end)) (message "Can't move region into itself") - (let ((text (buffer-substring-no-properties start end)) + (let ((text (filter-buffer-substring start end nil t)) (p1 (copy-marker start)) (p2 (copy-marker end))) (goto-char (marker-position cua--global-mark-marker)) From 1f8a33db8c92c2bae36c26588cfcdb46f8aed873 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:05:07 +0000 Subject: [PATCH 021/141] (Buffer Contents): Add NOPROPS arg to filter-buffer-substring. --- lispref/text.texi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lispref/text.texi b/lispref/text.texi index 3a0d4f7a585..d506341f0d5 100644 --- a/lispref/text.texi +++ b/lispref/text.texi @@ -205,7 +205,7 @@ This is like @code{buffer-substring}, except that it does not copy text properties, just the characters themselves. @xref{Text Properties}. @end defun -@defun filter-buffer-substring start end &optional delete +@defun filter-buffer-substring start end &optional delete noprops This function passes the buffer text between @var{start} and @var{end} through the filter functions specified by the variable @code{buffer-substring-filters}, and returns the value from the last @@ -217,7 +217,12 @@ If @var{delete} is non-@code{nil}, this function deletes the text between @var{start} and @var{end} after copying it, like @code{delete-and-extract-region}. -Lisp code should use this function instead of @code{buffer-substring} +If @var{noprops} is non-@code{nil}, the final string returned does not +include text properties, while the string passed through the filters +still includes text properties from the buffer text. + +Lisp code should use this function instead of @code{buffer-substring}, +@code{buffer-substring-no-properties}, or @code{delete-and-extract-region} when copying into user-accessible data structures such as the kill-ring, X clipboard, and registers. Major and minor modes can add functions to From 6c23041776a67f2390b81dea710fbf65ecc8875f Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 9 Apr 2006 23:05:19 +0000 Subject: [PATCH 022/141] *** empty log message *** --- lisp/ChangeLog | 16 +++++++++++++++- lispref/ChangeLog | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be7923765ce..cb736c59738 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2006-04-10 Kim F. Storm + + * simple.el (filter-buffer-substring): Add NOPROPS arg, so + it can also replace buffer-substring-no-properties. + + * emulation/cua-base.el (cua-delete-region, cua-paste) + (cua-repeat-replace-region): Use filter-buffer-substring. + + * emulation/cua-gmrk.el (cua-copy-region-to-global-mark) + (cua-cut-region-to-global-mark): Likewise. + + * emulation/cua-rect.el (cua--extract-rectangle) + (cua-incr-rectangle, cua--rectangle-aux-replace): Likewise. + 2006-04-09 Roland Winkler * textmodes/bibtex.el (bibtex-entry-update): New optional arg @@ -9,7 +23,7 @@ * textmodes/bibtex.el (bibtex-find-text-internal): Add new element string-const to return value. (bibtex-remove-delimiters): Use it. - + 2006-04-08 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-form): Don't call diff --git a/lispref/ChangeLog b/lispref/ChangeLog index b42cbcad5a1..43fcd1e406d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Kim F. Storm + + * text.texi (Buffer Contents): Add NOPROPS arg to + filter-buffer-substring. + 2006-04-08 Kevin Ryde * os.texi (Command-Line Arguments): Update xref to emacs manual From 8803c4f4ac3311a509545354b3203f6d8044cb42 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 10 Apr 2006 03:06:55 +0000 Subject: [PATCH 023/141] (picture-mode-exit): Run picture-mode-exit-hook. --- lisp/ChangeLog | 8 ++++++++ lisp/textmodes/picture.el | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb736c59738..596e92eaa0e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2006-04-09 Richard Stallman + + * textmodes/picture.el (picture-mode-exit): Run picture-mode-exit-hook. + + * play/landmark.el (lm-font-lock-face-O, lm-font-lock-face-X): + Make them faces. + (lm-font-lock-keywords): Update appropriately. + 2006-04-10 Kim F. Storm * simple.el (filter-buffer-substring): Add NOPROPS arg, so diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 1c3e1baa9b1..ce1dbf8993b 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -758,8 +758,9 @@ they are not defaultly assigned to keys." (defun picture-mode-exit (&optional nostrip) "Undo `picture-mode' and return to previous major mode. -With no argument strips whitespace from end of every line in Picture buffer - otherwise just return to previous mode." +With no argument, strip whitespace from end of every line in Picture buffer; + otherwise, just return to previous mode. +Runs `picture-mode-exit-hook' at the end." (interactive "P") (if (not (eq major-mode 'picture-mode)) (error "You aren't editing a Picture") @@ -769,7 +770,8 @@ With no argument strips whitespace from end of every line in Picture buffer (setq major-mode picture-mode-old-major-mode) (kill-local-variable 'tab-stop-list) (setq truncate-lines picture-mode-old-truncate-lines) - (force-mode-line-update))) + (force-mode-line-update) + (run-hooks 'picture-mode-exit-hook))) (provide 'picture) From 4f07f2e8a5458758dcf2bfbdf9b0cf8c91a8572e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 10 Apr 2006 03:19:09 +0000 Subject: [PATCH 024/141] (rmail-mime-charset-pattern): Ignore format and delsp specs while looking for charset. --- lisp/ChangeLog | 3 +++ lisp/mail/rmail.el | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 596e92eaa0e..2adf8adf559 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2006-04-09 Richard Stallman + * mail/rmail.el (rmail-mime-charset-pattern): Ignore format and delsp + specs while looking for charset. + * textmodes/picture.el (picture-mode-exit): Run picture-mode-exit-hook. * play/landmark.el (lm-font-lock-face-O, lm-font-lock-face-X): diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e0fecb4ff28..a400efc5cc8 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -623,7 +623,9 @@ the variable `rmail-mime-feature'.") ;;;###autoload (defvar rmail-mime-charset-pattern - "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?" + (concat "^content-type:[ ]*text/plain;" + "\\(?:[ \t\n]*\\(format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" + "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?") "Regexp to match MIME-charset specification in a header of message. The first parenthesized expression should match the MIME-charset name.") From d9316f5c596fbb4ead8b9cc7e981e939bc7a04ab Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 10 Apr 2006 09:16:42 +0000 Subject: [PATCH 025/141] *** empty log message *** --- lisp/ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2adf8adf559..378b71c1e74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2006-04-10 Nick Roberts + + * progmodes/gdb-ui.el (gdb-init-1): Re-initialise gdb-main-file to nil. + (gdb-get-version): Make it work for pre "interpreter mi" (GDB 5.3?). + (gdb-setup-windows): Put something in source window if we can't find + the source file. + (gdb-frame-handler): Make it work again with just assembly. + (gdb-data-list-register-values-handler): Make it work when there is + no stack. + 2006-04-09 Richard Stallman * mail/rmail.el (rmail-mime-charset-pattern): Ignore format and delsp From caf2f944597e1107bbfa56152ea9fcd108f13176 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 10 Apr 2006 09:18:11 +0000 Subject: [PATCH 026/141] (gdb-init-1): Re-initialise gdb-main-file to nil. (gdb-get-version): Make it work for pre "interpreter mi" (GDB 5.3?). (gdb-setup-windows): Put something in source window if we can't find the source file. (gdb-frame-handler): Make it work again with just assembly. (gdb-data-list-register-values-handler): Make it work when there is no stack. --- lisp/progmodes/gdb-ui.el | 50 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 9f527d12f9f..244570170fa 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -524,6 +524,7 @@ With arg, use separate IO iff arg is positive." gdb-frame-number nil gdb-var-list nil gdb-force-update t + gdb-main-file nil gdb-first-post-prompt t gdb-prompting nil gdb-input-queue nil @@ -580,8 +581,7 @@ With arg, use separate IO iff arg is positive." (defun gdb-get-version () (goto-char (point-min)) - (if (and (re-search-forward gdb-error-regexp nil t) - (string-match ".*(missing implementation)" (match-string 1))) + (if (re-search-forward "Undefined\\( mi\\)* command:" nil t) (setq gdb-version "pre-6.4") (setq gdb-version "6.4+")) (gdb-init-2)) @@ -2746,7 +2746,11 @@ corresponding to the mode line clicked." (switch-to-buffer (if gud-last-last-frame (gud-find-file (car gud-last-last-frame)) - (gud-find-file gdb-main-file))) + (if gdb-main-file + (gud-find-file gdb-main-file) + ;; Put buffer list in window if we + ;; can't find a source file. + (list-buffers-noselect)))) (when gdb-use-separate-io-buffer (split-window-horizontally) (other-window 1) @@ -3139,19 +3143,18 @@ BUFFER nil or omitted means use the current buffer." (if (re-search-forward "Stack level \\([0-9]+\\)" nil t) (setq gdb-frame-number (match-string 1))) (goto-char (point-min)) - (if (re-search-forward - ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\) (\\(\\S-*?\\):[0-9]+?);? " - nil t) - (progn - (setq gdb-selected-frame (match-string 2)) - (if (gdb-get-buffer 'gdb-locals-buffer) - (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) - (setq mode-name (concat "Locals:" gdb-selected-frame)))) - (if (gdb-get-buffer 'gdb-assembler-buffer) - (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer) - (setq mode-name (concat "Machine:" gdb-selected-frame)))) - (setq gdb-frame-address (match-string 1)))) - (if gud-overlay-arrow-position + (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\ +\\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? " + nil t) + (setq gdb-selected-frame (match-string 2)) + (if (gdb-get-buffer 'gdb-locals-buffer) + (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) + (setq mode-name (concat "Locals:" gdb-selected-frame)))) + (if (gdb-get-buffer 'gdb-assembler-buffer) + (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer) + (setq mode-name (concat "Machine:" gdb-selected-frame)))) + (setq gdb-frame-address (match-string 1)) + (if (and (match-string 3) gud-overlay-arrow-position) (let ((buffer (marker-buffer gud-overlay-arrow-position)) (position (marker-position gud-overlay-arrow-position))) (when (and buffer (string-equal (buffer-name buffer) (match-string 3))) @@ -3160,9 +3163,9 @@ BUFFER nil or omitted means use the current buffer." (if (string-equal gdb-frame-number "0") nil '((overlay-arrow . hollow-right-triangle)))) - (set-marker gud-overlay-arrow-position position))))) + (set-marker gud-overlay-arrow-position position)))))) (goto-char (point-min)) - (if (re-search-forward " source language \\(\\S-*\\)\." nil t) + (if (re-search-forward " source language \\(\\S-+\\)\." nil t) (setq gdb-current-language (match-string 1))) (gdb-invalidate-assembler)) @@ -3281,11 +3284,12 @@ in_scope=\"\\(.*?\\)\".*?}") gdb-pending-triggers)) (goto-char (point-min)) (if (re-search-forward gdb-error-regexp nil t) - (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) - (let ((buffer-read-only nil)) - (erase-buffer) - (insert (match-string 1)) - (goto-char (point-min)))) + (let ((err (match-string 1))) + (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) + (let ((buffer-read-only nil)) + (erase-buffer) + (insert err) + (goto-char (point-min))))) (let ((register-list (reverse gdb-register-names)) (register nil) (register-string nil) (register-values nil)) (goto-char (point-min)) From f8f107772d5625ac1a471a9858284c16cb343330 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 10 Apr 2006 09:33:40 +0000 Subject: [PATCH 027/141] (gethomedir): Make sure to always return a pointer that can be passed to free. --- src/ChangeLog | 5 +++++ src/xrdb.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index d5e4d20111e..9c7d551ce7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Andreas Schwab + + * xrdb.c (gethomedir): Make sure to always return a pointer that + can be passed to free. + 2006-04-09 Richard Stallman * lisp.h (Fkill_emacs): Undo previous change. diff --git a/src/xrdb.c b/src/xrdb.c index 2b7888ebe84..c95c98efffd 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -315,7 +315,7 @@ gethomedir () } if (ptr == NULL) - return "/"; + return strcpy ((char *) malloc (2), "/"); copy = (char *) malloc (strlen (ptr) + 2); strcpy (copy, ptr); From 8fd0f424be3d31ff138188b192efb9ff363b6383 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Mon, 10 Apr 2006 11:01:29 +0000 Subject: [PATCH 028/141] (gethomedir): Use xstrdup. --- src/ChangeLog | 4 ++++ src/xrdb.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9c7d551ce7f..ab26fb9a4c8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-04-10 Romain Francoise + + * xrdb.c (gethomedir): Use xstrdup. + 2006-04-10 Andreas Schwab * xrdb.c (gethomedir): Make sure to always return a pointer that diff --git a/src/xrdb.c b/src/xrdb.c index c95c98efffd..988db614c41 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -315,7 +315,7 @@ gethomedir () } if (ptr == NULL) - return strcpy ((char *) malloc (2), "/"); + return xstrdup ("/"); copy = (char *) malloc (strlen (ptr) + 2); strcpy (copy, ptr); From c9fdebdf3a790aae312ca5b63b3d4916713d289e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 10 Apr 2006 15:28:25 +0000 Subject: [PATCH 029/141] (finder-mode-map): Add n and p bindings. --- lisp/ChangeLog | 4 ++++ lisp/finder.el | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 378b71c1e74..a0c3e905b50 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-04-10 Richard Stallman + + * finder.el (finder-mode-map): Add n and p bindings. + 2006-04-10 Nick Roberts * progmodes/gdb-ui.el (gdb-init-1): Re-initialise gdb-main-file to nil. diff --git a/lisp/finder.el b/lisp/finder.el index fc96381e8f7..1374e1f4e76 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -104,6 +104,8 @@ (define-key map [mouse-2] 'finder-mouse-select) (define-key map "\C-m" 'finder-select) (define-key map "?" 'finder-summary) + (define-key map "n" 'next-line) + (define-key map "p" 'previous-line) (define-key map "q" 'finder-exit) (define-key map "d" 'finder-list-keywords) map)) From 2b690e5b35f847ce62f5abbb323d0f0820338b2c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 10 Apr 2006 18:45:34 +0000 Subject: [PATCH 030/141] (find-function-search-for-symbol): Fix regexp so the defined var/fun doesn't need to be quoted. --- lisp/ChangeLog | 35 ++++++++++++++++++----------------- lisp/emacs-lisp/find-func.el | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a0c3e905b50..5f3b91fefb9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Stefan Monnier + + * emacs-lisp/find-func.el (find-function-search-for-symbol): Fix regexp + so the defined var/fun doesn't need to be quoted. + 2006-04-10 Richard Stallman * finder.el (finder-mode-map): Add n and p bindings. @@ -108,12 +113,11 @@ (rcirc-multiline-minor-mode-map): New mode map. (rcirc-edit-multiline): Put multiline-edit buffer in rcirc-multiline-major-mode along with rcirc-multiline-minor-mode. - (rcirc-print): Any line starting with an ignored nick will be - ignored. + (rcirc-print): Ignore any line starting with an ignored nick. (rcirc-print): Decode using rcirc-decode-coding-system. (rcirc-track-minor-mode): Update global-mode-string when disabling this mode. - (minor-mode-alist): add LowPri indicator. + (minor-mode-alist): Add LowPri indicator. (rcirc-toggle-low-priority): New function. (rcirc-last-non-irc-buffer): Prefix arg now no means switch to next lowpriority buffer with activity. @@ -146,8 +150,7 @@ 2006-04-07 Reiner Steib - * pgg-gpg.el: Revert to revision 1.8 to allow the use of - gpg-agent. + * pgg-gpg.el: Revert to revision 1.8 to allow the use of gpg-agent. 2006-04-07 Nick Roberts @@ -160,21 +163,20 @@ * textmodes/paragraphs.el (sentence-end): Use string-or-null-p. - * textmodes/ispell.el (ispell-local-dictionary): Use - string-or-null-p. + * textmodes/ispell.el (ispell-local-dictionary): Use string-or-null-p. * files.el: Update comment about safe-local-variable declarations. 2006-04-06 J.D. Smith - * progmodes/idlwave.el: Updated to IDLWAVE version 6.0. See - idlwave.org. + * progmodes/idlwave.el: Updated to IDLWAVE version 6.0. + See idlwave.org. - * progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0. See - idlwave.org. Includes code to obsolete idlw-rinfo.el. + * progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0. + See idlwave.org. Includes code to obsolete idlw-rinfo.el. - * progmodes/idlw-help.el: Updated to IDLWAVE version 6.0. See - idlwave.org. + * progmodes/idlw-help.el: Updated to IDLWAVE version 6.0. + See idlwave.org. * progmodes/idlw-complete-structtag.el: Updated to IDLWAVE version 6.0 (minimal changes). See idlwave.org. @@ -245,8 +247,8 @@ 2006-04-05 Daiki Ueno - * pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region): Wait - for BEGIN_SIGNING too, new in GnuPG 1.4.3. + * pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region): + Wait for BEGIN_SIGNING too, new in GnuPG 1.4.3. 2006-04-05 Kenichi Handa @@ -259,8 +261,7 @@ default-enable-multibyte-characters. This reverts the change from revision 6.17 which is no longer necessary because the passphrase is sent separately now. GnuPG messages are unreadable under - multibyte locales with default-enable-multibyte-characters set to - nil. + multibyte locales with default-enable-multibyte-characters set to nil. 2006-04-04 Andreas Schwab diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 4f961df0791..0738444c9ec 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -229,7 +229,7 @@ The search is done in the source for library LIBRARY." (goto-char (point-min)) (if (or (re-search-forward regexp nil t) (re-search-forward - (concat "^([^ ]+" find-function-space-re "['(]" + (concat "^([^ ]+" find-function-space-re "['(]?" (regexp-quote (symbol-name symbol)) "\\_>") nil t)) From 888046a687cd6e1344673fbf2fe4dd85230e7d02 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 10 Apr 2006 19:16:30 +0000 Subject: [PATCH 031/141] *** empty log message *** --- admin/FOR-RELEASE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index b04273d274e..934cda45906 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -33,6 +33,10 @@ Assigned to Bill Wohler . * BUGS +** Stefan Monnier's March 20 bug report about 3d boxes in header line. + +** Is there a basic problem with cl-byte-compile-compiler-macro? + ** Markus Gritsch's report about Emacs looping on Windoze with the following .emacs file, and then reduce Emacs frame width to "something quite narrow": (setq-default truncate-lines t) From 8bca692e7e827cfb71fa368bbbace7b30e5d77e2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 10 Apr 2006 19:34:25 +0000 Subject: [PATCH 032/141] (set-locale-environment): Fix last change for when the locale's preferences don't specify any encoding. --- lisp/international/mule-cmds.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 17004f6bcd5..69dbb5c2445 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2526,7 +2526,9 @@ See also `locale-charset-language-names', `locale-language-names', ;; If a specific EOL conversion was specified in the default ;; buffer-file-coding-system, preserve it in the coding system ;; we will be using from now on. - (if (memq default-eol-type '(0 1 2 unix dos mac)) + (if (and (memq default-eol-type '(0 1 2 unix dos mac)) + coding-system + (coding-system-p coding-system)) (setq coding-system (coding-system-change-eol-conversion coding-system default-eol-type))) From 9b67f3aaa78ae2180c4494d8752d6b31c1204a3f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 10 Apr 2006 20:10:33 +0000 Subject: [PATCH 033/141] (pid_t) [_MSC_VER]: New typedef. --- src/s/ms-w32.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 5c6d1d07c20..3e5d9c865bb 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -365,6 +365,9 @@ Boston, MA 02110-1301, USA. */ #define ftruncate _chsize #define getw _getw #define getpid _getpid +#ifdef _MSC_VER +typedef int pid_t; +#endif #define isatty _isatty #define logb _logb #define _longjmp longjmp From 978781a5f7b2d6e3081e4b9fd442896c051309e8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 10 Apr 2006 20:11:12 +0000 Subject: [PATCH 034/141] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ src/ChangeLog | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f3b91fefb9..558af5fab0b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-04-10 Eli Zaretskii + + * international/mule-cmds.el (set-locale-environment): Fix last + change for when the locale's preferences don't specify any + encoding. + 2006-04-10 Stefan Monnier * emacs-lisp/find-func.el (find-function-search-for-symbol): Fix regexp diff --git a/src/ChangeLog b/src/ChangeLog index ab26fb9a4c8..bd557cd0b16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-04-10 Eli Zaretskii + + * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef. + 2006-04-10 Romain Francoise * xrdb.c (gethomedir): Use xstrdup. From 1d22fabd46ebbb3e2af5cdea011b42c7a0331463 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 10 Apr 2006 22:33:51 +0000 Subject: [PATCH 035/141] (find-function-regexp): Allow dashes in defun name, in similar fashion to find-variable-regexp. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/find-func.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 558af5fab0b..59d12a7f41b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Bill Wohler + + * emacs-lisp/find-func.el (find-function-regexp): Allow dashes in + defun name, in similar fashion to find-variable-regexp. + 2006-04-10 Eli Zaretskii * international/mule-cmds.el (set-locale-environment): Fix last diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 0738444c9ec..754ad9fdf19 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -64,7 +64,7 @@ (concat "^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\ ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\ -foo\\|[^cfgv]\\w+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\ +foo\\|[^cfgv]\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\ menu-bar-make-toggle\\)" find-function-space-re "\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)") From 4e9c705e50b4e6ee733e0134703b00253cc4cf7c Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 10 Apr 2006 23:43:34 +0000 Subject: [PATCH 036/141] * custom.el (defcustom, custom-handle-keyword): Add :package-version keyword. (custom-add-package-version): New function. Sets value of new property 'custom-package-version from :package-version keyword. * cus-edit.el (customize-package-emacs-version-alist): New variable. (customize-changed-options): Add check for custom-package-version. (customize-package-emacs-version): New function to look up Emacs version corresponding to the given package version. --- lisp/ChangeLog | 11 +++++++++++ lisp/cus-edit.el | 46 ++++++++++++++++++++++++++++++++++++++++++++-- lisp/custom.el | 12 ++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59d12a7f41b..8a205081fa5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,16 @@ 2006-04-10 Bill Wohler + * custom.el (defcustom, custom-handle-keyword): Add + :package-version keyword. + (custom-add-package-version): New function. Sets value of new + property 'custom-package-version from :package-version keyword. + + * cus-edit.el (customize-package-emacs-version-alist): New + variable. + (customize-changed-options): Add check for custom-package-version. + (customize-package-emacs-version): New function to look up Emacs + version corresponding to the given package version. + * emacs-lisp/find-func.el (find-function-regexp): Allow dashes in defun name, in similar fashion to find-variable-regexp. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e2275ce356d..4de2a431392 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -786,7 +786,7 @@ when the action is chosen.") (if (or (and (= 1 (length children)) (memq (widget-type (car children)) '(custom-variable custom-face))) - (y-or-n-p "Reset all settings' buffer text to show current values? ")) + (y-or-n-p "Reset all settings' buffer text to show current values? ")) (mapc (lambda (widget) (if (memq (widget-get widget :custom-state) '(modified changed)) @@ -1079,6 +1079,18 @@ Show the buffer in another window, but don't select it." (defvar customize-changed-options-previous-release "21.1" "Version for `customize-changed-options' to refer back to by default.") +;; Packages will update this variable, so make it available. +;;;###autoload +(defvar customize-package-emacs-version-alist nil + "Alist that maps packages to alists of package to Emacs versions. +The value alists map all package versions used with +the :package-version keyword to Emacs versions. Packages are +symbols and versions are strings. + +For example: + '((MH-E (\"7.4\" \"22.1\") (\"8.0\" \"22.1\")) + (Gnus (\"5.11\" \"22.1\")))") + ;;;###autoload (defalias 'customize-changed 'customize-changed-options) @@ -1119,7 +1131,12 @@ that were added or redefined since that version." (let (found) (mapatoms (lambda (symbol) - (let ((version (get symbol 'custom-version))) + (let* ((package-version (get symbol 'custom-package-version)) + (version + (or (and package-version + (customize-package-emacs-version symbol + package-version)) + (get symbol 'custom-version)))) (if version (when (customize-version-lessp since-version version) (if (or (get symbol 'custom-group) @@ -1135,6 +1152,31 @@ that were added or redefined since that version." (error "No user option defaults have been changed since Emacs %s" since-version)))) +(defun customize-package-emacs-version (symbol package-version) + "Return Emacs version of SYMBOL. +PACKAGE-VERSION has the form (PACKAGE VERSION). The VERSION of +PACKAGE is looked up in the associated list +`customize-package-emacs-version-alist' to find the version of +Emacs that is associated with it." + (let (package-versions emacs-version) + ;; Use message instead of error since we want user to be able to + ;; see the rest of the symbols even if a package author has + ;; botched things up. + (cond ((not (listp package-version)) + (message "Invalid package-version value for %s" symbol)) + ((setq package-versions (assq (car package-version) + customize-package-emacs-version-alist)) + (setq emacs-version + (cadr (assoc (cadr package-version) package-versions))) + (unless emacs-version + (message "Package version of %s not found in %s" symbol + "customize-package-emacs-version-alist"))) + (t + (message "Package %s neglected to update %s" + (car package-version) + "customize-package-emacs-version-alist"))) + emacs-version)) + (defun customize-version-lessp (version1 version2) ;; Why are the versions strings, and given that they are, why aren't ;; they converted to numbers and compared as such here? -- fx diff --git a/lisp/custom.el b/lisp/custom.el index c67f3b06272..42872ca761c 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -268,6 +268,12 @@ The following keywords are meaningful: VALUE should be a string specifying that the variable was first introduced, or its default value was changed, in Emacs version VERSION. +:package-version + VALUE should be a list with the form (PACKAGE VERSION) + specifying that the variable was first introduced, or its + default value was changed, in PACKAGE version VERSION. This + keyword takes priority over :version. The PACKAGE and VERSION + must appear in the alist `customize-package-emacs-version-alist'. :tag LABEL Use LABEL, a string, instead of the item's name, to label the item in customization menus and buffers. @@ -489,6 +495,8 @@ Fourth argument TYPE is the custom option type." (custom-add-to-group value symbol type)) ((eq keyword :version) (custom-add-version symbol value)) + ((eq keyword :package-version) + (custom-add-package-version symbol value)) ((eq keyword :link) (custom-add-link symbol value)) ((eq keyword :load) @@ -540,6 +548,10 @@ For other custom types, this has no effect." "To the custom option SYMBOL add the version VERSION." (put symbol 'custom-version (purecopy version))) +(defun custom-add-package-version (symbol version) + "To the custom option SYMBOL add the package version VERSION." + (put symbol 'custom-package-version (purecopy version))) + (defun custom-add-load (symbol load) "To the custom option SYMBOL add the dependency LOAD. LOAD should be either a library file name, or a feature name." From e5e864abb21f29bdfdf68fb77344b1ec027391e9 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 10 Apr 2006 23:44:54 +0000 Subject: [PATCH 037/141] (Common Keywords): Add :package-version. --- lispref/ChangeLog | 4 ++++ lispref/customize.texi | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 43fcd1e406d..f4ad95fc04e 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2006-04-10 Bill Wohler + + * customize.texi (Common Keywords): Add :package-version. + 2006-04-10 Kim F. Storm * text.texi (Buffer Contents): Add NOPROPS arg to diff --git a/lispref/customize.texi b/lispref/customize.texi index 1ae3b5b5132..a13793ecb54 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi @@ -130,6 +130,25 @@ any effect unless the code which implements the mode is loaded. This option specifies that the item was first introduced in Emacs version @var{version}, or that its default value was changed in that version. The value @var{version} must be a string. + +@item :package-version '(@var{package} @var{version}) +This option specifies that the item was first introduced in +@var{package} version @var{version}, or that its default value was +changed in that version. This keyword takes priority over :version. +The @var{package} and @var{version} must appear in the alist +@code{customize-package-emacs-version-alist}. This alist maps packages +to alists that map all package versions used with the +@code{:package-version} keyword to Emacs versions. Packages are +symbols and versions are strings. For example, the MH-E package +updates this alist with the following: + +@smallexample +(add-to-list 'customize-package-emacs-version-alist + '(MH-E ("6.0" "22.1") ("6.1" "22.1") ("7.0" "22.1") + ("7.1" "22.1") ("7.2" "22.1") ("7.3" "22.1") + ("7.4" "22.1") ("8.0" "22.1"))) +@end smallexample + @end table @node Group Definitions From f327867ab4bb56f54444054ff0a560820abc4206 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 10 Apr 2006 23:47:18 +0000 Subject: [PATCH 038/141] Add package-version keyword to `defcustom' and mention associated variable `customize-package-emacs-version-alist'. --- etc/ChangeLog | 5 +++++ etc/NEWS | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 95b24e50e2d..7811dc46526 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Bill Wohler + + * NEWS: Add package-version keyword to `defcustom' and mention + associated variable `customize-package-emacs-version-alist'. + 2006-04-07 Reiner Steib * NEWS: Add string-or-null-p. diff --git a/etc/NEWS b/etc/NEWS index 8361207ed6f..ecde349f915 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3691,6 +3691,12 @@ variables, including buffer-local and frame-local variables. ** defcustom changes: ++++ +*** The package-version keyword has been added to provide +`customize-changed-options' functionality to packages in the future. +Developers who make use of this keyword must also update the new +variable `customize-package-emacs-version-alist'. + +++ *** The new customization type `float' requires a floating point number. From 81117bddbd9f786706c28b53d25f276918731427 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Tue, 11 Apr 2006 00:08:56 +0000 Subject: [PATCH 039/141] (defcustom): Create Common Keywords section in docstring. (defface, defgroup): Replace definitions of a select few keywords with a reference to the Common Keywords in defcustom. (defcustom, defface, defgroup): Replace reference to Customization chapter in manual with hyperlink. --- lisp/ChangeLog | 5 ++++ lisp/custom.el | 64 +++++++++++++++++++++++--------------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a205081fa5..6de3fe1d977 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,11 @@ :package-version keyword. (custom-add-package-version): New function. Sets value of new property 'custom-package-version from :package-version keyword. + (defcustom): Create Common Keywords section in docstring. + (defface, defgroup): Replace definitions of a select few keywords + with a reference to the Common Keywords in defcustom. + (defcustom, defface, defgroup): Replace reference to Customization + chapter in manual with hyperlink. * cus-edit.el (customize-package-emacs-version-alist): New variable. diff --git a/lisp/custom.el b/lisp/custom.el index 42872ca761c..cd97b425038 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -203,8 +203,27 @@ The following keywords are meaningful: :type VALUE should be a widget type for editing the symbol's value. :options VALUE should be a list of valid members of the widget type. +:initialize + VALUE should be a function used to initialize the + variable. It takes two arguments, the symbol and value + given in the `defcustom' call. The default is + `custom-initialize-reset'. +:set VALUE should be a function to set the value of the symbol. + It takes two arguments, the symbol to set and the value to + give it. The default choice of function is `custom-set-default'. +:get VALUE should be a function to extract the value of symbol. + The function takes one argument, a symbol, and should return + the current value for that symbol. The default choice of function + is `custom-default-value'. +:require + VALUE should be a feature symbol. If you save a value + for this option, then when your `.emacs' file loads the value, + it does (require VALUE) first. + +The following common keywords are also meaningful. + :group VALUE should be a customization group. - Add SYMBOL to that group. + Add SYMBOL (or FACE with `defface') to that group. :link LINK-DATA Include an external link after the documentation string for this item. This is a sentence containing an active field which @@ -248,22 +267,6 @@ The following keywords are meaningful: An item can have more than one external link; however, most items have none at all. -:initialize - VALUE should be a function used to initialize the - variable. It takes two arguments, the symbol and value - given in the `defcustom' call. The default is - `custom-initialize-reset'. -:set VALUE should be a function to set the value of the symbol. - It takes two arguments, the symbol to set and the value to - give it. The default choice of function is `custom-set-default'. -:get VALUE should be a function to extract the value of symbol. - The function takes one argument, a symbol, and should return - the current value for that symbol. The default choice of function - is `custom-default-value'. -:require - VALUE should be a feature symbol. If you save a value - for this option, then when your `.emacs' file loads the value, - it does (require VALUE) first. :version VALUE should be a string specifying that the variable was first introduced, or its default value was changed, in Emacs @@ -292,8 +295,8 @@ to load a file defining variables with this form, or with _outside_ any bindings for these variables. \(`defvar' and `defconst' behave similarly in this respect.) -Read the section about customization in the Emacs Lisp manual for more -information." +See Info node `(elisp) Customization' in the Emacs Lisp manual +for more information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem @@ -320,10 +323,8 @@ The remaining arguments should have the form [KEYWORD VALUE]... -The following KEYWORDs are defined: - -:group VALUE should be a customization group. - Add FACE to that group. +For a list of valid keywords, see the common keywords listed in +`defcustom'. SPEC should be an alist of the form ((DISPLAY ATTS)...). @@ -374,8 +375,8 @@ corresponding ITEMs. These are the defined REQ values: the function `display-supports-face-attributes-p' for more information on exactly how testing is done. -Read the section about customization in the Emacs Lisp manual for more -information." +See Info node `(elisp) Customization' in the Emacs Lisp manual +for more information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem @@ -432,16 +433,11 @@ The remaining arguments should have the form [KEYWORD VALUE]... -The following KEYWORDs are defined: +For a list of valid keywords, see the common keywords listed in +`defcustom'. -:group VALUE should be a customization group. - Add SYMBOL to that group. - -:version VALUE should be a string specifying that the group was introduced - in Emacs version VERSION. - -Read the section about customization in the Emacs Lisp manual for more -information." +See Info node `(elisp) Customization' in the Emacs Lisp manual +for more information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem From 2fb18d1328ca01410d24a73939e5b79a6a12a914 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 11 Apr 2006 01:28:04 +0000 Subject: [PATCH 040/141] (C-SPC fails ...): Add description for fcitx. --- etc/ChangeLog | 4 ++++ etc/PROBLEMS | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 7811dc46526..28ae69d3410 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-04-11 Kenichi Handa + + * PROBLEMS (C-SPC fails ...): Add description for fcitx. + 2006-04-10 Bill Wohler * NEWS: Add package-version keyword to `defcustom' and mention diff --git a/etc/PROBLEMS b/etc/PROBLEMS index de0dc31edff..f106f9a4a17 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -991,7 +991,7 @@ xmodmap command to the xdm setup script for that display. Use the shell command `xset bc' to make the old X Menu package work. -*** C-SPC fails to work on Fedora GNU/Linux. +*** C-SPC fails to work on Fedora GNU/Linux (or with some input method). Fedora Core 4 steals the C-SPC key by default for the `iiimx' program which is the input method for some languages. It blocks Emacs users @@ -1005,6 +1005,12 @@ Another is to specify `Emacs*useXIM: false' in your X resources. Another is to build Emacs with the `--without-xim' configure option. +The same problem happens on any other system if you are using fcitx +(Chinese input method) which by default use C-SPC for toggling. If +you want to use fcitx with Emacs, you have two choices. Toggle fcitx +by another key (e.g. C-\) by modifying ~/.fcitx/config, or be +accustomed to use C-@ for `set-mark-command'. + *** M-SPC seems to be ignored as input. See if your X server is set up to use this as a command From db926d809113fbb185dfc9e400bdf3216a687762 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 11 Apr 2006 07:13:33 +0000 Subject: [PATCH 041/141] * lisp.h (wrong_type_argument): Mark as NO_RETURN. * data.c (wrong_type_argument): Try to avoid compiler warnings due to the fact the function is now marked as NO_RETURN. --- src/ChangeLog | 7 +++++++ src/data.c | 7 +++++++ src/lisp.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index bd557cd0b16..936b14089b4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-04-11 Dan Nicolaescu + + * lisp.h (wrong_type_argument): Mark as NO_RETURN. + + * data.c (wrong_type_argument): Try to avoid compiler warnings due + to the fact the function is now marked as NO_RETURN. + 2006-04-10 Eli Zaretskii * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef. diff --git a/src/data.c b/src/data.c index 73f712279d7..8b8015bb002 100644 --- a/src/data.c +++ b/src/data.c @@ -125,7 +125,14 @@ wrong_type_argument (predicate, value) tem = call1 (predicate, value); } while (NILP (tem)); + /* This function is marked as NO_RETURN, gcc would warn if it has a + return statement or if falls off the function. Other compilers + warn if no return statement is present. */ +#ifndef __GNUC__ return value; +#else + abort (); +#endif } void diff --git a/src/lisp.h b/src/lisp.h index 5d1b3266a0d..9748eebfcb5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2246,7 +2246,7 @@ extern unsigned long cons_to_long P_ ((Lisp_Object)); extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object)) NO_RETURN; -extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)); +extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object, Lisp_Object, struct buffer *)); extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object)); From 26ca33edc321e8987e2dfa8c4d6c55ec30bc0a6f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 11 Apr 2006 08:36:35 +0000 Subject: [PATCH 042/141] (Link format): New section, emphasis on bracket links. (External links): Document bracket links. (FAQ): Expanded to cover shell links and the new link format. --- man/org.texi | 1084 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 687 insertions(+), 397 deletions(-) diff --git a/man/org.texi b/man/org.texi index 2c7a4ef8289..19c0f222c57 100644 --- a/man/org.texi +++ b/man/org.texi @@ -4,8 +4,8 @@ @setfilename ../info/org @settitle Org Mode Manual -@set VERSION 4.10 -@set DATE March 2006 +@set VERSION 4.21 +@set DATE April 2006 @dircategory Emacs @direntry @@ -82,6 +82,7 @@ Software Foundation raise funds for GNU development.'' * Hyperlinks:: Notes in context * TODO items:: Every tree branch can be a TODO item * Timestamps:: Assign date and time to items +* Tags:: Tagging headlines and matching sets of tags * Agenda Views:: Collecting information into views * Exporting:: Sharing and publishing of notes * Miscellaneous:: All the rest which did not fit elsewhere @@ -94,7 +95,7 @@ Software Foundation raise funds for GNU development.'' Introduction * Summary:: Brief summary of what Org-mode does -* Installation and Activation:: How to install Org-mode +* Installation and activation:: How to install Org-mode * Feedback:: Bug reports, ideas, patches etc. Document Structure @@ -106,12 +107,12 @@ Document Structure * Structure editing:: Changing sequence and level of headlines * Archiving:: Move done task trees to a different place * Sparse trees:: Matches embedded in context -* Tags:: Tagging headlines and matching sets of tags * Plain Lists:: Editing hand-formatted lists Tables * Built-in table editor:: Simple tables +* Narrow columns:: Stop wasting space in tables * Table calculations:: Compute a field from other fields * orgtbl-mode:: The table editor as minor mode * table.el:: Complex tables @@ -127,13 +128,14 @@ Calculations in tables Hyperlinks -* Internal Links:: Links to other places in the current file -* External Links:: URL-like links to the world +* Link format:: How links in Org-mode are formatted +* Internal links:: Links to other places in the current file +* External links:: URL-like links to the world * Managing links:: Creating, inserting and following * Search Options:: Linking to a specific location * Remember:: Org-trees store quick notes -Internal Links +Internal links * Radio targets:: Make targets trigger links in plain text. * CamelCase links:: Activating CamelCase words as links @@ -141,7 +143,7 @@ Internal Links TODO items * TODO basics:: Marking and displaying TODO entries -* Progress Logging:: Document your productivity +* Progress logging:: Document your productivity * TODO extensions:: Workflow and assignments * Priorities:: Some things are more important than others @@ -156,6 +158,12 @@ Timestamps * Time stamps:: Assigning a time to a tree entry * Creating timestamps:: Commands which insert timestamps +Tags + +* Tag inheritance:: Tags use the tree structure of the outline +* Setting tags:: How to assign tags to a headline +* Tag searches:: Searching for combinations of tags + Agenda Views * Agenda files:: Files being searched for agenda information @@ -189,6 +197,7 @@ Miscellaneous * Completion:: M-TAB knows what you need * Customization:: Adapting Org-mode to your taste +* Updating settings:: How to tell Org-mode that settings have changed * Clean view:: Getting rid of leading stars in the outline * TTY keys:: Using Org-mode on a tty * FAQ:: Frequently asked questions @@ -205,11 +214,11 @@ Miscellaneous @menu * Summary:: Brief summary of what Org-mode does -* Installation and Activation:: How to install Org-mode +* Installation and activation:: How to install Org-mode * Feedback:: Bug reports, ideas, patches etc. @end menu -@node Summary, Installation and Activation, Introduction, Introduction +@node Summary, Installation and activation, Introduction, Introduction @section Summary @cindex summary @@ -234,7 +243,7 @@ Org-mode keeps simple things simple. When first fired up, it should feel like a simple but easy to use outliner. Complexity is not imposed, but a large amount of functionality is available when you need it. Org-mode can be used on different levels and in different -ways, for example +ways, for example: @example @r{@bullet{} as an outline extension with visibility cycling and structure editing} @@ -255,7 +264,7 @@ and example files. This page is located at @page -@node Installation and Activation, Feedback, Summary, Introduction +@node Installation and activation, Feedback, Summary, Introduction @section Installation and Activation @cindex installation @cindex autoload @@ -301,9 +310,9 @@ MY PROJECTS -*- mode: org; -*- @noindent which will select Org-mode for this buffer no matter what the file's name is. See also the variable -@code{org-insert-mode-line-in-empty-file'}. +@code{org-insert-mode-line-in-empty-file}. -@node Feedback, , Installation and Activation, Introduction +@node Feedback, , Installation and activation, Introduction @section Feedback @cindex feedback @cindex bug reports @@ -316,16 +325,17 @@ or ideas about it, please contact the maintainer Carsten Dominik at For bug reports, please provide as much information as possible, including the version information of Emacs (@kbd{C-h v emacs-version -@key{RET}}) and Org-mode (@kbd{M-x org-version}), as well as the -Org-mode related setup in @file{.emacs}. If an error occurs, a +@key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as +the Org-mode related setup in @file{.emacs}. If an error occurs, a traceback can be very useful. Often a small example file helps, along with clear information about: + @enumerate @item What exactly did you do? @item What did you expect to happen? @item What happened instead? @end enumerate -@noindent Thanks for helping to improve this mode. +@noindent Thank you for helping to improve this mode. @node Document Structure, Tables, Introduction, Top @chapter Document Structure @@ -343,7 +353,6 @@ edit the structure of the document. * Structure editing:: Changing sequence and level of headlines * Archiving:: Move done task trees to a different place * Sparse trees:: Matches embedded in context -* Tags:: Tagging headlines and matching sets of tags * Plain Lists:: Editing hand-formatted lists @end menu @@ -367,9 +376,9 @@ key. @cindex headlines @cindex outline tree -Headlines define the structure of an outline tree. The Headlines in +Headlines define the structure of an outline tree. The headlines in Org-mode start with one or more stars, on the left margin. For -example +example: @example * Top level headline @@ -380,6 +389,7 @@ example more text * Another top level headline @end example + @noindent Some people find the many stars too noisy and would prefer an outline that has whitespace followed by a single star as headline starters. @ref{Clean view} describes a setup to realize this. @@ -404,10 +414,12 @@ the visibility in the buffer. @kindex @key{TAB} @item @key{TAB} Rotate current subtree between the states + @example ,-> FOLDED -> CHILDREN -> SUBTREE --. '-----------------------------------' @end example + At the beginning of the buffer (or when called with @kbd{C-u}), this does the same as the command @kbd{S-@key{TAB}} below. @@ -418,10 +430,12 @@ the same as the command @kbd{S-@key{TAB}} below. @kindex S-@key{TAB} @item S-@key{TAB} Rotate the entire buffer between the states + @example ,-> OVERVIEW -> CONTENTS -> SHOW ALL --. '--------------------------------------' @end example + Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field. @cindex show all, command @@ -499,23 +513,23 @@ beginning of the next line. Insert new TODO entry with same level as current heading. @kindex M-@key{left} @item M-@key{left} -Promote current heading by one level +Promote current heading by one level. @kindex M-@key{right} @item M-@key{right} -Demote current heading by one level +Demote current heading by one level. @kindex M-S-@key{left} @item M-S-@key{left} -Promote the current subtree by one level +Promote the current subtree by one level. @kindex M-S-@key{right} @item M-S-@key{right} -Demote the current subtree by one level +Demote the current subtree by one level. @kindex M-S-@key{up} @item M-S-@key{up} Move subtree up (swap with previous subtree of same -level) +level). @kindex M-S-@key{down} @item M-S-@key{down} -Move subtree down (swap with next subtree of same level) +Move subtree down (swap with next subtree of same level). @kindex C-c C-x C-w @kindex C-c C-x C-k @item C-c C-x C-w @@ -567,7 +581,7 @@ this, see the documentation string of the variable agenda, archiving to a different file is a good way to keep archived trees from contributing agenda items. -@node Sparse trees, Tags, Archiving, Document Structure +@node Sparse trees, Plain Lists, Archiving, Document Structure @section Sparse trees @cindex sparse trees @cindex trees, sparse @@ -602,11 +616,13 @@ For frequently used sparse trees of specific search strings, you can use the variable @code{org-agenda-custom-commands} to define fast keyboard access to specific sparse trees. These commands will then be accessible through the agenda dispatcher (@pxref{Agenda dispatcher}). -For example +For example: + @lisp (setq org-agenda-custom-commands '(("f" occur-tree "FIXME"))) @end lisp + @noindent will define the key @kbd{C-c a f} as a shortcut for creating a sparse tree matching the string @samp{FIXME}. @@ -621,97 +637,20 @@ To print a sparse tree, you can use the Emacs command of the document @footnote{This does not work under XEmacs, because XEmacs uses selective display for outlining, not text properties}. Or you can use the command @kbd{C-c C-x v} to copy the visible part of -the document to another file (extension @file{.txt}) which then can be +the document to another file (extension @file{.txt}) which can then be printed in any desired way. -@node Tags, Plain Lists, Sparse trees, Document Structure -@section Tags -@cindex tags -@cindex headline tagging -@cindex matching, tags -@cindex sparse tree, tag based -If you wish to implement a tag system to cross-correlate information, -this can be done as well in Org-mode. Every headline can contain a -list of tags, at the end of the headline. Tags are normal words -containing letters, numbers, @samp{_}, and @samp{@@}. Tags must be -preceded and followed by a single colon; like @samp{:WORK:}. Several -tags can be specified like @samp{:WORK:URGENT:}. - -@cindex inheritance, of tags -Tags make use of the hierarchical structure of outline trees. If a -heading has a certain tag, all subheadings will inherit the tag as -well. For example, in the list - -@example -* Meeting with the French group :WORK: -** Summary by Frank :BOSS:NOTES: -*** TODO Prepare slides for him :ACTION: -@end example -@noindent -the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:}, -@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and -Org-mode finds that a certain headline matches the search criterion, -it will not check any sublevel headline, assuming that these likely -also match, and that the list of matches can become very long. You -can influence inheritance and searching using the variables -@code{org-use-tag-inheritance} and -@code{org-tags-match-list-sublevels}. - -@kindex M-@key{TAB} -Tags can simply be typed into the buffer. After a colon, -@kbd{M-@key{TAB}} offers completion on all tags being used in the -current buffer. There are also special commands for inserting tags, -and for executing searches based on tags. - -@table @kbd -@kindex C-c C-c -@item C-c C-c -@cindex completion, of tags -Enter new tags for the current headline. The minibuffer will prompt -for a list of tags and offer completion with respect to all other tags -used in the current buffer. Several tags, separated by colons, may be -specified at the prompt. After pressing @key{RET}, the tags will -be inserted and aligned to @code{org-tags-column}. When called with a -@kbd{C-u} prefix, align all tags in the current buffer to that column, -just to make things look nice. TAGS are automatically realigned after -promotion, demotion, and TODO state changes (@pxref{TODO basics}). -@kindex C-c \ -@item C-c \ -Create a sparse tree with all headlines matching a tags search. -@kindex C-c a m -@item C-c a m -Create a global list of tag matches from all agenda files. -@xref{Matching headline tags}. -@kindex C-c a M -@item C-c a M -Create a global list of tag matches from all agenda files, but check -only TODO items and force checking subitems (see variable -@code{org-tags-match-list-sublevels}). -@end table - -A tags search string can use Boolean operators @samp{&} for AND and -@samp{|} for OR. @samp{&} binds more strongly than -@samp{|}. Parenthesis are currently no implemented. A tag may also be -preceded by @samp{-}, to select against it, and @samp{+} is syntactic -sugar for positive selection. The AND operator @samp{&} is optional -when @samp{+} or @samp{-} is present. For example, @samp{+WORK-BOSS} -would select all headlines that are tagged @samp{:WORK:}, but discard -those also tagged @samp{:BOSS:}. The search string @samp{WORK|LAPTOP} -selects all lines tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string -@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are -also tagged @samp{NIGHT}. - -@node Plain Lists, , Tags, Document Structure +@node Plain Lists, , Sparse trees, Document Structure @section Plain Lists @cindex plain lists @cindex lists, plain @cindex lists, ordered @cindex ordered lists -Headlines define the structure of the Org-mode file, and also lists -(for example TODO items (@pxref{TODO items}) should be created using -headline levels. However, when taking notes, the plain text is +Headlines define both the structure of the Org-mode file, and also lists +(for example, TODO items (@pxref{TODO items}) should be created using +headline levels). However, when taking notes, the plain text is sometimes easier to read with hand-formatted lists. Org-mode supports editing such lists, and the HTML exporter (@pxref{Exporting}) does parse and format them. @@ -721,11 +660,11 @@ with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or they will be seen as top-level headlines. Also, when you are hiding leading stars to get a clean outline view, plain list items starting with a star are visually -indistinguishable from true headlines. In short: Even though @samp{*} +indistinguishable from true headlines. In short: even though @samp{*} is supported, it may be better to not use it for plain list items} as bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items belonging to the same list must have the same indentation on the first -line. In particular, if an ordered list reaches number @samp{10.}, also +line. In particular, if an ordered list reaches number @samp{10.}, then the 2--digit numbers must be written left-aligned with the other numbers in the list. Indentation also determines the end of a list item. It ends before the next line that is indented like the bullet/number, or @@ -792,12 +731,13 @@ Emacs @file{calc} package. @menu * Built-in table editor:: Simple tables +* Narrow columns:: Stop wasting space in tables * Table calculations:: Compute a field from other fields * orgtbl-mode:: The table editor as minor mode * table.el:: Complex tables @end menu -@node Built-in table editor, Table calculations, Tables, Tables +@node Built-in table editor, Narrow columns, Tables, Tables @section The built-in table editor @cindex table editor, builtin @@ -826,6 +766,7 @@ create the above table, you would only type |Name|Phone|Age |- @end example + @noindent and then press @key{TAB} to align the table and start filling in fields. @@ -840,18 +781,16 @@ unpredictable for you, configure the variables @table @kbd @tsubheading{Creation and conversion} -@item M-x org-table-create -Creates an empty Org-mode table. However, it is much easier to just -start typing, like @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}} - -@kindex C-c C-c -@item C-c C-c -Convert region to table. Works when the cursor is not in an existing -table, and when there is a region defined. If every line contains at -least one TAB character, the function assumes that the material is tab -separated. If not, lines are split at whitespace into fields. You -can use a prefix argument to indicate how many consecutive spaces are -at least required to indicate a field separator (default: just one). +@kindex C-c | +@item C-c | +Convert the active region to table. If every line contains at least one +TAB character, the function assumes that the material is tab separated. +If not, lines are split at whitespace into fields. You can use a prefix +argument to indicate the minimum number of consequtive spaces required +to indentify a field separator (default: just one).@* +If there is no active region, this command creates an empty Org-mode +table. However, it's easier to just start typing, like +@kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}. @tsubheading{Re-aligning and field motion} @kindex C-c C-c @@ -878,7 +817,7 @@ NEWLINE, so it can be used to split a table. @kindex M-@key{right} @item M-@key{left} @itemx M-@key{right} -Move the current column left/right +Move the current column left/right. @kindex M-S-@key{left} @item M-S-@key{left} @@ -892,7 +831,7 @@ Insert a new column to the left of the cursor position. @kindex M-@key{down} @item M-@key{up} @itemx M-@key{down} -Move the current row up/down +Move the current row up/down. @kindex M-S-@key{up} @item M-S-@key{up} @@ -940,7 +879,7 @@ prefix ARG may be used to change the number of desired lines. If there is no region, the current field is split at the cursor position and the text fragment to the right of the cursor is prepended to the field one line down. If there is no region, but you specify a prefix ARG, the -current field gets blank, and the content is appended to the field +current field is made blank, and the content is appended to the field above. @tsubheading{Calculations} @@ -1000,36 +939,87 @@ incremented during copy. This key is also used by CUA-mode (@pxref{Interaction}). @tsubheading{Miscellaneous} -@kindex C-c | -@item C-c | -Toggle the visibility of vertical lines in tables. The lines are -still there, only made invisible with a text property. Any @samp{|} -added by hand will become invisible on the next align. +@kindex C-c ` +@item C-c ` +Edit the current field in a separate window. This is useful for fields +that are not fully visible (@pxref{Narrow columns}). When called with a +@kbd{C-u} prefix, just make the full field visible, so that it can be +edited in place. + +@kindex C-c @key{TAB} +@item C-c @key{TAB} +This is an alias for @kbd{C-u C-c `} to make the current field fully +visible. @item M-x org-table-import Import a file as a table. The table should be TAB- or whitespace -separated. Useful for example to import an Excel table or data from a +separated. Useful, for example, to import an Excel table or data from a database, because these programs generally can write TAB-separated text files. This command works by inserting the file into the buffer and then converting the region to a table. Any prefix argument is passed on to the converter, which uses it to determine the separator. @item M-x org-table-export -Export the table as a TAB-separated file. Useful for data exchange with -for example Excel or database programs. +Export the table as a TAB-separated file. Useful for data exchange with, +for example, Excel or database programs. @end table -If you don't like the automatic table editor because it gets into your -way in lines which you would like to start with @samp{|}, you can turn +If you don't like the automatic table editor because it gets in your +way on lines which you would like to start with @samp{|}, you can turn it off with + @lisp (setq org-enable-table-editor nil) @end lisp + @noindent The only table command which then still works is @kbd{C-c C-c} to do a manual re-align. -@node Table calculations, orgtbl-mode, Built-in table editor, Tables +@node Narrow columns, Table calculations, Built-in table editor, Tables +@section Narrow columns +@cindex narrow columns in tables + +The width of columns is automatically determined by the table editor. +Sometimes a single field or a few fields need to carry more text, +leading to unconveniently wide columns. To limit@footnote{This feature +does not work on XEmacs.} the width of a column, one field anywhere in +the column must carry the string @samp{} where @samp{N} is an integer +specifying the width of the column in characters. The next re-align +will then set the width of this column to no more than this value. + +@example +|---+------------------------------| |---+--------| +| | | | | <6> | +| 1 | one | | 1 | one | +| 2 | two | ----\ | 2 | two | +| 3 | This is a long chunk of text | ----/ | 3 | This=> | +| 4 | four | | 4 | four | +|---+------------------------------| |---+--------| +@end example + +@noindent +Fields that are wider become clipped and end in the string @samp{=>}. +Note that the full text is still in the buffer, it is only invisible. +To see the full text, hold the mouse over the field - a tooltip window +will show the full content. To edit such a field, use the command +@kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will +open a new window with the full field. Edit it and finish with @kbd{C-c +C-c}. + +When visiting a file containing a table with narrowed columns, the +necessary character hiding has not yet happened, and the table needs to +be aligned before it looks nice. Setting the option +@code{org-startup-align-all-tables} will realign all tables in a file +upon visiting, but also slow down startup. You can also set this option +on a per-file basis with: + +@example +#+STARTUP: align +#+STARTUP: noalign +@end example + +@node Table calculations, orgtbl-mode, Narrow columns, Tables @section Calculations in tables @cindex calculations, in tables @cindex spreadsheet capabilities @@ -1062,9 +1052,9 @@ recalculation can be automated. A formula can be any algebraic expression understood by the Emacs @file{calc} package. Note that @file{calc} has the slightly -non-standard conversion that @samp{/} has lower precedence than +non-standard convention that @samp{/} has lower precedence than @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before -evaluation by @code{calc-eval} (@pxref{Calling Calc from Your +evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs Calc Manual}), variable substitution takes place: @@ -1091,7 +1081,7 @@ constant. Constants are defined globally through the variable @code{org-table-formula-constants}. If you have the @file{constants.el} package, it will also be used to resolve constants, including natural constants like @samp{$h} for Planck's -constant, units like @samp{$km} for kilometers. Column names and +constant, and units like @samp{$km} for kilometers. Column names and parameters can be specified in special table lines. These are described below, see @ref{Advanced features}. @@ -1106,10 +1096,11 @@ The default settings can be configured using the variable @code{org-calc-default-modes}.} during execution, e.g. @samp{p20} to switch the internal precision to 20 digits, @samp{n3}, @samp{s3}, @samp{e2} or @samp{f4} to switch to normal, scientific, engineering, -or fix display format, respectively, and @samp{D}, @samp{R}, @samp{F}, +or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F}, and @samp{S} to turn on degrees, radians, fraction and symbolic modes, respectively. In addition, you may provide a @code{printf} format specifier to reformat the final result. A few examples: + @example $1+$2 @r{Sum of first and second field} $1+$2;%.2f @r{Same, format result to two decimals} @@ -1120,7 +1111,7 @@ specifier to reformat the final result. A few examples: tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1} sin($1);Dp3%.1e @r{Same, but use printf specifier for display} vmean($2..$7) @r{Compute column range mean, using vector function} - vsum(&III) @r{Sum numbers from 3rd hline above to here} + vsum(&III) @r{Sum numbers from 3rd hline above, up to here} taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree} @end example @@ -1164,12 +1155,13 @@ header. @node Advanced features, Named-field formulas, Column formulas, Table calculations @subsection Advanced features -If you want want the recalculation of fields to happen automatically, +If you want the recalculation of fields to happen automatically, or if you want to be able to assign a formula to an individual field (instead of an entire column) you need to reserve the first column of the table for special marking characters. Here is an example of a table that collects exam results of students and makes use of these features: + @example @group |---+---------+--------+--------+--------+-------+------| @@ -1192,7 +1184,7 @@ features: @end example @noindent @b{Important}: Please note that for these special tables, -recalculating the table with @kbd{C-u C-c *} does only affect rows +recalculating the table with @kbd{C-u C-c *} will only affect rows which are marked @samp{#} or @samp{*}, and named fields. The column formulas are not applied in rows with empty first field. @@ -1209,7 +1201,7 @@ the value @samp{10}. Also, named fields can have their own formula associated with them. @item _ Similar to @samp{^}, but defines names for the fields in the row -@emph{below}. +@emph{below}. @item $ Fields in this row can define @emph{parameters} for formulas. For example, if a field in a @samp{$} row contains @samp{max=50}, then @@ -1226,8 +1218,8 @@ lines will be left alone by this command. Selects this line for global recalculation with @kbd{C-u C-c *}, but not for automatic recalculation. Use this when automatic recalculation slows down editing too much. -@item -Unmarked lines are exempted from recalculation with @kbd{C-u C-c *}. +@item +Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}. All lines that should be recalculated should be marked with @samp{#} or @samp{*}. @end table @@ -1240,7 +1232,7 @@ or @samp{*}. A named field can have its own formula associated with it. In the example above, this is used for the @samp{at} field that contains the average result of the students. To enter a formula for a named -field, just type it onto the buffer, preceded by @samp{:=}. Or use +field, just type it into the buffer, preceded by @samp{:=}. Or use @kbd{C-u C-c =}. This equation will be stored below the table like @samp{$name=...}. Any recalculation in the table (even if only requested for the current line) will also update all named field @@ -1251,9 +1243,9 @@ formulas. @cindex formula editing @cindex editing, of table formulas -To edit a column or field formula, you can use the commands @kbd{C-c +To edit a column or field formula, use the commands @kbd{C-c =} and @kbd{C-u C-c =}, respectively. The currently active expression -is then presented as default in the minibuffer, were it may be edited. +is then presented as default in the minibuffer, where it may be edited. Note that making a table field blank does not remove the formula associated with the field - during the next recalculation the field @@ -1264,7 +1256,7 @@ give an empty reply when prompted for the formula, or to edit the @kindex C-c C-c You may edit the @samp{#+TBLFM} directly and re-apply the changed equations with @kbd{C-c C-c} in that line, or with the -normal recalculation commands in the table. +normal recalculation commands in the table. @kindex C-c ' @kindex C-c C-c @@ -1283,8 +1275,8 @@ installing the changes. When the evaluation of a formula leads to an error, the field content becomes the string @samp{#ERROR}. If you would like see what is going on during variable substitution and calculation in order to find a -bug, turn on formula debugging in the menu and repeat the calculation -by pressing, for example by pressing @kbd{C-c = @key{RET}} in a field. +bug, turn on formula debugging in the menu and repeat the calculation, +for example by pressing @kbd{C-c = @key{RET}} in a field. Detailed information will be displayed. @node Appetizer, , Editing/debugging formulas, Table calculations @@ -1320,6 +1312,7 @@ might want to use it also in other modes like text-mode or mail-mode. The minor mode Orgtbl-mode makes this possible. You can always toggle the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for example in mail mode, use + @lisp (add-hook 'mail-mode-hook 'turn-on-orgtbl) @end lisp @@ -1362,46 +1355,81 @@ Just like HMTL, Org-mode provides links inside a file, and external links to other files, Usenet articles, emails and much more. @menu -* Internal Links:: Links to other places in the current file -* External Links:: URL-like links to the world +* Link format:: How links in Org-mode are formatted +* Internal links:: Links to other places in the current file +* External links:: URL-like links to the world * Managing links:: Creating, inserting and following * Search Options:: Linking to a specific location * Remember:: Org-trees store quick notes @end menu -@node Internal Links, External Links, Hyperlinks, Hyperlinks -@section Internal Links +@node Link format, Internal links, Hyperlinks, Hyperlinks +@section Link format +@cindex link format +@cindex format, of links + +Org-mode will recognize plain URL-like links and activate them as +clickable links. However, the general link format looks like this: + +@example +[[link][description]] @r{or alternatively} [[link]] +@end example + +Once a link in the buffer is complete (all brackets present), Org-mode +will change the display so that @samp{description} is displayed instead +of @samp{[[link][description]]} and @samp{link} is displayed instead of +@samp{[[link]]}. Links will be highlighted in the face @code{org-link}, +which by default is an underlined face. You can directly edit the +visible part of a link. Note that this can be either the @samp{link} +part (if there is not description) or the @samp{description} part. To +edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the +cursor on the link. + +If you place the cursor at the beginning or just behind the end of the +displayed text and press @key{BACKSPACE}, you will remove the +(invisible) bracket at that location. This makes the link incomplete +and the internals are again displayed as plain text. Inserting the +missing bracket does hide the link internals again. To show the +internal structure of all links, use the menu entry +@code{Org->Hyperlinks->Literal links}. + +@node Internal links, External links, Link format, Hyperlinks +@section Internal links @cindex internal links @cindex links, internal @cindex CamelCase links -Strings inside double brackets like @samp{[[My Target]]} are links -that lead to a text search in the current file. The link can be -followed with @kbd{C-c C-o} or with a mouse click (@pxref{Managing -links}). The preferred match for such a link is a dedicated target: -The same string in double angular brackets. Targets may be located -anywhere, often it is convenient to put them into a comment line, for -example +If the link text does not look like a URL, links are considered to be +internal in the current file. Links such as @samp{[[My Target]]} or +@samp{[[My Target][Find my target]]} lead to a text search in the +current file. The link can be followed with @kbd{C-c C-o} when the +cursor is on the link, or with a mouse click (@pxref{Managing links}). +The preferred match for such a link is a dedicated target: The same +string in double angular brackets. Targets may be located anywhere, +often it is convenient to put them into a comment line, for example + @example # <> @end example -If no dedicated target exists, Org-mode will search for the words in -the link, in the above example for @samp{my target}. Links starting -with a star like @samp{*My Target} restrict the search to headlines. -When searching, Org-mode will first try an exact match, but then move -on to more and more lenient searches. For example, the link -@samp{[[*My Targets]]} will find any of the following +If no dedicated target exists, Org-mode will search for the words in the +link, often removing the need for a dedicated target. In the above +example the search would be for @samp{my target}. Links starting with a +star like @samp{*My Target} restrict the search to headlines. When +searching, Org-mode will first try an exact match, but then move on to +more and more lenient searches. For example, the link @samp{[[*My +Targets]]} will find any of the following: + @example ** My targets ** TODO my targets are bright ** my 20 targets are @end example -It is therefore often not necessary to set a dedicated target. To -insert a link targeting a headline, in-buffer completion can be used. -Just type a star followed by a few optional letters into the buffer -and press @kbd{M-@key{TAB}}. All headlines in the current buffer will -be offered as completions. @xref{Managing links}, for more commands + +To insert a link targeting a headline, in-buffer completion can be used. +Just type a star followed by a few optional letters into the buffer and +press @kbd{M-@key{TAB}}. All headlines in the current buffer will be +offered as completions. @xref{Managing links}, for more commands creating links. Following a link pushes a mark onto Org-mode's own mark ring. You can @@ -1414,7 +1442,7 @@ earlier. * CamelCase links:: Activating CamelCase words as links @end menu -@node Radio targets, CamelCase links, Internal Links, Internal Links +@node Radio targets, CamelCase links, Internal links, Internal links @subsection Radio targets You can configure Org-mode to link any occurrences of certain target @@ -1427,24 +1455,20 @@ scanned automatically for radio targets only when the file is first loaded into Emacs. To update the target list during editing, press @kbd{C-c C-c} with the cursor on or at a target. -@node CamelCase links, , Radio targets, Internal Links +@node CamelCase links, , Radio targets, Internal links @subsection CamelCase words as links @cindex completion, of CamelCase links @cindex CamelCase links, completion of -As an alternative to @samp{[[...]]} links, Org-mode also supports -CamelCase words as links. This feature is not turned on by default -because of the occasional inconsistencies this system suffers from. -To activate CamelCase words as links, and to make headline completion -offer CamelCase version of headlines, the following customization is -needed: -@lisp -(setq org-activate-camels t - org-file-link-context-use-camel-case t) -@end lisp +Org-mode also supports CamelCase words as links. This feature is not +turned on by default because of the inconsistencies this system suffers +from. To activate CamelCase words as links, you need to customize +the option @code{org-activate-links}. A CamelCase word then leads to a +text search such that @samp{CamelCaseLink} is equivalent to +@samp{[[camel case link]]}. -@node External Links, Managing links, Internal Links, Hyperlinks -@section External Links +@node External links, Managing links, Internal links, Hyperlinks +@section External links @cindex links, external @cindex external links @cindex links, external @@ -1460,39 +1484,46 @@ needed: @cindex SHELL links Org-mode supports links to files, websites, Usenet and email messages; -and BBDB database entries. Links are just plain-text URL-like -locators, optionally enclosed by angular brackets. The following list -shows examples for each link type. +and BBDB database entries. External links are URL-like locators. The +following list shows examples for each link type. @example - @r{on the web} - @r{file, absolute path} - @r{file, relative path} - @r{Usenet link} - @r{Mail link} - @r{VM folder link} - @r{VM message link} - @r{VM on remote machine} - @r{WANDERLUST folder link} - @r{WANDERLUST message link} - @r{MH-E folder link} - @r{MH-E message link} - @r{RMAIL folder link} - @r{RMAIL message link} - @r{GNUS group link} - @r{GNUS article link} - @r{BBDB link} -@footnote{Note that @samp{<} and @samp{>} cannot be part of a link, and therefore of a shell command. If you need redirection, use @@@{ and @@@} instead.} @r{A shell command} +http://www.astro.uva.nl/~dominik @r{on the web} +file:/home/dominik/images/jupiter.jpg @r{file, absolute path} +file:papers/last.pdf @r{file, relative path} +news:comp.emacs @r{Usenet link} +mailto:adent@@galaxy.net @r{Mail link} +vm:folder @r{VM folder link} +vm:folder#id @r{VM message link} +vm://myself@@some.where.org/folder#id @r{VM on remote machine} +wl:folder @r{WANDERLUST folder link} +wl:folder#id @r{WANDERLUST message link} +mhe:folder @r{MH-E folder link} +mhe:folder#id @r{MH-E message link} +rmail:folder @r{RMAIL folder link} +rmail:folder#id @r{RMAIL message link} +gnus:group @r{GNUS group link} +gnus:group#id @r{GNUS article link} +bbdb:Richard Stallman @r{BBDB link} +shell:ls *.org @r{A shell command} @end example -A link may contain space characters and is terminated by @samp{>} or by -the end of a line. In tables, the end of a table field also terminates -a link. Angle brackets around a link are not required, but are -recommended to avoid problems with punctuation and other text following -the link. See also the variable @code{org-allow-space-in-links}. +A link should be enclosed in double brackets and may contain a +descriptive text to be displayed instead of the url (@pxref{Link +format}), for example: +@example +[[http://www.gnu.org/software/emacs/][GNU Emacs]] +@end example -@node Managing links, Search Options, External Links, Hyperlinks +@cindex angular brackets, around links +@cindex plain text external links +Org-mode also finds external links in the normal text and activates them +as links. If spaces must be part of the link (for example in +@samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of +the link, enclose them in angular brackets. + +@node Managing links, Search Options, External links, Hyperlinks @section Managing links Org-mode provides methods to create a link in the correct syntax, to @@ -1504,53 +1535,63 @@ insert it into an org-mode file, and to follow the link. @item C-c l Store a link to the current location. This is a @emph{global} command which can be used in any buffer to create a link. The link will be -stored for later insertion into an Org-mode buffer (see below). For -VM, RMAIL, WANDERLUST, GNUS and BBDB buffers, the link will point to -the current article/entry. For W3 and W3M buffer, the link goes to -the current URL. For Org-mode files, the current headline is -targeted. For any other files, the link will point to the file, with -a search string (@pxref{Search Options}) pointing to the -contents of the current line. If there is an active region, the -selected words will form the basis of the search string. The key -binding @kbd{C-c l} is only a suggestion - see @ref{Installation and -Activation}. +stored for later insertion into an Org-mode buffer (see below). For VM, +RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will point to +the current article/entry. For W3 and W3M buffers, the link goes to the +current URL. For Org-mode files, the current headline is targeted. For +any other files, the link will point to the file, with a search string +(@pxref{Search Options}) pointing to the contents of the current line. +If there is an active region, the selected words will form the basis of +the search string. The key binding @kbd{C-c l} is only a suggestion - +see @ref{Installation and activation}. @kindex C-c C-l @cindex link completion -@cindex file name completion @cindex completion, of links -@cindex completion, of file names @cindex inserting links @item C-c C-l -Insert a link. This prompts for a link to be inserted into the -buffer. You can just type a link, using one of the link type prefixes -mentioned in the examples above. Through completion, all links stored -during the current session can be accessed. When called with prefix -arg, you can use file name completion to enter a file link. The link +Insert a link. This prompts for a link to be inserted into the buffer. +You can just type a link, using text for an internal link, or one of the +link type prefixes mentioned in the examples above. Through completion, +all links stored during the current session can be accessed. The link will be formatted as given in the variable @code{org-link-format} and -inserted into the buffer. Note that you don't have to use this -command to insert a link. Links in Org-mode are plain text, and you -can type or paste them straight into the buffer. +inserted into the buffer, along with a descriptive text. Note that you +don't have to use this command to insert a link. Links in Org-mode are +plain text, and you can type or paste them straight into the buffer. +By using this command, the links are automatically enclosed in double +brackets, and you will be asked for the optional descriptive text. + +@kindex C-u C-c C-l +@cindex file name completion +@cindex completion, of file names +@item C-u C-c C-l +When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to +a file will be inserted and you may use file name completion to select +the name of the file. The path to the file is inserted relative to the +directory of the current org file, if the linked file is in the current +directory or in a subdirectory of it. Otherwise an absolute path, if +possible with @samp{~/} for your home directory is used. You can force +an absolute path with two @kbd{C-u} prefixes. + +@item C-c C-l @r{with cursor on existing link} +When the cursor is on an existing link, @kbd{C-c C-l} allows to edit the +link and description parts of the link. @cindex following links @kindex C-c C-o @item C-c C-o Open link at point. This will launch a web browser for URLs (using -@command{browse-url-at-point}), run vm/gnus/bbdb for the corresponding -links, and execute the command in a shell link. When the cursor is on -a CamelCase link, this commands runs the corresponding search. When -the cursor is on a TAGS list in a headline, it creates the -corresponding TAGS view. Furthermore, it will visit text files in -@samp{file:} links with Emacs and select a suitable application for -non-text files. Classification of files is based on file extension -only. See option @code{org-file-apps}. If there is no link at point, -the current subtree will be searched for one. If you want to override -the default application and visit the file with Emacs, use a @kbd{C-u} -prefix. If the cursor is on a time stamp, compiles the agenda for -that date. - -@strong{IMPORTANT}: Be careful not to use any dangerous commands in a -shell link. +@command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb +for the corresponding links, and execute the command in a shell link. +When the cursor is on an internal link, this commands runs the +corresponding search. When the cursor is on a TAGS list in a headline, +it creates the corresponding TAGS view. If the cursor is on a time +stamp, it compiles the agenda for that date. Furthermore, it will visit +text files in @samp{file:} links with Emacs and select a suitable +application for non-text files. Classification of files is based on +file extension only. See option @code{org-file-apps}. If you want to +override the default application and visit the file with Emacs, use a +@kbd{C-u} prefix. @kindex mouse-2 @kindex mouse-1 @@ -1589,12 +1630,14 @@ particular location in the file when following a link. This can be a line number or a search option after a double@footnote{For backward compatibility, line numbers can also follow a single colon.} colon. For example: + @example - - - - +[[file:~/code/main.c::255]] +[[file:~/xx.org::My Target]] +[[file:~/xx.org::*My Target]] +[[file:~/xx.org::/regexp/]] @end example + @noindent Here is what these options do. @table @code @@ -1603,7 +1646,7 @@ Jump to line 255. @item My Target Search for a link target @samp{<>}, or do a text search for @samp{my target}, similar to the search in internal links, see -@ref{Internal Links}. +@ref{Internal links}. @item *My Target In an Org-mode file, restrict search to headlines. @item /regexp/ @@ -1632,29 +1675,65 @@ information. The notes produced by @emph{Remember} can be stored in different ways, and Org-mode files are a good target. Org-mode allows to file away notes either to a default file, or directly to the correct location in your Org-mode outline tree. The following -customization@footnote{The two autoload forms are only necessary if +customization@footnote{The three autoload forms are only necessary if @file{org.el} is not part of the Emacs distribution or an XEmacs package.} will tell @emph{Remember} to use org files as target, and to create annotations compatible with Org-mode links. @example -(autoload 'org-remember-annotation "org") -(autoload 'org-remember-handler "org") (setq org-directory "~/path/to/my/orgfiles/") (setq org-default-notes-file "~/.notes") +(autoload 'org-remember-annotation "org") +(autoload 'org-remember-apply-template "org") +(autoload 'org-remember-handler "org") (setq remember-annotation-functions '(org-remember-annotation)) (setq remember-handler-functions '(org-remember-handler)) +(add-hook 'remember-mode-hook 'org-remember-apply-template) @end example -When you compose a note with remember, you have to press @kbd{C-c C-c} -to exit remember-mode and to file away the note. The handler first -prompts for a target file - if you press @key{RET}, the value of +@cindex templates, for remember +In combination with Org-mode, you can use templates to generate +different types of remember notes. For example, if you would like to +use one template to create general TODO entries, and another one for +journal entries, you could use: + +@example +(setq org-remember-templates + '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org") + (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org"))) +@end example + +@noindent In these entries, the character specifies how to select the +template, the first string specifies the template, and the (optional) +second string specifies a default file (overruling +@code{org-default-notes-file}) as a target for this note. + +When you call @kbd{M-x remember} to remember something, org will prompt +for a key to select the template and then prepare the buffer like +@example +* TODO + +@end example + +@noindent or + +@example +* [2006-03-21 Tue 15:37] + + +@end example + +@noindent See the variable @code{org-remember-templates} for more details. + +When you are finished composing a note with remember, you have to press +@kbd{C-c C-c} to file the note away. The handler first prompts for a +target file - if you press @key{RET}, the value of @code{org-default-notes-file} is used. Then the command offers the headings tree of the selected file. You can either immediately press -@key{RET} to get the note appended to the file. Or you can use -vertical cursor motion (@key{up} and @key{down}) and visibility -cycling (@key{TAB}) to find a better place. Pressing @key{RET} or -@key{left} or @key{right} leads to the following result. +@key{RET} to get the note appended to the file. Or you can use vertical +cursor motion (@key{up} and @key{down}) and visibility cycling +(@key{TAB}) to find a better place. Pressing @key{RET} or @key{left} or +@key{right} leads to the following result. @multitable @columnfractions 0.2 0.1 0.7 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted} @@ -1680,6 +1759,7 @@ additional data. If the variable @code{org-adapt-indentation} is non-nil, the entire text is also indented so that it starts in the same column as the headline (after the asterisks). + @node TODO items, Timestamps, Hyperlinks, Top @chapter TODO items @cindex TODO items @@ -1697,16 +1777,16 @@ things you have to do. @menu * TODO basics:: Marking and displaying TODO entries -* Progress Logging:: Document your productivity +* Progress logging:: Document your productivity * TODO extensions:: Workflow and assignments * Priorities:: Some things are more important than others @end menu -@node TODO basics, Progress Logging, TODO items, TODO items +@node TODO basics, Progress logging, TODO items, TODO items @section Basic TODO functionality Any headline can become a TODO item by starting it with the word TODO, -for example +for example: @example *** TODO Write letter to Sam Fortune @@ -1720,10 +1800,12 @@ The most important commands to work with TODO entries are: @cindex cycling, of TODO states @item C-c C-t Rotate the TODO state of the current item between + @example ,-> (unmarked) -> TODO -> DONE --. '--------------------------------' @end example + The same rotation can also be done ``remotely'' from the timeline and agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}). @kindex C-c C-v @@ -1746,15 +1828,17 @@ If you would like to have all your TODO items listed as part of your agenda, customize the variable @code{org-agenda-include-all-todo}. @end table -@node Progress Logging, TODO extensions, TODO basics, TODO items +@node Progress logging, TODO extensions, TODO basics, TODO items @section Progress Logging @cindex progress logging @cindex logging, of progress If you want to keep track of @emph{when} a certain TODO item was finished, turn on logging with + @lisp (setq org-log-done t) @end lisp + @noindent Then each time you turn a TODO entry into DONE using either @kbd{C-c C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line @@ -1765,16 +1849,18 @@ state cycling, that line will be removed again. In the timeline you can then use the @kbd{L} key to display the TODO items closed on each day, giving you an overview of what has been done on a day. -@node TODO extensions, Priorities, Progress Logging, TODO items +@node TODO extensions, Priorities, Progress logging, TODO items @section Extended use of TODO keywords @cindex extended TODO keywords -The default implementation of TODO entries is just two states: TODO -and DONE. You can, however, use the TODO feature for more -complicated things by configuring the variables -@code{org-todo-keywords} and @code{org-todo-interpretation}. Using -special setup, you can even use TODO keywords in different ways in -different org files. +The default implementation of TODO entries is just two states: TODO and +DONE. You can, however, use the TODO feature for more complicated +things by configuring the variables @code{org-todo-keywords} and +@code{org-todo-interpretation}. Using special setup, you can even use +TODO keywords in different ways in different org files. + +Note that @i{tags} are another way to classify headlines in general and +TODO items in particular (@pxref{Tags}). @menu * Workflow states:: From TODO to DONE in steps @@ -1788,7 +1874,7 @@ different org files. @cindex workflow states as TODO keywords You can use TODO keywords to indicate different states in the process -of working on an item, for example +of working on an item, for example: @lisp (setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE") @@ -1836,7 +1922,7 @@ Use prefix arguments or completion to quickly select a specific name. You can also review the items of a specific TODO type in a sparse tree by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect -collect Lucy's items from all agenda files into a single buffer, you +Lucy's items from all agenda files into a single buffer, you would use the prefix arg as well when creating the global todo list: @kbd{C-3 C-c t}. @@ -1922,7 +2008,7 @@ Furthermore, these keys are also used by CUA-mode (@pxref{Interaction}). @end table -@node Timestamps, Agenda Views, TODO items, Top +@node Timestamps, Tags, TODO items, Top @chapter Timestamps Items can be labeled with timestamps to make them useful for project @@ -1945,7 +2031,7 @@ planning. A time stamp is a specification of a date (possibly with time) in a special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue 09:39>}. A time stamp can appear anywhere in the headline or body -of an org-tree entry. Its presence allows to show entries on specific +of an org-tree entry. Its presence allows entries to be shown on specific dates in the agenda (@pxref{Weekly/Daily Agenda}). We distinguish: @table @var @@ -2011,12 +2097,13 @@ this command is used twice in succession, a time range is inserted. @kindex C-u C-c . @item C-u C-c . Like @kbd{C-c .}, but use the alternative format which contains date -and time. +and time. The default time can be rounded to multiples of 5 minutes, +see the option @code{org-time-stamp-rounding-minutes}. @kindex C-c ! @item C-c ! Like @kbd{C-c .}, but insert an inactive time stamp not triggering the -agenda. +agenda. @kindex C-c < @item C-c < @@ -2118,18 +2205,123 @@ One month back. Choose date in calendar (only if nothing typed into minibuffer). @end table -@node Agenda Views, Exporting, Timestamps, Top +@node Tags, Agenda Views, Timestamps, Top +@chapter Tags +@cindex tags +@cindex headline tagging +@cindex matching, tags +@cindex sparse tree, tag based + +If you wish to implement a system to cross-correlate information, an +excellent way is to assign @i{tags} to headline. Org-mode has +extensive support for using tags. + +Every headline can contain a list of tags, at the end of the headline. +Tags are normal words containing letters, numbers, @samp{_}, and +@samp{@@}. Tags must be preceded and followed by a single colon; like +@samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}. + +@menu +* Tag inheritance:: Tags use the tree structure of the outline +* Setting tags:: How to assign tags to a headline +* Tag searches:: Searching for combinations of tags +@end menu + +@node Tag inheritance, Setting tags, Tags, Tags +@section Tag inheritance +@cindex inheritance, of tags + +@i{Tags} make use of the hierarchical structure of outline trees. If a +heading has a certain tag, all subheadings will inherit the tag as +well. For example, in the list + +@example +* Meeting with the French group :WORK: +** Summary by Frank :BOSS:NOTES: +*** TODO Prepare slides for him :ACTION: +@end example + +@noindent +the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:}, +@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and +Org-mode finds that a certain headline matches the search criterion, it +will not check any sublevel headline, assuming that these likely also +match, and that the list of matches can become very long. However, this +may not be what you want, and you can influence inheritance and +searching using the variables @code{org-use-tag-inheritance} and +@code{org-tags-match-list-sublevels}. + +@node Setting tags, Tag searches, Tag inheritance, Tags +@section Setting tags +@cindex setting tags + +@kindex M-@key{TAB} +As Org-mode deals with plain text files, tags can simply be typed into +the buffer. After a colon, @kbd{M-@key{TAB}} offers completion on all +tags being used in the current buffer. There is also a special command +for inserting tags: + +@table @kbd +@kindex C-c C-c +@item C-c C-c +@cindex completion, of tags +Enter new tags for the current headline. The minibuffer will prompt for +a list of tags and offer completion with respect to all other tags used +in the current buffer. Several tags, separated by colons, may be +specified at the prompt. After pressing @key{RET}, the tags will be +inserted and aligned to @code{org-tags-column}. When called with a +@kbd{C-u} prefix, all tags in the current buffer will be aligned to that +column, just to make things look nice. TAGS are automatically realigned +after promotion, demotion, and TODO state changes (@pxref{TODO basics}). +@end table + +@node Tag searches, , Setting tags, Tags +@section Tag searches +@cindex tag searches + +Once a tags system has been set up, it can be used to collect related +information into special lists. + +@table @kbd +@kindex C-c \ +@item C-c \ +Create a sparse tree with all headlines matching a tags search. +@kindex C-c a m +@item C-c a m +Create a global list of tag matches from all agenda files. +@xref{Matching headline tags}. +@kindex C-c a M +@item C-c a M +Create a global list of tag matches from all agenda files, but check +only TODO items and force checking subitems (see variable +@code{org-tags-match-list-sublevels}). +@end table + +A @i{tags} search string can use Boolean operators @samp{&} for AND and +@samp{|} for OR. @samp{&} binds more strongly than @samp{|}. +Parenthesis are currently not implemented. A tag may also be preceded +by @samp{-}, to select against it, and @samp{+} is syntactic sugar for +positive selection. The AND operator @samp{&} is optional when @samp{+} +or @samp{-} is present. For example, @samp{+WORK-BOSS} would select all +headlines that are tagged @samp{:WORK:}, but discard those also tagged +@samp{:BOSS:}. The search string @samp{WORK|LAPTOP} selects all lines +tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string +@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are +also tagged @samp{NIGHT}. + +@node Agenda Views, Exporting, Tags, Top @chapter Agenda Views @cindex agenda views -Due to the way Org-mode works, TODO items and time-stamped items can -be scattered throughout a file or even a number of files. To get an -overview over open action items, or over events that are important for -a particular date, this information must be collected, sorted and -displayed in an organized way. +Due to the way Org-mode works, TODO items, time-stamped items, and +tagged headlines can be scattered throughout a file or even a number of +files. To get an overview over open action items, or over events that +are important for a particular date, this information must be collected, +sorted and displayed in an organized way. Org-mode can select items based on various criteria, and display them in a separate buffer. Three different views are provided: + @itemize @bullet @item an @emph{agenda} that is like a calendar and shows information @@ -2141,6 +2333,7 @@ action items, and a @emph{tags view} that shows information based on the tags associated with headlines in the outline tree. @end itemize + @noindent The extracted information is displayed in a special @emph{agenda buffer}. This buffer is read-only, but provides commands to visit the @@ -2161,7 +2354,9 @@ edit these files remotely. @section Agenda files The information to be shown is collected from all @emph{agenda files}, -the files listed in the variable @code{org-agenda-files}. Thus even +the files listed in the variable @code{org-agenda-files}@footnote{If the +value of that variable is not a list, but a single file name, then the +list of agenda files will be maintained in that external file.}. Thus even if you only work with a single Org-mode file, this file should be put into that list@footnote{When using the dispatcher pressing @kbd{1} before selecting a command will actually limit the command to the @@ -2181,8 +2376,9 @@ the front. With prefix arg, file is added/moved to the end. Remove current file from the list of agenda files. @kindex C-, @item C-, -Cycle through agenda file list. +Cycle through agenda file list, visiting one file after the other. @end table + @noindent The Org menu contains the current list of files and can be used to visit any of them. @@ -2195,7 +2391,7 @@ to visit any of them. @cindex agenda commands, custom The views are created through a dispatcher that should be bound to a global key, for example @kbd{C-c a} (@pxref{Installation and -Activation}). In the following we will assume that @kbd{C-c a} is +activation}). In the following we will assume that @kbd{C-c a} is indeed how the dispatcher is accessed and list keyboard access to commands accordingly. After pressing @kbd{C-c a}, an additional letter is required to execute a command. The dispatcher offers the @@ -2206,7 +2402,7 @@ Create the calendar-like agenda (@pxref{Weekly/Daily Agenda}). @item t / T Create a list of all TODO items (@pxref{Global TODO list}). @item m / M -Create a list of headline matching a TAGS expression (@pxref{Matching +Create a list of headlines matching a TAGS expression (@pxref{Matching headline tags}). @end table @@ -2222,6 +2418,7 @@ Custom commands are configured in the variable @code{org-agenda-custom-commands}. You can customize this variable, for example by pressing @kbd{C-c a C}. You can also directly set it with Emacs Lisp in @file{.emacs}. For example: + @lisp (setq org-agenda-custom-commands '(("w" todo "WAITING") @@ -2229,8 +2426,9 @@ with Emacs Lisp in @file{.emacs}. For example: ("U" tags-tree "+BOSS-URGENT") ("f" occur-tree "\\"))) @end lisp + @noindent will define @kbd{C-c a w} as a global search for -TODO entries with @samp{WAITING} as todo keyword, @kbd{C-c a u} as a +TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a global tags search for headlines marked @samp{:BOSS:} but not @samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the current buffer and display the result as a sparse tree, and @kbd{C-c a @@ -2252,11 +2450,11 @@ a paper agenda, showing all the tasks for the current week or day. Compile an agenda for the current week from a list of org files. The agenda shows the entries for each day. With a @kbd{C-u} prefix (or when the variable @code{org-agenda-include-all-todo} is @code{t}), all -unfinished TODO items (also those without a date) are also listed at +unfinished TODO items (including those without a date) are also listed at the beginning of the buffer, before the first date.@* @end table -Remote editing from the agenda buffer means for example that you can +Remote editing from the agenda buffer means, for example, that you can change the dates of deadlines and appointments from the agenda buffer. The commands available in the Agenda buffer are listed in @ref{Agenda commands}. @@ -2275,12 +2473,15 @@ commands}. In the agenda buffer, each entry is preceded by a @emph{category}, which is derived from the file name. The category can also be set with a special line anywhere in the buffer, looking like this: + @example #+CATEGORY: Thesis @end example + If there are several such lines in a file, each specifies the category -for the text below it. The display in the agenda buffer looks best if -the category is not longer than 10 characters. +for the text below it (but the first category also applies to any text +before the first CATEGORY line). The display in the agenda buffer looks +best if the category is not longer than 10 characters. @node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily Agenda @subsection Time-of-Day Specifications @@ -2337,7 +2538,7 @@ The time grid can be turned on and off with the variable Emacs contains the calendar and diary by Edward M. Reingold. The calendar displays a three-month calendar with holidays from different -countries and cultures. The diary allows to keep track of +countries and cultures. The diary allows you to keep track of anniversaries, lunar phases, sunrise/set, recurrent appointments (weekly, monthly) and more. In this way, it is quite complementary to Org-mode. It can be very useful to combine output from Org-mode with @@ -2349,13 +2550,12 @@ agenda, you only need to customize the variable @lisp (setq org-agenda-include-diary t) @end lisp -@noindent @noindent After that, everything will happen automatically. All diary entries including holidays, anniversaries etc will be included in the agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and @key{RET} can be used from the agenda buffer to jump to the diary -file, in order to edit existing diary entries. The @kbd{i} command to +file in order to edit existing diary entries. The @kbd{i} command to insert new entries for the current date works in the agenda buffer, as well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display Sunrise/Sunset times, show lunar phases and to convert to other @@ -2399,7 +2599,7 @@ the TODO entries directly from that buffer (@pxref{Agenda commands}). @xref{Global TODO list}, for more information. @kindex C-c a T @item C-c a T -Like the above, but allow to select a specific TODO keyword. You can +Like the above, but allows selection of a specific TODO keyword. You can also do this by specifying a prefix argument to @kbd{C-c a t}. With a @kbd{C-u} prefix you are prompted for a keyword. With a numeric prefix, the Nth keyword in @code{org-todo-keywords} is selected. @@ -2452,7 +2652,7 @@ The timeline is not really an agenda view, because it only summarizes items from a single Org-mode file. But it also uses the agenda buffer and provides similar commands, so we discuss it here. The timeline shows all time-stamped items in a single Org-mode file (or the -selected part of it), in @emph{time-sorted view}. The main purpose of +selected part of it), in a @emph{time-sorted view}. The main purpose of this command is to give an overview over events in a project. @table @kbd @@ -2462,8 +2662,8 @@ Show a time-sorted view of the org file, with all time-stamped items. When called with a @kbd{C-u} prefix, all unfinished TODO entries (scheduled or not) are also listed under the current date. @end table -@noindent +@noindent The commands available in the timeline buffer are listed in @ref{Agenda commands}. @@ -2476,7 +2676,7 @@ file where they originate. You are not allowed to edit the agenda buffer itself, but commands are provided to show and jump to the original entry location, and to edit the org-files ``remotely'' from the agenda buffer. In this way, all information is stored only once, -and you don't risk that your agenda and note files diverge. +removing the risk that your agenda and note files may diverge. Some commands can be executed with mouse clicks on agenda lines. For the other commands, the cursor needs to be in the desired line. @@ -2507,7 +2707,7 @@ Display original location and recenter that window. @itemx mouse-1 @itemx @key{TAB} Go to the original location of the item in another window. Under Emacs -22, also @kbd{mouse-1} will works for this. +22, @kbd{mouse-1} will also works for this. @kindex @key{RET} @itemx @key{RET} @@ -2531,11 +2731,11 @@ Delete other windows. @kindex w @item w -Switch to weekly view (7 days displayed together) +Switch to weekly view (7 days displayed together). @kindex d @item d -Switch to daily view (just one day displayed) +Switch to daily view (just one day displayed). @kindex D @item D @@ -2580,7 +2780,7 @@ original org file. @kindex T @item T -Show all tags assiciated with the current item. Because of +Show all tags associated with the current item. Because of inheritance, this may be more than the tags listed in the line itself. @kindex : @@ -2650,7 +2850,7 @@ date at the cursor. @kindex M @item M -Show the phases of the moon for three month around current date. +Show the phases of the moon for the three months around current date. @kindex S @item S @@ -2673,7 +2873,7 @@ Export a single iCalendar file containing entries from all agenda files. @tsubheading{Quit and Exit} @kindex q @item q -Quit Agenda, remove the agenda buffer. +Quit agenda, remove the agenda buffer. @kindex x @cindex agenda files, removing buffers @@ -2718,11 +2918,13 @@ warning. @cindex headline levels, for exporting In the exported version, the first 3 outline levels will become headlines, defining a general document structure. Additional levels -will be exported as itemize lists. If you want that transition to occur +will be exported as itemized lists. If you want that transition to occur at a different level, specify it with a prefix argument. For example, + @example @kbd{C-1 C-c C-x a org-export-as-ascii} @end example + @noindent creates only top level headlines and does the rest as items. Lines starting with @samp{#} and subtrees starting with the word @samp{COMMENT} @@ -2757,11 +2959,13 @@ Toggle fixed-width for entry (QUOTE) or region, see below. @cindex headline levels, for exporting In the exported version, the first 3 outline levels will become headlines, defining a general document structure. Additional levels -will be exported as itemize lists. If you want that transition to occur +will be exported as itemized lists. If you want that transition to occur at a different level, specify it with a prefix argument. For example, + @example @kbd{C-2 C-c C-x b} @end example + @noindent creates two levels of headings and does the rest as items. @@ -2851,9 +3055,10 @@ correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion #+TEXT: Several lines may be given. #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t @end example + @noindent The OPTIONS line is a compact form to specify export settings. Here -you can +you can: @cindex headline levels @cindex section-numbers @cindex table of contents @@ -2886,7 +3091,7 @@ end of the outline tree. For example: @example * COMMENT HTML style specifications -# Local Variables: +# Local Variables: # org-export-html-style: "