summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog367
-rw-r--r--lisp/ChangeLog.116
-rw-r--r--lisp/abbrev.el4
-rw-r--r--lisp/add-log.el85
-rw-r--r--lisp/allout.el100
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/calc/calc-embed.el4
-rw-r--r--lisp/calendar/cal-menu.el2
-rw-r--r--lisp/calendar/cal-tex.el20
-rw-r--r--lisp/calendar/diary-lib.el2
-rw-r--r--lisp/comint.el2
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/cvs-status.el2
-rw-r--r--lisp/diff-mode.el170
-rw-r--r--lisp/emacs-lisp/warnings.el3
-rw-r--r--lisp/faces.el8
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/follow.el525
-rw-r--r--lisp/gnus/ChangeLog72
-rw-r--r--lisp/gnus/deuglify.el3
-rw-r--r--lisp/gnus/message.el20
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/mm-uu.el54
-rw-r--r--lisp/gnus/mml-sec.el51
-rw-r--r--lisp/gnus/mml.el159
-rw-r--r--lisp/gnus/mml1991.el67
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/gnus/nnweb.el4
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/help-mode.el5
-rw-r--r--lisp/image.el44
-rw-r--r--lisp/international/mule.el6
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/log-view.el2
-rw-r--r--lisp/mh-e/ChangeLog37
-rw-r--r--lisp/mh-e/mh-e.el5
-rw-r--r--lisp/mh-e/mh-letter.el29
-rw-r--r--lisp/net/rcirc.el79
-rw-r--r--lisp/net/tramp.el169
-rw-r--r--lisp/pcvs-defs.el2
-rw-r--r--lisp/pcvs-info.el2
-rw-r--r--lisp/pcvs-parse.el2
-rw-r--r--lisp/pcvs-util.el2
-rw-r--r--lisp/progmodes/antlr-mode.el2
-rw-r--r--lisp/progmodes/asm-mode.el10
-rw-r--r--lisp/progmodes/cc-subword.el49
-rw-r--r--lisp/progmodes/grep.el471
-rw-r--r--lisp/progmodes/gud.el50
-rw-r--r--lisp/progmodes/python.el12
-rw-r--r--lisp/reveal.el2
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/smerge-mode.el2
-rw-r--r--lisp/startup.el9
-rw-r--r--lisp/subr.el50
-rw-r--r--lisp/term/mac-win.el5
-rw-r--r--lisp/textmodes/bibtex.el14
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/org.el98
-rw-r--r--lisp/textmodes/paragraphs.el28
-rw-r--r--lisp/textmodes/reftex-vars.el6
-rw-r--r--lisp/time-stamp.el6
-rw-r--r--lisp/tool-bar.el22
-rw-r--r--lisp/url/ChangeLog8
-rw-r--r--lisp/url/url-gw.el16
-rw-r--r--lisp/url/url-handlers.el56
65 files changed, 1883 insertions, 1177 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 56ee9cb71e6..b39bebc7215 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,303 @@
+2006-05-01 Richard Stallman <rms@gnu.org>
+
+ * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
+ M-r, M-R, M-A, M-SPC or M-DEL.
+ (diff-mode-map): diff-refine-hunk now on C-c C-w
+ (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
+
+ * help-mode.el (help-mode): view-exit-action calls delete-window
+ only when it is safe and possible.
+
+ * simple.el (undo-outer-limit-truncate): Put quotes around buffer name
+ in messages.
+
+ * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
+
+ * tool-bar.el (tool-bar-setup): Put Help and Preferences items
+ in the default tool-bar-map.
+
+2006-05-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-completion-file-name-handler-alist)
+ (tramp-run-real-handler, tramp-completion-run-real-handler)
+ (tramp-completion-handle-file-name-all-completions)
+ (tramp-completion-handle-file-name-completion): Autoload them.
+ (tramp-completion-handle-file-exists-p)
+ (tramp-completion-handle-file-name-directory)
+ (tramp-completion-handle-file-name-nondirectory)
+ (tramp-completion-handle-expand-file-name): Remove them.
+ (tramp-handle-file-name-directory): Return the real directory
+ name. Returning "/" only doesn't need to be necessary any longer.
+ (tramp-file-name-handler): Make special attention when in hostname
+ completion mode.
+ (tramp-completion-file-name-handler): Revert patch from
+ 2006-04-28.
+ (tramp-register-file-name-handlers): Register
+ `tramp-completion-file-name-handler' only when
+ `partial-completion-mode is enabled.
+ (tramp-completion-handle-file-name-all-completions): Delete
+ directory part from results.
+ (tramp-get-completion-methods, tramp-get-completion-user-host):
+ Discard deleting "/", it doesn't work after the change of
+ `tramp-handle-file-name-directory' above.
+
+2006-05-01 Kim F. Storm <storm@cua.dk>
+
+ * progmodes/grep.el (grep-expand-template): Use save-match-data.
+
+2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
+ select-frame-set-input-focus instead of raise-frame.
+ (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
+
+2006-05-01 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gud.el (gud-def): Add %c case.
+ (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily.
+ (gud-format-command): Make match case sensitive. Match on %F.
+
+2006-04-30 Glenn Morris <rgm@gnu.org>
+
+ * calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
+ (cal-tex-preamble): Use cal-tex-preamble-extra.
+ (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
+ than alias `list-diary-entries'.
+
+2006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * help-fns.el (describe-variable): Add info about safe local variables.
+
+2006-04-29 Richard Stallman <rms@gnu.org>
+
+ * bindings.el (mode-line-format): help-echo doc fixes.
+
+ * net/tramp.el (tramp-file-name-handler-alist): Delete
+ expand-file-name and other operations that can cause spurious loading.
+
+2006-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (safe-local-variable-p): Remove support for the special
+ value t.
+
+ * textmodes/paragraphs.el (sentence-end-without-space):
+ Fix safety predicate.
+ (sentence-end-double-space, sentence-end-without-period)
+ (paragraph-ignore-fill-prefix):
+ * textmodes/fill.el (colon-double-space):
+ * abbrev.el (abbrev-mode): Tighten the safety predicate.
+
+ * subr.el (booleanp): New fun.
+
+ * textmodes/reftex-vars.el (reftex-guess-label-type):
+ Tighten the safety predicate.
+
+2006-04-28 Kim F. Storm <storm@cua.dk>
+
+ * progmodes/grep.el (defgroup grep): Doc fix.
+ (grep-auto-highlight): Remove.
+ (grep-template): New defcustom.
+ (grep-find-template): Rename from grep-tree-template.
+ (grep-files-aliases): Rename from grep-tree-files-aliases.
+ Remove "all" alias, add "l" alias.
+ (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
+ (grep-find-ignored-directories): New defcustom to replace
+ grep-tree-ignore-CVS-directories, to facilitate ignoring
+ subdirectories for multiple version control systems.
+ (grep-mode-map): Add Recursive grep item to GREP menu.
+ (grep-regexp-history, grep-files-history): New defvars.
+ (grep-probe): New helper function.
+ (grep-compute-defaults): Use it to simplify code.
+ Adapt to name changes.
+ Use `.' as base in grep-find-template rather than <D>.
+ (grep): Remove superfluous highlight-regexp arg. Fix doc.
+ Call grep-compute-defaults unconditionally.
+ (grep-expand-keywords): New defconst.
+ (grep-expand-template): Rename from grep-expand-command-macros.
+ Simplify via grep-expand-keywords. Look at case-fold-search instead
+ of grep-tree-ignore-case to add -i option.
+ Bind case-fold-search to nil while matching keywords.
+ (grep-tree-last-regexp, grep-tree-last-files): Remove.
+ (grep-read-regexp, grep-read-files): New helper functions.
+ (rgrep): Rename from grep-tree. Rework to use proper histories.
+ Adapt to changes in defcustoms and functions above.
+ (lgrep): New command, as grep, but using same interactive api as rgrep.
+
+2006-04-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-completion-file-name-handler):
+ Disable Tramp's functionality while loading Tramp itself.
+ (tramp-register-file-name-handlers): That's a defsubst now.
+ Code from `tramp-repair-jka-compr' moved here. Apply it via
+ `after-init-hook'.
+ (tramp-repair-jka-compr): Remove.
+
+2006-04-27 Jay Belanger <belanger@truman.edu>
+
+ * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
+ read expression when `math-read-big-expr' doesn't work.
+
+2006-04-27 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * startup.el (command-line-1): Display warning when
+ pure-space-overflow is non-nil.
+
+2006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
+
+ * textmodes/bibtex.el (bibtex-user-optional-fields): Mark as
+ risky.
+
+2006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
+
+ * textmodes/bibtex.el (bibtex-url): New optional arg no-browse.
+ Return the URL or nil if none can be generated.
+
+2006-04-27 Nick Roberts <nickrob@snap.net.nz>
+
+ * progmodes/gud.el (gud-comint-buffer): Move forward to stop
+ byte compiler warnings.
+ (gud-basic-call, gud-find-expr): Let user select an expression
+ for printing. Print expression as well as value in GUD buffer.
+
+2006-04-17 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el: Remove local autoload declaration for
+ pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el.
+ (allout-show-bodies, allout-header-prefix, allout-primary-bullet)
+ (allout-plain-bullets-string, allout-distinctive-bullets-string)
+ (allout-use-mode-specific-leader, allout-old-style-prefixes)
+ (allout-stylish-prefixes, allout-numbered-bullet)
+ (allout-file-xref-bullet, allout-presentation-padding)
+ (allout-use-hanging-indents, allout-reindent-bodies): Mark as
+ safe-local-variable with suitable value spec, and add autoload
+ cookie for loaddefs inclusion. We now use an explicit spec everywhere.
+ (move-beginning-of-line, move-end-of-line): Repair so these compat
+ functions now actually resituate the point, when appropriate.
+
+2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/cc-subword.el (c-subword-mode-map): Use command remapping.
+
+ * add-log.el (add-log-iso8601-time-zone): Make parameter optional.
+ (add-log-iso8601-time-string): Fix call to format-time-string.
+
+2006-04-26 Kim F. Storm <storm@cua.dk>
+
+ * subr.el (posn-string, posn-image, posn-object): Doc fix.
+
+2006-04-26 Masatake YAMATO <jet@gyve.org>
+
+ * progmodes/asm-mode.el (asm-mode, asm-mode-syntax-table):
+ Add support for "//" style comments. Remove `b' flag
+ from ?* in `asm-mode-syntax-table'.
+
+2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * follow.el: Use (featurep 'xemacs) everywhere.
+ (follow-mode): Use define-minor-mode.
+ (follow-mode-map): Move initialization into the declaration.
+ Use command remapping.
+ (follow-emacs-version-xemacs-p): Remove.
+ (follow-submit-feedback): Remove.
+
+ * allout.el (allout-layout, allout-passphrase-verifier-string)
+ (allout-passphrase-hint-string): Tighten up a bit the safety predicate.
+
+ * textmodes/reftex-vars.el (reftex-vref-is-default)
+ (reftex-fref-is-default, reftex-guess-label-type):
+ Tighten up a bit the safety predicate.
+
+ * textmodes/paragraphs.el (sentence-end-double-space)
+ (sentence-end-without-period, sentence-end-without-space)
+ (page-delimiter, paragraph-ignore-fill-prefix):
+ Tighten up a bit the safety predicate.
+
+ * textmodes/fill.el (colon-double-space): Tighten up the safety pred.
+
+ * progmodes/python.el (python-continuation-line-p)
+ (python-beginning-of-statement): syntax-ppss may return
+ a negative depth.
+ (python-mode): Don't forcefully enable font-lock.
+
+ * time-stamp.el (time-stamp-start, time-stamp-end)
+ (time-stamp-inserts-lines): Tighten up a bit the safety predicate.
+
+ * add-log.el: Remove spurious * in docstrings.
+ (add-log-time-zone-rule): Rename from change-log-time-zone-rule.
+ (add-change-log-entry): Use it here, since it's not specific
+ to iso8601.
+ (add-log-iso8601-time-string): Don't use it here any more.
+ (change-log-indent-text, change-log-indent): Rename from add-log-*.
+
+ * abbrev.el (abbrev-mode): Tighten up a bit the safety predicate.
+
+2006-04-25 Ryan Yeske <rcyeske@gmail.com>
+
+ * net/rcirc.el (rcirc-print): Revert last change with ignored nicks.
+ (rcirc-toggle-low-priority): Doc fix.
+ (rcirc-handler-NOTICE): Remove beginning of line anchor in
+ ChanServ regexp.
+ (rcirc-startup-channels-alist): Connect to #rcirc by default, not
+ #emacs.
+ (rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Add variables.
+ (rcirc-decode-coding-system): Use utf-8 as the default.
+ (rcirc-multiline-minor-mode): Set the fill-column.
+ (rcirc-format-response-string): Display bright and dim nicks.
+ (rcirc-browse-url): Update interactive spec to fill ARG.
+ (rcirc-bright-nick, rcirc-dim-nick): Add faces.
+ (rcirc-print): Ignore dim-nick messages wrt modeline-activity.
+
+2006-04-24 J.D. Smith <jdsmith@as.arizona.edu>
+
+ * textmodes/bibtex.el (bibtex-find-entry): Don't demand matching
+ case for @Article, etc.
+
+2006-04-23 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-register-file-name-handlers): New defun.
+ Added with autoload cookie.
+ (tramp-unload-file-name-handlers): Rename from
+ `tramp-unload-file-name-handler-alist'.
+
+2006-04-23 Romain Francoise <romain@orebokech.com>
+
+ * comint.el (comint-match-partial-filename): Doc fix.
+
+2006-04-21 Glenn Morris <rgm@gnu.org>
+
+ * calendar/cal-menu.el (calendar-mode-map): Refer to
+ `diary-view-entries' rather than alias `view-diary-entries'.
+ * calendar/diary-lib.el (view-other-diary-entries): Ditto.
+
+2006-04-21 Luc Teirlinck <teirllm@auburn.edu>
+
+ * progmodes/antlr-mode.el (antlr-default):
+ * cus-edit.el (custom-documentation):
+ * faces.el (scroll-bar, border, cursor, mouse): Avoid nil spec
+ in defface.
+
+2006-04-21 Kim F. Storm <storm@cua.dk>
+
+ * image.el (image-type): New defun split out of create-image.
+ (create-image): Use it.
+
+2006-04-21 Carsten Dominik <dominik@science.uva.nl>
+
+ * textmodes/org.el (org-mode-map): Catch conflict with old allout.el.
+ (org-open-at-point): Remove the "...done" message to keep output
+ in the echo area visible.
+ (org-export-as-xoxo): Fix call to `indent-region'.
+
+2006-04-21 Kevin Ryde <user42@zip.com.au>
+
+ * international/mule.el (keyboard-coding-system): defcustom
+ info-link fixes: "Specify Coding" has been split, keyboard now in
+ "Terminal Coding", and "Single-Byte Character Support" is now
+ "Unibyte Mode".
+
2006-04-21 Nick Roberts <nickrob@snap.net.nz>
- * progmodes/gdb-ui.el (gdb-data-list-register-values-handler):
+ * progmodes/gdb-ui.el (gdb-data-list-register-values-handler):
Use font-lock-warning-face for any errors e.g. no stack.
(gdb-stack-list-locals-handler): Display any errors e.g. no stack.
@@ -13,26 +310,26 @@
2006-04-20 Carsten Dominik <dominik@science.uva.nl>
- * textmodes/org.el: (org-deadline-announce): Face removed.
- (org-level-faces, org-n-levels): Converted to constant.
- (org-compatible-face): New function.
- (org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
- (org-level-5, org-level-6, org-level-7, org-level-8)
- (org-special-keyword, org-warning, org-headline-done, org-link)
- (org-date, org-tag, org-todo, org-done, org-table, org-formula)
- (org-scheduled-today, org-scheduled-previously, org-time-grid):
+ * textmodes/org.el (org-deadline-announce): Face removed.
+ (org-level-faces, org-n-levels): Convert to constant.
+ (org-compatible-face): New function.
+ (org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
+ (org-level-5, org-level-6, org-level-7, org-level-8)
+ (org-special-keyword, org-warning, org-headline-done, org-link)
+ (org-date, org-tag, org-todo, org-done, org-table, org-formula)
+ (org-scheduled-today, org-scheduled-previously, org-time-grid):
Face definition revised for better color tty support.
- (org-bold-re, org-italic-re, org-underline-re): New constants.
- (org-set-font-lock-defaults): Use the new constants.
- (org-agenda-highlight-todo): New function.
- (org-agenda-todo): Fixed bug with point at end of line.
- (org-agenda-change-all-lines, org-finalize-agenda-entries):
+ (org-bold-re, org-italic-re, org-underline-re): New constants.
+ (org-set-font-lock-defaults): Use the new constants.
+ (org-agenda-highlight-todo): New function.
+ (org-agenda-todo): Fix bug with point at end of line.
+ (org-agenda-change-all-lines, org-finalize-agenda-entries):
Fontify TODO keywords.
- (org-insert-link): Preserve relative path in ../ links.
- (org-export-as-html): Convert links pointing to .org files into
+ (org-insert-link): Preserve relative path in ../ links.
+ (org-export-as-html): Convert links pointing to .org files into
links that will work beteen the exported HTML files.
- (org-todo-list): Fix bug when arg=0.
- (org-insert-heading): More fine-tuning.
+ (org-todo-list): Fix bug when arg=0.
+ (org-insert-heading): More fine-tuning.
2006-04-19 Romain Francoise <romain@orebokech.com>
@@ -49,12 +346,11 @@
when moving off either end of the input history ring.
(comint-delete-input): New function, used by
`comint-previous-input' and others.
- (comint-previous-matching-input): Use
- `coming-delete-input'. Save the partial input if leaving the
+ (comint-previous-matching-input):
+ Use `coming-delete-input'. Save the partial input if leaving the
edit line. Goto point-max before deleting input to avoid
partial input fragments hanging around.
- (comint-restore-input): New function, used by
- `comint-previous-input', and bound to "C-c C-j".
+ (comint-restore-input): New function, used by `comint-previous-input'.
2006-04-18 Luc Teirlinck <teirllm@auburn.edu>
@@ -62,8 +358,7 @@
2006-04-18 Dan Nicolaescu <dann@ics.uci.edu>
- * progmodes/python.el (python-mode): Add support for
- hs-minor-mode.
+ * progmodes/python.el (python-mode): Add support for hs-minor-mode.
2006-04-19 Reiner Steib <Reiner.Steib@gmx.de>
@@ -141,7 +436,7 @@
(gdb-frame-address): Re-use to identify frame for watch expression.
(gdb-var-list, gdb-var-create-handler): Add frame address for root
variables.
- (gdb-init-1, gdb-source, gdb-post-prompt, )
+ (gdb-init-1, gdb-source, gdb-post-prompt)
(gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address.
(gdb-frame-handler): Get gdb-frame-address.
@@ -222,7 +517,7 @@
2006-04-13 Carsten Dominik <dominik@science.uva.nl>
- * textmodes/org.el: (org-set-regexps-and-options)
+ * textmodes/org.el (org-set-regexps-and-options)
(org-get-current-options): Better names for the startup folding
options.
@@ -231,7 +526,7 @@
* vc.el (vc-annotate): Arrange for point to end up at the same
line number as in the original, but only when using a new buffer.
-2006-04-12 Davis Herring <herring@lanl.gov> (tiny change)
+2006-04-12 Stuart Herring <herring@lanl.gov> (tiny change)
* files.el (hack-one-local-variable-eval-safep):
Recognize `edebug-form-spec' for `put', but only if it passes
@@ -245,7 +540,7 @@
2006-04-13 Carsten Dominik <dominik@science.uva.nl>
- * textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string.
+ * textmodes/org.el (org-ctrl-c-ctrl-c): Improve documentation string.
(org-agenda-mouse-1-follows-link)
(org-mouse-1-follows-link): New options.
(org-format-agenda-item): Fix bug if TAGS is nil.
@@ -2437,7 +2732,7 @@
(describe-key-briefly-internal, describe-key-internal):
Functions merged back into their callers.
-2006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2006-02-13 Martin Rudalics <rudalics@gmx.at>
* info.el (info-xref-visited): Inherit from info-xref too.
(Info-set-mode-line): Replace occurrences of `%' by `%%'
@@ -3585,7 +3880,7 @@
* add-log.el (add-change-log-entry, change-log-merge):
Conditionally use `hard-newline'.
-2006-01-13 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2006-01-13 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (widget-field-end): If the overlay is no longer
associated with a buffer, behave as if the overlay didn't exist.
@@ -4595,7 +4890,7 @@
display-multi-frame-p, use selected-frame when menu-updating-frame
is nil.
-2005-12-20 Davis Herring <herring@lanl.gov> (tiny change)
+2005-12-20 Stuart Herring <herring@lanl.gov> (tiny change)
* align.el (align-rules-list): Use [ \t] instead of \s-
for column separators in text mode.
@@ -4675,7 +4970,7 @@
* emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
Capture error from printing circular structures.
-2005-12-17 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-12-17 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (widget-checkbox-action): Clear undo info.
@@ -6658,7 +6953,7 @@
scrolling the help window. Doc fix.
(help-return-method): Doc fix.
-2005-12-03 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-12-03 Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
whereby names of length one or names starting with a
@@ -7212,7 +7507,7 @@
* custom.el (defcustom): Update link types in docstring.
-2005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-11-20 Martin Rudalics <rudalics@gmx.at>
* custom.el (defgroup): Add doc-string-elt info.
@@ -7485,7 +7780,7 @@
* apropos.el (apropos-calc-scores): Use apropos-pattern.
-2005-11-16 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-11-16 Martin Rudalics <rudalics@gmx.at>
* wid-edit.el (color): Enclose %t in %{...%}.
@@ -14401,7 +14696,7 @@
* emulation/edt-mapper.el (edt-save-function-key-map)
(EDT-key-name): `defvar' to silence the byte-compiler.
-2005-07-02 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-07-02 Martin Rudalics <rudalics@gmx.at>
* font-lock.el (font-lock-regexp-grouping-backslash): Rename from
font-lock-regexp-backslash. Doc fix.
diff --git a/lisp/ChangeLog.11 b/lisp/ChangeLog.11
index 8b00b539e69..f9c93d4102e 100644
--- a/lisp/ChangeLog.11
+++ b/lisp/ChangeLog.11
@@ -5065,7 +5065,7 @@
* imenu.el: Several doc fixes: don't say variables are buffer-local.
-2004-08-16 Davis Herring <herring@lanl.gov>
+2004-08-16 Stuart Herring <herring@lanl.gov>
* isearch.el (isearch-string, isearch-message-string, isearch-point)
(isearch-success, isearch-forward-flag, isearch-other-end)
@@ -5082,7 +5082,7 @@
* term/x-win.el (x-selection-value): If utf8 was successful but
ctext was not, use utf8 string.
-2004-08-14 Davis Herring <herring@lanl.gov>
+2004-08-14 Stuart Herring <herring@lanl.gov>
* isearch.el: Remove accidental changes of March 4. Fix backing
up when a regexp isearch is made more general. Use symbolic
@@ -11471,7 +11471,7 @@
* files.el (kill-some-buffers): Doc fix.
-2003-12-29 David Herring <sdh6@ra.msstate.edu> (tiny change)
+2003-12-29 Stuart Herring <herring@lanl.gov> (tiny change)
* comint.el (comint-watch-for-password-prompt): Pass `string' as
arg to send-invisible
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 9ba53f6f6f5..234b8230587 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -58,7 +58,7 @@ Interactively, use the command `abbrev-mode'
to enable or disable Abbrev mode in the current buffer."
:type 'boolean
:group 'abbrev-mode)
-;;;###autoload(put 'abbrev-mode 'safe-local-variable t)
+;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
(defvar edit-abbrevs-map
@@ -363,5 +363,5 @@ A prefix argument means don't query; expand all abbrevs."
(if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
(expand-abbrev)))))))
-;;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5
+;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5
;;; abbrev.el ends here
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 1afdc7dcb72..47a839d539d 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -72,7 +72,7 @@ This defaults to the value returned by the function `user-full-name'."
;;;###autoload
(defcustom add-log-mailing-address nil
- "*Email addresses of user, for inclusion in ChangeLog headers.
+ "Email addresses of user, for inclusion in ChangeLog headers.
This defaults to the value of `user-mail-address'. In addition to
being a simple string, this value can also be a list. All elements
will be recognized as referring to the same user; when creating a new
@@ -83,7 +83,7 @@ ChangeLog entry, one element will be chosen at random."
:group 'change-log)
(defcustom add-log-time-format 'add-log-iso8601-time-string
- "*Function that defines the time format.
+ "Function that defines the time format.
For example, `add-log-iso8601-time-string', which gives the
date in international ISO 8601 format,
and `current-time-string' are two valid values."
@@ -95,7 +95,7 @@ and `current-time-string' are two valid values."
:group 'change-log)
(defcustom add-log-keep-changes-together nil
- "*If non-nil, normally keep day's log entries for one file together.
+ "If non-nil, normally keep day's log entries for one file together.
Log entries for a given file made with \\[add-change-log-entry] or
\\[add-change-log-entry-other-window] will only be added to others \
@@ -127,20 +127,20 @@ this variable."
:group 'change-log)
(defcustom add-log-always-start-new-record nil
- "*If non-nil, `add-change-log-entry' will always start a new record."
+ "If non-nil, `add-change-log-entry' will always start a new record."
:version "22.1"
:type 'boolean
:group 'change-log)
(defcustom add-log-buffer-file-name-function nil
- "*If non-nil, function to call to identify the full filename of a buffer.
+ "If non-nil, function to call to identify the full filename of a buffer.
This function is called with no argument. If this is nil, the default is to
use `buffer-file-name'."
:type '(choice (const nil) function)
:group 'change-log)
(defcustom add-log-file-name-function nil
- "*If non-nil, function to call to identify the filename for a ChangeLog entry.
+ "If non-nil, function to call to identify the filename for a ChangeLog entry.
This function is called with one argument, the value of variable
`buffer-file-name' in that buffer. If this is nil, the default is to
use the file's name relative to the directory of the change log file."
@@ -286,12 +286,16 @@ Note: The search is conducted only within 10%, at the beginning of the file."
map)
"Keymap for Change Log major mode.")
-(defvar change-log-time-zone-rule nil
+;; It used to be called change-log-time-zone-rule but really should be
+;; called add-log-time-zone-rule since it's only used from add-log-* code.
+(defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule)
+(defvar add-log-time-zone-rule nil
"Time zone used for calculating change log time stamps.
It takes the same format as the TZ argument of `set-time-zone-rule'.
-If nil, use local time.")
+If nil, use local time.
+If t, use universal time.")
-(defun add-log-iso8601-time-zone (time)
+(defun add-log-iso8601-time-zone (&optional time)
(let* ((utc-offset (or (car (current-time-zone time)) 0))
(sign (if (< utc-offset 0) ?- ?+))
(sec (abs utc-offset))
@@ -304,18 +308,14 @@ If nil, use local time.")
(t "%c%02d"))
sign hh mm ss)))
+(defvar add-log-iso8601-with-time-zone nil)
+
(defun add-log-iso8601-time-string ()
- (if change-log-time-zone-rule
- (let ((tz (getenv "TZ"))
- (now (current-time)))
- (unwind-protect
- (progn
- (set-time-zone-rule change-log-time-zone-rule)
- (concat
- (format-time-string "%Y-%m-%d " now)
- (add-log-iso8601-time-zone now)))
- (set-time-zone-rule tz)))
- (format-time-string "%Y-%m-%d")))
+ (let ((time (format-time-string "%Y-%m-%d"
+ nil (eq t add-log-time-zone-rule))))
+ (if add-log-iso8601-with-time-zone
+ (concat time " " (add-log-iso8601-time-zone))
+ time)))
(defun change-log-name ()
"Return (system-dependent) default name for a change log file."
@@ -494,7 +494,7 @@ The change log file can start with a copyright notice and a copying
permission notice. The first blank line indicates the end of these
notices.
-Today's date is calculated according to `change-log-time-zone-rule' if
+Today's date is calculated according to `add-log-time-zone-rule' if
non-nil, otherwise in local time."
(interactive (list current-prefix-arg
(prompt-for-change-log-name)))
@@ -538,13 +538,22 @@ non-nil, otherwise in local time."
(skip-chars-forward "\n"))
;; Advance into first entry if it is usable; else make new one.
- (let ((new-entries (mapcar (lambda (addr)
- (concat (funcall add-log-time-format)
- " " full-name
- " <" addr ">"))
- (if (consp mailing-address)
- mailing-address
- (list mailing-address)))))
+ (let ((new-entries
+ (mapcar (lambda (addr)
+ (concat
+ (if (stringp add-log-time-zone-rule)
+ (let ((tz (getenv "TZ")))
+ (unwind-protect
+ (progn
+ (set-time-zone-rule add-log-time-zone-rule)
+ (funcall add-log-time-format))
+ (set-time-zone-rule tz)))
+ (funcall add-log-time-format))
+ " " full-name
+ " <" addr ">"))
+ (if (consp mailing-address)
+ mailing-address
+ (list mailing-address)))))
(if (and (not add-log-always-start-new-record)
(let ((hit nil))
(dolist (entry new-entries hit)
@@ -652,21 +661,21 @@ the change log file in another window."
(add-change-log-entry whoami file-name t))
;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
-(defvar add-log-indent-text 0)
+(defvar change-log-indent-text 0)
-(defun add-log-indent ()
+(defun change-log-indent ()
(let* ((indent
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(cond
- ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>$")
+ ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>\\(?: +(.*)\\)? *$")
;; Matching the output of add-log-time-format is difficult,
;; but I'll get it has at least two adjacent digits.
(string-match "[[:digit:]][[:digit:]]" (match-string 1)))
0)
((looking-at "[^*(]")
- (+ (current-left-margin) add-log-indent-text))
+ (+ (current-left-margin) change-log-indent-text))
(t (current-left-margin)))))
(pos (save-excursion (indent-line-to indent) (point))))
(if (> pos (point)) (goto-char pos))))
@@ -688,7 +697,7 @@ Runs `change-log-mode-hook'.
tab-width 8)
(set (make-local-variable 'fill-paragraph-function)
'change-log-fill-paragraph)
- (set (make-local-variable 'indent-line-function) 'add-log-indent)
+ (set (make-local-variable 'indent-line-function) 'change-log-indent)
(set (make-local-variable 'tab-always-indent) nil)
;; We really do want "^" in paragraph-start below: it is only the
;; lines that begin at column 0 (despite the left-margin of 8) that
@@ -722,23 +731,23 @@ Prefix arg means justify as well."
(defcustom add-log-current-defun-header-regexp
"^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"
- "*Heuristic regexp used by `add-log-current-defun' for unknown major modes."
+ "Heuristic regexp used by `add-log-current-defun' for unknown major modes."
:type 'regexp
:group 'change-log)
;;;###autoload
(defvar add-log-lisp-like-modes
- '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
+ '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
"*Modes that look like Lisp to `add-log-current-defun'.")
;;;###autoload
(defvar add-log-c-like-modes
- '(c-mode c++-mode c++-c-mode objc-mode)
+ '(c-mode c++-mode c++-c-mode objc-mode)
"*Modes that look like C to `add-log-current-defun'.")
;;;###autoload
(defvar add-log-tex-like-modes
- '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
+ '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
"*Modes that look like TeX to `add-log-current-defun'.")
;;;###autoload
@@ -1103,5 +1112,5 @@ old-style time formats for entries are supported."
(provide 'add-log)
-;;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762
+;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762
;;; add-log.el ends here
diff --git a/lisp/allout.el b/lisp/allout.el
index 66c4b8681db..dc19c1fa15a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -84,8 +84,6 @@
(require 'pgg-gpg)
(require 'overlay)
))
-(autoload 'pgg-gpg-symmetric-key-p "pgg-gpg"
- "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.")
;;;_* USER CUSTOMIZATION VARIABLES:
@@ -199,6 +197,9 @@ just the header."
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-show-bodies)
+;;;###autoload
+(put 'allout-show-bodies 'safe-local-variable
+ (lambda (x) (member x '(t nil))))
;;;_ = allout-header-prefix
(defcustom allout-header-prefix "."
@@ -212,6 +213,8 @@ outlines start at level 2 to avoid this discrepancy."
:type 'string
:group 'allout)
(make-variable-buffer-local 'allout-header-prefix)
+;;;###autoload
+(put 'allout-header-prefix 'safe-local-variable 'stringp)
;;;_ = allout-primary-bullet
(defcustom allout-primary-bullet "*"
"Bullet used for top-level outline topics.
@@ -227,6 +230,8 @@ bullets."
:type 'string
:group 'allout)
(make-variable-buffer-local 'allout-primary-bullet)
+;;;###autoload
+(put 'allout-primary-bullet 'safe-local-variable 'stringp)
;;;_ = allout-plain-bullets-string
(defcustom allout-plain-bullets-string ".,"
"*The bullets normally used in outline topic prefixes.
@@ -241,6 +246,8 @@ of this var to take effect."
:type 'string
:group 'allout)
(make-variable-buffer-local 'allout-plain-bullets-string)
+;;;###autoload
+(put 'allout-plain-bullets-string 'safe-local-variable 'stringp)
;;;_ = allout-distinctive-bullets-string
(defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^"
"*Persistent outline header bullets used to distinguish special topics.
@@ -274,6 +281,8 @@ strings."
:type 'string
:group 'allout)
(make-variable-buffer-local 'allout-distinctive-bullets-string)
+;;;###autoload
+(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp)
;;;_ = allout-use-mode-specific-leader
(defcustom allout-use-mode-specific-leader t
@@ -305,6 +314,9 @@ incorrect.]"
(const allout-mode-leaders)
(const comment-start))
:group 'allout)
+;;;###autoload
+(put 'allout-use-mode-specific-leader 'safe-local-variable
+ (lambda (x) (or (member x '(t nil)) (stringp x))))
;;;_ = allout-mode-leaders
(defvar allout-mode-leaders '()
"Specific allout-prefix leading strings per major modes.
@@ -330,6 +342,9 @@ are always respected by the topic maneuvering functions."
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-old-style-prefixes)
+;;;###autoload
+(put 'allout-old-style-prefixes 'safe-local-variable
+ (lambda (x) (member x '(t nil))))
;;;_ = allout-stylish-prefixes - alternating bullets
(defcustom allout-stylish-prefixes t
"*Do fancy stuff with topic prefix bullets according to level, etc.
@@ -376,6 +391,9 @@ is non-nil."
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-stylish-prefixes)
+;;;###autoload
+(put 'allout-stylish-prefixes 'safe-local-variable
+ (lambda (x) (member x '(t nil))))
;;;_ = allout-numbered-bullet
(defcustom allout-numbered-bullet "#"
@@ -388,6 +406,9 @@ disables numbering maintenance."
:type '(choice (const nil) string)
:group 'allout)
(make-variable-buffer-local 'allout-numbered-bullet)
+;;;###autoload
+(put 'allout-numbered-bullet 'safe-local-variable
+ (lambda (x) (or (not x) (stringp x))))
;;;_ = allout-file-xref-bullet
(defcustom allout-file-xref-bullet "@"
"*Bullet signifying file cross-references, for `allout-resolve-xref'.
@@ -395,6 +416,9 @@ disables numbering maintenance."
Set this var to the bullet you want to use for file cross-references."
:type '(choice (const nil) string)
:group 'allout)
+;;;###autoload
+(put 'allout-file-xref-bullet 'safe-local-variable
+ (lambda (x) (or (not x) (stringp x))))
;;;_ = allout-presentation-padding
(defcustom allout-presentation-padding 2
"*Presentation-format white-space padding factor, for greater indent."
@@ -402,6 +426,8 @@ Set this var to the bullet you want to use for file cross-references."
:group 'allout)
(make-variable-buffer-local 'allout-presentation-padding)
+;;;###autoload
+(put 'allout-presentation-padding 'safe-local-variable 'integerp)
;;;_ = allout-abbreviate-flattened-numbering
(defcustom allout-abbreviate-flattened-numbering nil
@@ -455,11 +481,16 @@ formatted copy."
:group 'allout)
;;;_ + Topic encryption
+;;;_ = allout-encryption group
+(defgroup allout-encryption nil
+ "Settings for topic encryption features of allout outliner."
+ :group 'allout)
;;;_ = allout-topic-encryption-bullet
(defcustom allout-topic-encryption-bullet "~"
"*Bullet signifying encryption of the entry's body."
:type '(choice (const nil) string)
- :group 'allout)
+ :version "22.0"
+ :group 'allout-encryption)
;;;_ = allout-passphrase-verifier-handling
(defcustom allout-passphrase-verifier-handling t
"*Enable use of symmetric encryption passphrase verifier if non-nil.
@@ -467,7 +498,8 @@ formatted copy."
See the docstring for the `allout-enable-file-variable-adjustment'
variable for details about allout ajustment of file variables."
:type 'boolean
- :group 'allout)
+ :version "22.0"
+ :group 'allout-encryption)
(make-variable-buffer-local 'allout-passphrase-verifier-handling)
;;;_ = allout-passphrase-hint-handling
(defcustom allout-passphrase-hint-handling 'always
@@ -482,7 +514,8 @@ variable for details about allout ajustment of file variables."
:type '(choice (const always)
(const needed)
(const disabled))
- :group 'allout)
+ :version "22.0"
+ :group 'allout-encryption)
(make-variable-buffer-local 'allout-passphrase-hint-handling)
;;;_ = allout-encrypt-unencrypted-on-saves
(defcustom allout-encrypt-unencrypted-on-saves t
@@ -514,7 +547,8 @@ disable auto-saves for that file."
:type '(choice (const :tag "Yes" t)
(const :tag "All except current topic" except-current)
(const :tag "No" nil))
- :group 'allout)
+ :version "22.0"
+ :group 'allout-encryption)
(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
;;;_ + Miscellaneous customization
@@ -585,6 +619,9 @@ where auto-fill occurs."
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-use-hanging-indents)
+;;;###autoload
+(put 'allout-use-hanging-indents 'safe-local-variable
+ (lambda (x) (member x '(t nil))))
;;;_ = allout-reindent-bodies
(defcustom allout-reindent-bodies (if allout-use-hanging-indents
@@ -602,6 +639,9 @@ those that do not have the variable `comment-start' set. A value of
:group 'allout)
(make-variable-buffer-local 'allout-reindent-bodies)
+;;;###autoload
+(put 'allout-reindent-bodies 'safe-local-variable
+ (lambda (x) (member x '(nil t text force))))
;;;_ = allout-enable-file-variable-adjustment
(defcustom allout-enable-file-variable-adjustment t
@@ -667,7 +707,9 @@ the layout used for the allout.el source file.)
case the value of `allout-default-layout' is used.")
(make-variable-buffer-local 'allout-layout)
;;;###autoload
-(put 'allout-layout 'safe-local-variable t)
+(put 'allout-layout 'safe-local-variable
+ (lambda (x) (or (numberp x) (listp x) (integerp x)
+ (member x '(: * + -)))))
;;;_ : Topic header format
;;;_ = allout-regexp
@@ -1053,7 +1095,8 @@ The verifier string is retained as an Emacs file variable, as well as in
the emacs buffer state, if file variable adjustments are enabled. See
`allout-enable-file-variable-adjustment' for details about that.")
(make-variable-buffer-local 'allout-passphrase-verifier-string)
-(put 'allout-passphrase-verifier-string 'safe-local-variable t)
+;;;###autoload
+(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp)
;;;_ = allout-passphrase-hint-string
(defvar allout-passphrase-hint-string ""
"Variable used to retain reminder string for file's encryption passphrase.
@@ -1065,8 +1108,9 @@ The hint is retained as an Emacs file variable, as well as in the emacs buffer
state, if file variable adjustments are enabled. See
`allout-enable-file-variable-adjustment' for details about that.")
(make-variable-buffer-local 'allout-passphrase-hint-string)
-(put 'allout-passphrase-hint-string 'safe-local-variable t)
(setq-default allout-passphrase-hint-string "")
+;;;###autoload
+(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp)
;;;_ = allout-after-save-decrypt
(defvar allout-after-save-decrypt nil
"Internal variable, is nil or has the value of two points:
@@ -1573,6 +1617,12 @@ OPEN: A topic that is not closed, though its offspring or body may be."
; epoch, minor-mode key bindings:
(setq allout-mode-map
(produce-allout-mode-map allout-keybindings-list))
+ (substitute-key-definition 'beginning-of-line
+ 'move-beginning-of-line
+ allout-mode-map global-map)
+ (substitute-key-definition 'end-of-line
+ 'move-end-of-line
+ allout-mode-map global-map)
(produce-allout-mode-menubar-entries)
(fset 'allout-mode-map allout-mode-map)
; Include on minor-mode-map-alist,
@@ -5778,17 +5828,14 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
(if (/= arg 1)
(condition-case nil (line-move (1- arg)) (error nil)))
- (let ((orig (point)))
- ;; Move to beginning-of-line, ignoring fields and invisibles.
- (skip-chars-backward "^\n")
- (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
- (goto-char (if (featurep 'xemacs)
- (previous-property-change (point))
- (previous-char-property-change (point))))
- (skip-chars-backward "^\n"))
- (vertical-motion 0)
- (if (/= orig (point))
- (goto-char orig))))
+ ;; Move to beginning-of-line, ignoring fields and invisibles.
+ (skip-chars-backward "^\n")
+ (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
+ (goto-char (if (featurep 'xemacs)
+ (previous-property-change (point))
+ (previous-char-property-change (point))))
+ (skip-chars-backward "^\n"))
+ (vertical-motion 0))
)
;;;_ > move-end-of-line if necessary - older emacs, xemacs
(if (not (fboundp 'move-end-of-line))
@@ -5802,8 +5849,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))
- done)
+ (let (done)
(while (not done)
(let ((newpos
(save-excursion
@@ -5813,8 +5859,10 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
(error nil))
(not (bobp))
(progn
- (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
- (goto-char (previous-char-property-change (point))))
+ (while (and (not (bobp))
+ (line-move-invisible-p (1- (point))))
+ (goto-char
+ (previous-char-property-change (point))))
(backward-char 1)))
(point)))))
(goto-char newpos)
@@ -5827,9 +5875,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
;; and now we're not really at eol,
;; keep going.
(setq arg 1)
- (setq done t)))))
- (if (/= orig (point))
- (goto-char orig))))
+ (setq done t)))))))
)
;;;_ > line-move-invisible-p if necessary
(if (not (fboundp 'line-move-invisible-p))
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f8dfc9fe6c0..4fdfb172e3e 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -310,13 +310,13 @@ Keymap to display on minor modes.")
(list
(propertize "%[(" 'help-echo help-echo)
`(:propertize ("" mode-name)
- help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode"
+ help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
mouse-face mode-line-highlight
local-map ,mode-line-major-mode-keymap)
'("" mode-line-process)
`(:propertize ("" minor-mode-alist)
mouse-face mode-line-highlight
- help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu"
+ help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
local-map ,mode-line-minor-mode-keymap)
(propertize "%n" 'help-echo "mouse-2: widen"
'mouse-face 'mode-line-highlight
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 28a319f84e4..adb94ef7381 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -932,7 +932,9 @@ The command \\[yank] can retrieve it from there."
(substring str pref-len suff-pos)))
(if (string-match "[^ \t\n]" str)
(setq pref-len 0
- val (math-read-big-expr str))
+ val (condition-case nil
+ (math-read-big-expr str)
+ (error (math-read-expr str))))
(setq val nil))))
(if (eq (car-safe val) 'error)
(setq val (list 'error
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index c377bcc8735..262e474f7b9 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -89,7 +89,7 @@
(define-key calendar-mode-map [menu-bar diary mark]
'("Mark All" . mark-diary-entries))
(define-key calendar-mode-map [menu-bar diary view]
- '("Cursor Date" . view-diary-entries))
+ '("Cursor Date" . diary-view-entries))
(define-key calendar-mode-map [menu-bar diary view]
'("Other File" . view-other-diary-entries))
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index a67d90c832e..1fd85513230 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -45,7 +45,7 @@
(require 'calendar)
-(autoload 'list-diary-entries "diary-lib" nil t)
+(autoload 'diary-list-entries "diary-lib" nil t)
(autoload 'calendar-holiday-list "holidays" nil t)
(autoload 'calendar-iso-from-absolute "cal-iso" nil t)
@@ -121,6 +121,14 @@ will put the Hebrew date at the bottom of each day."
:type 'integer
:group 'calendar-tex)
+(defcustom cal-tex-preamble-extra nil
+ "A string giving extra LaTeX commands to insert in the calendar preamble.
+For example, to include extra packages:
+\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
+ :type 'string
+ :group 'calendar-tex
+ :version "22.1")
+
(defcustom cal-tex-hook nil
"*List of functions called after any LaTeX calendar buffer is generated.
You can use this to do postprocessing on the buffer. For example, to change
@@ -240,7 +248,7 @@ This definition is the heart of the calendar!")
"Generate a list of all diary-entries from absolute date D1 to D2."
(let ((diary-list-include-blanks nil)
(diary-display-hook 'ignore))
- (list-diary-entries
+ (diary-list-entries
(calendar-gregorian-from-absolute d1)
(1+ (- d2 d1)))))
@@ -253,8 +261,10 @@ Optional ARGS are included."
(insert "\\documentclass")
(if args
(insert "[" args "]"))
- (insert "{article}\n"
- "\\hbadness 20000
+ (insert "{article}\n")
+ (if (stringp cal-tex-preamble-extra)
+ (insert cal-tex-preamble-extra "\n"))
+ (insert "\\hbadness 20000
\\hfuzz=1000pt
\\vbadness 20000
\\lineskip 0pt
@@ -357,6 +367,8 @@ Optional parameter specifies number of years."
(cal-tex-noindent)
(cal-tex-nl)
(let ((month-names; don't use default in case user changed it
+ ;; These are only used to define the command names, not
+ ;; the names of the months they insert.
["January" "February" "March" "April" "May" "June"
"July" "August" "September" "October" "November" "December"]))
(calendar-for-loop i from 1 to 12 do
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index a8eeebae8fc..6ced08bf083 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -79,7 +79,7 @@ D-FILE specifies the file to use as the diary file."
(list (prefix-numeric-value current-prefix-arg)
(read-file-name "Enter diary file name: " default-directory nil t)))
(let ((diary-file d-file))
- (view-diary-entries arg)))
+ (diary-view-entries arg)))
(autoload 'check-calendar-holidays "holidays"
"Check the list of holidays for any that occur on DATE.
diff --git a/lisp/comint.el b/lisp/comint.el
index f8edc85c1ac..946085661fc 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2703,7 +2703,7 @@ interpreter (e.g., the percent notation of cmd.exe on NT)."
name))
(defun comint-match-partial-filename ()
- "Return the filename at point, or nil if non is found.
+ "Return the filename at point, or nil if none is found.
Environment variables are substituted. See `comint-word'."
(let ((filename (comint-word comint-file-name-chars)))
(and filename (comint-substitute-in-file-name
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index e68d2eab293..52f66038ea6 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2089,7 +2089,7 @@ and `face'."
'custom-button-pressed
'custom-button-pressed-unraised))
-(defface custom-documentation nil
+(defface custom-documentation '((t nil))
"Face used for documentation strings in customization buffers."
:group 'custom-faces)
;; backward-compatibility alias
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index cf0ee85db23..477914293a7 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs cvs status tree tools
;; This file is part of GNU Emacs.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 7c7f7902d82..cc89aad6ca3 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: convenience patch diff
;; This file is part of GNU Emacs.
@@ -118,7 +118,8 @@ when editing big diffs)."
("\C-m" . diff-goto-source)
([mouse-2] . diff-goto-source)
;; From XEmacs' diff-mode.
- ("W" . widen)
+;; Standard M-w is useful, so don't change M-W.
+;; ("W" . widen)
;;("." . diff-goto-source) ;display-buffer
;;("f" . diff-goto-source) ;find-file
("o" . diff-goto-source) ;other-window
@@ -127,14 +128,14 @@ when editing big diffs)."
;;("h" . diff-show-header)
;;("j" . diff-show-difference) ;jump to Nth diff
;;("q" . diff-quit)
- (" " . scroll-up)
- ("\177" . scroll-down)
- ;; Our very own bindings.
- ("A" . diff-ediff-patch)
- ("r" . diff-restrict-view)
- ("R" . diff-reverse-direction)
- ("U" . diff-context->unified)
- ("C" . diff-unified->context)
+;; Not useful if you have to metafy them.
+;; (" " . scroll-up)
+;; ("\177" . scroll-down)
+;; Standard M-a is useful, so don't change M-A.
+;; ("A" . diff-ediff-patch)
+;; Standard M-r is useful, so don't change M-r or M-R.
+;; ("r" . diff-restrict-view)
+;; ("R" . diff-reverse-direction)
("q" . quit-window))
"Basic keymap for `diff-mode', bound to various prefix keys.")
@@ -143,10 +144,14 @@ when editing big diffs)."
;; From compilation-minor-mode.
("\C-c\C-c" . diff-goto-source)
;; Misc operations.
- ("\C-c\C-r" . diff-refine-hunk)
- ("\C-c\C-s" . diff-split-hunk)
("\C-c\C-a" . diff-apply-hunk)
+ ("\C-c\C-e" . diff-ediff-patch)
+ ("\C-c\C-n" . diff-restrict-view)
+ ("\C-c\C-r" . diff-reverse-direction)
+ ("\C-c\C-s" . diff-split-hunk)
("\C-c\C-t" . diff-test-hunk)
+ ("\C-c\C-u" . diff-context->unified)
+ ("\C-c\C-w" . diff-refine-hunk)
("\C-c\C-f" . next-error-follow-minor-mode))
"Keymap for `diff-mode'. See also `diff-mode-shared-map'.")
@@ -711,77 +716,80 @@ else cover the whole bufer."
(delete-region last-pt (point))
(setq delete nil)))))))))))))))
-(defun diff-context->unified (start end)
+(defun diff-context->unified (start end &optional to-context)
"Convert context diffs to unified diffs.
-START and END are either taken from the region (if a prefix arg is given) or
-else cover the whole bufer."
- (interactive (if current-prefix-arg
- (list (mark) (point))
- (list (point-min) (point-max))))
- (unless (markerp end) (setq end (copy-marker end)))
- (let (;;(diff-inhibit-after-change t)
- (inhibit-read-only t))
- (save-excursion
- (goto-char start)
- (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
- (< (point) end))
- (combine-after-change-calls
- (if (match-beginning 2)
- ;; we matched a file header
- (progn
- ;; use reverse order to make sure the indices are kept valid
- (replace-match "+++" t t nil 3)
- (replace-match "---" t t nil 2))
- ;; we matched a hunk header
- (let ((line1s (match-string 4))
- (line1e (match-string 5))
- (pt1 (match-beginning 0)))
- (replace-match "")
- (unless (re-search-forward
- "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
- (error "Can't find matching `--- n1,n2 ----' line"))
- (let ((line2s (match-string 1))
- (line2e (match-string 2))
- (pt2 (progn
- (delete-region (progn (beginning-of-line) (point))
- (progn (forward-line 1) (point)))
- (point-marker))))
- (goto-char pt1)
- (forward-line 1)
- (while (< (point) pt2)
- (case (char-after)
- ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
- (?\s ;merge with the other half of the chunk
- (let* ((endline2
- (save-excursion
- (goto-char pt2) (forward-line 1) (point)))
- (c (char-after pt2)))
- (case c
- ((?! ?+)
- (insert "+"
- (prog1 (buffer-substring (+ pt2 2) endline2)
- (delete-region pt2 endline2))))
- (?\s ;FIXME: check consistency
- (delete-region pt2 endline2)
- (delete-char 1)
- (forward-line 1))
- (?\\ (forward-line 1))
- (t (delete-char 1) (forward-line 1)))))
- (t (forward-line 1))))
- (while (looking-at "[+! ] ")
- (if (/= (char-after) ?!) (forward-char 1)
- (delete-char 1) (insert "+"))
- (delete-char 1) (forward-line 1))
- (save-excursion
+START and END are either taken from the region
+\(when it is highlighted) or else cover the whole buffer.
+With a prefix argument, convert unified format to context format."
+ (interactive (if (and transient-mark-mode mark-active)
+ (list (mark) (point) current-prefix-arg)
+ (list (point-min) (point-max) current-prefix-arg)))
+ (if to-context
+ (diff-unified->context start end)
+ (unless (markerp end) (setq end (copy-marker end)))
+ (let ( ;;(diff-inhibit-after-change t)
+ (inhibit-read-only t))
+ (save-excursion
+ (goto-char start)
+ (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
+ (< (point) end))
+ (combine-after-change-calls
+ (if (match-beginning 2)
+ ;; we matched a file header
+ (progn
+ ;; use reverse order to make sure the indices are kept valid
+ (replace-match "+++" t t nil 3)
+ (replace-match "---" t t nil 2))
+ ;; we matched a hunk header
+ (let ((line1s (match-string 4))
+ (line1e (match-string 5))
+ (pt1 (match-beginning 0)))
+ (replace-match "")
+ (unless (re-search-forward
+ "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
+ (error "Can't find matching `--- n1,n2 ----' line"))
+ (let ((line2s (match-string 1))
+ (line2e (match-string 2))
+ (pt2 (progn
+ (delete-region (progn (beginning-of-line) (point))
+ (progn (forward-line 1) (point)))
+ (point-marker))))
(goto-char pt1)
- (insert "@@ -" line1s ","
- (number-to-string (- (string-to-number line1e)
- (string-to-number line1s)
- -1))
- " +" line2s ","
- (number-to-string (- (string-to-number line2e)
- (string-to-number line2s)
- -1)) " @@"))))))))))
+ (forward-line 1)
+ (while (< (point) pt2)
+ (case (char-after)
+ ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
+ (?\s ;merge with the other half of the chunk
+ (let* ((endline2
+ (save-excursion
+ (goto-char pt2) (forward-line 1) (point)))
+ (c (char-after pt2)))
+ (case c
+ ((?! ?+)
+ (insert "+"
+ (prog1 (buffer-substring (+ pt2 2) endline2)
+ (delete-region pt2 endline2))))
+ (?\s ;FIXME: check consistency
+ (delete-region pt2 endline2)
+ (delete-char 1)
+ (forward-line 1))
+ (?\\ (forward-line 1))
+ (t (delete-char 1) (forward-line 1)))))
+ (t (forward-line 1))))
+ (while (looking-at "[+! ] ")
+ (if (/= (char-after) ?!) (forward-char 1)
+ (delete-char 1) (insert "+"))
+ (delete-char 1) (forward-line 1))
+ (save-excursion
+ (goto-char pt1)
+ (insert "@@ -" line1s ","
+ (number-to-string (- (string-to-number line1e)
+ (string-to-number line1s)
+ -1))
+ " +" line2s ","
+ (number-to-string (- (string-to-number line2e)
+ (string-to-number line2s)
+ -1)) " @@")))))))))))
(defun diff-reverse-direction (start end)
"Reverse the direction of the diffs.
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 133c4c42f2a..a02a8c14eba 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -209,6 +209,7 @@ only, and you can use whatever symbols you like.)
LEVEL should be either :debug, :warning, :error, or :emergency
\(but see `warning-minimum-level' and `warning-minimum-log-level').
+Default is :warning.
:emergency -- a problem that will seriously impair Emacs operation soon
if you do not attend to it promptly.
@@ -292,7 +293,7 @@ See also `warning-series', `warning-prefix-function' and
Aside from generating the message with `format',
this is equivalent to `display-warning'.
-TYPE is the warning type: either a custom group name (a symbol).
+TYPE is the warning type: either a custom group name (a symbol),
or a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories and
can be whatever you like.)
diff --git a/lisp/faces.el b/lisp/faces.el
index 67f8a2af07a..6a05edc84ca 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2144,19 +2144,19 @@ used to display the prompt text."
:group 'frames
:group 'basic-faces)
-(defface scroll-bar '()
+(defface scroll-bar '((t nil))
"Basic face for the scroll bar colors under X."
:version "21.1"
:group 'frames
:group 'basic-faces)
-(defface border '()
+(defface border '((t nil))
"Basic face for the frame border under X."
:version "21.1"
:group 'frames
:group 'basic-faces)
-(defface cursor '()
+(defface cursor '((t nil))
"Basic face for the cursor color under X.
Note: Other faces cannot inherit from the cursor face."
:version "21.1"
@@ -2165,7 +2165,7 @@ Note: Other faces cannot inherit from the cursor face."
(put 'cursor 'face-no-inherit t)
-(defface mouse '()
+(defface mouse '((t nil))
"Basic face for the mouse color under X."
:version "21.1"
:group 'mouse
diff --git a/lisp/files.el b/lisp/files.el
index df63e016c63..76167eb27cf 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2652,15 +2652,11 @@ It is safe if any of these conditions are met:
* There is a matching entry (SYM . VAL) in the
`safe-local-variable-values' user option.
- * The `safe-local-variable' property of SYM is t.
-
* The `safe-local-variable' property of SYM is a function that
evaluates to a non-nil value with VAL as an argument."
(or (member (cons sym val) safe-local-variable-values)
(let ((safep (get sym 'safe-local-variable)))
- (or (eq safep t)
- (and (functionp safep)
- (funcall safep val))))))
+ (and (functionp safep) (funcall safep val)))))
(defun risky-local-variable-p (sym &optional ignored)
"Non-nil if SYM could be dangerous as a file-local variable.
diff --git a/lisp/follow.el b/lisp/follow.el
index 1958c407664..27c37132f0a 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -7,7 +7,6 @@
;; Maintainer: FSF (Anders' email bounces, Sep 2005)
;; Created: 1995-05-25
;; Keywords: display, window, minor-mode, convenience
-;; Last Changed: 1999-11-17
;; This file is part of GNU Emacs.
@@ -46,14 +45,14 @@
;; movement commands.
;;
;; Follow mode comes to its prime when a large screen and two
-;; side-by-side window are used. The user can, with the help of Follow
+;; side-by-side window are used. The user can, with the help of Follow
;; mode, use two full-height windows as though they would have been
-;; one. Imagine yourself editing a large function, or section of text,
+;; one. Imagine yourself editing a large function, or section of text,
;; and being able to use 144 lines instead of the normal 72... (your
;; mileage may vary).
;; To test this package, make sure `follow' is loaded, or will be
-;; autoloaded when activated (see below). Then do the following:
+;; autoloaded when activated (see below). Then do the following:
;;
;; * Find your favorite file (preferably a long one).
;;
@@ -77,13 +76,13 @@
;; +----------+----------+
;;
;; As you can see, the right-hand window starts at line 73, the line
-;; immediately below the end of the left-hand window. As long as
+;; immediately below the end of the left-hand window. As long as
;; `follow-mode' is active, the two windows will follow eachother!
;;
;; * Play around and enjoy! Scroll one window and watch the other.
-;; Jump to the beginning or end. Press `Cursor down' at the last
-;; line of the left-hand window. Enter new lines into the
-;; text. Enter long lines spanning several lines, or several
+;; Jump to the beginning or end. Press `Cursor down' at the last
+;; line of the left-hand window. Enter new lines into the
+;; text. Enter long lines spanning several lines, or several
;; windows.
;;
;; * Should you find `Follow' mode annoying, just type
@@ -146,7 +145,7 @@
;; Usage:
;;
;; To activate issue the command "M-x follow-mode"
-;; and press return. To deactivate, do it again.
+;; and press return. To deactivate, do it again.
;;
;; The following is a list of commands useful when follow-mode is active.
;;
@@ -197,7 +196,7 @@
;; in the same frame. (My apoligies to you who can't use frames.)
;;
;; 2) Bind `follow-mode' to key so you can turn it off whenever
-;; you want to view two locations. Of course, `follow' mode can
+;; you want to view two locations. Of course, `follow' mode can
;; be reactivated by hitting the same key again.
;;
;; Example from my ~/.emacs:
@@ -208,7 +207,7 @@
;;
;; In an ideal world, follow mode would have been implemented in the
;; kernel of the display routines, making sure that the windows (using
-;; follow mode) ALWAYS are aligned. On planet earth, however, we must
+;; follow mode) ALWAYS are aligned. On planet earth, however, we must
;; accept a solution where we ALMOST ALWAYS can make sure that the
;; windows are aligned.
;;
@@ -222,7 +221,7 @@
;;
;; Note that only the selected window is checked, for the reason of
;; efficiency and code complexity. (I.e. it is possible to make a
-;; non-selected windows unaligned. It will, however, pop right back
+;; non-selected windows unaligned. It will, however, pop right back
;; when it is selected.)
;;}}}
@@ -259,7 +258,7 @@
(eval-when-compile
(if (or (featurep 'bytecomp)
(featurep 'byte-compile))
- (cond ((string-match "XEmacs" emacs-version)
+ (cond ((featurep 'xemacs)
;; Make XEmacs shut up! I'm using standard Emacs
;; functions, they are NOT obsolete!
(if (eq (get 'force-mode-line-update 'byte-compile)
@@ -278,176 +277,44 @@
:group 'windows
:group 'convenience)
-(defvar follow-mode nil
- "Variable indicating if Follow mode is active.")
-
(defcustom follow-mode-hook nil
- "*Hooks to run when follow-mode is turned on."
+ "Hooks to run when follow-mode is turned on."
:type 'hook
:group 'follow)
(defcustom follow-mode-off-hook nil
- "*Hooks to run when follow-mode is turned off."
+ "Hooks to run when follow-mode is turned off."
:type 'hook
:group 'follow)
-(defvar follow-mode-map nil
- "*Minor mode keymap for Follow mode.")
-(defcustom follow-mode-line-text " Follow"
- "*Text shown in the mode line when Follow mode is active.
-Defaults to \" Follow\". Examples of other values
-are \" Fw\", or simply \"\"."
- :type 'string
- :group 'follow)
+;;{{{ Keymap/Menu
-(defcustom follow-auto nil
- "*Non-nil activates Follow mode whenever a file is loaded."
- :type 'boolean
- :group 'follow)
+;; Define keys for the follow-mode minor mode map and replace some
+;; functions in the global map. All `follow' mode special functions
+;; can be found on (the somewhat cumbersome) "C-c . <key>"
+;; (Control-C dot <key>). (As of Emacs 19.29 the keys
+;; C-c <punctuation character> are reserved for minor modes.)
+;;
+;; To change the prefix, redefine `follow-mode-prefix' before
+;; `follow' is loaded, or see the section on `follow-mode-hook'
+;; above for an example of how to bind the keys the way you like.
+;;
+;; Please note that the keymap is defined the first time this file is
+;; loaded. Also note that the only legal way to manipulate the
+;; keymap is to use `define-key'. Don't change it using `setq' or
+;; similar!
(defcustom follow-mode-prefix "\C-c."
- "*Prefix key to use for follow commands in Follow mode.
+ "Prefix key to use for follow commands in Follow mode.
The value of this variable is checked as part of loading Follow mode.
After that, changing the prefix key requires manipulating keymaps."
:type 'string
:group 'follow)
-(defcustom follow-intercept-processes
- (fboundp 'start-process)
- "*When non-nil, Follow Mode will monitor process output."
- :type 'boolean
- :group 'follow)
-
-(defvar follow-emacs-version-xemacs-p
- (string-match "XEmacs" emacs-version)
- "Non-nil when running under XEmacs.")
-
-(defvar follow-avoid-tail-recenter-p
- (not follow-emacs-version-xemacs-p)
- "*When non-nil, patch emacs so that tail windows won't be recentered.
-
-A \"tail window\" is a window that displays only the end of
-the buffer. Normally it is practical for the user that empty
-windows are recentered automatically. However, when using
-Follow Mode it breaks the display when the end is displayed
-in a window \"above\" the last window. This is for
-example the case when displaying a short page in info.
-
-Must be set before Follow Mode is loaded.
-
-Please note that it is not possible to fully prevent Emacs from
-recentering empty windows. Please report if you find a repeatable
-situation in which Emacs recenters empty windows.
-
-XEmacs, as of 19.12, does not recenter windows, good!")
-
-(defvar follow-cache-command-list
- '(next-line previous-line forward-char backward-char)
- "List of commands that don't require recalculation.
-
-In order to be able to use the cache, a command should not change the
-contents of the buffer, nor should it change selected window or current
-buffer.
-
-The commands in this list are checked at load time.
-
-To mark other commands as suitable for caching, set the symbol
-property `follow-mode-use-cache' to non-nil.")
-
-(defvar follow-debug nil
- "*Non-nil when debugging Follow mode.")
-
-
-;; Internal variables:
-
-(defvar follow-internal-force-redisplay nil
- "True when Follow mode should redisplay the windows.")
-
-(defvar follow-process-filter-alist '()
- "The original filters for processes intercepted by Follow mode.")
-
-(defvar follow-active-menu nil
- "The menu visible when Follow mode is active.")
-
-(defvar follow-deactive-menu nil
- "The menu visible when Follow mode is deactivated.")
-
-(defvar follow-inside-post-command-hook nil
- "Non-nil when inside Follow modes `post-command-hook'.
-Used by `follow-window-size-change'.")
-
-(defvar follow-windows-start-end-cache nil
- "Cache used by `follow-window-start-end'.")
-
-;;}}}
-;;{{{ Bug report
-
-(eval-when-compile (require 'reporter))
-
-(defun follow-submit-feedback ()
- "Submit feedback on Follow mode to the author: andersl@andersl.com"
- (interactive)
- (require 'reporter)
- (and (y-or-n-p "Do you really want to submit a report on Follow mode? ")
- (reporter-submit-bug-report
- "Anders Lindgren <andersl@andersl.com>"
- "follow.el"
- '(post-command-hook
- pre-command-hook
- window-size-change-functions
- window-scroll-functions
- follow-mode-hook
- follow-mode-off-hook
- follow-auto
- follow-intercept-processes
- follow-avoid-tail-recenter-p
- follow-process-filter-alist)
- nil
- nil
- (concat
- "Hi Anders!\n\n"
- "(I have read the section on how to report bugs in the "
- "Emacs manual.)\n\n"
- "Even though I know you are busy, I thought you might "
- "want to know...\n\n"))))
-
-;;}}}
-;;{{{ Debug messages
-
-;; This inline function must be as small as possible!
-;; Maybe we should define a macro that expands to nil if
-;; the variable is not set.
-
-(defsubst follow-debug-message (&rest args)
- "Like message, but only active when `follow-debug' is non-nil."
- (if (and (boundp 'follow-debug) follow-debug)
- (apply 'message args)))
-
-;;}}}
-
-;;{{{ Keymap/Menu
-
-;;; Define keys for the follow-mode minor mode map and replace some
-;;; functions in the global map. All `follow' mode special functions
-;;; can be found on (the somewhat cumbersome) "C-c . <key>"
-;;; (Control-C dot <key>). (As of Emacs 19.29 the keys
-;;; C-c <punctuation character> are reserved for minor modes.)
-;;;
-;;; To change the prefix, redefine `follow-mode-prefix' before
-;;; `follow' is loaded, or see the section on `follow-mode-hook'
-;;; above for an example of how to bind the keys the way you like.
-;;;
-;;; Please note that the keymap is defined the first time this file is
-;;; loaded. Also note that the only legal way to manipulate the
-;;; keymap is to use `define-key'. Don't change it using `setq' or
-;;; similar!
-
-
-(if follow-mode-map
- nil
- (setq follow-mode-map (make-sparse-keymap))
- (let ((map (make-sparse-keymap)))
+(defvar follow-mode-map
+ (let ((mainmap (make-sparse-keymap))
+ (map (make-sparse-keymap)))
(define-key map "\C-v" 'follow-scroll-up)
(define-key map "\M-v" 'follow-scroll-down)
(define-key map "v" 'follow-scroll-down)
@@ -460,38 +327,26 @@ Used by `follow-window-size-change'.")
(define-key map "n" 'follow-next-window)
(define-key map "p" 'follow-previous-window)
- (define-key follow-mode-map follow-mode-prefix map)
+ (define-key mainmap follow-mode-prefix map)
;; Replace the standard `end-of-buffer', when in Follow Mode. (I
;; don't see the point in trying to replace every function that
;; could be enhanced in Follow mode. End-of-buffer is a special
;; case since it is very simple to define and it greatly enhances
;; the look and feel of Follow mode.)
- ;;
- ;; (The function `substitute-key-definition' does not work
- ;; in all versions of Emacs.)
- (mapcar
- (function
- (lambda (pair)
- (let ((old (car pair))
- (new (cdr pair)))
- (mapcar (function (lambda (key)
- (define-key follow-mode-map key new)))
- (where-is-internal old global-map)))))
- '((end-of-buffer . follow-end-of-buffer)
- (fkey-end-of-buffer . follow-end-of-buffer)))
+ (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
- ;;;
- ;;; The menu.
- ;;;
+ ;;
+ ;; The menu.
+ ;;
- (if (not follow-emacs-version-xemacs-p)
+ (if (not (featurep 'xemacs))
;;
;; Emacs
;;
(let ((menumap (funcall (symbol-function 'make-sparse-keymap)
- "Follow"))
+ "Follow"))
(count 0)
id)
(mapcar
@@ -516,16 +371,16 @@ Used by `follow-window-size-change'.")
("First Window" . follow-first-window)
("--")
("Switch To Buffer (all windows)"
- . follow-switch-to-buffer-all)
+ . follow-switch-to-buffer-all)
("Switch To Buffer" . follow-switch-to-buffer)
("--")
("Delete Other Windows and Split"
- . follow-delete-other-windows-and-split)
+ . follow-delete-other-windows-and-split)
("--")
("Scroll Down" . follow-scroll-down)
("Scroll Up" . follow-scroll-up)))
- ;; If there is a `tools' meny, we use it. However, we can't add a
+ ;; If there is a `tools' menu, we use it. However, we can't add a
;; minor-mode specific item to it (it's broken), so we make the
;; contents ghosted when not in use, and add ourselves to the
;; global map. If no `tools' menu is present, just make a
@@ -546,7 +401,7 @@ Used by `follow-window-size-change'.")
(if last
(progn
(funcall (symbol-function 'define-key-after)
- tools-map [separator-follow] '("--") last)
+ tools-map [separator-follow] '("--") last)
(funcall (symbol-function 'define-key-after)
tools-map [follow] (cons "Follow" menumap)
'separator-follow))
@@ -555,7 +410,7 @@ Used by `follow-window-size-change'.")
(define-key (current-global-map) [menu-bar tools follow]
(cons "Follow" menumap))))
;; No tools menu, add "Follow" to the menubar.
- (define-key follow-mode-map [menu-bar follow]
+ (define-key mainmap [menu-bar follow]
(cons "Follow" menumap)))))
;;
@@ -593,21 +448,103 @@ Used by `follow-window-size-change'.")
(defun follow-menu-filter (menu)
(if follow-mode
menu
- '(["Activate " follow-mode t]))))))
+ '(["Activate " follow-mode t]))))
+
+ mainmap)
+ "Minor mode keymap for Follow mode.")
+;;}}}
-;;; Register the follow mode keymap.
-(or (assq 'follow-mode minor-mode-map-alist)
- (setq minor-mode-map-alist
- (cons (cons 'follow-mode follow-mode-map) minor-mode-map-alist)))
+(defcustom follow-mode-line-text " Follow"
+ "Text shown in the mode line when Follow mode is active.
+Defaults to \" Follow\". Examples of other values
+are \" Fw\", or simply \"\"."
+ :type 'string
+ :group 'follow)
+
+(defcustom follow-auto nil
+ "Non-nil activates Follow mode whenever a file is loaded."
+ :type 'boolean
+ :group 'follow)
+
+(defcustom follow-intercept-processes (fboundp 'start-process)
+ "When non-nil, Follow Mode will monitor process output."
+ :type 'boolean
+ :group 'follow)
+
+(defvar follow-avoid-tail-recenter-p (not (featurep 'xemacs))
+ "*When non-nil, patch emacs so that tail windows won't be recentered.
+
+A \"tail window\" is a window that displays only the end of
+the buffer. Normally it is practical for the user that empty
+windows are recentered automatically. However, when using
+Follow Mode it breaks the display when the end is displayed
+in a window \"above\" the last window. This is for
+example the case when displaying a short page in info.
+
+Must be set before Follow Mode is loaded.
+
+Please note that it is not possible to fully prevent Emacs from
+recentering empty windows. Please report if you find a repeatable
+situation in which Emacs recenters empty windows.
+
+XEmacs, as of 19.12, does not recenter windows, good!")
+
+(defvar follow-cache-command-list
+ '(next-line previous-line forward-char backward-char)
+ "List of commands that don't require recalculation.
+
+In order to be able to use the cache, a command should not change the
+contents of the buffer, nor should it change selected window or current
+buffer.
+
+The commands in this list are checked at load time.
+
+To mark other commands as suitable for caching, set the symbol
+property `follow-mode-use-cache' to non-nil.")
+
+(defvar follow-debug nil
+ "*Non-nil when debugging Follow mode.")
+
+
+;; Internal variables:
+
+(defvar follow-internal-force-redisplay nil
+ "True when Follow mode should redisplay the windows.")
+
+(defvar follow-process-filter-alist '()
+ "The original filters for processes intercepted by Follow mode.")
+
+(defvar follow-active-menu nil
+ "The menu visible when Follow mode is active.")
+
+(defvar follow-deactive-menu nil
+ "The menu visible when Follow mode is deactivated.")
+
+(defvar follow-inside-post-command-hook nil
+ "Non-nil when inside Follow modes `post-command-hook'.
+Used by `follow-window-size-change'.")
+
+(defvar follow-windows-start-end-cache nil
+ "Cache used by `follow-window-start-end'.")
+
+;;}}}
+;;{{{ Debug messages
+
+;; This inline function must be as small as possible!
+;; Maybe we should define a macro that expands to nil if
+;; the variable is not set.
+
+(defsubst follow-debug-message (&rest args)
+ "Like message, but only active when `follow-debug' is non-nil."
+ (if (and (boundp 'follow-debug) follow-debug)
+ (apply 'message args)))
;;}}}
;;{{{ Cache
-(let ((cmds follow-cache-command-list))
- (while cmds
- (put (car cmds) 'follow-mode-use-cache t)
- (setq cmds (cdr cmds))))
+(dolist (cmd follow-cache-command-list)
+ (put cmd 'follow-mode-use-cache t))
;;}}}
@@ -615,20 +552,20 @@ Used by `follow-window-size-change'.")
;;;###autoload
(defun turn-on-follow-mode ()
- "Turn on Follow mode. Please see the function `follow-mode'."
+ "Turn on Follow mode. Please see the function `follow-mode'."
(interactive)
(follow-mode 1))
;;;###autoload
(defun turn-off-follow-mode ()
- "Turn off Follow mode. Please see the function `follow-mode'."
+ "Turn off Follow mode. Please see the function `follow-mode'."
(interactive)
(follow-mode -1))
-
+(put 'follow-mode 'permanent-local t)
;;;###autoload
-(defun follow-mode (arg)
+(define-minor-mode follow-mode
"Minor mode that combines windows into one tall virtual window.
The feeling of a \"virtual window\" has been accomplished by the use
@@ -665,39 +602,21 @@ is called. When turned off, `follow-mode-off-hook' is called.
Keys specific to Follow mode:
\\{follow-mode-map}"
- (interactive "P")
- (make-local-variable 'follow-mode)
- (put 'follow-mode 'permanent-local t)
- (let ((follow-mode-orig follow-mode))
- (setq follow-mode
- (if (null arg)
- (not follow-mode)
- (> (prefix-numeric-value arg) 0)))
- (if (and follow-mode follow-intercept-processes)
- (follow-intercept-process-output))
- (cond ((and follow-mode (not follow-mode-orig)) ; On
- ;; XEmacs: If this is non-nil, the window will scroll before
- ;; the point will have a chance to get into the next window.
- (if (boundp 'scroll-on-clipped-lines)
- (set 'scroll-on-clipped-lines nil))
- (force-mode-line-update)
- (add-hook 'post-command-hook 'follow-post-command-hook t)
- (run-hooks 'follow-mode-hook))
-
- ((and (not follow-mode) follow-mode-orig) ; Off
- (force-mode-line-update)
- (run-hooks 'follow-mode-off-hook)))))
-
-
-;; Register follow-mode as a minor mode.
-
-(if (fboundp 'add-minor-mode)
- ;; XEmacs
- (funcall (symbol-function 'add-minor-mode)
- 'follow-mode 'follow-mode-line-text)
- (or (assq 'follow-mode minor-mode-alist)
- (setq minor-mode-alist
- (cons '(follow-mode follow-mode-line-text) minor-mode-alist))))
+ :keymap follow-mode-map
+ (if (and follow-mode follow-intercept-processes)
+ (follow-intercept-process-output))
+ (cond (follow-mode ; On
+ ;; XEmacs: If this is non-nil, the window will scroll before
+ ;; the point will have a chance to get into the next window.
+ (if (boundp 'scroll-on-clipped-lines)
+ (setq scroll-on-clipped-lines nil))
+ (force-mode-line-update)
+ (add-hook 'post-command-hook 'follow-post-command-hook t)
+ (run-hooks 'follow-mode-hook))
+
+ ((not follow-mode) ; Off
+ (force-mode-line-update)
+ (run-hooks 'follow-mode-off-hook))))
;;}}}
;;{{{ Find file hook
@@ -1033,7 +952,7 @@ window, normally is the end plus one.
If WIN is nil, the selected window is used.
Returns (end-pos end-of-buffer-p)"
- (if follow-emacs-version-xemacs-p
+ (if (featurep 'xemacs)
;; XEmacs can calculate the end of the window by using
;; the 'guarantee options. GOOD!
(let ((end (window-end win t)))
@@ -1511,7 +1430,7 @@ non-first windows in Follow Mode."
;;}}}
;;{{{ Post Command Hook
-;;; The magic little box. This function is called after every command.
+;; The magic little box. This function is called after every command.
;; This is not as complicated as it seems. It is simply a list of common
;; display situations and the actions to take, plus commands for redrawing
@@ -1735,17 +1654,17 @@ non-first windows in Follow Mode."
;;;; Scroll-bar support code.
-;;; Why is it needed? Well, if the selected window is in follow mode,
-;;; all its follower stick to it blindly. If one of them is scrolled,
-;;; it immediately returns to the original position when the mouse is
-;;; released. If the selected window is not a follower of the dragged
-;;; window the windows will be unaligned.
+;; Why is it needed? Well, if the selected window is in follow mode,
+;; all its follower stick to it blindly. If one of them is scrolled,
+;; it immediately returns to the original position when the mouse is
+;; released. If the selected window is not a follower of the dragged
+;; window the windows will be unaligned.
-;;; The advices doesn't get compiled. Aestetically, this might be a
-;;; problem but in practical life it isn't.
+;; The advices doesn't get compiled. Aestetically, this might be a
+;; problem but in practical life it isn't.
-;;; Discussion: Now when the other windows in the chain follow the
-;;; dragged, should we really select it?
+;; Discussion: Now when the other windows in the chain follow the
+;; dragged, should we really select it?
(cond ((fboundp 'scroll-bar-drag)
;;;
@@ -1851,29 +1770,29 @@ WINDOW can be an object or a window."
;;}}}
;;{{{ Process output
-;;; The following sections installs a spy that listens to process
-;;; output and tries to reposition the windows whose buffers are in
-;;; Follow mode. We play safe as much as possible...
-;;;
-;;; When follow-mode is activated all active processes are
-;;; intercepted. All new processes that change their filter function
-;;; using `set-process-filter' are also intercepted. The reason is
-;;; that a process can cause a redisplay recentering "tail" windows.
-;;; Note that it doesn't hurt to spy on more processes than needed.
-;;;
-;;; Technically, we set the process filter to `follow-generic-filter'.
-;;; The original filter is stored in `follow-process-filter-alist'.
-;;; Our generic filter calls the original filter, or inserts the
-;;; output into the buffer, if the buffer originally didn't have an
-;;; output filter. It also makes sure that the windows connected to
-;;; the buffer are aligned.
-;;;
-;;; Discussion: How do we find processes that don't call
-;;; `set-process-filter'? (How often are processes created in a
-;;; buffer after Follow mode are activated?)
-;;;
-;;; Discussion: Should we also advice `process-filter' to make our
-;;; filter invisible to others?
+;; The following sections installs a spy that listens to process
+;; output and tries to reposition the windows whose buffers are in
+;; Follow mode. We play safe as much as possible...
+;;
+;; When follow-mode is activated all active processes are
+;; intercepted. All new processes that change their filter function
+;; using `set-process-filter' are also intercepted. The reason is
+;; that a process can cause a redisplay recentering "tail" windows.
+;; Note that it doesn't hurt to spy on more processes than needed.
+;;
+;; Technically, we set the process filter to `follow-generic-filter'.
+;; The original filter is stored in `follow-process-filter-alist'.
+;; Our generic filter calls the original filter, or inserts the
+;; output into the buffer, if the buffer originally didn't have an
+;; output filter. It also makes sure that the windows connected to
+;; the buffer are aligned.
+;;
+;; Discussion: How do we find processes that don't call
+;; `set-process-filter'? (How often are processes created in a
+;; buffer after Follow mode are activated?)
+;;
+;; Discussion: Should we also advice `process-filter' to make our
+;; filter invisible to others?
;;{{{ Advice for `set-process-filter'
@@ -1980,7 +1899,7 @@ connected to processes.
The only reason to call this function is if the Follow mode spy filter
would interfere with some other package. If this happens, please
-report this using the `follow-submit-feedback' function."
+report this using the `report-emacs-bug' function."
(interactive)
(follow-tidy-process-filter-alist)
(let ((list (process-list)))
@@ -1999,12 +1918,12 @@ report this using the `follow-submit-feedback' function."
;;}}}
;;{{{ The filter
-;;; The following section is a naive method to make buffers with
-;;; process output to work with Follow mode. Whenever the start of the
-;;; window displaying the buffer is moved, we moves it back to its
-;;; original position and try to select a new window. (If we fail,
-;;; the normal redisplay functions of Emacs will scroll it right
-;;; back!)
+;; The following section is a naive method to make buffers with
+;; process output to work with Follow mode. Whenever the start of the
+;; window displaying the buffer is moved, we moves it back to its
+;; original position and try to select a new window. (If we fail,
+;; the normal redisplay functions of Emacs will scroll it right
+;; back!)
(defun follow-generic-filter (proc output)
"Process output filter for process connected to buffers in Follow mode."
@@ -2219,7 +2138,7 @@ report this using the `follow-submit-feedback' function."
;; unless we are in `slow-search-mode', i.e. only a few lines
;; of text is visible.
-(if follow-emacs-version-xemacs-p
+(if (featurep 'xemacs)
(defadvice isearch-done (before follow-isearch-done activate)
(if (and (boundp 'follow-mode)
follow-mode
@@ -2235,28 +2154,28 @@ report this using the `follow-submit-feedback' function."
;;}}}
;;{{{ Tail window handling
-;;; In Emacs (not XEmacs) windows showing nothing are sometimes
-;;; recentered. When in Follow Mode, this is not desireable for
-;;; non-first windows in the window chain. This section tries to
-;;; make the windows stay where they should be.
-;;;
-;;; If the display is updated, all windows starting at (point-max) are
-;;; going to be recentered at the next redisplay, unless we do a
-;;; read-and-write cycle to update the `force' flag inside the windows.
-;;;
-;;; In 19.30, a new varible `window-scroll-functions' is called every
-;;; time a window is recentered. It is not perfect for our situation,
-;;; since when it is called for a tail window, it is to late. However,
-;;; if it is called for another window, we can try to update our
-;;; windows.
-;;;
-;;; By patching `sit-for' we can make sure that to catch all explicit
-;;; updates initiated by lisp programs. Internal calls, on the other
-;;; hand, are not handled.
-;;;
-;;; Please note that the function `follow-avoid-tail-recenter' is also
-;;; called from other places, e.g. `post-command-hook' and
-;;; `post-command-idle-hook'.
+;; In Emacs (not XEmacs) windows showing nothing are sometimes
+;; recentered. When in Follow Mode, this is not desireable for
+;; non-first windows in the window chain. This section tries to
+;; make the windows stay where they should be.
+;;
+;; If the display is updated, all windows starting at (point-max) are
+;; going to be recentered at the next redisplay, unless we do a
+;; read-and-write cycle to update the `force' flag inside the windows.
+;;
+;; In 19.30, a new varible `window-scroll-functions' is called every
+;; time a window is recentered. It is not perfect for our situation,
+;; since when it is called for a tail window, it is to late. However,
+;; if it is called for another window, we can try to update our
+;; windows.
+;;
+;; By patching `sit-for' we can make sure that to catch all explicit
+;; updates initiated by lisp programs. Internal calls, on the other
+;; hand, are not handled.
+;;
+;; Please note that the function `follow-avoid-tail-recenter' is also
+;; called from other places, e.g. `post-command-hook' and
+;; `post-command-idle-hook'.
;; If this function is called it is too late for this window, but
;; we might save other windows from being recentered.
@@ -2328,9 +2247,9 @@ This prevents `mouse-drag-region' from messing things up."
;;{{{ The end
-;;;
-;;; We're done!
-;;;
+;;
+;; We're done!
+;;
(provide 'follow)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c66def4af66..cecc180f522 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,68 @@
+2006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
+ unibyte after clear-decrypt function runs.
+
+ * mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg
+ returns as a unibyte string.
+
+2006-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is
+ always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el.
+ (mml1991-pgg-encrypt): Ditto.
+
+2006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * deuglify.el (gnus-outlook-deuglify-unwrap-min)
+ (gnus-outlook-deuglify-unwrap-max): Remove autoload.
+
+ * mml-sec.el (mml-secure-method): New internal variable.
+ (mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign)
+ (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New
+ functions using mml-secure-method. Sync from the trunk.
+
+ * mml.el (mml-mode-map): Add key bindings for those functions.
+ (mml-menu): Simplify security menu entries. Suggested by Jesper
+ Harder <harder@myrealbox.com>. Sync from the trunk.
+
+ * message.el (message-valid-fqdn-regexp): Add TLDs .cat, jobs,
+ .mobi and .travel. Remove .nato, .bitnet and .uucp.
+ (message-in-body-p): New function. Sync from the trunk.
+
+ * mml.el (mml-mode, mml-dnd-protocol-alist)
+ (mml-dnd-attach-options, mml-dnd-attach-file)
+ (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
+ DND support and use of message-in-body-p from the trunk.
+
+2006-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before
+ binding pgg-* variables; reimplement the section which prevents
+ MIME header from being signed.
+ (mml1991-pgg-encrypt): Make sure to load pgg.el before binding
+ pgg-text-mode; remove a blank line at the top of body.
+
+ * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank
+ lines at the top of body; use gnus-newsgroup-charset if there's no
+ Charset header.
+
+2006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
+
+ * nnweb.el (nnweb-google-wash-article): Sync up to new Google
+ HTML.
+
+2006-04-25 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-uu.el (mm-uu-pgp-signed-test): Erase prompt.
+ (mm-uu-pgp-encrypted-test): Ditto.
+ (mm-uu-pgp-encrypted-extract-1): Make sure there's a blank line
+ between header and body; return application/pgp-encrypted handle
+ if decryption failed; decode decrypted body by charset.
+
+ * mm-decode.el (mm-automatic-display): Don't make application/pgp
+ element match to application/pgp-*.
+
2006-04-20 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-util.el (gnus-replace-in-string): Prefer
@@ -419,13 +484,6 @@
2006-02-09 Daiki Ueno <ueno@unixuser.org>
- * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings
- in elisp.
- (pgg-gpg-encrypt-symmetric-region): Ditto.
- (pgg-gpg-sign-region): Ditto.
-
- * pgg-def.el (pgg-text-mode): New variable.
-
* mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode.
(mml2015-pgg-encrypt): Ditto.
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 4096324fdaa..404aebbd921 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -234,14 +234,12 @@
:version "22.1"
:group 'gnus)
-;;;###autoload
(defcustom gnus-outlook-deuglify-unwrap-min 45
"Minimum length of the cited line above the (possibly) wrapped line."
:version "22.1"
:type 'integer
:group 'gnus-outlook-deuglify)
-;;;###autoload
(defcustom gnus-outlook-deuglify-unwrap-max 95
"Maximum length of the cited line after unwrapping."
:version "22.1"
@@ -288,7 +286,6 @@
:type 'string
:group 'gnus-outlook-deuglify)
-;;;###autoload
(defcustom gnus-outlook-display-hook nil
"A hook called after an deuglified article has been prepared.
It is run after `gnus-article-prepare-hook'."
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 472eb2468dd..8bc0f704b5c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1586,11 +1586,16 @@ functionality to work."
(defcustom message-valid-fqdn-regexp
(concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
;; valid TLDs:
- "\\([a-z][a-z]" ;; two letter country TDLs
- "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org"
- "\\|aero\\|coop\\|info\\|name\\|museum"
- "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style?
- "\\)")
+ "\\([a-z][a-z]\\|" ;; two letter country TDLs
+ "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|"
+ "cat\\|com\\|coop\\|edu\\|gov\\|"
+ "info\\|int\\|jobs\\|"
+ "mil\\|mobi\\|museum\\|name\\|net\\|"
+ "org\\|pro\\|travel\\|uucp\\)")
+ ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
+ ;; http://en.wikipedia.org/wiki/GTLD
+ ;; `in the process of being approved': .asia .post .tel .sex
+ ;; "dead" nato bitnet uucp
"Regular expression that matches a valid FQDN."
;; see also: gnus-button-valid-fqdn-regexp
:version "22.1"
@@ -2679,6 +2684,11 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
(or (search-forward (concat "\n" mail-header-separator "\n") nil t)
(search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
+(defun message-in-body-p ()
+ "Return t if point is in the message body."
+ (let ((body (save-excursion (message-goto-body) (point))))
+ (>= (point) body)))
+
(defun message-goto-eoh ()
"Move point to the end of the headers."
(interactive)
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 5ee47a8ce26..b79e081f0e1 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -307,7 +307,7 @@ when selecting a different article."
"application/pkcs7-signature" "application/x-pkcs7-mime"
"application/pkcs7-mime"
;; Mutt still uses this even though it has already been withdrawn.
- "application/pgp")
+ "application/pgp\\'")
"A list of MIME types to be displayed automatically."
:type '(repeat regexp)
:group 'mime-display)
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 9029e0d699c..9d9d87a3670 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -352,7 +352,9 @@ Return that buffer."
((eq mm-verify-option 'never) nil)
((eq mm-verify-option 'always) t)
((eq mm-verify-option 'known) t)
- (t (y-or-n-p "Verify pgp signed part? ")))))
+ (t (prog1
+ (y-or-n-p "Verify pgp signed part? ")
+ (message ""))))))
(eval-when-compile
(defvar gnus-newsgroup-charset))
@@ -403,15 +405,51 @@ Return that buffer."
((eq mm-decrypt-option 'never) nil)
((eq mm-decrypt-option 'always) t)
((eq mm-decrypt-option 'known) t)
- (t (y-or-n-p "Decrypt pgp encrypted part? ")))))
+ (t (prog1
+ (y-or-n-p "Decrypt pgp encrypted part? ")
+ (message ""))))))
(defun mm-uu-pgp-encrypted-extract-1 (handles ctl)
- (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max))))
- (if (mm-uu-pgp-encrypted-test)
- (with-current-buffer buf
- (mml2015-clean-buffer)
- (funcall (mml2015-clear-decrypt-function))))
- (list (mm-make-handle buf mm-uu-text-plain-type))))
+ (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))
+ (first t)
+ charset)
+ ;; Make sure there's a blank line between header and body.
+ (with-current-buffer buf
+ (goto-char (point-min))
+ (while (prog2
+ (forward-line 1)
+ (if first
+ (looking-at "[^\t\n ]+:")
+ (looking-at "[^\t\n ]+:\\|[\t ]"))
+ (setq first nil)))
+ (unless (memq (char-after) '(?\n nil))
+ (insert "\n"))
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (setq charset (mail-fetch-field "charset")))
+ (if (and (mm-uu-pgp-encrypted-test)
+ (progn
+ (mml2015-clean-buffer)
+ (funcall (mml2015-clear-decrypt-function))
+ (equal (mm-handle-multipart-ctl-parameter mm-security-handle
+ 'gnus-info)
+ "OK")))
+ (progn
+ ;; Decode charset.
+ (if (and (or charset
+ (setq charset gnus-newsgroup-charset))
+ (setq charset (mm-charset-to-coding-system charset))
+ (not (eq charset 'ascii)))
+ ;; Assume that buffer's multibyteness is turned off.
+ ;; See `mml2015-pgg-clear-decrypt'.
+ (insert (mm-decode-coding-string (prog1
+ (buffer-string)
+ (erase-buffer)
+ (mm-enable-multibyte))
+ charset))
+ (mm-enable-multibyte))
+ (list (mm-make-handle buf mm-uu-text-plain-type)))
+ (list (mm-make-handle buf '("application/pgp-encrypted")))))))
(defun mm-uu-pgp-encrypted-extract ()
(let ((mm-security-handle (list (format "multipart/encrypted"))))
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 2af068897f0..df301dc74b7 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -188,6 +188,29 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
(cons method tags))))
(t (error "The message is corrupted. No mail header separator"))))))
+(defvar mml-secure-method
+ (if (equal mml-default-encrypt-method mml-default-sign-method)
+ mml-default-sign-method
+ "pgpmime")
+ "Current security method. Internal variable.")
+
+(defun mml-secure-sign (&optional method)
+ "Add MML tags to sign this MML part.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+ (interactive)
+ (mml-secure-part
+ (or method mml-secure-method mml-default-sign-method)
+ 'sign))
+
+(defun mml-secure-encrypt (&optional method)
+ "Add MML tags to encrypt this MML part.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+ (interactive)
+ (mml-secure-part
+ (or method mml-secure-method mml-default-sign-method)))
+
(defun mml-secure-sign-pgp ()
"Add MML tags to PGP sign this MML part."
(interactive)
@@ -249,6 +272,34 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
(when (re-search-backward "^<#secure.*>\n" nil t)
(delete-region (match-beginning 0) (match-end 0)))))
+
+(defun mml-secure-message-sign (&optional method)
+ "Add MML tags to sign this MML part.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+ (interactive)
+ (mml-secure-part
+ (or method mml-secure-method mml-default-sign-method)
+ 'sign))
+
+(defun mml-secure-message-sign-encrypt (&optional method)
+ "Add MML tag to sign and encrypt the entire message.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+ (interactive)
+ (mml-secure-message
+ (or method mml-secure-method mml-default-sign-method)
+ 'signencrypt))
+
+(defun mml-secure-message-encrypt (&optional method)
+ "Add MML tag to encrypt the entire message.
+Use METHOD if given. Else use `mml-secure-method' or
+`mml-default-sign-method'."
+ (interactive)
+ (mml-secure-message
+ (or method mml-secure-method mml-default-sign-method)
+ 'encrypt))
+
(defun mml-secure-message-sign-smime ()
"Add MML tag to encrypt/sign the entire message."
(interactive)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 6ae004a2a3b..466c0b832de 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -40,7 +40,8 @@
(autoload 'message-fetch-field "message")
(autoload 'message-info "message")
(autoload 'fill-flowed-encode "flow-fill")
- (autoload 'message-posting-charset "message"))
+ (autoload 'message-posting-charset "message")
+ (autoload 'dnd-get-local-file-name "dnd"))
(defvar gnus-article-mime-handles)
(defvar gnus-mouse-2)
@@ -51,6 +52,7 @@
(defvar message-posting-charset)
(defvar message-required-mail-headers)
(defvar message-required-news-headers)
+(defvar dnd-protocol-alist)
(defcustom mml-content-type-parameters
'(name access-type expiration size permission format)
@@ -877,6 +879,11 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
(encryptpart (make-sparse-keymap))
(map (make-sparse-keymap))
(main (make-sparse-keymap)))
+ (define-key map "\C-s" 'mml-secure-message-sign)
+ (define-key map "\C-c" 'mml-secure-message-encrypt)
+ (define-key map "\C-e" 'mml-secure-message-sign-encrypt)
+ (define-key map "\C-p\C-s" 'mml-secure-sign)
+ (define-key map "\C-p\C-c" 'mml-secure-encrypt)
(define-key sign "p" 'mml-secure-message-sign-pgpmime)
(define-key sign "o" 'mml-secure-message-sign-pgp)
(define-key sign "s" 'mml-secure-message-sign-smime)
@@ -914,26 +921,54 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
["Attach File..." mml-attach-file
,@(if (featurep 'xemacs) '(t)
'(:help "Attach a file at point"))]
- ["Attach Buffer..." mml-attach-buffer t]
- ["Attach External..." mml-attach-external t]
- ["Insert Part..." mml-insert-part t]
- ["Insert Multipart..." mml-insert-multipart t]
- ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t]
- ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t]
- ["PGP Sign" mml-secure-message-sign-pgp t]
- ["PGP Encrypt" mml-secure-message-encrypt-pgp t]
- ["S/MIME Sign" mml-secure-message-sign-smime t]
- ["S/MIME Encrypt" mml-secure-message-encrypt-smime t]
- ("Secure MIME part"
- ["PGP/MIME Sign Part" mml-secure-sign-pgpmime t]
- ["PGP/MIME Encrypt Part" mml-secure-encrypt-pgpmime t]
- ["PGP Sign Part" mml-secure-sign-pgp t]
- ["PGP Encrypt Part" mml-secure-encrypt-pgp t]
- ["S/MIME Sign Part" mml-secure-sign-smime t]
- ["S/MIME Encrypt Part" mml-secure-encrypt-smime t])
- ["Encrypt/Sign off" mml-unsecure-message t]
+ ["Attach Buffer..." mml-attach-buffer
+ ,@(if (featurep 'xemacs) '(t)
+ '(:help "Attach a buffer to the outgoing MIME message"))]
+ ["Attach External..." mml-attach-external
+ ,@(if (featurep 'xemacs) '(t)
+ '(:help "Attach reference to file"))]
+ ;;
+ ("Change Security Method"
+ ["PGP/MIME"
+ (lambda () (interactive) (setq mml-secure-method "pgpmime"))
+ ,@(if (featurep 'xemacs) nil
+ '(:help "Set Security Method to PGP/MIME"))
+ :style radio
+ :selected (equal mml-secure-method "pgpmime") ]
+ ["S/MIME"
+ (lambda () (interactive) (setq mml-secure-method "smime"))
+ ,@(if (featurep 'xemacs) nil
+ '(:help "Set Security Method to S/MIME"))
+ :style radio
+ :selected (equal mml-secure-method "smime") ]
+ ["Inline PGP"
+ (lambda () (interactive) (setq mml-secure-method "pgp"))
+ ,@(if (featurep 'xemacs) nil
+ '(:help "Set Security Method to inline PGP"))
+ :style radio
+ :selected (equal mml-secure-method "pgp") ] )
+ ;;
+ ["Sign Message" mml-secure-message-sign t]
+ ["Encrypt Message" mml-secure-message-encrypt t]
+ ["Sign and Encrypt Message" mml-secure-message-sign-encrypt t]
+ ["Encrypt/Sign off" mml-unsecure-message
+ ,@(if (featurep 'xemacs) '(t)
+ '(:help "Don't Encrypt/Sign Message"))]
+ ;; Maybe we could remove these, because people who write MML most probably
+ ;; don't use the menu:
+ ["Insert Part..." mml-insert-part
+ :active (message-in-body-p)]
+ ["Insert Multipart..." mml-insert-multipart
+ :active (message-in-body-p)]
+ ;;
+ ;; Do we have separate encrypt and encrypt/sign commands for parts?
+ ["Sign Part" mml-secure-sign t]
+ ["Encrypt Part" mml-secure-encrypt t]
;;["Narrow" mml-narrow-to-part t]
- ["Quote MML" mml-quote-region t]
+ ["Quote MML in region" mml-quote-region
+ :active (message-mark-active-p)
+ ,@(if (featurep 'xemacs) nil
+ '(:help "Quote MML tags in region"))]
["Validate MML" mml-validate t]
["Preview" mml-preview t]
"----"
@@ -957,8 +992,11 @@ See Info node `(emacs-mime)Composing'.
(when (set (make-local-variable 'mml-mode)
(if (null arg) (not mml-mode)
(> (prefix-numeric-value arg) 0)))
- (gnus-add-minor-mode 'mml-mode " MML" mml-mode-map)
+ (add-minor-mode 'mml-mode " MML" mml-mode-map)
(easy-menu-add mml-menu mml-mode-map)
+ (when (boundp 'dnd-protocol-alist)
+ (set (make-local-variable 'dnd-protocol-alist)
+ (append mml-dnd-protocol-alist dnd-protocol-alist)))
(run-hooks 'mml-mode-hook)))
;;;
@@ -1056,6 +1094,36 @@ See Info node `(emacs-mime)Composing'.
;;; Attachment functions.
+(defcustom mml-dnd-protocol-alist
+ '(("^file:///" . mml-dnd-attach-file)
+ ("^file://" . dnd-open-file)
+ ("^file:" . mml-dnd-attach-file))
+ "The functions to call when a drop in `mml-mode' is made.
+See `dnd-protocol-alist' for more information. When nil, behave
+as in other buffers."
+ :type '(choice (repeat (cons (regexp) (function)))
+ (const :tag "Behave as in other buffers" nil))
+ :version "22.1" ;; Gnus 5.10.9
+ :group 'message)
+
+(defcustom mml-dnd-attach-options nil
+ "Which options should be queried when attaching a file via drag and drop.
+
+If it is a list, valid members are `type', `description' and
+`disposition'. `disposition' implies `type'. If it is nil,
+don't ask for options. If it is t, ask the user whether or not
+to specify options."
+ :type '(choice
+ (const :tag "Non" nil)
+ (const :tag "Query" t)
+ (list :value (type description disposition)
+ (set :inline t
+ (const type)
+ (const description)
+ (const disposition))))
+ :version "22.1" ;; Gnus 5.10.9
+ :group 'message)
+
(defun mml-attach-file (file &optional type description disposition)
"Attach a file to the outgoing MIME message.
The file is not inserted or encoded until you send the message with
@@ -1073,11 +1141,37 @@ body) or \"attachment\" (separate from the body)."
(description (mml-minibuffer-read-description))
(disposition (mml-minibuffer-read-disposition type)))
(list file type description disposition)))
- (mml-insert-empty-tag 'part
- 'type type
- 'filename file
- 'disposition (or disposition "attachment")
- 'description description))
+ (save-excursion
+ (unless (message-in-body-p) (goto-char (point-max)))
+ (mml-insert-empty-tag 'part
+ 'type type
+ 'filename file
+ 'disposition (or disposition "attachment")
+ 'description description)))
+
+(defun mml-dnd-attach-file (uri action)
+ "Attach a drag and drop file.
+
+Ask for type, description or disposition according to
+`mml-dnd-attach-options'."
+ (let ((file (dnd-get-local-file-name uri t)))
+ (when (and file (file-regular-p file))
+ (let ((mml-dnd-attach-options mml-dnd-attach-options)
+ type description disposition)
+ (setq mml-dnd-attach-options
+ (when (and (eq mml-dnd-attach-options t)
+ (not
+ (y-or-n-p
+ "Use default type, disposition and description? ")))
+ '(type description disposition)))
+ (when (or (memq 'type mml-dnd-attach-options)
+ (memq 'disposition mml-dnd-attach-options))
+ (setq type (mml-minibuffer-read-type file)))
+ (when (memq 'description mml-dnd-attach-options)
+ (setq description (mml-minibuffer-read-description)))
+ (when (memq 'disposition mml-dnd-attach-options)
+ (setq disposition (mml-minibuffer-read-disposition type)))
+ (mml-attach-file file type description disposition)))))
(defun mml-attach-buffer (buffer &optional type description)
"Attach a buffer to the outgoing MIME message.
@@ -1087,8 +1181,11 @@ See `mml-attach-file' for details of operation."
(type (mml-minibuffer-read-type buffer "text/plain"))
(description (mml-minibuffer-read-description)))
(list buffer type description)))
- (mml-insert-empty-tag 'part 'type type 'buffer buffer
- 'disposition "attachment" 'description description))
+ (save-excursion
+ (unless (message-in-body-p) (goto-char (point-max)))
+ (mml-insert-empty-tag 'part 'type type 'buffer buffer
+ 'disposition "attachment"
+ 'description description)))
(defun mml-attach-external (file &optional type description)
"Attach an external file into the buffer.
@@ -1099,8 +1196,10 @@ TYPE is the MIME type to use."
(type (mml-minibuffer-read-type file))
(description (mml-minibuffer-read-description)))
(list file type description)))
- (mml-insert-empty-tag 'external 'type type 'name file
- 'disposition "attachment" 'description description))
+ (save-excursion
+ (unless (message-in-body-p) (goto-char (point-max)))
+ (mml-insert-empty-tag 'external 'type type 'name file
+ 'disposition "attachment" 'description description)))
(defun mml-insert-multipart (&optional type)
(interactive (list (completing-read "Multipart type (default mixed): "
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 0c6bb675388..4db3540aec1 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -230,22 +230,22 @@
(defun mml1991-pgg-sign (cont)
(let ((pgg-text-mode t)
+ (pgg-default-user-id (or (message-options-get 'mml-sender)
+ pgg-default-user-id))
headers cte)
;; Don't sign headers.
(goto-char (point-min))
- (while (not (looking-at "^$"))
- (forward-line))
- (unless (eobp) ;; no headers?
+ (when (re-search-forward "^$" nil t)
(setq headers (buffer-substring (point-min) (point)))
- (forward-line) ;; skip header/body separator
- (delete-region (point-min) (point)))
- (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers)
- (setq cte (intern (match-string 1 headers))))
- (mm-decode-content-transfer-encoding cte)
- (unless (let ((pgg-default-user-id
- (or (message-options-get 'mml-sender)
- pgg-default-user-id)))
- (pgg-sign-region (point-min) (point-max) t))
+ (save-restriction
+ (narrow-to-region (point-min) (point))
+ (setq cte (mail-fetch-field "content-transfer-encoding")))
+ (forward-line 1)
+ (delete-region (point-min) (point))
+ (when cte
+ (setq cte (intern (downcase cte)))
+ (mm-decode-content-transfer-encoding cte)))
+ (unless (pgg-sign-region (point-min) (point-max) t)
(pop-to-buffer pgg-errors-buffer)
(error "Encrypt error"))
(delete-region (point-min) (point-max))
@@ -254,7 +254,8 @@
(goto-char (point-min))
(while (re-search-forward "\r+$" nil t)
(replace-match "" t t))
- (mm-encode-content-transfer-encoding cte)
+ (when cte
+ (mm-encode-content-transfer-encoding cte))
(goto-char (point-min))
(when headers
(insert headers))
@@ -262,18 +263,18 @@
t))
(defun mml1991-pgg-encrypt (cont &optional sign)
- (let ((pgg-text-mode t)
- cte)
- ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED
- (goto-char (point-min))
- (while (looking-at "^Content[^ ]+:")
- (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)")
- (setq cte (intern (match-string 1))))
- (forward-line))
- (unless (bobp)
- (delete-region (point-min) (point)))
- (mm-decode-content-transfer-encoding cte)
- (unless (pgg-encrypt-region
+ (goto-char (point-min))
+ (when (re-search-forward "^$" nil t)
+ (let ((cte (save-restriction
+ (narrow-to-region (point-min) (point))
+ (mail-fetch-field "content-transfer-encoding"))))
+ ;; Strip MIME headers since it will be ASCII armoured.
+ (forward-line 1)
+ (delete-region (point-min) (point))
+ (when cte
+ (mm-decode-content-transfer-encoding (intern (downcase cte))))))
+ (unless (let ((pgg-text-mode t))
+ (pgg-encrypt-region
(point-min) (point-max)
(split-string
(or
@@ -281,15 +282,13 @@
(message-options-set 'message-recipients
(read-string "Recipients: ")))
"[ \f\t\n\r\v,]+")
- sign)
- (pop-to-buffer pgg-errors-buffer)
- (error "Encrypt error"))
- (delete-region (point-min) (point-max))
- ;;(insert "Content-Type: application/pgp-encrypted\n\n")
- ;;(insert "Version: 1\n\n")
- (insert "\n")
- (insert-buffer-substring pgg-output-buffer)
- t))
+ sign))
+ (pop-to-buffer pgg-errors-buffer)
+ (error "Encrypt error"))
+ (delete-region (point-min) (point-max))
+ (insert "\n")
+ (insert-buffer-substring pgg-output-buffer)
+ t)
;;;###autoload
(defun mml1991-encrypt (cont &optional sign)
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 80dd5b26597..591ef647678 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -707,6 +707,8 @@
(buffer-string))))
(progn
(erase-buffer)
+ ;; Treat data which pgg returns as a unibyte string.
+ (mm-disable-multibyte)
(insert-buffer-substring pgg-output-buffer)
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 134b62e97b9..a67d5a469f6 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -307,8 +307,8 @@ Valid types include `google', `dejanews', and `gmane'.")
(defun nnweb-google-wash-article ()
;; We have Google's masked e-mail addresses here. :-/
(let ((case-fold-search t)
- (start-re "<pre>\n *")
- (end-re "\n *</pre>"))
+ (start-re "<pre>[\r\n ]*")
+ (end-re "[\r\n ]*</pre>"))
(goto-char (point-min))
(if (save-excursion
(or (re-search-forward "The requested message.*could not be found."
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d30fc02c409..2b75e7fd053 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -630,6 +630,7 @@ it is displayed along with the global value."
(indirect-variable variable)
(error variable)))
(obsolete (get variable 'byte-obsolete-variable))
+ (safe-var (get variable 'safe-local-variable))
(doc (or (documentation-property variable 'variable-documentation)
(documentation-property alias 'variable-documentation))))
(unless (eq alias variable)
@@ -641,6 +642,11 @@ it is displayed along with the global value."
(princ (if (stringp (car obsolete)) (car obsolete)
(format "use `%s' instead." (car obsolete))))
(terpri))
+ (when safe-var
+ (princ "This variable is safe to use as a file local variable")
+ (princ (format " only if its value\nsatisfies the predicate `%s'.\n"
+ safe-var))
+ (terpri))
(princ "Documentation:\n")
(princ (or doc "Not documented as a variable.")))
;; Make a link to customize if this variable can be customized.
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index a5cdf1f4d72..0c6e0f47453 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -197,7 +197,10 @@ Commands:
(view-mode)
(make-local-variable 'view-no-disable-on-exit)
(setq view-no-disable-on-exit t)
- (setq view-exit-action (lambda (buffer) (delete-window)))
+ (setq view-exit-action (lambda (buffer)
+ (or (window-minibuffer-p (selected-window))
+ (one-window-p t)
+ (delete-window))))
(run-mode-hooks 'help-mode-hook))
;;;###autoload
diff --git a/lisp/image.el b/lisp/image.el
index 2212b0fb471..b388396ded7 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -280,27 +280,14 @@ be determined."
;;;###autoload
-(defun image-type-available-p (type)
- "Return non-nil if image type TYPE is available.
-Image types are symbols like `xbm' or `jpeg'."
- (and (fboundp 'init-image-library)
- (init-image-library type image-library-alist)))
-
-
-;;;###autoload
-(defun create-image (file-or-data &optional type data-p &rest props)
- "Create an image.
+(defun image-type (file-or-data &optional type data-p)
+ "Determine and return image type.
FILE-OR-DATA is an image file name or image data.
Optional TYPE is a symbol describing the image type. If TYPE is omitted
or nil, try to determine the image type from its first few bytes
of image data. If that doesn't work, and FILE-OR-DATA is a file name,
use its file extension as image type.
-Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
-Optional PROPS are additional image attributes to assign to the image,
-like, e.g. `:mask MASK'.
-Value is the image created, or nil if images of type TYPE are not supported.
-
-Images should not be larger than specified by `max-image-size'."
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data."
(when (and (not data-p) (not (stringp file-or-data)))
(error "Invalid image file name `%s'" file-or-data))
(cond ((null data-p)
@@ -319,6 +306,31 @@ Images should not be larger than specified by `max-image-size'."
(error "Cannot determine image type"))
(unless (symbolp type)
(error "Invalid image type `%s'" type))
+ type)
+
+;;;###autoload
+(defun image-type-available-p (type)
+ "Return non-nil if image type TYPE is available.
+Image types are symbols like `xbm' or `jpeg'."
+ (and (fboundp 'init-image-library)
+ (init-image-library type image-library-alist)))
+
+
+;;;###autoload
+(defun create-image (file-or-data &optional type data-p &rest props)
+ "Create an image.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type. If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data. If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
+Optional PROPS are additional image attributes to assign to the image,
+like, e.g. `:mask MASK'.
+Value is the image created, or nil if images of type TYPE are not supported.
+
+Images should not be larger than specified by `max-image-size'."
+ (setq type (image-type file-or-data type data-p))
(when (image-type-available-p type)
(append (list 'image :type type (if data-p :data :file) file-or-data)
props)))
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 3a6c53c3113..82c022075a4 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1265,15 +1265,15 @@ or by the previous use of this command."
"Specify coding system for keyboard input.
If you set this on a terminal which can't distinguish Meta keys from
8-bit characters, you will have to use ESC to type Meta characters.
-See Info node `Specify Coding' and Info node `Single-Byte Character Support'.
+See Info node `Terminal Coding' and Info node `Unibyte Mode'.
On non-windowing terminals, this is set from the locale by default.
Setting this variable directly does not take effect;
use either \\[customize] or \\[set-keyboard-coding-system]."
:type '(coding-system :tag "Coding system")
- :link '(info-link "(emacs)Specify Coding")
- :link '(info-link "(emacs)Single-Byte Character Support")
+ :link '(info-link "(emacs)Terminal Coding")
+ :link '(info-link "(emacs)Unibyte Mode")
:set (lambda (symbol value)
;; Don't load encoded-kbd-mode unnecessarily.
(if (or value (boundp 'encoded-kbd-mode))
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 0c7a655a237..611bab0a247 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs cvs commit log
;; This file is part of GNU Emacs.
diff --git a/lisp/log-view.el b/lisp/log-view.el
index 8a6f88650d2..dbee454b7d6 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: rcs sccs cvs log version-control
;; This file is part of GNU Emacs.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 89ca1dc04aa..f7846394638 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,40 @@
+2006-04-28 Bill Wohler <wohler@newt.com>
+
+ Release MH-E version 7.95.
+
+ * mh-e.el (Version, mh-version): Update for release 7.95.
+
+2006-04-26 Eric Ding <ericding@alum.mit.edu>
+
+ * mh-e.el (mh-invisible-header-fields-internal): Add entry
+ "X-Provags-ID:"
+
+2006-04-25 Bill Wohler <wohler@newt.com>
+
+ * mh-letter.el (mh-folder-expand-at-point): Fix folder completion.
+ Folders returned by mh-folder-completion-function no longer need
+ adornment (closes SF #1476270).
+
+2006-04-21 Bill Wohler <wohler@newt.com>
+
+ * mh-e.el (Version, mh-version): Add +cvs to version.
+
+2006-04-21 Bill Wohler <wohler@newt.com>
+
+ Release MH-E version 7.94.
+
+ * mh-e.el (Version, mh-version): Update for release 7.94.
+
+2006-04-21 Bill Wohler <wohler@newt.com>
+
+ * mh-letter.el (mh-insert-letter): If a message number isn't
+ given, throw an error rather than using a potentially incorrect
+ message number (closes SF #1473729). In addition, use the cur
+ message if mh-sent-from-msg is nil (when sending a message, in
+ contrast to replying). Move conversion of int to string into
+ interactive stanza so body can assume variables are of proper
+ type.
+
2006-04-20 Bill Wohler <wohler@newt.com>
* mh-tool-bar.el (image-load-path): Define to shush compiler.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 9ae686d8950..88b8c5bac09 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -6,7 +6,7 @@
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.93+cvs
+;; Version: 7.95
;; Keywords: mail
;; This file is part of GNU Emacs.
@@ -136,7 +136,7 @@
;; Try to keep variables local to a single file. Provide accessors if
;; variables are shared. Use this section as a last resort.
-(defconst mh-version "7.93+cvs" "Version number of MH-E.")
+(defconst mh-version "7.95" "Version number of MH-E.")
;; Variants
@@ -2526,6 +2526,7 @@ of citations entirely, choose \"None\"."
"X-Originating-IP:" ; Hotmail
"X-Postfilter:"
"X-Priority:" ; MS Outlook
+ "X-Provags-ID:"
"X-Qotd-" ; User added
"X-RM"
"X-Received-Date:"
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 9445b5ea41f..d037c09e2aa 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -393,24 +393,26 @@ message is not indented, and \"> \" is not inserted before each line.
This command leaves the mark before the letter and point after it."
(interactive
(let* ((folder
- (mh-prompt-for-folder "Message from"
- mh-sent-from-folder nil))
+ (mh-prompt-for-folder "Message from" mh-sent-from-folder nil))
(default
- (if (and (equal folder mh-sent-from-folder)
- (numberp mh-sent-from-msg))
- mh-sent-from-msg
+ (if (equal folder mh-sent-from-folder)
+ (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur")))
(nth 0 (mh-translate-range folder "cur"))))
(message
(read-string (concat "Message number"
(or (and default
(format " (default %d): " default))
- ": ")))))
+ ": "))
+ nil nil
+ (if (numberp default)
+ (int-to-string default)
+ default))))
(list folder message current-prefix-arg)))
+ (if (equal message "")
+ (error "No message number given"))
(save-restriction
(narrow-to-region (point) (point))
(let ((start (point-min)))
- (if (and (equal message "") (numberp mh-sent-from-msg))
- (setq message (int-to-string mh-sent-from-msg)))
(insert-file-contents
(expand-file-name message (mh-expand-file-name folder)))
(when (not verbatim)
@@ -864,15 +866,12 @@ downcasing the field name."
"Do folder name completion in Fcc header field."
(let* ((end (point))
(beg (mh-beginning-of-word))
- (folder (buffer-substring beg end))
+ (folder (buffer-substring-no-properties beg end))
(leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+)))
- (last-slash (mh-search-from-end ?/ folder))
- (prefix (and last-slash (substring folder 0 last-slash)))
- (choices (mapcar #'(lambda (x)
- (list (cond (prefix (format "%s/%s" prefix x))
- (leading-plus (format "+%s" x))
- (t x))))
+ (choices (mapcar (lambda (x) (list x))
(mh-folder-completion-function folder nil t))))
+ (unless leading-plus
+ (setq folder (concat "+" folder)))
(mh-complete-word folder choices beg end)))
;;;###mh-autoload
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 53703166e64..a0b328413b0 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -74,13 +74,13 @@
:group 'rcirc)
(defcustom rcirc-default-user-full-name (if (string= (user-full-name) "")
- rcirc-user-name
- (user-full-name))
+ rcirc-user-name
+ (user-full-name))
"The full name sent to the server when connecting."
:type 'string
:group 'rcirc)
-(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs"))
+(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
"Alist of channels to join at startup.
Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
:type '(alist :key-type string :value-type (repeat string))
@@ -206,6 +206,18 @@ When an ignored person renames, their nick is added to both lists.
Nicks will be removed from the automatic list on follow-up renamings or
parts.")
+(defcustom rcirc-bright-nick-regexp nil
+ "Regexp matching nicks to be emphasized.
+See `rcirc-bright-nick' face."
+ :type 'regexp
+ :group 'rcirc)
+
+(defcustom rcirc-dim-nick-regexp nil
+ "Regexp matching nicks to be deemphasized.
+See `rcirc-dim-nick' face."
+ :type 'regexp
+ :group 'rcirc)
+
(defcustom rcirc-print-hooks nil
"Hook run after text is printed.
Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
@@ -217,7 +229,7 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
:type 'boolean
:group 'rcirc)
-(defcustom rcirc-decode-coding-system 'undecided
+(defcustom rcirc-decode-coding-system 'utf-8
"Coding system used to decode incoming irc messages."
:type 'coding-system
:group 'rcirc)
@@ -546,7 +558,7 @@ With no argument or nil as argument, use the current buffer."
(with-current-buffer rcirc-server-buffer
(or rcirc-nick rcirc-default-nick))))
-(defvar rcirc-max-message-length 450
+(defvar rcirc-max-message-length 420
"Messages longer than this value will be split.")
(defun rcirc-send-message (process target message &optional noticep)
@@ -955,7 +967,8 @@ Create the buffer if it doesn't exist."
:global nil
:group 'rcirc
(make-local-variable 'rcirc-parent-buffer)
- (put 'rcirc-parent-buffer 'permanent-local t))
+ (put 'rcirc-parent-buffer 'permanent-local t)
+ (setq fill-column rcirc-max-message-length))
(defun rcirc-multiline-minor-submit ()
"Send the text in buffer back to parent buffer."
@@ -1029,6 +1042,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
(split-string (or (cdr (assoc response rcirc-response-formats))
(cdr (assq t rcirc-response-formats)))
"%"))
+ (sender (or sender ""))
(result "")
(face nil)
key face-key repl)
@@ -1054,9 +1068,16 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
(rcirc-facify nick
(if (eq key ?n)
face
- (if (string= sender (rcirc-nick process))
- 'rcirc-my-nick
- 'rcirc-other-nick)))))
+ (cond ((string= sender (rcirc-nick process))
+ 'rcirc-my-nick)
+ ((and rcirc-bright-nick-regexp
+ (string-match rcirc-bright-nick-regexp sender))
+ 'rcirc-bright-nick)
+ ((and rcirc-dim-nick-regexp
+ (string-match rcirc-dim-nick-regexp sender))
+ 'rcirc-dim-nick)
+ (t
+ 'rcirc-other-nick))))))
((eq key ?T)
;; %T -- timestamp
(rcirc-facify
@@ -1130,8 +1151,9 @@ record activity."
(or text (setq text ""))
(unless (or (member sender rcirc-ignore-list)
(member (with-syntax-table rcirc-nick-syntax-table
- (when (string-match "^\\([^/]\\w*\\)\\b" text)
- (match-string 1 text))) rcirc-ignore-list))
+ (when (string-match "^\\([^/]\\w*\\)[:,]" text)
+ (match-string 1 text)))
+ rcirc-ignore-list))
(let* ((buffer (rcirc-target-buffer process sender response target text))
(inhibit-read-only t))
(with-current-buffer buffer
@@ -1222,10 +1244,12 @@ record activity."
(regexp-quote (rcirc-nick process))
"\\b")
text)))
- (when (or (not rcirc-ignore-buffer-activity-flag)
- ;; always notice when our nick is mentioned, even
- ;; if ignoring channel activity
- nick-match)
+ (when (if rcirc-ignore-buffer-activity-flag
+ ;; - Always notice when our nick is mentioned
+ nick-match
+ ;; - Never bother us if a dim-nick spoke
+ (not (and rcirc-dim-nick-regexp sender
+ (string-match rcirc-dim-nick-regexp sender))))
(rcirc-record-activity
(current-buffer)
(when (or nick-match (and (not (rcirc-channel-p rcirc-target))
@@ -1375,7 +1399,7 @@ if NICK is also on `rcirc-ignore-list-automatic'."
(force-mode-line-update))
(defun rcirc-toggle-low-priority ()
- "Toggle the value of `rcirc-ignore-buffer-activity-flag'."
+ "Toggle the value of `rcirc-low-priority-flag'."
(interactive)
(setq rcirc-low-priority-flag
(not rcirc-low-priority-flag))
@@ -1788,7 +1812,7 @@ ones added to the list automatically are marked with an asterisk."
(defun rcirc-browse-url (&optional arg)
"Prompt for URL to browse based on URLs in buffer."
- (interactive)
+ (interactive "P")
(let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls))
(initial-input (car rcirc-urls))
(history (cdr rcirc-urls)))
@@ -1910,7 +1934,7 @@ FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
(cond ((rcirc-channel-p target)
target)
;;; -ChanServ- [#gnu] Welcome...
- ((string-match "^\\[\\(#[^ ]+\\)\\]" message)
+ ((string-match "\\[\\(#[^\] ]+\\)\\]" message)
(match-string 1 message))
(sender
(if (string= sender (rcirc-server-name process))
@@ -2211,6 +2235,25 @@ Passwords are stored in `rcirc-authinfo' (which see)."
"The face used to highlight other messages."
:group 'rcirc-faces)
+(defface rcirc-bright-nick
+ '((((class grayscale) (background light))
+ (:foreground "LightGray" :weight bold :underline t))
+ (((class grayscale) (background dark))
+ (:foreground "Gray50" :weight bold :underline t))
+ (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
+ (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
+ (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
+ (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
+ (((class color) (min-colors 8)) (:foreground "magenta"))
+ (t (:weight bold :underline t)))
+ "Face used for nicks matched by `rcirc-bright-nick-regexp'."
+ :group 'rcirc-faces)
+
+(defface rcirc-dim-nick
+ '((t :inherit default))
+ "Face used for nicks matched by `rcirc-dim-nick-regexp'."
+ :group 'rcirc-faces)
+
(defface rcirc-server ; font-lock-comment-face
'((((class grayscale) (background light))
(:foreground "DimGray" :weight bold :slant italic))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 617e21ebfeb..6e166aa2393 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1821,8 +1821,6 @@ while (my $data = <STDIN>) {
Escape sequence %s is replaced with name of Perl binary.
This string is passed to `format', so percent characters need to be doubled.")
-; These values conform to `file-attributes' from XEmacs 21.2.
-; GNU Emacs and other tools not checked.
(defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2)
(1 . "p") ; fifo
(2 . "c") ; character device
@@ -1927,17 +1925,12 @@ on the FILENAME argument, even if VISIT was a string.")
"Alist of handler functions.
Operations not mentioned here will be handled by the normal Emacs functions.")
-;; Handlers for partial tramp file names. For GNU Emacs just
-;; `file-name-all-completions' is needed. The other ones are necessary
-;; for XEmacs.
+;; Handlers for partial tramp file names. For Emacs just
+;; `file-name-all-completions' is needed.
+;;;###autoload
(defconst tramp-completion-file-name-handler-alist
- '(
- (file-name-directory . tramp-completion-handle-file-name-directory)
- (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory)
- (file-exists-p . tramp-completion-handle-file-exists-p)
- (file-name-all-completions . tramp-completion-handle-file-name-all-completions)
- (file-name-completion . tramp-completion-handle-file-name-completion)
- (expand-file-name . tramp-completion-handle-expand-file-name))
+ '((file-name-all-completions . tramp-completion-handle-file-name-all-completions)
+ (file-name-completion . tramp-completion-handle-file-name-completion))
"Alist of completion handler functions.
Used for file names matching `tramp-file-name-regexp'. Operations not
mentioned here will be handled by `tramp-file-name-handler-alist' or the
@@ -2172,28 +2165,11 @@ target of the symlink differ."
;; Localname manipulation functions that grok TRAMP localnames...
(defun tramp-handle-file-name-directory (file)
"Like `file-name-directory' but aware of TRAMP files."
- ;; everything except the last filename thing is the directory
+ ;; Everything except the last filename thing is the directory.
(with-parsed-tramp-file-name file nil
- ;; For the following condition, two possibilities should be tried:
- ;; (1) (string= localname "")
- ;; (2) (or (string= localname "") (string= localname "/"))
- ;; The second variant fails when completing a "/" directory on
- ;; the remote host, that is a filename which looks like
- ;; "/user@host:/". But maybe wildcards fail with the first variant.
- ;; We should do some investigation.
- (if (string= localname "")
- ;; For a filename like "/[foo]", we return "/". The `else'
- ;; case would return "/[foo]" unchanged. But if we do that,
- ;; then `file-expand-wildcards' ceases to work. It's not
- ;; quite clear to me what's the intuition that tells that this
- ;; behavior is the right behavior, but oh, well.
- "/"
- ;; run the command on the localname portion only
- ;; CCC: This should take into account the remote machine type, no?
- ;; --daniel <daniel@danann.net>
- (tramp-make-tramp-file-name multi-method method user host
- ;; This will not recurse...
- (or (file-name-directory localname) "")))))
+ ;; Run the command on the localname portion only.
+ (tramp-make-tramp-file-name
+ multi-method method user host (file-name-directory (or localname "")))))
(defun tramp-handle-file-name-nondirectory (file)
"Like `file-name-nondirectory' but aware of TRAMP files."
@@ -4144,7 +4120,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
;; (inhibit-file-name-operation operation))
;; (apply operation args)))
-(defun tramp-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-run-real-handler (operation args)
"Invoke normal file name handler for OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
@@ -4157,13 +4134,14 @@ pass to the OPERATION."
,(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
(inhibit-file-name-operation operation))
- (apply operation args)))
+ (apply operation args))))
;; This function is used from `tramp-completion-file-name-handler' functions
;; only, if `tramp-completion-mode' is true. But this cannot be checked here
;; because the check is based on a full filename, not available for all
;; basic I/O operations.
-(defun tramp-completion-run-real-handler (operation args)
+;;;###autoload
+(progn (defun tramp-completion-run-real-handler (operation args)
"Invoke `tramp-file-name-handler' for OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
@@ -4175,7 +4153,7 @@ pass to the OPERATION."
,(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
(inhibit-file-name-operation operation))
- (apply operation args)))
+ (apply operation args))))
;; We handle here all file primitives. Most of them have the file
;; name as first parameter; nevertheless we check for them explicitly
@@ -4272,12 +4250,25 @@ ARGS are the arguments OPERATION has been called with."
(defun tramp-file-name-handler (operation &rest args)
"Invoke Tramp file name handler.
Falls back to normal file name handler if no tramp file name handler exists."
+;; (setq edebug-trace t)
+;; (edebug-trace "%s" (with-output-to-string (backtrace)))
(save-match-data
(let* ((filename (apply 'tramp-file-name-for-operation operation args))
+ (completion (tramp-completion-mode filename))
(foreign (tramp-find-foreign-file-name-handler filename)))
- (cond
- (foreign (apply foreign operation args))
- (t (tramp-run-real-handler operation args))))))
+ (with-parsed-tramp-file-name filename nil
+ (cond
+ ;; When we are in completion mode, some operations shouldn' be
+ ;; handled by backend.
+ ((and completion (memq operation '(expand-file-name)))
+ (tramp-run-real-handler operation args))
+ ((and completion (zerop (length localname))
+ (memq operation '(file-exists-p file-directory-p)))
+ t)
+ ;; Call the backend function.
+ (foreign (apply foreign operation args))
+ ;; Nothing to do for us.
+ (t (tramp-run-real-handler operation args)))))))
;; In Emacs, there is some concurrency due to timers. If a timer
@@ -4325,31 +4316,43 @@ Fall back to normal file name handler if no Tramp handler exists."
(setq tramp-locked tl))))
;;;###autoload
-(defun tramp-completion-file-name-handler (operation &rest args)
+(progn (defun tramp-completion-file-name-handler (operation &rest args)
"Invoke tramp file name completion handler.
Falls back to normal file name handler if no tramp file name handler exists."
-;; (setq tramp-debug-buffer t)
-;; (tramp-message 1 "%s %s" operation args)
-;; (tramp-message 1 "%s %s\n%s"
-;; operation args (with-output-to-string (backtrace)))
+;; (setq edebug-trace t)
+;; (edebug-trace "%s" (with-output-to-string (backtrace)))
(let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
(if fn
(save-match-data (apply (cdr fn) args))
- (tramp-completion-run-real-handler operation args))))
+ (tramp-completion-run-real-handler operation args)))))
;;;###autoload
-(put 'tramp-completion-file-name-handler 'safe-magic t)
+(defsubst tramp-register-file-name-handlers ()
+ "Add tramp file name handlers to `file-name-handler-alist'."
+ (add-to-list 'file-name-handler-alist
+ (cons tramp-file-name-regexp 'tramp-file-name-handler))
+ (when partial-completion-mode
+ (add-to-list 'file-name-handler-alist
+ (cons tramp-completion-file-name-regexp
+ 'tramp-completion-file-name-handler))
+ (put 'tramp-completion-file-name-handler 'safe-magic t))
+ ;; If jka-compr is already loaded, move it to the front of
+ ;; `file-name-handler-alist'.
+ (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
+ (when jka
+ (setq file-name-handler-alist
+ (cons jka (delete jka file-name-handler-alist))))))
-;; Register in file name handler alist
-;;;###autoload
-(add-to-list 'file-name-handler-alist
- (cons tramp-file-name-regexp 'tramp-file-name-handler))
-(add-to-list 'file-name-handler-alist
- (cons tramp-completion-file-name-regexp
- 'tramp-completion-file-name-handler))
+;; During autoload, it shall be checked whether
+;; `partial-completion-mode' is active. Therefore registering will be
+;; delayed.
+;;;###autoload(add-hook
+;;;###autoload 'after-init-hook
+;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
+(tramp-register-file-name-handlers)
;;;###autoload
-(defun tramp-unload-file-name-handler-alist ()
+(defun tramp-unload-file-name-handlers ()
(setq file-name-handler-alist
(delete (rassoc 'tramp-file-name-handler
file-name-handler-alist)
@@ -4357,17 +4360,7 @@ Falls back to normal file name handler if no tramp file name handler exists."
file-name-handler-alist)
file-name-handler-alist))))
-(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handler-alist)
-
-(defun tramp-repair-jka-compr ()
- "If jka-compr is already loaded, move it to the front of
-`file-name-handler-alist'. On Emacs 22 or so this will not be
-necessary anymore."
- (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
- (when jka
- (setq file-name-handler-alist
- (cons jka (delete jka file-name-handler-alist))))))
-(tramp-repair-jka-compr)
+(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
;;; Interactions with other packages:
@@ -4482,31 +4475,10 @@ necessary anymore."
last-input-event) ?\ ))))))
t)))
-(defun tramp-completion-handle-file-exists-p (filename)
- "Like `file-exists-p' for tramp files."
- (if (tramp-completion-mode filename)
- (tramp-run-real-handler
- 'file-exists-p (list filename))
- (tramp-completion-run-real-handler
- 'file-exists-p (list filename))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-directory (file)
- "Like `file-name-directory' but aware of TRAMP files."
- (if (tramp-completion-mode file)
- "/"
- (tramp-completion-run-real-handler
- 'file-name-directory (list file))))
-
-;; Localname manipulation in case of partial TRAMP file names.
-(defun tramp-completion-handle-file-name-nondirectory (file)
- "Like `file-name-nondirectory' but aware of TRAMP files."
- (substring
- file (length (tramp-completion-handle-file-name-directory file))))
-
;; Method, host name and user name completion.
;; `tramp-completion-dissect-file-name' returns a list of
;; tramp-file-name structures. For all of them we return possible completions.
+;;;###autoload
(defun tramp-completion-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for partial tramp files."
@@ -4561,7 +4533,8 @@ necessary anymore."
;; unify list, remove nil elements
(while result
(let ((car (car result)))
- (when car (add-to-list 'result1 car))
+ (when car (add-to-list
+ 'result1 (substring car (length directory))))
(setq result (cdr result))))
;; Complete local parts
@@ -4580,6 +4553,7 @@ necessary anymore."
(setq tramp-completion-mode nil)))
;; Method, host name and user name completion for a file.
+;;;###autoload
(defun tramp-completion-handle-file-name-completion (filename directory)
"Like `file-name-completion' for tramp files."
(try-completion filename
@@ -4706,8 +4680,7 @@ remote host and localname (filename on remote host)."
(lambda (method)
(and method
(string-match (concat "^" (regexp-quote partial-method)) method)
- ;; we must remove leading "/".
- (substring (tramp-make-tramp-file-name nil method nil nil nil) 1)))
+ (tramp-make-tramp-file-name nil method nil nil nil)))
(delete "multi" (mapcar 'car tramp-methods))))
;; Compares partial user and host names with possible completions.
@@ -4740,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
host nil)))
(unless (zerop (+ (length user) (length host)))
- ;; we must remove leading "/".
- (substring (tramp-make-tramp-file-name nil method user host nil) 1)))
+ (tramp-make-tramp-file-name nil method user host nil)))
(defun tramp-parse-rhosts (filename)
"Return a list of (user host) tuples allowed to access.
@@ -4960,15 +4932,6 @@ User may be nil."
(forward-line 1)
result))
-(defun tramp-completion-handle-expand-file-name (name &optional dir)
- "Like `expand-file-name' for tramp files."
- (let ((fullname (concat (or dir default-directory) name)))
- (if (tramp-completion-mode fullname)
- (tramp-run-real-handler
- 'expand-file-name (list name dir))
- (tramp-completion-run-real-handler
- 'expand-file-name (list name dir)))))
-
;;; Internal Functions:
(defun tramp-maybe-send-perl-script (multi-method method user host script name)
@@ -7629,7 +7592,7 @@ Therefore, the contents of files might be included in the debug buffer(s).")
(defun tramp-unload-tramp ()
(interactive)
;; When Tramp is not loaded yet, its autoloads are still active.
- (tramp-unload-file-name-handler-alist)
+ (tramp-unload-file-name-handlers)
;; ange-ftp settings must be enabled.
(when (functionp 'tramp-ftp-enable-ange-ftp)
(funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el
index 8f7de913261..127a550b28c 100644
--- a/lisp/pcvs-defs.el
+++ b/lisp/pcvs-defs.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el
index 7d1a11ccb68..4aaa5add58d 100644
--- a/lisp/pcvs-info.el
+++ b/lisp/pcvs-info.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el
index 892dc962767..0193939606c 100644
--- a/lisp/pcvs-parse.el
+++ b/lisp/pcvs-parse.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el
index b04f3c121a1..cb18fc83d59 100644
--- a/lisp/pcvs-util.el
+++ b/lisp/pcvs-util.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;; This file is part of GNU Emacs.
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 7ddd9212f6c..e31a94030c3 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -829,7 +829,7 @@ in the grammar's actions and semantic predicates, see
`antlr-font-lock-maximum-decoration'.")
(defvar antlr-default-face 'antlr-default)
-(defface antlr-default nil
+(defface antlr-default '((t nil))
"Face to prevent strings from language dependent highlighting.
Do not change."
:group 'antlr)
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index b79237adba7..ebb532a3525 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -62,9 +62,9 @@
(defvar asm-mode-syntax-table
(let ((st (make-syntax-table)))
- (modify-syntax-entry ?\n ">" st)
- (modify-syntax-entry ?/ ". 14b" st)
- (modify-syntax-entry ?* ". 23b" st)
+ (modify-syntax-entry ?\n "> b" st)
+ (modify-syntax-entry ?/ ". 124b" st)
+ (modify-syntax-entry ?* ". 23" st)
st)
"Syntax table used while in Asm mode.")
@@ -136,14 +136,14 @@ Special commands:
(use-local-map (nconc (make-sparse-keymap) asm-mode-map))
(local-set-key (vector asm-comment-char) 'asm-comment)
(set-syntax-table (make-syntax-table asm-mode-syntax-table))
- (modify-syntax-entry asm-comment-char "<")
+ (modify-syntax-entry asm-comment-char "< b")
(make-local-variable 'comment-start)
(setq comment-start (string asm-comment-char))
(make-local-variable 'comment-add)
(setq comment-add 1)
(make-local-variable 'comment-start-skip)
- (setq comment-start-skip "\\(?:\\s<+\\|/\\*+\\)[ \t]*")
+ (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
(make-local-variable 'comment-end-skip)
(setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
(make-local-variable 'comment-end)
diff --git a/lisp/progmodes/cc-subword.el b/lisp/progmodes/cc-subword.el
index 6ba76708ebf..72227e33290 100644
--- a/lisp/progmodes/cc-subword.el
+++ b/lisp/progmodes/cc-subword.el
@@ -91,8 +91,8 @@
;; Don't complain about the `define-minor-mode' form if it isn't defined.
(cc-bytecomp-defvar c-subword-mode)
-;;; Autoload directives must be on the top level, so we construct an
-;;; autoload form instead.
+;; Autoload directives must be on the top level, so we construct an
+;; autoload form instead.
;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t)
(if (not (fboundp 'define-minor-mode))
@@ -107,36 +107,19 @@ telling us which (X)Emacs version you're using."
(defvar c-subword-mode-map
(let ((map (make-sparse-keymap)))
- (substitute-key-definition 'forward-word
- 'c-forward-subword
- map global-map)
- (substitute-key-definition 'backward-word
- 'c-backward-subword
- map global-map)
- (substitute-key-definition 'mark-word
- 'c-mark-subword
- map global-map)
-
- (substitute-key-definition 'kill-word
- 'c-kill-subword
- map global-map)
- (substitute-key-definition 'backward-kill-word
- 'c-backward-kill-subword
- map global-map)
-
- (substitute-key-definition 'transpose-words
- 'c-transpose-subwords
- map global-map)
-
- (substitute-key-definition 'capitalize-word
- 'c-capitalize-subword
- map global-map)
- (substitute-key-definition 'upcase-word
- 'c-upcase-subword
- map global-map)
- (substitute-key-definition 'downcase-word
- 'c-downcase-subword
- map global-map)
+ (dolist (cmd '(forward-word backward-word mark-word
+ kill-word backward-kill-word
+ transpose-words
+ capitalize-word upcase-word downcase-word))
+ (let ((othercmd (let ((name (symbol-name cmd)))
+ (string-match "\\(.*-\\)\\(word.*\\)" name)
+ (intern (concat "c-"
+ (match-string 1 name)
+ "sub"
+ (match-string 2 name))))))
+ (if (fboundp 'command-remapping)
+ (define-key map (vector 'remap cmd) othercmd)
+ (substitute-key-definition cmd othercmd map global-map))))
map)
"Keymap used in command `c-subword-mode' minor mode.")
@@ -308,5 +291,5 @@ Optional argument ARG is the same as for `upcase-word'."
(cc-provide 'cc-subword)
-;;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3
+;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3
;;; cc-subword.el ends here
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6afa3f29348..0aba9d42b84 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -35,7 +35,7 @@
(defgroup grep nil
- "Run compiler as inferior of Emacs, parse error messages."
+ "Run grep as inferior of Emacs, parse error messages."
:group 'tools
:group 'processes)
@@ -48,23 +48,6 @@
:version "22.1"
:group 'grep)
-(defcustom grep-auto-highlight t
- "*Specify how many grep matches to highlight (and parse) initially.
-\(Highlighting applies to an grep match when the mouse is over it.)
-If this is a number N, all grep matches in the first N lines
-are highlighted and parsed as soon as they arrive in Emacs.
-If t, highlight and parse the whole grep output as soon as it arrives.
-If nil, don't highlight or parse any of the grep buffer until you try to
-move to the error messages.
-
-Those grep matches which are not parsed and highlighted initially
-will be parsed and highlighted as soon as you try to move to them."
- :type '(choice (const :tag "All" t)
- (const :tag "None" nil)
- (integer :tag "First N lines"))
- :version "22.1"
- :group 'grep)
-
(defcustom grep-highlight-matches 'auto-detect
"If t, use special markers to highlight grep matches.
@@ -108,6 +91,20 @@ call that function before using this variable in your program."
(const :tag "Not Set" nil))
:group 'grep)
+(defcustom grep-template nil
+ "The default command to run for \\[lgrep].
+The default value of this variable is set up by `grep-compute-defaults';
+call that function before using this variable in your program.
+The following place holders should be present in the string:
+ <C> - place to put -i if case insensitive grep.
+ <F> - file names and wildcards to search.
+ <R> - the regular expression searched for.
+ <N> - place to insert null-device."
+ :type '(choice string
+ (const :tag "Not Set" nil))
+ :version "22.1"
+ :group 'grep)
+
(defcustom grep-use-null-device 'auto-detect
"If t, append the value of `null-device' to `grep' commands.
This is done to ensure that the output of grep includes the filename of
@@ -130,8 +127,8 @@ call that function before using this variable in your program."
(const :tag "Not Set" nil))
:group 'grep)
-(defcustom grep-tree-command nil
- "The default find command for \\[grep-tree].
+(defcustom grep-find-template nil
+ "The default command to run for \\[rgrep].
The default value of this variable is set up by `grep-compute-defaults';
call that function before using this variable in your program.
The following place holders should be present in the string:
@@ -145,27 +142,22 @@ The following place holders should be present in the string:
:version "22.1"
:group 'grep)
-(defcustom grep-tree-files-aliases '(
+(defcustom grep-files-aliases '(
+ ("el" . "*.el")
("ch" . "*.[ch]")
("c" . "*.c")
("h" . "*.h")
- ("m" . "[Mm]akefile*")
("asm" . "*.[sS]")
- ("all" . "*")
- ("el" . "*.el")
+ ("m" . "[Mm]akefile*")
+ ("l" . "[Cc]hange[Ll]og*")
)
- "*Alist of aliases for the FILES argument to `grep-tree'."
+ "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'."
:type 'alist
:group 'grep)
-(defcustom grep-tree-ignore-case t
- "*If non-nil, `grep-tree' ignores case in matches."
- :type 'boolean
- :group 'grep)
-
-(defcustom grep-tree-ignore-CVS-directories t
- "*If non-nil, `grep-tree' does no recurse into CVS directories."
- :type 'boolean
+(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}")
+ "*List of names of sub-directories which `rgrep' shall not recurse into."
+ :type '(repeat string)
:group 'grep)
(defcustom grep-error-screen-columns nil
@@ -208,6 +200,8 @@ See `compilation-error-screen-columns'"
'("Compile..." . compile))
(define-key map [menu-bar grep compilation-grep]
'("Another grep..." . grep))
+ (define-key map [menu-bar grep compilation-grep-find]
+ '("Recursive grep..." . grep-find))
(define-key map [menu-bar grep compilation-recompile]
'("Repeat grep" . recompile))
(define-key map [menu-bar grep compilation-separator2]
@@ -353,6 +347,11 @@ This variable's value takes effect when `grep-compute-defaults' is called.")
;;;###autoload
(defvar grep-find-history nil)
+;; History of lgrep and rgrep regexp and files args.
+(defvar grep-regexp-history nil)
+(defvar grep-files-history '("ch" "el"))
+
+
;;;###autoload
(defun grep-process-setup ()
"Setup compilation variables and buffer for `grep'.
@@ -378,6 +377,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(cons msg code))))
(run-hooks 'grep-setup-hook))
+(defun grep-probe (command args &optional func result)
+ (equal (condition-case nil
+ (apply (or func 'call-process) command args)
+ (error nil))
+ (or result 0)))
+
;;;###autoload
(defun grep-compute-defaults ()
(unless (or (not grep-use-null-device) (eq grep-use-null-device t))
@@ -385,73 +390,67 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(with-temp-buffer
(let ((hello-file (expand-file-name "HELLO" data-directory)))
(not
- (and (equal (condition-case nil
- (if grep-command
- ;; `grep-command' is already set, so
- ;; use that for testing.
- (call-process-shell-command
- grep-command nil t nil
- "^English" hello-file)
- ;; otherwise use `grep-program'
- (call-process grep-program nil t nil
- "-nH" "^English" hello-file))
- (error nil))
- 0)
+ (and (if grep-command
+ ;; `grep-command' is already set, so
+ ;; use that for testing.
+ (grep-probe grep-command
+ `(nil t nil "^English" ,hello-file)
+ #'call-process-shell-command)
+ ;; otherwise use `grep-program'
+ (grep-probe grep-program
+ `(nil t nil "-nH" "^English" ,hello-file)))
(progn
(goto-char (point-min))
(looking-at
(concat (regexp-quote hello-file)
":[0-9]+:English")))))))))
- (unless grep-command
- (setq grep-command
- (let ((required-options (if grep-use-null-device "-n" "-nH")))
- (if (equal (condition-case nil ; in case "grep" isn't in exec-path
- (call-process grep-program nil nil nil
- "-e" "foo" null-device)
- (error nil))
- 1)
- (format "%s %s -e " grep-program required-options)
- (format "%s %s " grep-program required-options)))))
- (unless grep-find-use-xargs
- (setq grep-find-use-xargs
- (if (and
- (equal (call-process "find" nil nil nil
- null-device "-print0")
- 0)
- (equal (call-process "xargs" nil nil nil
- "-0" "-e" "echo")
- 0))
- 'gnu)))
- (unless grep-find-command
- (setq grep-find-command
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "%s . -type f -print0 | xargs -0 -e %s"
- find-program grep-command))
- (grep-find-use-xargs
- (format "%s . -type f -print | xargs %s"
- find-program grep-command))
- (t (cons (format "%s . -type f -exec %s {} %s \\;"
- find-program grep-command null-device)
- (+ 22 (length grep-command)))))))
- (unless grep-tree-command
- (setq grep-tree-command
- (let* ((glen (length grep-program))
- (gcmd (concat grep-program " <C>" (substring grep-command glen))))
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "%s <D> <X> -type f <F> -print0 | xargs -0 -e %s <R>"
- find-program gcmd))
- (grep-find-use-xargs
- (format "%s <D> <X> -type f <F> -print | xargs %s <R>"
- find-program gcmd))
- (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;"
- find-program gcmd null-device))))))
+ (unless (and grep-command grep-find-command
+ grep-template grep-find-template)
+ (let ((grep-options
+ (concat (if grep-use-null-device "-n" "-nH")
+ (if (grep-probe grep-program
+ `(nil nil nil "-e" "foo" ,null-device)
+ nil 1)
+ " -e"))))
+ (unless grep-command
+ (setq grep-command
+ (format "%s %s " grep-program grep-options)))
+ (unless grep-template
+ (setq grep-template
+ (format "%s <C> %s <R> <F>" grep-program grep-options)))
+ (unless grep-find-use-xargs
+ (setq grep-find-use-xargs
+ (if (and
+ (grep-probe find-program `(nil nil nil ,null-device "-print0"))
+ (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
+ 'gnu)))
+ (unless grep-find-command
+ (setq grep-find-command
+ (cond ((eq grep-find-use-xargs 'gnu)
+ (format "%s . -type f -print0 | xargs -0 -e %s"
+ find-program grep-command))
+ (grep-find-use-xargs
+ (format "%s . -type f -print | xargs %s"
+ find-program grep-command))
+ (t (cons (format "%s . -type f -exec %s {} %s \\;"
+ find-program grep-command null-device)
+ (+ 22 (length grep-command)))))))
+ (unless grep-find-template
+ (setq grep-find-template
+ (let ((gcmd (format "%s <C> %s <R>"
+ grep-program grep-options)))
+ (cond ((eq grep-find-use-xargs 'gnu)
+ (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
+ find-program gcmd))
+ (grep-find-use-xargs
+ (format "%s . <X> -type f <F> -print | xargs %s"
+ find-program gcmd))
+ (t (format "%s . <X> -type f <F> -exec %s {} %s \\;"
+ find-program gcmd null-device))))))))
(unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
(setq grep-highlight-matches
(with-temp-buffer
- (and (equal (condition-case nil
- (call-process grep-program nil t nil "--help")
- (error nil))
- 0)
+ (and (grep-probe grep-program '(nil t nil "--help"))
(progn
(goto-char (point-min))
(search-forward "--color" nil t))
@@ -487,8 +486,22 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(file-name-extension buffer-file-name))))
(replace-match tag-default t t grep-default 1))))
+
;;;###autoload
-(defun grep (command-args &optional highlight-regexp)
+(define-compilation-mode grep-mode "Grep"
+ "Sets `grep-last-buffer' and `compilation-window-height'."
+ (setq grep-last-buffer (current-buffer))
+ (set (make-local-variable 'compilation-error-face)
+ grep-hit-face)
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ grep-regexp-alist)
+ (set (make-local-variable 'compilation-process-setup-function)
+ 'grep-process-setup)
+ (set (make-local-variable 'compilation-disable-input) t))
+
+
+;;;###autoload
+(defun grep (command-args)
"Run grep, with user-specified args, and collect output in a buffer.
While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
or \\<grep-mode-map>\\[compile-goto-error] in the grep \
@@ -501,15 +514,10 @@ easily repeat a grep command.
A prefix argument says to default the argument based upon the current
tag the cursor is over, substituting it into the last grep command
in the grep command history (or into `grep-command'
-if that history list is empty).
-
-If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to
-temporarily highlight in visited source lines."
+if that history list is empty)."
(interactive
(progn
- (unless (and grep-command
- (or (not grep-use-null-device) (eq grep-use-null-device t)))
- (grep-compute-defaults))
+ (grep-compute-defaults)
(let ((default (grep-default-command)))
(list (read-from-minibuffer "Run grep (like this): "
(if current-prefix-arg
@@ -522,19 +530,8 @@ temporarily highlight in visited source lines."
(compilation-start (if (and grep-use-null-device null-device)
(concat command-args " " null-device)
command-args)
- 'grep-mode nil highlight-regexp))
+ 'grep-mode))
-;;;###autoload
-(define-compilation-mode grep-mode "Grep"
- "Sets `grep-last-buffer' and `compilation-window-height'."
- (setq grep-last-buffer (current-buffer))
- (set (make-local-variable 'compilation-error-face)
- grep-hit-face)
- (set (make-local-variable 'compilation-error-regexp-alist)
- grep-regexp-alist)
- (set (make-local-variable 'compilation-process-setup-function)
- 'grep-process-setup)
- (set (make-local-variable 'compilation-disable-input) t))
;;;###autoload
(defun grep-find (command-args)
@@ -547,9 +544,7 @@ This command uses a special history list for its arguments, so you can
easily repeat a find command."
(interactive
(progn
- (unless (and grep-command
- (or (not grep-use-null-device) (eq grep-use-null-device t)))
- (grep-compute-defaults))
+ (grep-compute-defaults)
(if grep-find-command
(list (read-from-minibuffer "Run find (like this): "
grep-find-command nil nil
@@ -565,84 +560,190 @@ easily repeat a find command."
;;;###autoload
(defalias 'find-grep 'grep-find)
-(defun grep-expand-command-macros (command &optional regexp files dir excl case-fold)
- "Patch grep COMMAND replacing <D>, etc."
- (setq command
- (replace-regexp-in-string "<D>"
- (or dir ".") command t t))
- (setq command
- (replace-regexp-in-string "<X>"
- (or excl "") command t t))
- (setq command
- (replace-regexp-in-string "<F>"
- (or files "") command t t))
- (setq command
- (replace-regexp-in-string "<C>"
- (if case-fold "-i" "") command t t))
- (setq command
- (replace-regexp-in-string "<R>"
- (or regexp "") command t t))
- command)
-
-(defvar grep-tree-last-regexp "")
-(defvar grep-tree-last-files (car (car grep-tree-files-aliases)))
+
+;; User-friendly interactive API.
+
+(defconst grep-expand-keywords
+ '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
+ ("<D>" . dir)
+ ("<F>" . files)
+ ("<N>" . null-device)
+ ("<X>" . excl)
+ ("<R>" . (shell-quote-argument (or regexp ""))))
+ "List of substitutions performed by `grep-expand-template'.
+If car of an element matches, the cdr is evalled in to get the
+substitution string. Note dynamic scoping of variables.")
+
+(defun grep-expand-template (template &optional regexp files dir excl)
+ "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
+ (let ((command template)
+ (cf case-fold-search)
+ (case-fold-search nil))
+ (dolist (kw grep-expand-keywords command)
+ (if (string-match (car kw) command)
+ (setq command
+ (replace-match
+ (or (if (symbolp (cdr kw))
+ (eval (cdr kw))
+ (save-match-data (eval (cdr kw))))
+ "")
+ t t command))))))
+
+(defun grep-read-regexp ()
+ "Read regexp arg for interactive grep."
+ (let ((default
+ (or (funcall (or find-tag-default-function
+ (get major-mode 'find-tag-default-function)
+ 'find-tag-default))
+ "")))
+ (read-string
+ (concat "Search for"
+ (if (and default (> (length default) 0))
+ (format " (default %s): " default) ": "))
+ nil 'grep-regexp-history default)))
+
+(defun grep-read-files (regexp)
+ "Read files arg for interactive grep."
+ (let* ((bn (or (buffer-file-name) (buffer-name)))
+ (fn (and bn
+ (stringp bn)
+ (file-name-nondirectory bn)))
+ (default
+ (or (and fn
+ (let ((aliases grep-files-aliases)
+ alias)
+ (while aliases
+ (setq alias (car aliases)
+ aliases (cdr aliases))
+ (if (string-match (wildcard-to-regexp (cdr alias)) fn)
+ (setq aliases nil)
+ (setq alias nil)))
+ (cdr alias)))
+ (and fn
+ (let ((ext (file-name-extension fn)))
+ (and ext (concat "*." ext))))))
+ (files (read-string
+ (concat "Search for \"" regexp
+ "\" in files"
+ (if default (concat " (default " default ")"))
+ ": ")
+ nil 'grep-files-history default)))
+ (and files
+ (or (cdr (assoc files grep-files-aliases))
+ files))))
;;;###autoload
-(defun grep-tree (regexp files dir &optional subdirs)
- "Grep for REGEXP in FILES in directory tree rooted at DIR.
-Collect output in a buffer.
-Interactively, prompt separately for each search parameter.
-With prefix arg, reuse previous REGEXP.
+(defun lgrep (regexp &optional files)
+ "Run grep, searching for REGEXP in FILES in current directory.
The search is limited to file names matching shell pattern FILES.
-FILES may use abbreviations defined in `grep-tree-files-aliases', e.g.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
entering `ch' is equivalent to `*.[ch]'.
-While find runs asynchronously, you can use the \\[next-error] command
-to find the text that grep hits refer to.
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep shell command.
-This command uses a special history list for its arguments, so you can
-easily repeat a find command.
+Collect output in a buffer. While grep runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
-When used non-interactively, optional arg SUBDIRS limits the search to
-those sub directories of DIR."
+This command shares argument histories with \\[rgrep] and \\[grep]."
(interactive
- (let* ((regexp
- (if current-prefix-arg
- grep-tree-last-regexp
- (let* ((default (current-word))
- (spec (read-string
- (concat "Search for"
- (if (and default (> (length default) 0))
- (format " (default %s): " default) ": ")))))
- (if (equal spec "") default spec))))
- (files
- (read-string (concat "Search for \"" regexp "\" in files (default " grep-tree-last-files "): ")))
- (dir
- (read-directory-name "Base directory: " nil default-directory t)))
- (list regexp files dir)))
- (unless grep-tree-command
- (grep-compute-defaults))
- (unless (and (stringp files) (> (length files) 0))
- (setq files grep-tree-last-files))
- (when files
- (setq grep-tree-last-files files)
- (let ((mf (assoc files grep-tree-files-aliases)))
- (if mf
- (setq files (cdr mf)))))
- (let ((command-args (grep-expand-command-macros
- grep-tree-command
- (setq grep-tree-last-regexp regexp)
- (and files (concat "-name '" files "'"))
- (if subdirs
- (if (stringp subdirs)
- subdirs
- (mapconcat 'identity subdirs " "))
- nil) ;; we change default-directory to dir
- (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ")
- grep-tree-ignore-case))
- (default-directory (file-name-as-directory (expand-file-name dir)))
- (null-device nil)) ; see grep
- (grep command-args regexp)))
+ (progn
+ (grep-compute-defaults)
+ (cond
+ ((and grep-command (equal current-prefix-arg '(16)))
+ (list (read-from-minibuffer "Run: " grep-command
+ nil nil 'grep-history)
+ nil))
+ ((not grep-template)
+ (list nil
+ (read-string "grep.el: No `grep-template' available. Press RET.")))
+ (t (let* ((regexp (grep-read-regexp))
+ (files (grep-read-files regexp)))
+ (list regexp files))))))
+ (when (and (stringp regexp) (> (length regexp) 0))
+ (let ((command regexp))
+ (if (null files)
+ (if (string= command grep-command)
+ (setq command nil))
+ (setq command (grep-expand-template
+ grep-template
+ regexp
+ files))
+ (when command
+ (if (equal current-prefix-arg '(4))
+ (setq command
+ (read-from-minibuffer "Confirm: "
+ command nil nil 'grep-history))
+ (push command grep-history))))
+ (when command
+ ;; Setting process-setup-function makes exit-message-function work
+ ;; even when async processes aren't supported.
+ (compilation-start (if (and grep-use-null-device null-device)
+ (concat command " " null-device)
+ command) 'grep-mode)))))
+
+
+;;;###autoload
+(defun rgrep (regexp &optional files dir)
+ "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
+The search is limited to file names matching shell pattern FILES.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
+entering `ch' is equivalent to `*.[ch]'.
+
+With \\[universal-argument] prefix, allow user to edit the constructed
+shell command line before it is executed.
+With two \\[universal-argument] prefixes, edit and run grep-find shell command.
+
+Collect output in a buffer. While find runs asynchronously, you
+can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
+in the grep output buffer, to go to the lines where grep found matches.
+
+This command shares argument histories with \\[lgrep] and \\[grep-find]."
+ (interactive
+ (progn
+ (grep-compute-defaults)
+ (cond
+ ((and grep-find-command (equal current-prefix-arg '(16)))
+ (list (read-from-minibuffer "Run: " grep-find-command
+ nil nil 'grep-find-history)
+ nil))
+ ((not grep-find-template)
+ (list nil nil
+ (read-string "grep.el: No `grep-find-template' available. Press RET.")))
+ (t (let* ((regexp (grep-read-regexp))
+ (files (grep-read-files regexp))
+ (dir (read-directory-name "Base directory: "
+ nil default-directory t)))
+ (list regexp files dir))))))
+ (when (and (stringp regexp) (> (length regexp) 0))
+ (if (null files)
+ (if (not (string= regexp grep-find-command))
+ (compilation-start regexp 'grep-mode))
+ (let* ((default-directory (file-name-as-directory (expand-file-name dir)))
+ (command (grep-expand-template
+ grep-find-template
+ regexp
+ (concat "\\( -name "
+ (mapconcat #'shell-quote-argument
+ (split-string files)
+ " -o -name ")
+ " \\)")
+ default-directory
+ (and grep-find-ignored-directories
+ (concat "\\( -path '*/"
+ (mapconcat #'identity
+ grep-find-ignored-directories
+ "' -o -path '*/")
+ "' \\) -prune -o ")))))
+ (when command
+ (if current-prefix-arg
+ (setq command
+ (read-from-minibuffer "Confirm: "
+ command nil nil 'grep-find-history))
+ (push command grep-find-history))
+ (compilation-start command 'grep-mode))))))
(provide 'grep)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index e1e2b9e28cd..11259aa3965 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -83,6 +83,8 @@ Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and b
(defvar gud-minor-mode nil)
(put 'gud-minor-mode 'permanent-local t)
+(defvar gud-comint-buffer nil)
+
(defvar gud-keep-buffer nil)
(defun gud-symbol (sym &optional soft minor-mode)
@@ -301,13 +303,15 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
optional doc string DOC. Certain %-escapes in the string arguments
are interpreted specially if present. These are:
- %f name (without directory) of current source file.
- %F name (without directory or extension) of current source file.
- %d directory of current source file.
- %l number of current source line
- %e text of the C lvalue or function-call expression surrounding point.
- %a text of the hexadecimal address surrounding point
- %p prefix argument to the command (if any) as a number
+ %f -- Name (without directory) of current source file.
+ %F -- Name (without directory or extension) of current source file.
+ %d -- Directory of current source file.
+ %l -- Number of current source line.
+ %e -- Text of the C lvalue or function-call expression surrounding point.
+ %a -- Text of the hexadecimal address surrounding point.
+ %p -- Prefix argument to the command (if any) as a number.
+ %c -- Fully qualified class name derived from the expression
+ surrounding point (jdb only).
The `current' source file is the file of the current buffer (if
we're in a C file) or the source file current at the last break or
@@ -444,8 +448,7 @@ required by the caller."
(when (or gdb-force-update
(not (save-excursion
(goto-char (point-min))
- (let ((case-fold-search t))
- (looking-at "Watch Expressions:")))))
+ (looking-at "Watch Expressions:"))))
(erase-buffer)
(insert "Watch Expressions:\n")
(if gdb-speedbar-auto-raise
@@ -740,8 +743,6 @@ To run GDB in text command mode, set `gud-gdb-command-name' to
;; The completion list is constructed by the process filter.
(defvar gud-gdb-fetched-lines)
-(defvar gud-comint-buffer nil)
-
(defun gud-gdb-complete-command (&optional command a b)
"Perform completion on the GDB command preceding point.
This is implemented using the GDB `complete' command which isn't
@@ -2804,7 +2805,9 @@ Obeying it means displaying in another window the specified file and line."
(let ((insource (not (eq (current-buffer) gud-comint-buffer)))
(frame (or gud-last-frame gud-last-last-frame))
result)
- (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str))
+ (while (and str
+ (let ((case-fold-search nil))
+ (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str)))
(let ((key (string-to-char (match-string 2 str)))
subst)
(cond
@@ -2889,8 +2892,11 @@ Obeying it means displaying in another window the specified file and line."
(set-buffer gud-comint-buffer)
(save-restriction
(widen)
- (goto-char (process-mark proc))
- (forward-line 0)
+ (if (marker-position gud-delete-prompt-marker)
+ ;; We get here when printing an expression.
+ (goto-char gud-delete-prompt-marker)
+ (goto-char (process-mark proc))
+ (forward-line 0))
(if (looking-at comint-prompt-regexp)
(set-marker gud-delete-prompt-marker (point)))
(if (memq gud-minor-mode '(gdbmi gdba))
@@ -2911,7 +2917,21 @@ Obeying it means displaying in another window the specified file and line."
(defvar gud-find-expr-function 'gud-find-c-expr)
(defun gud-find-expr (&rest args)
- (apply gud-find-expr-function args))
+ (let ((expr (if (and transient-mark-mode mark-active)
+ (buffer-substring (region-beginning) (region-end))
+ (apply gud-find-expr-function args))))
+ (save-match-data
+ (if (string-match "\n" expr)
+ (error "Expression must not include a newline"))
+ (with-current-buffer gud-comint-buffer
+ (save-excursion
+ (goto-char (process-mark (get-buffer-process gud-comint-buffer)))
+ (forward-line 0)
+ (when (looking-at comint-prompt-regexp)
+ (set-marker gud-delete-prompt-marker (point))
+ (set-marker-insertion-type gud-delete-prompt-marker t))
+ (insert (concat expr " = ")))))
+ expr))
;; The next eight functions are hacked from gdbsrc.el by
;; Debby Ayers <ayers@asc.slb.com>,
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5e645535a23..9636f7eaeae 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -292,9 +292,9 @@ The criteria are that the previous line ends in a backslash outside
comments and strings, or that the bracket/paren nesting depth is nonzero."
(or (and (eq ?\\ (char-before (line-end-position 0)))
(not (syntax-ppss-context (syntax-ppss))))
- (/= 0 (syntax-ppss-depth
- (save-excursion ; syntax-ppss with arg changes point
- (syntax-ppss (line-beginning-position)))))))
+ (< 0 (syntax-ppss-depth
+ (save-excursion ; syntax-ppss with arg changes point
+ (syntax-ppss (line-beginning-position)))))))
(defun python-comment-line-p ()
"Return non-nil iff current line has only a comment."
@@ -719,7 +719,10 @@ expressions."
(python-beginning-of-string)
;; Skip forward out of nested brackets.
(condition-case () ; beware invalid syntax
- (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+ (let ((depth (syntax-ppss-depth (syntax-ppss))))
+ ;; Beware negative depths.
+ (if (> depth 0) (backward-up-list depth))
+ t)
(error (throw 'foo nil))))))
(back-to-indentation))
@@ -1755,7 +1758,6 @@ lines count as headers.
(if (featurep 'hippie-exp)
(set (make-local-variable 'hippie-expand-try-functions-list)
(cons 'python-try-complete hippie-expand-try-functions-list)))
- (unless font-lock-mode (font-lock-mode 1))
(when python-guess-indent (python-guess-indent))
(set (make-local-variable 'python-command) python-python-command)
(unless (boundp 'python-mode-running) ; kill the recursion from jython-mode
diff --git a/lisp/reveal.el b/lisp/reveal.el
index 4120f9331b3..84411f98658 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: outlines
;; This file is part of GNU Emacs.
diff --git a/lisp/simple.el b/lisp/simple.el
index 36b2d8b8f21..6b571aaba3f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1709,7 +1709,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
;; but we don't want to ask the question again.
(setq undo-extra-outer-limit (+ size 50000))
(if (let (use-dialog-box track-mouse executing-kbd-macro )
- (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
+ (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? "
(buffer-name) size)))
(progn (setq buffer-undo-list nil)
(setq undo-extra-outer-limit nil)
@@ -1717,7 +1717,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
nil))
(display-warning '(undo discard-info)
(concat
- (format "Buffer %s undo info was %d bytes long.\n"
+ (format "Buffer `%s' undo info was %d bytes long.\n"
(buffer-name) size)
"The undo info was discarded because it exceeded \
`undo-outer-limit'.
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index 9fddc4b1a05..8d9df188875 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1999, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006 Free Software Foundation, Inc.
-;; Author: Stefan Monnier <monnier@cs.yale.edu>
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: tools revision-control merge diff3 cvs conflict
;; This file is part of GNU Emacs.
diff --git a/lisp/startup.el b/lisp/startup.el
index c28fc728145..66676c302b9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1620,6 +1620,15 @@ normal otherwise."
(when init-file-had-error
(sit-for 2))
+ (when (and pure-space-overflow
+ (not noninteractive))
+ (display-warning
+ 'initialization
+ "Building Emacs overflowed pure space."
+ ;; FIXME: Tell the user what kind of problems are possible and how to fix
+ ;; the overflow.
+ :warning))
+
(when command-line-args-left
;; We have command args; process them.
(let ((dir command-line-default-directory)
diff --git a/lisp/subr.el b/lisp/subr.el
index 5e18eaa5992..5c0317d00c3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -851,19 +851,23 @@ and `event-end' functions."
(nth 3 position))
(defsubst posn-string (position)
- "Return the string object of POSITION, or nil if a buffer position.
+ "Return the string object of POSITION.
+Value is a cons (STRING . STRING-POS), or nil if not a string.
POSITION should be a list of the form returned by the `event-start'
and `event-end' functions."
(nth 4 position))
(defsubst posn-image (position)
- "Return the image object of POSITION, or nil if a not an image.
+ "Return the image object of POSITION.
+Value is an list (image ...), or nil if not an image.
POSITION should be a list of the form returned by the `event-start'
and `event-end' functions."
(nth 7 position))
(defsubst posn-object (position)
"Return the object (image or string) of POSITION.
+Value is a list (image ...) for an image object, a cons cell
+\(STRING . STRING-POS) for a string object, and nil for a buffer position.
POSITION should be a list of the form returned by the `event-start'
and `event-end' functions."
(or (posn-image position) (posn-string position)))
@@ -1258,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
;;; Load history
-;;; (defvar symbol-file-load-history-loaded nil
-;;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller.")
-
-;;; (defun load-symbol-file-load-history ()
-;;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
-;;; That file records the part of `load-history' for preloaded files,
-;;; which is cleared out before dumping to make Emacs smaller."
-;;; (unless symbol-file-load-history-loaded
-;;; (load (expand-file-name
-;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
-;;; (if (eq system-type 'ms-dos)
-;;; "fns.el"
-;;; (format "fns-%s.el" emacs-version))
-;;; exec-directory)
-;;; ;; The file name fns-%s.el already has a .el extension.
-;;; nil nil t)
-;;; (setq symbol-file-load-history-loaded t)))
+;; (defvar symbol-file-load-history-loaded nil
+;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller.")
+
+;; (defun load-symbol-file-load-history ()
+;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
+;; That file records the part of `load-history' for preloaded files,
+;; which is cleared out before dumping to make Emacs smaller."
+;; (unless symbol-file-load-history-loaded
+;; (load (expand-file-name
+;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
+;; (if (eq system-type 'ms-dos)
+;; "fns.el"
+;; (format "fns-%s.el" emacs-version))
+;; exec-directory)
+;; ;; The file name fns-%s.el already has a .el extension.
+;; nil nil t)
+;; (setq symbol-file-load-history-loaded t)))
(defun symbol-file (symbol &optional type)
"Return the input source in which SYMBOL was defined.
@@ -1923,6 +1927,10 @@ a system-dependent default device name is used."
Otherwise, return nil."
(or (stringp object) (null object)))
+(defun booleanp (object)
+ "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
+ (memq object '(nil t)))
+
;;;; Support for yanking and text properties.
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index c5c5bc5ef03..fa8934aec9e 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1480,7 +1480,7 @@ in `selection-converter-alist', which see."
(re-search-forward
(mapconcat 'regexp-quote (split-string search-text) "\\|")
nil t)))))
- (raise-frame))
+ (select-frame-set-input-focus (selected-frame)))
(defun mac-ae-text (ae)
(or (cdr (mac-ae-parameter ae nil "TEXT"))
@@ -1911,9 +1911,10 @@ Switch to a buffer editing the last file dropped."
(dolist (file-name (nth 2 event))
(dnd-handle-one-url window 'private
(concat "file:" file-name))))
- (raise-frame))
+ (select-frame-set-input-focus (selected-frame)))
(global-set-key [drag-n-drop] 'mac-drag-n-drop)
+(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
;;;; Non-toolkit Scroll bars
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index ff1c1e48eb0..e4f0a3db545 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -103,6 +103,7 @@ CROSSREF-OPTIONAL lists in `bibtex-entry-field-alist' (which see)."
(choice :tag "Init" :value ""
string
function))))))
+(put 'bibtex-user-optional-fields 'risky-local-variable t)
(defcustom bibtex-entry-format
'(opts-or-alts required-fields numerical-fields)
@@ -3303,7 +3304,7 @@ Otherwise, use `set-buffer'. DISPLAY is t when called interactively."
(display (message "Key `%s' not found" key)))
found)
- (let* (case-fold-search
+ (let* ((case-fold-search t)
(pnt (save-excursion
(goto-char (or start (point-min)))
(if (re-search-forward (concat "^[ \t]*\\("
@@ -4330,11 +4331,12 @@ An error is signaled if point is outside key or BibTeX field."
"\n")
(goto-char endpos)))
-(defun bibtex-url (&optional pos)
+(defun bibtex-url (&optional pos no-browse)
"Browse a URL for the BibTeX entry at point.
Optional POS is the location of the BibTeX entry.
The URL is generated using the schemes defined in `bibtex-generate-url-list'
-\(see there\). Then the URL is passed to `browse-url'."
+\(see there\). Then the URL is passed to `browse-url' unless NO-BROWSE is nil.
+Return the URL or nil if none can be generated."
(interactive)
(save-excursion
(if pos (goto-char pos))
@@ -4369,8 +4371,10 @@ The URL is generated using the schemes defined in `bibtex-generate-url-list'
(error "Match failed: %s" field)))
(if fmt (apply 'format fmt (nreverse obj))
(apply 'concat (nreverse obj)))))
- (browse-url (message "%s" url))))
- (unless url (message "No URL known.")))))
+ (if (interactive-p) (message "%s" url))
+ (unless no-browse (browse-url url))))
+ (if (and (not url) (interactive-p)) (message "No URL known."))
+ url)))
;; Make BibTeX a Feature
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 312c73a380b..9218c565c97 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -48,7 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph."
"*Non-nil means put two spaces after a colon when filling."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'colon-double-space 'safe-local-variable t)
+;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp)
(defvar fill-paragraph-function nil
"Mode-specific function to fill a paragraph, or nil if there is none.
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 12359391f73..3c18eda2305 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <dominik at science dot uva dot nl>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.25
+;; Version: 4.26
;;
;; This file is part of GNU Emacs.
;;
@@ -79,8 +79,11 @@
;; excellent reference card made by Philip Rooke. This card can be found
;; in the etc/ directory of Emacs 22.
;;
-;; Changes since version 4.00:
+;; Changes since version 4.10:
;; ---------------------------
+;; Version 4.26
+;; - Bug fixes.
+;;
;; Version 4.25
;; - Revision of the font-lock faces section, with better tty support.
;; - TODO keywords in Agenda buffer are fontified.
@@ -119,60 +122,6 @@
;; `org-time-stamp-rounding-minutes'.
;; - Bug fixes (there are *always* more bugs).
;;
-;; Version 4.10
-;; - Bug fixes.
-;;
-;; Version 4.09
-;; - Bug fixes.
-;; - Small improvements to font-lock support.
-;; - MHE support finalized.
-;;
-;; Version 4.08
-;; - Bug fixes.
-;; - Improved MHE support
-;;
-;; Version 4.07
-;; - Bug fixes.
-;; - Leading stars in headlines can be hidden, so make the outline look
-;; cleaner.
-;; - Mouse-1 can be used to follow links.
-;;
-;; Version 4.06
-;; - HTML exporter treats targeted internal links.
-;; - Bug fixes.
-;;
-;; Version 4.05
-;; - Changes to internal link system (thanks to David Wainberg for ideas).
-;; - in-file links: [[Search String]] instead of <file:::Search String>
-;; - automatic links to "radio targets".
-;; - CamelCase not longer active by default, configure org-activate-camels
-;; if you want to turn it back on.
-;; - After following a link, `C-c &' jumps back to it.
-;; - MH-E link support (thanks to Thomas Baumann).
-;; - Special table lines are no longer exported.
-;; - Bug fixes and minor improvements.
-;;
-;; Version 4.04
-;; - Cleanup tags display in agenda.
-;; - Bug fixes.
-;;
-;; Version 4.03
-;; - Table alignment fixed for use with wide characters.
-;; - `C-c -' leaves cursor in current table line.
-;; - The current TAG can be incorporated into the agenda prefix.
-;; See option `org-agenda-prefix-format' for details.
-;;
-;; Version 4.02
-;; - Minor bug fixes and improvements around tag searches.
-;; - XEmacs compatibility fixes.
-;;
-;; Version 4.01
-;; - Tags can also be set remotely from agenda buffer.
-;; - Boolean logic for tag searches.
-;; - Additional agenda commands can be configured through the variable
-;; `org-agenda-custom-commands'.
-;; - Minor bug fixes.
-;;
;;; Code:
(eval-when-compile
@@ -188,7 +137,7 @@
;;; Customization variables
-(defvar org-version "4.25"
+(defvar org-version "4.26"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
@@ -198,7 +147,7 @@
;; of outline.el.
(defconst org-noutline-p (featurep 'noutline)
"Are we using the new outline mode?")
-(defconst org-xemacs-p (featurep 'xemacs)) ;; FIXME: used by external code?
+(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself
(defconst org-format-transports-properties-p
(let ((x "a"))
(add-text-properties 0 1 '(test t) x)
@@ -2383,7 +2332,10 @@ This face is only used if `org-fontify-done-headline' is set."
(defvar orgtbl-mode) ; defined later in this file
;;; Define the mode
-(defvar org-mode-map (copy-keymap outline-mode-map)
+(defvar org-mode-map
+ (if (and (not (keymapp outline-mode-map)) (featurep 'allout))
+ (error "Conflict with outdated version of allout.el. Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22.")
+ (copy-keymap outline-mode-map))
"Keymap for Org-mode.")
(defvar org-struct-menu) ; defined later in this file
@@ -7448,9 +7400,8 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
(org-add-props cmd nil
'face 'org-warning))))
(progn
- (message "Executing %s..." cmd)
- (shell-command cmd)
- (message "Executing %s...done" cmd))
+ (message "Executing %s" cmd)
+ (shell-command cmd))
(error "Abort"))))
(t
@@ -7904,8 +7855,7 @@ If the file does not exist, an error is thrown."
(setq cmd 'emacs))))
(cond
((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
-; (setq cmd (format cmd (concat "\"" file "\"")))
- ;; FIXME: normalize use of quotes
+ ;; Normalize use of quote, this can vary.
(if (string-match "['\"]%s['\"]" cmd)
(setq cmd (replace-match "'%s'" t t cmd)))
(setq cmd (format cmd file))
@@ -8958,10 +8908,10 @@ Optional argument NEW may specify text to replace the current field content."
e (not (= (match-beginning 2) (match-end 2))))
(setq f (format (if num " %%%ds %s" " %%-%ds %s")
l (if e "|" (setq org-table-may-need-update t) ""))
- n (format f s t t))
+ n (format f s))
(if new
- (if (<= (length new) l)
- (setq n (format f new t t)) ;; FIXME: why t t?????
+ (if (<= (length new) l) ;; FIXME: length -> str-width?
+ (setq n (format f new t t)) ;; FIXME: t t?
(setq n (concat new "|") org-table-may-need-update t)))
(or (equal n o)
(let (org-table-may-need-update)
@@ -12277,16 +12227,6 @@ stacked delimiters is N. Escaping delimiters is not possible."
(setq string (replace-match (match-string 1 string) t t string))))
string)
-;(defun org-export-html-convert-emphasize (string)
-; (let (c (s 0))
-; (while (string-match "\\(\\W\\|^\\)\\([*/_]\\)\\(\\w+\\)\\2\\(\\W\\|$\\)" string s)
-; (setq c (cdr (assoc (match-string 2 string)
-; '(("*" . "b") ("/" . "i") ("_" . "u"))))
-; s (+ (match-end 0) 3)
-; string (replace-match
-; (concat "\\1<" c ">\\3</" c ">\\4") t nil string)))
-; string))
-
(defun org-export-html-convert-emphasize (string)
(while (string-match org-italic-re string)
(setq string (replace-match "\\1<i>\\3</i>\\4" t nil string)))
@@ -12496,7 +12436,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
;; Finish the buffer off and clean it up.
(switch-to-buffer-other-window out)
- (indent-region (point-min) (point-max))
+ (indent-region (point-min) (point-max) nil)
(save-buffer)
(goto-char (point-min))
)))
@@ -12719,6 +12659,8 @@ a time), or the day by one (if it does not contain a time)."
(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright)
;; All the other keys
+
+(define-key org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up.
(define-key org-mode-map "\C-c$" 'org-archive-subtree)
(define-key org-mode-map "\C-c\C-j" 'org-goto)
(define-key org-mode-map "\C-c\C-t" 'org-todo)
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 6693be4e0c9..aac4cee4dd7 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -81,7 +81,7 @@ to paragraphs. The fill functions insert and delete only soft newlines."
(set-hard-newline-properties (point) (1+ (point)))))))))))
(defcustom paragraph-start "\f\\|[ \t]*$" "\
-*Regexp for beginning of a line that starts OR separates paragraphs.
+Regexp for beginning of a line that starts OR separates paragraphs.
This regexp should match lines that separate paragraphs
and should also match lines that start a paragraph
\(and are part of that paragraph).
@@ -107,7 +107,7 @@ hard newline are considered to match."
;; start a new paragraph).
(defcustom paragraph-separate "[ \t\f]*$"
- "*Regexp for beginning of a line that separates paragraphs.
+ "Regexp for beginning of a line that separates paragraphs.
If you change this, you may have to change `paragraph-start' also.
This is matched against the text at the left margin, which is not necessarily
@@ -119,7 +119,7 @@ text indented by a margin setting."
;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp)
(defcustom sentence-end-double-space t
- "*Non-nil means a single space does not end a sentence.
+ "Non-nil means a single space does not end a sentence.
This is relevant for filling. See also `sentence-end-without-period'
and `colon-double-space'.
@@ -128,10 +128,10 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'sentence-end-double-space 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp)
(defcustom sentence-end-without-period nil
- "*Non-nil means a sentence will end without a period.
+ "Non-nil means a sentence will end without a period.
For example, a sentence in Thai text ends with double space but
without a period.
@@ -140,21 +140,21 @@ regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
:group 'fill)
-;;;###autoload(put 'sentence-end-without-period 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp)
(defcustom sentence-end-without-space
"$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
- "*String of characters that end sentence without following spaces.
+ "String of characters that end sentence without following spaces.
This value is used by the function `sentence-end' to construct the
regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:group 'paragraphs
:type 'string)
-;;;###autoload(put 'sentence-end-without-space 'safe-local-variable t)
+;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp)
(defcustom sentence-end nil
- "*Regexp describing the end of a sentence.
+ "Regexp describing the end of a sentence.
The value includes the whitespace following the sentence.
All paragraph boundaries also end sentences, regardless.
@@ -166,7 +166,7 @@ to obtain the value of this variable."
;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
(defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*"
- "*Regexp matching the basic end of a sentence, not including following space."
+ "Regexp matching the basic end of a sentence, not including following space."
:group 'paragraphs
:type 'string
:version "22.1")
@@ -195,17 +195,17 @@ in between. See Info node `(elisp)Standard Regexps'."
"[ \t\n]*")))
(defcustom page-delimiter "^\014"
- "*Regexp describing line-beginnings that separate pages."
+ "Regexp describing line-beginnings that separate pages."
:group 'paragraphs
:type 'regexp)
-;;;###autoload(put 'page-delimiter 'safe-local-variable t)
+;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp)
(defcustom paragraph-ignore-fill-prefix nil
- "*Non-nil means the paragraph commands are not affected by `fill-prefix'.
+ "Non-nil means the paragraph commands are not affected by `fill-prefix'.
This is desirable in modes where blank lines are the paragraph delimiters."
:group 'paragraphs
:type 'boolean)
-;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable t)
+;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp)
(defun forward-paragraph (&optional arg)
"Move forward to end of paragraph.
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 07b5d1ca178..f4334fbbd70 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -948,7 +948,7 @@ Instead of nil or t, this may also be a string of type letters indicating
the label types for which it should be true."
:group 'reftex-referencing-labels
:type `(choice :tag "\\vref is default macro" ,@reftex-tmp))
-;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable t)
+;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
(defcustom reftex-fref-is-default nil
"*Non-nil means, the fancyref macro \\fref is used as default.
@@ -959,7 +959,7 @@ Instead of nil or t, this may also be a string of type letters indicating
the label types for which it should be true."
:group 'reftex-referencing-labels
:type `(choice :tag "\\fref is default macro" ,@reftex-tmp))
-;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable t)
+;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
(defcustom reftex-level-indent 2
"*Number of spaces to be used for indentation per section level."
@@ -975,7 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for
a label type. If you set this variable to nil, RefTeX will always prompt."
:group 'reftex-referencing-labels
:type 'boolean)
-;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable t)
+;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t))))
(defcustom reftex-format-ref-function nil
"Function which produces the string to insert as a reference.
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 2f6d860bd21..4a14a0197e8 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -164,7 +164,7 @@ Do not change `time-stamp-line-limit', `time-stamp-start',
incompatible with other people's files! If you must change them for some
application, do so in the local variables section of the time-stamped file
itself.")
-;;;###autoload(put 'time-stamp-start 'safe-local-variable t)
+;;;###autoload(put 'time-stamp-start 'safe-local-variable 'stringp)
(defvar time-stamp-end "\\\\?[\">]" ;Do not change!
"Regexp marking the text after the time stamp.
@@ -184,7 +184,7 @@ Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern',
or `time-stamp-inserts-lines' for yourself or you will be incompatible
with other people's files! If you must change them for some application,
do so in the local variables section of the time-stamped file itself.")
-;;;###autoload(put 'time-stamp-end 'safe-local-variable t)
+;;;###autoload(put 'time-stamp-end 'safe-local-variable 'stringp)
(defvar time-stamp-inserts-lines nil ;Do not change!
@@ -201,7 +201,7 @@ Do not change `time-stamp-end' or `time-stamp-inserts-lines' for
yourself or you will be incompatible with other people's files!
If you must change them for some application, do so in the local
variables section of the time-stamped file itself.")
-;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable t)
+;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable 'symbolp)
(defvar time-stamp-count 1 ;Do not change!
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 0a1d706a694..37d60441648 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -267,14 +267,20 @@ holds a keymap."
;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
(tool-bar-add-item-from-menu 'print-buffer "print")
- (tool-bar-add-item "preferences" 'customize 'customize
- :help "Edit preferences (customize)")
-
- (tool-bar-add-item "help" (lambda ()
- (interactive)
- (popup-menu menu-bar-help-menu))
- 'help
- :help "Pop up the Help menu")
+
+ ;; tool-bar-add-item-from-menu itself operates on
+ ;; (default-value 'tool-bar-map), but when we don't use that function,
+ ;; we must explicitly operate on the default value.
+
+ (let ((tool-bar-map (default-value 'tool-bar-map)))
+ (tool-bar-add-item "preferences" 'customize 'customize
+ :help "Edit preferences (customize)")
+
+ (tool-bar-add-item "help" (lambda ()
+ (interactive)
+ (popup-menu menu-bar-help-menu))
+ 'help
+ :help "Pop up the Help menu"))
)
(provide 'tool-bar)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 7d9e289e8e5..92bdf480e06 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * url-gw.el (url-open-stream): Don't hide errors.
+ (url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.
+
+ * url-handlers.el (url-insert): New function.
+ (url-insert-file-contents): Use it.
+
2006-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
* url-handlers.el (url-handler-directory-file-name): New handler.
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el
index 0cd2e6f9a50..878259927eb 100644
--- a/lisp/url/url-gw.el
+++ b/lisp/url/url-gw.el
@@ -118,8 +118,7 @@ linked Emacs under SunOS 4.x"
url-gateway-nslookup-program host))
(res host))
(set-process-query-on-exit-flag proc nil)
- (save-excursion
- (set-buffer (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
(while (memq (process-status proc) '(run open))
(accept-process-output proc))
(goto-char (point-min))
@@ -168,8 +167,7 @@ linked Emacs under SunOS 4.x"
(defun url-open-telnet (name buffer host service)
(if (not (stringp service))
(setq service (int-to-string service)))
- (save-excursion
- (set-buffer (get-buffer-create buffer))
+ (with-current-buffer (get-buffer-create buffer)
(erase-buffer)
(let ((proc (start-process name buffer "telnet" "-8"))
(case-fold-search t))
@@ -261,11 +259,15 @@ Will not make a connection if `url-gateway-unplugged' is non-nil."
(otherwise
(error "Bad setting of url-gateway-method: %s"
url-gateway-method)))))
- (error
- (setq conn nil)))
+ ;; Ignoring errors here seems wrong. E.g. it'll throw away the
+ ;; error signalled two lines above. It was also found inconvenient
+ ;; during debugging.
+ ;; (error
+ ;; (setq conn nil))
+ )
conn)))
(provide 'url-gw)
-;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
+;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
;;; url-gw.el ends here
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index 00fc415659e..6c6d85a1e03 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -216,33 +216,47 @@ accessible."
(url-copy-file url filename)
filename))
+(defun url-insert (buffer &optional beg end)
+ "Insert the body of a URL object.
+BUFFER should be a complete URL buffer as returned by `url-retrieve'.
+If the headers specify a coding-system, it is applied to the body before it is inserted.
+Returns a list of the form (SIZE CHARSET), where SIZE is the size in bytes
+of the inserted text and CHARSET is the charset that was specified in the header,
+or nil if none was found.
+BEG and END can be used to only insert a subpart of the body.
+They count bytes from the beginning of the body."
+ (let* ((handle (with-current-buffer buffer (mm-dissect-buffer t)))
+ (data (with-current-buffer (mm-handle-buffer handle)
+ (if beg
+ (buffer-substring (+ (point-min) beg)
+ (if end (+ (point-min) end) (point-max)))
+ (buffer-string))))
+ (charset (mail-content-type-get (mm-handle-type handle)
+ 'charset)))
+ (mm-destroy-parts handle)
+ (if charset
+ (insert (mm-decode-string data (mm-charset-to-coding-system charset)))
+ (insert data))
+ (list (length data) charset)))
+
;;;###autoload
(defun url-insert-file-contents (url &optional visit beg end replace)
- (let ((buffer (url-retrieve-synchronously url))
- (handle nil)
- (charset nil)
- (data nil))
+ (let ((buffer (url-retrieve-synchronously url)))
(if (not buffer)
(error "Opening input file: No such file or directory, %s" url))
(if visit (setq buffer-file-name url))
- (with-current-buffer buffer
- (setq handle (mm-dissect-buffer t))
- (set-buffer (mm-handle-buffer handle))
- (setq data (if beg (buffer-substring beg end)
- (buffer-string))))
- (kill-buffer buffer)
- (mm-destroy-parts handle)
- (if replace (delete-region (point-min) (point-max)))
(save-excursion
- (setq charset (mail-content-type-get (mm-handle-type handle)
- 'charset))
- (let ((start (point)))
- (if charset
- (insert (mm-decode-string data (mm-charset-to-coding-system charset)))
- (progn
- (insert data)
- (decode-coding-inserted-region start (point) url visit beg end replace)))))
- (list url (length data))))
+ (let* ((start (point))
+ (size-and-charset (url-insert buffer beg end)))
+ (kill-buffer buffer)
+ (when replace
+ (delete-region (point-min) start)
+ (delete-region (point) (point-max)))
+ (unless (cadr size-and-charset)
+ ;; If the headers don't specify any particular charset, use the
+ ;; usual heuristic/rules that we apply to files.
+ (decode-coding-inserted-region start (point) url visit beg end replace))
+ (list url (car size-and-charset))))))
(defun url-file-name-completion (url directory)
(error "Unimplemented"))