summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-03-06 16:22:16 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2011-03-06 16:22:16 -0500
commit0d6459dfb52188481bfd6bb53f1b2f653ecd6a5d (patch)
tree306b87fc2903ad23343f3c84be1cccfa72e5a97e /lisp
parent798cb64441228d473f7bdd213183c70fb582595c (diff)
parent892777baa1739fa5f1f2d1c2975488c3e6f57bae (diff)
downloademacs-0d6459dfb52188481bfd6bb53f1b2f653ecd6a5d.tar.gz
Merge from trunk
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog.102
-rw-r--r--lisp/ChangeLog.129
-rw-r--r--lisp/ChangeLog.310
-rw-r--r--lisp/ChangeLog.trunk888
-rw-r--r--lisp/allout-widgets.el2
-rw-r--r--lisp/allout.el16
-rw-r--r--lisp/bookmark.el3
-rw-r--r--lisp/calc/calc-ext.el19
-rw-r--r--lisp/calc/calc-math.el2
-rw-r--r--lisp/calc/calc-units.el276
-rw-r--r--lisp/calc/calc-vec.el13
-rw-r--r--lisp/calc/calc.el5
-rw-r--r--lisp/calendar/cal-hebrew.el47
-rw-r--r--lisp/cedet/semantic/analyze.el2
-rw-r--r--lisp/cedet/semantic/complete.el2
-rw-r--r--lisp/cedet/semantic/edit.el4
-rw-r--r--lisp/cedet/semantic/format.el2
-rw-r--r--lisp/cedet/semantic/java.el2
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/desktop.el3
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/dired-x.el251
-rw-r--r--lisp/dired.el31
-rw-r--r--lisp/emacs-lisp/assoc.el10
-rw-r--r--lisp/emacs-lisp/autoload.el16
-rw-r--r--lisp/emacs-lisp/bytecomp.el1
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el18
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/emacs-lisp/elp.el2
-rw-r--r--lisp/emacs-lisp/ert.el62
-rw-r--r--lisp/emacs-lisp/ewoc.el2
-rw-r--r--lisp/emacs-lisp/package-x.el89
-rw-r--r--lisp/emacs-lisp/package.el124
-rw-r--r--lisp/emacs-lisp/pcase.el129
-rw-r--r--lisp/emacs-lock.el3
-rw-r--r--lisp/emulation/viper-cmd.el4
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/ChangeLog.016
-rw-r--r--lisp/erc/erc-track.el4
-rw-r--r--lisp/eshell/em-alias.el7
-rw-r--r--lisp/eshell/em-banner.el11
-rw-r--r--lisp/eshell/em-cmpl.el3
-rw-r--r--lisp/eshell/em-dirs.el5
-rw-r--r--lisp/eshell/em-glob.el3
-rw-r--r--lisp/eshell/em-hist.el7
-rw-r--r--lisp/eshell/em-ls.el12
-rw-r--r--lisp/eshell/em-pred.el3
-rw-r--r--lisp/eshell/em-prompt.el3
-rw-r--r--lisp/eshell/em-rebind.el3
-rw-r--r--lisp/eshell/em-script.el3
-rw-r--r--lisp/eshell/em-smart.el3
-rw-r--r--lisp/eshell/em-term.el3
-rw-r--r--lisp/eshell/em-unix.el13
-rw-r--r--lisp/eshell/esh-arg.el3
-rw-r--r--lisp/eshell/esh-cmd.el45
-rw-r--r--lisp/eshell/esh-ext.el7
-rw-r--r--lisp/eshell/esh-io.el3
-rw-r--r--lisp/eshell/esh-mode.el114
-rw-r--r--lisp/eshell/esh-module.el6
-rw-r--r--lisp/eshell/esh-proc.el34
-rw-r--r--lisp/eshell/esh-test.el233
-rw-r--r--lisp/eshell/esh-util.el19
-rw-r--r--lisp/eshell/esh-var.el35
-rw-r--r--lisp/eshell/eshell.el20
-rw-r--r--lisp/facemenu.el24
-rw-r--r--lisp/files-x.el22
-rw-r--r--lisp/files.el147
-rw-r--r--lisp/find-file.el4
-rw-r--r--lisp/generic-x.el12
-rw-r--r--lisp/gnus/ChangeLog223
-rw-r--r--lisp/gnus/auth-source.el408
-rw-r--r--lisp/gnus/gnus-agent.el14
-rw-r--r--lisp/gnus/gnus-art.el48
-rw-r--r--lisp/gnus/gnus-demon.el2
-rw-r--r--lisp/gnus/gnus-gravatar.el3
-rw-r--r--lisp/gnus/gnus-group.el17
-rw-r--r--lisp/gnus/gnus-msg.el13
-rw-r--r--lisp/gnus/gnus-range.el8
-rw-r--r--lisp/gnus/gnus-start.el28
-rw-r--r--lisp/gnus/gnus-sum.el18
-rw-r--r--lisp/gnus/gnus-uu.el30
-rw-r--r--lisp/gnus/gnus.el11
-rw-r--r--lisp/gnus/message.el172
-rw-r--r--lisp/gnus/nnimap.el41
-rw-r--r--lisp/gnus/nnir.el26
-rw-r--r--lisp/gnus/nnmail.el3
-rw-r--r--lisp/gnus/nntp.el2
-rw-r--r--lisp/gnus/sieve.el103
-rw-r--r--lisp/help-fns.el23
-rw-r--r--lisp/help-mode.el15
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/image-dired.el2
-rw-r--r--lisp/international/ja-dic-cnv.el2
-rw-r--r--lisp/international/mule-cmds.el4
-rw-r--r--lisp/international/titdic-cnv.el7
-rw-r--r--lisp/isearch.el3
-rw-r--r--lisp/mail/mailclient.el2
-rw-r--r--lisp/mail/mailheader.el2
-rw-r--r--lisp/mail/rmail.el16
-rw-r--r--lisp/mail/rmailmm.el45
-rw-r--r--lisp/mail/sendmail.el8
-rw-r--r--lisp/man.el56
-rw-r--r--lisp/mh-e/ChangeLog5
-rw-r--r--lisp/mh-e/mh-funcs.el4
-rw-r--r--lisp/mh-e/mh-mime.el4
-rw-r--r--lisp/net/ange-ftp.el2
-rw-r--r--lisp/net/browse-url.el7
-rw-r--r--lisp/net/rcirc.el109
-rw-r--r--lisp/net/soap-client.el21
-rw-r--r--lisp/net/soap-inspect.el3
-rw-r--r--lisp/net/tramp-cache.el3
-rw-r--r--lisp/net/tramp-cmds.el6
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/obsolete/fast-lock.el3
-rw-r--r--lisp/obsolete/sym-comp.el2
-rw-r--r--lisp/org/ChangeLog422
-rw-r--r--lisp/org/org-id.el3
-rw-r--r--lisp/org/org.el44
-rw-r--r--lisp/outline.el5
-rw-r--r--lisp/password-cache.el7
-rw-r--r--lisp/printing.el8
-rw-r--r--lisp/progmodes/ada-prj.el2
-rw-r--r--lisp/progmodes/cc-engine.el2766
-rw-r--r--lisp/progmodes/cperl-mode.el16
-rw-r--r--lisp/progmodes/ebnf2ps.el16
-rw-r--r--lisp/progmodes/grep.el6
-rw-r--r--lisp/progmodes/gud.el2
-rw-r--r--lisp/progmodes/idlwave.el4
-rw-r--r--lisp/progmodes/prolog.el4
-rw-r--r--lisp/progmodes/sql.el5
-rw-r--r--lisp/progmodes/vhdl-mode.el8
-rw-r--r--lisp/ps-print.el3
-rw-r--r--lisp/recentf.el15
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/saveplace.el3
-rw-r--r--lisp/shell.el4
-rw-r--r--lisp/speedbar.el2
-rw-r--r--lisp/term/screen.el11
-rw-r--r--lisp/textmodes/artist.el50
-rw-r--r--lisp/textmodes/paragraphs.el2
-rw-r--r--lisp/textmodes/reftex.el7
-rw-r--r--lisp/textmodes/sgml-mode.el7
-rw-r--r--lisp/time.el2
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-init.el4
-rw-r--r--lisp/vc/emerge.el8
-rw-r--r--lisp/vc/vc-bzr.el89
-rw-r--r--lisp/vc/vc-dir.el7
-rw-r--r--lisp/vc/vc-rcs.el12
-rw-r--r--lisp/vc/vc-svn.el4
-rw-r--r--lisp/vc/vc.el4
-rw-r--r--lisp/window.el23
152 files changed, 4535 insertions, 3464 deletions
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 83ee20fa497..1c2f2b5b015 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -20591,7 +20591,7 @@
* viper-cmd.el (viper-change-state): Got rid of make-local-hook.
(viper-special-read-and-insert-char): Make C-m work right in the r
- comand.
+ command.
(viper-buffer-search-enable): Fixed format string.
* viper-ex.el (ex-token-alist): Use ex-set-visited-file-name
diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12
index d2f7cab27f0..35572bd6105 100644
--- a/lisp/ChangeLog.12
+++ b/lisp/ChangeLog.12
@@ -10699,9 +10699,6 @@
output of the next command. Reported by M Jared Finder
<jared@hpalace.com>.
- * net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
- for `process-file', in order to let it work for older Emacsen too.
-
2006-04-17 Ralf Angeli <angeli@iwi.uni-sb.de>
* textmodes/tex-mode.el (tex-font-lock-match-suscript): New function.
@@ -11678,7 +11675,7 @@
make underlining work for wide characters.
(org-goto-map, org-agenda-mode-map, org-mode-map): Explicitly bind
TAB to `org-cycle', to make sure that no binding in
- `outline-mode-map' can supercede it.
+ `outline-mode-map' can supersede it.
2006-03-14 Ken Manheimer <ken.manheimer@gmail.com>
@@ -19139,7 +19136,7 @@
* pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
pgg-decrypt-region.
(pgg-pending-timers): A new hash for tracking the passphrase cache
- timers, so that new ones supercede old ones.
+ timers, so that new ones supersede old ones.
(pgg-add-passphrase-to-cache): Rename from
`pgg-add-passphrase-cache' to reduce confusion (all callers
changed). Modified to cancel old timers when new ones are added.
@@ -19225,7 +19222,7 @@
* pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
pgg-decrypt-region.
(pgg-pending-timers): A new hash for tracking the passphrase cache
- timers, so that new ones supercede old ones.
+ timers, so that new ones supersede old ones.
(pgg-add-passphrase-to-cache): Rename from
`pgg-add-passphrase-cache' to reduce confusion (all callers
changed). Modified to cancel old timers when new ones are added.
diff --git a/lisp/ChangeLog.3 b/lisp/ChangeLog.3
index b54580ff0bc..8cafac2c0c4 100644
--- a/lisp/ChangeLog.3
+++ b/lisp/ChangeLog.3
@@ -4906,7 +4906,7 @@
* two-column.el: Doc fixes.
* loaddefs.el (function-keymap): Definition deleted; this has been
- superceded by function-key-map.
+ superseded by function-key-map.
* gomoku.el (gomoku-mode-map): Use function key symbols, instead
of the keypad.el facilities.
@@ -6056,7 +6056,7 @@
and `fill-column'. Code now actually sets `left-margin' and
`fill-column', as advertised.
* text-mode.el (change-log-mode): Function deleted, since it's
- been superceded by the one in add-log.el.
+ been superseded by the one in add-log.el.
1992-06-14 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -6070,7 +6070,7 @@
1992-06-12 Jim Blandy (jimb@pogo.cs.oberlin.edu)
- * isearch-mode.el: New package, which will probably supercede
+ * isearch-mode.el: New package, which will probably supersede
isearch.el.
(isearch-mode-map, isearch-mode-meta-map): When initializing
these, remember that vectors are no longer keymaps.
@@ -10009,7 +10009,7 @@
display-time-string.
(rmail-pop-up): Default display-time-hook to automatically retrieve
new mail if the variable rmail-pop-up is non-nil.
- (add-clock-handler): Removed; superceded by timer.el.
+ (add-clock-handler): Removed; superseded by timer.el.
* loaddefs.el: Removed add-clock-handler.
@@ -10032,7 +10032,7 @@
* loaddefs.el: Autoload for diff.
- * files.el (diff): Superceded by diff.el.
+ * files.el (diff): Superseded by diff.el.
(diff-switches-function): Still needs to be merged into diff.el.
* diff.el: New file.
diff --git a/lisp/ChangeLog.trunk b/lisp/ChangeLog.trunk
index 05c765e0881..e4d402afa76 100644
--- a/lisp/ChangeLog.trunk
+++ b/lisp/ChangeLog.trunk
@@ -1,3 +1,530 @@
+2011-03-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * isearch.el (isearch-mode-map): Bind C-y to isearch-yank-kill,
+ and move isearch-yank-line to M-s C-e (Bug#8183).
+
+2011-03-06 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-engine.el (c-guess-basic-syntax): Reindent.
+ (c-guess-basic-syntax): Move CASE 19 to a different place,
+ correctly to process template-args-cont lines.
+
+2011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-ext.el (calc-init-extensions): Rename
+ calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel
+ and calc-nplevel, respectively. Add keybindings for calc-spn,
+ calc-midi and calc-freq. Add autoloads for calcFunc-spn,
+ calcFunc-midi, calcFunc-freq, calc-spn, calc-midi and calc-freq.
+
+ * calc/calc-units.el (calc-dblevel): Rename from
+ calc-logunits-dblevel.
+ (calc-nplevel): Rename from calc-logunits-nplevel.
+ (math-midi-round, math-freqp, math-midip, math-spnp)
+ (math-spn-to-midi, math-midi-to-spn, math-freq-to-spn)
+ (math-midi-to-freq, math-spn-to-freq, calcFunc-spn, calcFunc-midi)
+ (calcFunc-freq, calc-freq, calc-midi, calc-spn): New functions.
+ (math-notes): New variable.
+
+ * calc/calc.el (calc-note-threshold): New variable.
+
+2011-03-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * emacs-lisp/package.el (package-archives): Accept either ordinary
+ directory names, in addition to HTTP URLs.
+ (package--with-work-buffer): New macro. Handle normal directories.
+ (package-handle-response): Don't display the failing buffer.
+ (package-download-single, package-download-tar)
+ (package--download-one-archive): Use package--with-work-buffer.
+ (package-archive-base): Rename from package-archive-url.
+
+2011-03-06 Glenn Morris <rgm@gnu.org>
+
+ * generic-x.el (generic-unix-modes): Add xmodmap-generic-mode.
+ (xmodmap-generic-mode): Respect generic-extras-enable-list.
+
+2011-03-06 Daniel Clemente <dcl441-bugs@yahoo.com> (tiny change)
+
+ * generic-x.el (xmodmap-generic-mode): New. (Bug#2065)
+
+2011-03-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * allout.el (allout-init, allout-prefixed-keybindings)
+ (allout-unprefixed-keybindings):
+ * progmodes/prolog.el (prolog-find-term):
+ Fix typos in docstrings.
+
+2011-03-06 Nikolaj Schumacher <me@nschum.de> (tiny change)
+
+ * emacs-lisp/elp.el (elp-results): Fix off-by-one in header. (Bug#2746)
+
+2011-03-06 Kevin Ryde <user42@zip.com.au>
+
+ * textmodes/sgml-mode.el (sgml-fill-nobreak): Give it a doc. (Bug#5326)
+
+2011-03-06 Michael Shields <shields@msrl.com> (tiny change)
+
+ * window.el (one-window-p, walk-windows, display-buffer):
+ Doc fixes. (Bug#5567)
+
+2011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * cus-edit.el (custom-prompt-variable): Use the `custom-get' property
+ of the variable if it exists.
+
+2011-03-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * bookmark.el:
+ * desktop.el:
+ * emacs-lock.el:
+ * ps-print.el:
+ * saveplace.el:
+ * net/tramp-cache.el:
+ * obsolete/fast-lock.el:
+ * textmodes/reftex.el:
+ Don't set `kill-emacs-hook' on noninteractive sessions (bug#8137).
+
+2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * files.el (delete-directory, copy-directory, list-directory):
+ Use read-directory-name.
+
+ * find-file.el (ff-find-the-other-file):
+ * net/ange-ftp.el (ange-ftp-make-directory):
+ * printing.el (pr-interactive-dir):
+ * progmodes/ada-prj.el (ada-prj-load-directory):
+ * progmodes/ebnf2ps.el (ebnf-print-directory)
+ (ebnf-spool-directory, ebnf-eps-directory)
+ (ebnf-syntax-directory):
+ * shell.el (shell):
+ * speedbar.el (speedbar-create-directory):
+ * vc/emerge.el (emerge-merge-directories):
+ * vc/vc-dir.el (vc-dir):
+ * vc/vc.el (vc-create-tag, vc-retrieve-tag): Likewise.
+
+2011-03-05 Chong Yidong <cyd@stupidchicken.com>
+
+ * help-mode.el (help-buffer): If we are to return the current
+ buffer, signal an error if it's not in Help mode (Bug#8147).
+
+2011-03-05 Reuben Thomas <rrt@sc3d.org>
+
+ * files.el (file-name-version-regexp): Handle backup files of the
+ form `foo.js.~HEAD~1~' (Bug#8159).
+
+2011-03-05 Glenn Morris <rgm@gnu.org>
+
+ * eshell/esh-var.el: Don't require esh-test when compiling.
+ * eshell/em-banner.el, eshell/esh-cmd.el, eshell/esh-mode.el:
+ * eshell/esh-var.el, eshell/eshell.el: Move tests to esh-test.
+ * eshell/esh-test.el: Move to ../../test/eshell.el.
+
+2011-03-05 David Engster <deng@randomsample.de>
+
+ * files.el (save-some-buffers): Report the names of buffers saved
+ automatically due to buffer-save-without-query (Bug#8134).
+
+2011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
+
+ * net/rcirc.el: Add QuakeNet authentication support.
+ (rcirc-authinfo, rcirc-check-auth-status)
+ (rcirc-authenticate): Support QuakeNet.
+
+2011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
+
+ * net/rcirc.el: Add functionality to authenticate before
+ autojoining channels.
+ (rcirc-authenticate-before-join): New option.
+ (rcirc-authenticated-hook): New variable.
+ (rcirc-connect): Make local variable rcirc-user-authenticated.
+ (rcirc-handler-001): Respect rcirc-authenticate-before-join.
+ (rcirc-check-auth-status, rcirc-join-channels-post-auth):
+ New functions.
+ (rcirc-handler-PRIVMSG, rcirc-handler-NOTICE):
+ Call rcirc-check-auth-status.
+
+2011-03-05 Alex Harsanyi <AlexHarsanyi@gmail.com>
+
+ * net/soap-client.el (soap-namespace-put-link): Check if the target
+ name is fully qualified -- use only the name part.
+ (soap-parse-complex-type, soap-parse-sequence): Recognize xsd:all
+ types, treated the same as xsd:sequence. (Bug#8166)
+
+2011-03-05 Eli Zaretskii <eliz@gnu.org>
+
+ * files.el (find-file-noselect): Don't ask about re-visiting
+ non-literally if the file is already visited in image-mode.
+ (Bug#8177)
+
+2011-03-05 Glenn Morris <rgm@gnu.org>
+
+ * eshell/esh-mode.el (eshell-kill-buffer-function): New function.
+ (eshell-mode): Use eshell-kill-buffer-function.
+ Run the -initialize functions independently of the -load-hooks.
+ * eshell/esh-proc.el (eshell-kill-process-function): New function.
+ (eshell-gather-process-output, eshell-sentinel)
+ (eshell-interrupt-process, eshell-kill-process, eshell-quit-process):
+ Use eshell-kill-process-function.
+ * eshell/em-alias.el (eshell-alias-load-hook):
+ * eshell/em-banner.el (eshell-banner-load-hook):
+ * eshell/em-cmpl.el (eshell-cmpl-load-hook):
+ * eshell/em-dirs.el (eshell-dirs-load-hook):
+ * eshell/em-glob.el (eshell-glob-load-hook):
+ * eshell/em-hist.el (eshell-hist-load-hook):
+ * eshell/em-pred.el (eshell-pred-load-hook):
+ * eshell/em-prompt.el (eshell-prompt-load-hook):
+ * eshell/em-rebind.el (eshell-rebind-load-hook):
+ * eshell/em-script.el (eshell-script-load-hook):
+ * eshell/em-smart.el (eshell-smart-load-hook):
+ * eshell/em-term.el (eshell-term-load-hook):
+ * eshell/em-unix.el (eshell-unix-load-hook):
+ * eshell/esh-arg.el (eshell-arg-load-hook):
+ * eshell/esh-cmd.el (eshell-cmd-load-hook):
+ * eshell/esh-ext.el (eshell-ext-load-hook):
+ * eshell/esh-io.el (eshell-io-load-hook):
+ * eshell/esh-mode.el (eshell-exit-hook):
+ * eshell/esh-proc.el (eshell-proc-load-hook, eshell-kill-hook):
+ * eshell/esh-var.el (eshell-var-load-hook):
+ Set default hook values to nil. (Bug#5375)
+
+ * eshell/esh-module.el (eshell-module-unload-hook)
+ (eshell-modules-list): Remove leading * from defcustom docs.
+
+ * eshell/esh-util.el (eshell-for): Make it obsolete.
+ * eshell/em-alias.el (eshell/alias, eshell-alias-completions):
+ * eshell/em-dirs.el (eshell-save-some-last-dir):
+ * eshell/em-hist.el (eshell-save-some-history)
+ (eshell-hist-parse-modifier):
+ * eshell/em-ls.el (eshell-ls-dir, eshell-ls-files)
+ (eshell-ls-entries):
+ * eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
+ * eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval)
+ (eshell/which):
+ * eshell/esh-ext.el (eshell-find-interpreter):
+ * eshell/esh-mode.el (eshell-mode):
+ * eshell/esh-module.el (eshell-unload-extension-modules):
+ * eshell/esh-proc.el (eshell-process-interact):
+ * eshell/esh-test.el (eshell-test):
+ * eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
+ * eshell/esh-var.el (eshell/env, eshell-environment-variables)
+ (eshell-variables-list):
+ * eshell/eshell.el (eshell-unload-all-modules):
+ Replace eshell-for with dolist.
+
+2011-03-04 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-bzr.el (vc-bzr-after-dir-status): Handle bzr 2.3.0. (Bug#8170)
+
+2011-03-04 Tom Tromey <tromey@redhat.com>
+
+ * progmodes/gud.el (gdb-script-mode): Derive from prog-mode.
+
+2011-03-04 Glenn Morris <rgm@gnu.org>
+
+ * outline.el (outline-regexp): No longer allow nil.
+ (outline-heading-end-regexp): Add safety predicate. (Bug#7619)
+
+ * net/browse-url.el (browse-url):
+ Handle deleted default-directory. (Bug#6077)
+
+ * recentf.el (recentf-include-p): In case of a buggy predicate,
+ err on the side of including, not excluding. (Bug#5843)
+
+2011-03-04 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-units.el (math-to-standard-rec): Don't treat subscripted
+ variables as units.
+
+2011-03-04 Bob Rogers <rogers@rgrjr.dyndns.org>
+
+ * emacs-lisp/ewoc.el (ewoc-goto-next): Give a more explicit error
+ if there is no node. (Bug#3261)
+
+2011-03-04 Leo <sdl.web@gmail.com>
+
+ * vc/diff-mode.el (diff-mode): Fix whitespace-style. (Bug#8139)
+
+ * time.el (display-time-world-list): Fix typo. (Bug#7571)
+
+2011-03-04 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
+
+ * cus-edit.el (custom-buffer-create-internal):
+ Split search string before passing it to `customize-apropos' (bug#8136).
+
+2011-03-04 Drew Adams <drew.adams@oracle.com>
+
+ * image-dired.el (image-dired-cmd-read-exif-data-options):
+ Fix typo in docstring (bug#8156).
+
+2011-03-03 Deniz Dogan <deniz.a.m.dogan@gmail.com>
+
+ * net/rcirc.el (rcirc-cmd-join): Accept comma-separated input.
+
+2011-03-03 Christian Ohler <ohler@gnu.org>
+
+ * emacs-lisp/ert.el (ert--explain-equal): New function.
+ (ert--explain-equal-rec): Renamed from `ert--explain-not-equal'.
+ All callers changed.
+ (ert--explain-equal-including-properties): Renamed from
+ `ert--explain-not-equal-including-properties'. All callers
+ changed.
+
+2011-03-03 Christian Ohler <ohler@gnu.org>
+
+ * emacs-lisp/ert.el (ert--stats-set-test-and-result)
+ (ert-char-for-test-result, ert-string-for-test-result)
+ (ert-run-tests-batch, ert--print-test-for-ewoc):
+ Handle `ert-test-quit'.
+
+2011-03-03 David Abrahams <dave@boostpro.com> (tiny change)
+
+ * vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs):
+ Move ediff-defvar-local calls after defcustoms. (Bug#1821)
+
+2011-03-03 Glenn Morris <rgm@gnu.org>
+
+ * files.el (file-truename): Doc fix. (Bug#2341)
+
+2011-03-03 Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
+
+ * vc/vc-dir.el (vc-dir-mode-map): Bind vc-dir-find-file to e (Bug#7349).
+
+2011-03-03 Vagn Johansen <gonz808@hotmail.com> (tiny change)
+
+ * vc/vc-svn.el (vc-svn-after-dir-status): Some MS Windows svn client
+ programs output backslashes. (Bug#7663)
+
+2011-03-03 Glenn Morris <rgm@gnu.org>
+
+ * mail/sendmail.el (mail-mode-map): Remove mail-sent-via.
+ (mail-mode): Remove mail-sent-via from the doc.
+ (mail-sent-via): Make it obsolete. (Bug#1776)
+
+ * progmodes/grep.el (grep-highlight-matches): Doc fix.
+ (grep-process-setup): No highlighting without font-lock. (Bug#8084)
+
+ * vc/vc-bzr.el (vc-bzr-state-heuristic): Handle dirstate entries
+ with no parents. (Bug#8025)
+
+2011-03-02 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * password-cache.el (password-in-cache-p): Add autoload.
+
+2011-03-02 Glenn Morris <rgm@gnu.org>
+
+ * man.el (Man-support-local-filenames): Also handle Red Hat's man.
+ * dired-x.el (Man-support-local-filenames): Autoload it.
+ (dired-guess-shell-alist-default): Also handle Red Hat's man.
+
+ * dired-x.el (dired-default-directory-alist, dired-default-directory):
+ Mark as obsolete.
+ (dired-smart-shell-command): Just call dired-current-directory.
+
+ * dired-x.el (dired-jump-other-window): Add autoload.
+ (dired-default-directory-alist, dired-default-directory): Doc fixes.
+ (dired-default-directory-alist): Mark as risky.
+
+ * dired-x.el (dired-omit-here-always): Make it obsolete.
+
+2011-03-02 Chong Yidong <cyd@stupidchicken.com>
+
+ * textmodes/artist.el (artist-curr-go): Default to pen-line.
+ (artist-select-op-pen-line): New function.
+ (artist-menu-map): New variable.
+ (artist-mode-map): Add a menu to the menu-bar.
+
+2011-03-02 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-math.el (calcFunc-log10): Check for symbolic mode
+ when evaluating.
+
+ * calc/calc-units.el (math-conditional-apply, math-conditional-pow):
+ New function.
+ (math-logunits-add, math-logunits-mul, math-logunits-divide):
+ (math-logunits-quant, math-logunits-level):
+ Use `math-conditional-apply' and `math-conditional-pow' to evaluate
+ functions.
+ (math-logunits-level): Extract units from ratio.
+
+2011-03-01 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs-lisp/cl-macs.el (lexical-let*): Fix argument name in docstring.
+
+2011-03-01 Glenn Morris <rgm@gnu.org>
+
+ * calendar/cal-hebrew.el (calendar-hebrew-birthday)
+ (diary-hebrew-birthday): Rename and rework functions added
+ in previous change.
+
+2011-03-01 Ed Reingold <reingold@emr.cs.iit.edu>
+
+ * calendar/cal-hebrew.el (hebrew-calendar-birthday)
+ (diary-hebrew-birthday): New functions.
+
+2011-03-01 Glenn Morris <rgm@gnu.org>
+
+ * dired.el (dired-safe-switches-p): Beef it up.
+ (dired-actual-switches): Use it for the safe-local prop. (Bug#3230)
+
+2011-03-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * dired.el (dired-safe-switches-p): New function.
+
+2011-03-01 Glenn Morris <rgm@gnu.org>
+
+ * files.el (dir-locals-collect-variables):
+ Add the ability to exclude subdirectories. (Bug#8100)
+
+ * dired-x.el (dired-omit-here-always): Add `(subdirs . nil)' to locals.
+
+2011-02-28 Christoph Scholtes <cschol2112@googlemail.com>
+
+ * ido.el (ido-everywhere): Doc fix.
+ (ido-mode): Doc fix.
+
+2011-02-28 Glenn Morris <rgm@gnu.org>
+
+ * dired-x.el (dired-guess-shell-alist-default): Use \\', not $.
+
+2011-02-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cmds.el (tramp-append-tramp-buffers): Dump load-path
+ shadows.
+
+2011-02-28 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * dired-x.el (dired-guess-shell-alist-default): Add rar and 7z.
+
+2011-02-28 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs-lisp/pcase.el (pcase, pcase--u1, pcase--q1):
+ Fix typos in docstrings.
+
+2011-02-28 Stephen Berman <stephen.berman@gmx.net>
+
+ * dired-aux.el (dired-update-file-line):
+ Fix 2010-11-09 change. (Bug#8131)
+
+2011-02-28 Eli Zaretskii <eliz@gnu.org>
+
+ * international/mule-cmds.el (set-default-coding-systems): Use the
+ -unix variant of encoding in default-keyboard-coding-system.
+ (Bug#8122)
+
+2011-02-27 Chong Yidong <cyd@stupidchicken.com>
+
+ * facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
+
+2011-02-27 Prestoo Ten <prestooten@gmail.com> (tiny change)
+
+ * term/screen.el: New file (Bug#2650).
+
+2011-02-27 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/pcase.el (pcase--if): Try to invert test to reduce depth.
+ (pcase-mutually-exclusive-predicates): New var.
+ (pcase--split-consp, pcase--split-pred): Use it.
+ (pcase--split-equal, pcase--split-member): When splitting against
+ a pure predicate, run it to know the outcome.
+ (pcase--u1): Mark vars that are actually used.
+ (pcase--q1): Avoid introducing unused vars.
+
+2011-02-27 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-ext.el (calc-init-extensions):
+ Autoload `calc-l-prefix-help' instead of `calc-ul-prefix-help'.
+
+ * calc/calc-math.el (calcFunc-log10): Don't signal an error in
+ symbolic mode.
+
+ * calc/calc-vec.el (calcFunc-subscr): Return nil if the first
+ argument is a variable.
+
+2011-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/assoc.el: Remove misleading `sort' (bug#8126).
+ (aput, adelete, amake): Replace `eval' -> `symbol-value'.
+ Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
+
+2011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * password-cache.el (password-in-cache-p): Convenience function to
+ check if a key is in the cache, even if the value is nil.
+
+2011-02-25 Jambunathan K <kjambunathan@gmail.com>
+
+ * emacs-lisp/package-x.el (package--archive-contents-from-url)
+ (package--archive-contents-from-file): New functions.
+ (package-update-news-on-upload): New var.
+ (package-upload-buffer-internal): Extract archive-contents from
+ package-archive-upload-base if it is not found at archive-url.
+ Obey package-update-news-on-upload.
+ (package-upload-buffer, package-upload-file): Doc fix.
+
+2011-02-24 Glenn Morris <rgm@gnu.org>
+
+ * files-x.el (modify-dir-local-variable): Handle dir-locals from
+ the cache, and from non-file sources.
+
+ * help-fns.el (describe-variable): Return consistent results when a
+ dir-local from a file came from the cache or did not. (Bug#8095)
+ If a dir-local has no associated file, say it came from a "directory".
+
+ * files.el (hack-dir-local-variables): Fix setting of `dir-name'.
+ (hack-local-variables-confirm, hack-local-variables-filter): Doc fix.
+
+ * files.el (dir-locals-find-file): Doc fix.
+ Fix the check for cache elements that have no associated file,
+ and the mtime check for those that do. (Bug#8095)
+
+ * dired-x.el (dired-hack-local-variables):
+ Handle interrupts during hacking local variables. (Bug#5216)
+
+ * emacs-lisp/autoload.el (autoload-save-buffers)
+ (autoload-find-destination, update-directory-autoloads):
+ Avoid prompts when updating autoloads.
+
+2011-02-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete.
+
+2011-02-23 Kenichi Handa <handa@m17n.org>
+
+ * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an
+ error when a multipart boundary in the nested multipart is found.
+
+ * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of
+ header components.
+
+2011-02-23 Glenn Morris <rgm@gnu.org>
+
+ * dired.el (dired-mode): Call hack-dir-local-variables-non-file-buffer.
+ * dired-x.el (dired-omit-mode): Safe if boolean.
+ (dired-enable-local-variables): Fix doc and custom type.
+ (dired-enable-local-variables, dired-local-variables-file)
+ (dired-hack-local-variables): Make obsolete.
+ (dired-omit-here-always): Use dir-locals.el instead.
+
+ * files.el (safe-local-eval-forms): Add the write-file-hooks version.
+
+2011-02-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * help-fns.el (describe-function-1): Don't signal an error just because
+ the DOC file disappeared.
+
+2011-02-22 Seppo Sade <sepposade1@gmail.com> (tiny change)
+
+ * eshell/esh-ext.el (eshell-external-command): Do not restrict
+ remote check to "ftp". (Bug#8089)
+
+2011-02-21 Alan Mackenzie <acm@muc.de>
+
+ Fix bug #7930.
+ * progmodes/cc-engine.el (c-state-literal-at): Prevent positions
+ in macros finding their way into c-state-nonlit-pos-cache.
+ Strengthen the comments.
+ (c-state-dump): New commented out diagnostic routine.
+
2011-02-21 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-rfn-eshadow-setup-minibuffer): Do not use
@@ -16,10 +543,10 @@
* faces.el (color-values): Use cond for clarity. Doc fix.
- * facemenu.el (color-rgb-to-hsv): Deleted; use the version in
+ * facemenu.el (color-rgb-to-hsv): Delete; use the version in
color.el instead.
- (list-colors-sort-key, list-colors-print): Use
- color-normalized-values.
+ (list-colors-sort-key, list-colors-print):
+ Use color-normalized-values.
2011-02-20 Drew Adams <drew.adams@oracle.com>
@@ -48,8 +575,8 @@
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-ignore-buffer): Remove leading "*" from docs.
-2011-02-19 Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
- Dima Kogan <dkogan@cds.caltech.edu> (tiny change)
+2011-02-19 Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
+ Dima Kogan <dkogan@cds.caltech.edu> (tiny change)
* progmodes/hideshow.el (hs-find-block-beginning)
(hs-hide-level-recursive): Ignore comments when parsing braces
@@ -69,8 +596,8 @@
(vc-bzr-error-regex-alist): New var.
(vc-bzr-merge-branch): Use it to highlight the pull/merge buffer.
- * vc/vc-dispatcher.el (vc-do-async-command): Bind
- inhibit-read-only to t.
+ * vc/vc-dispatcher.el (vc-do-async-command):
+ Bind inhibit-read-only to t.
* progmodes/compile.el (compilation--flush-directory-cache):
Handle the case where cdr of compilation--flush-directory-cache
@@ -134,8 +661,8 @@
* apropos.el (apropos-print): Call apropos-mode before setting up
buffer variables. Use inhibit-read-only.
- * emacs-lisp/package.el (package--list-packages): Call
- package-menu-mode before setting up buffer variables.
+ * emacs-lisp/package.el (package--list-packages):
+ Call package-menu-mode before setting up buffer variables.
* play/solitaire.el (solitaire): Call solitaire-mode before
setting up buffer variables. Use inhibit-read-only.
@@ -204,13 +731,13 @@
2011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
- * lisp/allout-widgets.el: (allout-widgets-icons-light-subdir)
+ * lisp/allout-widgets.el (allout-widgets-icons-light-subdir)
(allout-widgets-icons-dark-subdir): Track relocations of icons
* lisp/allout.el: Remove commentary about remove encryption
passphrase mnemonic support and verification.
- (allout-encrypt-string): (allout-encrypt-string): Recognize epg
- failure to decrypt gpg2 armored text using gpg1, and indicate that
- the gpg version *might* be the problem in the error message.
+ (allout-encrypt-string): Recognize epg failure to decrypt gpg2
+ armored text using gpg1, and indicate that the gpg version *might*
+ be the problem in the error message.
2011-02-17 Deniz Dogan <deniz.a.m.dogan@gmail.com>
@@ -499,7 +1026,7 @@
2011-02-11 Deniz Dogan <deniz.a.m.dogan@gmail.com>
- * net/rcirc.el (defun-rcirc-join): Accept multiple channels.
+ * net/rcirc.el (rcirc-cmd-join): Accept multiple channels.
2011-02-11 Glenn Morris <rgm@gnu.org>
@@ -542,7 +1069,7 @@
* play/pong.el (pong-mode-map):
* play/handwrite.el (menu-bar-handwrite-map):
* play/gametree.el (gametree-mode-map):
- * net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map
+ * net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map)
(rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map):
* net/newst-plainview.el (newsticker-menu, newsticker-mode-map)
(newsticker--url-keymap):
@@ -580,7 +1107,7 @@
auto-activation is controlled solely by customization
`allout-auto-activation'.
- (allout-auto-activation-helper) (allout-setup): New autoloads
+ (allout-auto-activation-helper, allout-setup): New autoloads
implement new custom set procedure for allout-auto-activation.
Also, explicitly invoke
(allout-setup) after allout-auto-activation is custom-defined, to
@@ -592,7 +1119,7 @@
allout-auto-activation, and mark obsolete.
(allout-mode): Respect string values for allout-auto-activation.
Run allout-after-copy-or-kill-hook without any args.
- (allout-mode) (allout-layout) (allout-default-layout)
+ (allout-mode, allout-layout, allout-default-layout)
(outlineify-sticky): Adjust docstring for new scheme.
(allout-after-copy-or-kill-hook): No arguments - hook implementers
should concentrate on the kill ring.
@@ -633,7 +1160,7 @@
extension-specific processing of killed text.
(allout-mode): Include new allout-after-copy-or-kill-hook among
mentioned hooks.
- (allout-kill-line) (allout-kill-topic): Ensure that processing
+ (allout-kill-line, allout-kill-topic): Ensure that processing
after kill happens even if barf-if-buffer-read-only is raised.
Include new allout-after-copy-or-kill-hook among that subsequent
processing.
@@ -655,23 +1182,23 @@
* calc/calc.el (calc-logunits-field-reference): Rename from
`calc-default-field-reference-level'.
(calc-logunits-power-reference): Rename from
- `calc-default-power-reference-level'
+ `calc-default-power-reference-level'.
* calc/calc-units.el (math-logunits-quant): Rename from
`math-logunits-level'
(math-logunits-plus): Rename from math-logcombine.
(calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove.
(calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub)
- (calcFunc-lufieldsub,calc-logunits-add calc-logunits-sub):
+ (calcFunc-lufieldsub, calc-logunits-add, calc-logunits-sub):
New functions.
(calcFunc-fieldquant): Rename from `calcFunc-fieldlevel'.
(calcFunc-powerquant): Rename from `calcFunc-powerlevel'.
(calc-logunits-quantity): Rename from `calc-level'.
(calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel)
- (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel)
+ (calcFunc-nppowerlevel, calc-logunits-dblevel, calc-logunits-nplevel)
(math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul)
(calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv)
- (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level):
+ (calcFunc-lupowerdiv, calc-logunits-divide, math-logunits-level):
New functions.
* calc/calc-help.el (calc-u-prefix-help): Remove "L" reference.
@@ -1394,11 +1921,10 @@
(allout-institute-keymap): Take over the "setup" part of the former
allout-setup-mode-map. Reassign allout-mode-map-value value and
update the defalias.
- (allout-command-prefix) (allout-prefixed-keybindings)
+ (allout-command-prefix, allout-prefixed-keybindings)
(allout-unprefixed-keybindings):
Use allout-compose-and-institute-keymap to process the bindings.
- (allout-unprefixed-keybindings): Remove extraneous '?' question
- marks.
+ (allout-unprefixed-keybindings): Remove extraneous '?' question marks.
(allout-prefixed-keybindings): Elide binding to (prefixed) \C-h -
user can customize if they want to use that binding.
Bind allout-copy-topic-as-kill to (prefixed) \M-k.
@@ -1407,14 +1933,12 @@
(allout-hotspot-key-handler): Remove attempt to resolve the key
through the literal key-string lookup on allout-keybindings-list.
That probably hasn't worked for a Long Time, and removal of
- allout-keybindings-list further simplifies the keybindings
- situation.
+ allout-keybindings-list further simplifies the keybindings situation.
(allout-pre-command-business): Use allout-mode-map-value instead
of allout-mode-map.
(allout-preempt-trailing-ctrl-h): Remove. The user can customize
the bindings if they want to use a keybinding having a trailing
- \C-h. No deprecation needed since this feature was never in a
- release.
+ \C-h. No deprecation needed since this feature was never in a release.
(allout-keybindings-list): Remove. It's not been useful for a
while. (See allout-hotspot-key-handler changes, above.)
(produce-allout-mode-map): Remove. Consolidate into
@@ -2392,7 +2916,7 @@
* loadup.el (symbol-file-load-history-loaded): Remove; unused.
2010-12-15 Jari Aalto <jari.aalto@cante.net>
- Scott Evans <gse@antisleep.com>
+ Scott Evans <gse@antisleep.com>
* rect.el (rectange--default-line-number-format)
(rectangle-number-line-callback): New functions.
@@ -2552,7 +3076,7 @@
* dired.el (dired-pop-to-buffer): Bind pop-up-frames to nil
(Bug#7533).
-2010-12-13 W. Martin Borgert <debacle@debian.org> (tiny change)
+2010-12-13 W. Martin Borgert <debacle@debian.org> (tiny change)
* files.el (auto-mode-alist): Handle .dbk (DocBook) with xml-mode.
(Bug#7491).
@@ -2596,7 +3120,7 @@
this original name from `bookmark-name-from-record' reverting part
of 2010-12-08T08:09:27Z!kfogel@red-bean.com / kfogel@red-bean.com-20101208080927-5j9jqnb2xvcw4ogm.
As Drew Adams pointed out, there was no reason to cause churn for
- third-party callers.
+ third-party callers. (Bug#7609)
2010-12-12 Alan Mackenzie <acm@muc.de>
@@ -2942,7 +3466,6 @@
* net/tramp-cmds.el: Remove solved todo item.
- * net/tramp-efs.el:
* net/tramp-ftp.el:
* net/tramp-gvfs.el:
* net/tramp-gw.el:
@@ -3481,7 +4004,7 @@
describe-prefix-bindings
- adapt to new version of called-interactively-p, while
maintaining backwards compatibility with old version
- - fix hotspot navigation so i works properly with meta-modified keys
+ - fix hotspot navigation so i works properly with meta-modified keys.
* allout.el (allout-keybindings, allout-bind-keys)
(allout-keybindings-binding, allout-prefixed-keybindings)
@@ -3608,7 +4131,7 @@
2010-11-12 Glenn Morris <rgm@gnu.org>
* emacs-lisp/bytecomp.el (byte-compile-log-buffer): New constant.
- Use it to replace all instances of "*Compile-Log*"
+ Use it to replace all instances of "*Compile-Log*".
2010-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -4556,7 +5079,7 @@
2010-10-24 Michael McNamara <mac@mail.brushroad.com>
- * verilog-mode.el (verilog-directive-re): Make this variable
+ * progmodes/verilog-mode.el (verilog-directive-re): Make this variable
auto-built for efficiency of execution and updating.
(verilog-extended-complete-re): Support 'pure' fucntion & task
declarations (these have no bodies).
@@ -4590,7 +5113,7 @@
2010-10-24 Wilson Snyder <wsnyder@wsnyder.org>
- * verilog-mode.el (verilog-auto-inst, verilog-gate-ios)
+ * progmodes/verilog-mode.el (verilog-auto-inst, verilog-gate-ios)
(verilog-gate-keywords, verilog-read-sub-decls)
(verilog-read-sub-decls-gate, verilog-read-sub-decls-gate-ios)
(verilog-read-sub-decls-line, verilog-read-sub-decls-sig): Support
@@ -5539,7 +6062,7 @@
2010-10-03 Glenn Morris <rgm@gnu.org>
- * obsolete/x-menu.el: Remove file, obsolete since 21.1
+ * obsolete/x-menu.el: Remove file, obsolete since 21.1.
* textmodes/rst.el (rst-font-lock-keywords-function):
Drop Emacs 20 code.
@@ -6187,8 +6710,8 @@
Use `tramp-compat-funcall'.
* net/tramp.el (tramp-process-actions):
- * net/tramp-gvfs.el (tramp-handle-vc-registered):
- * net/tramp-sh.el (tramp-gvfs-handler-askquestion)
+ * net/tramp-gvfs.el (tramp-gvfs-handler-askquestion):
+ * net/tramp-sh.el (tramp-handle-vc-registered)
(tramp-get-remote-stat, tramp-get-remote-readlink):
Use `tramp-compat-with-temp-message'.
@@ -6253,7 +6776,7 @@
2010-09-14 Sascha Wilde <wilde@sha-bang.de>
- * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision):
+ * vc/vc-hg.el (vc-hg-state, vc-hg-working-revision):
Replace setting HGRCPATH to "" by some less invasive --config options.
2010-09-14 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -7235,48 +7758,6 @@
* whitespace.el (whitespace-style): Adjust type declaration.
-2010-08-26 Magnus Henoch <magnus.henoch@gmail.com>
-
- * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
- empty argument to gvfs-copy.
-
-2010-08-26 Chong Yidong <cyd@stupidchicken.com>
-
- * net/tramp-compat.el (tramp-compat-delete-file): Rewrite to
- handle new TRASH arg of `delete-file'.
-
-2010-08-26 Christian Lynbech <christian.lynbech@tieto.com> (tiny change)
-
- * net/tramp.el (tramp-handle-insert-directory): Don't use
- `forward-word', its default syntax could be changed.
-
-2010-08-26 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
- Michael Albinus <michael.albinus@gmx.de>
-
- Implement compression for inline methods.
-
- * net/tramp.el (tramp-inline-compress-start-size): New defcustom.
- (tramp-copy-size-limit): Allow also nil.
- (tramp-inline-compress-commands): New defconst.
- (tramp-find-inline-compress, tramp-get-inline-compress)
- (tramp-get-inline-coding): New defuns.
- (tramp-get-remote-coding, tramp-get-local-coding): Remove,
- replaced by `tramp-get-inline-coding'.
- (tramp-handle-file-local-copy, tramp-handle-write-region)
- (tramp-method-out-of-band-p): Use `tramp-get-inline-coding'.
-
-2010-08-26 Noah Lavine <noah549@gmail.com> (tiny change)
-
- Detect ssh 'ControlMaster' argument automatically in some cases.
-
- * net/tramp.el (tramp-detect-ssh-controlmaster): New defun.
- (tramp-default-method): Use it.
-
-2010-08-26 Karel Klíč <kklic@redhat.com>
-
- * net/tramp.el (tramp-file-name-for-operation):
- Add file-selinux-context.
-
2010-08-26 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> (tiny change)
* play/cookie1.el (read-cookie): Fix off-by-one error (bug#6921).
@@ -7308,210 +7789,14 @@
Sync with Tramp 2.1.19.
- * net/tramp-cmds.el (tramp-cleanup-all-connections)
- (tramp-reporter-dump-variable, tramp-load-report-modules)
- (tramp-append-tramp-buffers): Use `tramp-compat-funcall'.
- (tramp-bug): Recommend setting of `tramp-verbose' to 9.
-
- * net/tramp-compat.el (top): Do not autoload
- `tramp-handle-file-remote-p'. Load tramp-util.el and tramp-vc.el
- only when `start-file-process' is not bound.
- (byte-compile-not-obsolete-vars): Define if not bound.
- (tramp-compat-funcall): New defmacro.
- (tramp-compat-line-beginning-position)
- (tramp-compat-line-end-position)
- (tramp-compat-temporary-file-directory)
- (tramp-compat-make-temp-file, tramp-compat-file-attributes)
- (tramp-compat-copy-file, tramp-compat-copy-directory)
- (tramp-compat-delete-file, tramp-compat-delete-directory)
- (tramp-compat-number-sequence, tramp-compat-process-running-p):
- Use it.
- (tramp-advice-file-expand-wildcards): Do not use
- `tramp-handle-file-remote-p'.
- (tramp-compat-make-temp-file): Simplify fallback implementation.
- (tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT.
- (tramp-compat-copy-tree): Remove function.
- (tramp-compat-delete-file): New defun.
- (tramp-compat-delete-directory): Provide implementation for older
- Emacsen.
- (tramp-compat-file-attributes): Handle only
- `wrong-number-of-arguments' error.
-
- * net/tramp-fish.el (tramp-fish-handle-copy-file):
- Add PRESERVE_SELINUX_CONTEXT.
- (tramp-fish-handle-delete-file): Add TRASH arg.
- (tramp-fish-handle-directory-files-and-attributes):
- Do not use `tramp-fish-handle-file-attributes.
- (tramp-fish-handle-file-local-copy)
- (tramp-fish-handle-insert-file-contents)
- (tramp-fish-maybe-open-connection): Use `with-progress-reporter'.
-
- * net/tramp-gvfs.el (top): Require url-util.
- (tramp-gvfs-mount-point): Remove.
- (tramp-gvfs-file-name-handler-alist): Add `file-selinux-context'
- and `set-file-selinux-context'.
- (tramp-gvfs-stringify-dbus-message, tramp-gvfs-send-command)
- (tramp-gvfs-handle-file-selinux-context)
- (tramp-gvfs-handle-set-file-selinux-context): New defuns.
- (with-tramp-dbus-call-method): Format trace message.
- (tramp-gvfs-handle-copy-file): Handle PRESERVE-SELINUX-CONTEXT.
- (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file):
- Implement backup call, when operation on local files fails.
- Use progress reporter. Flush properties of changed files.
- (tramp-gvfs-handle-delete-file): Add TRASH arg.
- Use `tramp-compat-delete-file'.
- (tramp-gvfs-handle-expand-file-name): Expand "~/".
- (tramp-gvfs-handle-make-directory): Make more traces.
- (tramp-gvfs-handle-write-region): Protect deleting tmpfile.
- (tramp-gvfs-url-file-name): Hexify file name in url.
- (tramp-gvfs-fuse-file-name): Take also prefix (like dav shares)
- into account for the resulting file name.
- (tramp-gvfs-handler-askquestion): Preserve current message, in
- order to let progress reporter continue afterwards. (Bug#6257)
- Return dummy mountpoint, when the answer is "no".
- See `tramp-gvfs-maybe-open-connection'.
- (tramp-gvfs-handler-mounted-unmounted)
- (tramp-gvfs-connection-mounted-p): Test also for new mountspec
- attribute "default_location". Set "prefix" property.
- Handle default-location.
- (tramp-gvfs-mount-spec): Return both prefix and mountspec.
- (tramp-gvfs-maybe-open-connection): Test, whether mountpoint
- exists. Raise an error, if not (due to a corresponding answer
- "no" in interactive questions, for example).
- Use `tramp-compat-funcall'.
-
- * net/tramp-imap.el (top): Autoload `epg-make-context'.
- (tramp-imap-handle-copy-file): Add PRESERVE-SELINUX-CONTEXT.
- (tramp-imap-do-copy-or-rename-file)
- (tramp-imap-handle-insert-file-contents)
- (tramp-imap-handle-file-local-copy): Use `with-progress-reporter'.
- (tramp-imap-handle-delete-file): Add TRASH arg.
-
- * net/tramp-smb.el (tramp-smb-handle-copy-file):
- Add PRESERVE-SELINUX-CONTEXT.
- (tramp-smb-handle-copy-file)
- (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
- (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection):
- Use `with-progress-reporter'.
- (tramp-smb-handle-delete-file): Add TRASH arg.
+ * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Protect
+ deleting tmpfile.
+ (tramp-gvfs-maybe-open-connection): Use `tramp-compat-funcall'.
- * net/tramp.el (tramp-methods): Move hostname to the end in all
- ssh `tramp-login-args'. Add `tramp-async-args' attribute where
- appropriate.
- (tramp-verbose): Describe verbose level 9.
- (tramp-completion-function-alist)
- (tramp-file-name-regexp, tramp-chunksize)
- (tramp-local-coding-commands, tramp-remote-coding-commands)
- (with-connection-property, tramp-completion-mode-p)
- (tramp-action-process-alive, tramp-action-out-of-band)
- (tramp-check-for-regexp, tramp-file-name-p, tramp-equal-remote)
- (tramp-exists-file-name-handler): Fix docstring.
- (tramp-remote-process-environment): Use `format' instead of
- `concat'. Protect version string by apostroph.
- (tramp-shell-prompt-pattern): Do not use a shy group in case of
- XEmacs.
- (tramp-file-name-regexp-unified)
- (tramp-completion-file-name-regexp-unified): On W32 systems, do
- not regard the volume letter as remote filename. (Bug#5447)
- (tramp-perl-file-attributes)
- (tramp-perl-directory-files-and-attributes): Don't pass "$3".
- (tramp-vc-registered-read-file-names): Read input as
- here-document, otherwise the command could exceed maximum length
- of command line.
- (tramp-file-name-handler-alist): Add `file-selinux-context' and
- `set-file-selinux-context'.
- (tramp-debug-message): Add `tramp-compat-funcall' to ignored
- backtrace functions.
- (tramp-error-with-buffer): Don't show the connection buffer when
- we are in completion mode.
- (tramp-progress-reporter-update, tramp-remote-selinux-p)
- (tramp-handle-file-selinux-context)
- (tramp-handle-set-file-selinux-context, tramp-process-sentinel)
- (tramp-connectable-p, tramp-open-shell, tramp-get-remote-trash):
- New defuns.
- (with-progress-reporter): New defmacro.
- (tramp-debug-outline-regexp): New defconst.
- (top, tramp-rfn-eshadow-setup-minibuffer)
- (tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times)
- (tramp-handle-dired-compress-file, tramp-handle-shell-command)
- (tramp-completion-mode-p, tramp-check-for-regexp)
- (tramp-open-connection-setup-interactive-shell)
- (tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd)
- (tramp-time-diff, tramp-coding-system-change-eol-conversion)
- (tramp-set-process-query-on-exit-flag, tramp-unload-tramp):
- Use `tramp-compat-funcall'.
- (tramp-handle-make-symbolic-link): Flush file properties.
- (tramp-handle-load, tramp-handle-file-local-copy)
- (tramp-handle-insert-file-contents, tramp-handle-write-region)
- (tramp-handle-vc-registered, tramp-maybe-send-script)
- (tramp-find-shell): Use `with-progress-reporter'.
- (tramp-do-file-attributes-with-stat): Add space in format string,
- in order to work around a bug in pdksh. Reported by Gilles Pion
- <gpion@lfdj.com>.
- (tramp-handle-verify-visited-file-modtime): Do not send a command
- when the connection is not established.
- (tramp-handle-set-file-times): Simplify the check for utc.
- (tramp-handle-directory-files-and-attributes)
- (tramp-get-remote-path): Use `copy-tree'.
- (tramp-completion-handle-file-name-all-completions): Ensure, that
- non remote files are still checked. Oops.
- (tramp-handle-copy-file, tramp-do-copy-or-rename-file):
- Handle PRESERVE-SELINUX-CONTEXT.
- (tramp-do-copy-or-rename-file): Add progress reporter.
- (tramp-do-copy-or-rename-file-directly): Do not use
- `tramp-handle-file-remote-p'.
- (tramp-do-copy-or-rename-file-out-of-band):
- Use `tramp-compat-delete-directory'.
- (tramp-do-copy-or-rename-file-out-of-band)
- (tramp-compute-multi-hops, tramp-maybe-open-connection):
- Use `format-spec-make'.
- (tramp-handle-delete-file): Add TRASH arg.
- (tramp-handle-dired-uncache): Flush directory cache, not only file
- cache.
- (tramp-handle-expand-file-name)
+ * net/tramp.el (tramp-handle-expand-file-name)
(tramp-completion-handle-file-name-all-completions)
(tramp-completion-handle-file-name-completion):
Use `tramp-connectable-p'.
- (tramp-handle-start-file-process): Set connection property "vec".
- Use it, in order to invalidate file caches. Check only for
- `remote-tty' process property.
- Implement tty setting. (Bug#4604, Bug#6360)
- (tramp-file-name-for-operation): Add `call-process-region' and
- `set-file-selinux-context'.
- (tramp-find-foreign-file-name-handler)
- (tramp-advice-make-auto-save-file-name)
- (tramp-set-auto-save-file-modes): Remove superfluous check for
- `stringp'. This is done inside `tramp-tramp-file-p'.
- (tramp-file-name-handler): Trace 'quit. Catch the error for some
- operations when we are in completion mode. This gives the user
- the chance to correct the file name in the minibuffer.
- (tramp-completion-mode-p): Use `non-essential'.
- (tramp-handle-file-name-all-completions): Backward/ XEmacs
- compatibility: Use `completion-ignore-case' if
- `read-file-name-completion-ignore-case' does not exist.
- (tramp-get-debug-buffer): Use `tramp-debug-outline-regexp'.
- (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
- `tramp-open-shell'.
- (tramp-action-password): Hide password prompt before next run.
- (tramp-process-actions): Widen connection buffer for the trace.
- (tramp-open-connection-setup-interactive-shell): Set `remote-tty'
- process property. Trace stty settings if `tramp-verbose' >= 9.
- Apply workaround for IRIX64 bug. Move argument of last
- `tramp-send-command' where it belongs to.
- (tramp-maybe-open-connection): Use `async-args' and `gw-args' in
- front of `login-args'.
- (tramp-get-ls-command, tramp-get-ls-command-with-dired): Run tests
- on "/dev/null" instead of "/".
- (tramp-get-ls-command-with-dired): Make test for "--dired"
- stronger.
- (tramp-set-auto-save-file-modes): Adapt version check.
- (tramp-set-process-query-on-exit-flag): Fix wrong parentheses.
- (tramp-handle-process-file): Call the program in a subshell, in
- order to preserve working directory.
- (tramp-handle-shell-command): Don't use hard-wired "/bin/sh" but
- `tramp-remote-sh' from `tramp-methods'.
- (tramp-get-ls-command): Make test for "--color=never" stronger.
- (tramp-check-for-regexp): Use (forward-line 1).
* net/trampver.el: Update release number.
@@ -7607,7 +7892,7 @@
* net/dbus.el: Accept UNIX domain sockets as bus address.
(top): Don't initialize `dbus-registered-objects-table' anymore,
- this is done in dbusbind,c.
+ this is done in dbusbind.c.
(dbus-check-event): Adapt test for bus.
(dbus-return-values-table, dbus-unregister-service)
(dbus-event-bus-name, dbus-introspect, dbus-register-property):
@@ -7944,7 +8229,7 @@
* progmodes/octave-mod.el (octave-mode): Set comment-add.
(octave-mode-map): Use comment-dwim (bug#6829).
-2010-08-12 Antoine Levitt <antoine.levitt@gmail.com> (tiny change)
+2010-08-12 Antoine Levitt <antoine.levitt@gmail.com>
* cus-edit.el (custom-save-variables, custom-save-faces): Fix up
indentation of inserted comment.
@@ -8123,7 +8408,7 @@
2010-08-08 Jay Belanger <jay.p.belanger@gmail.com>
- * calc/calc.el (calc-trail-mode,calc-refresh): Use `face' property
+ * calc/calc.el (calc-trail-mode, calc-refresh): Use `face' property
to italicize headers.
(calc-highlight-selections-with-faces): New variable.
(calc-selected-face, calc-nonselected-face): New faces.
@@ -8168,7 +8453,7 @@
* progmodes/cc-cmds.el (c-mask-paragraph, c-fill-paragraph):
Fix for the case that a C style comment has its delimiters alone on
- their respective lines.
+ their respective lines. (Bug#193)
2010-08-06 Michael Albinus <michael.albinus@gmx.de>
@@ -8507,7 +8792,7 @@
(sql-interactive-mode-menu): Add "Save Connection" item.
(sql-add-product): Fix menu item.
(sql-get-product-feature): Improved error handling.
- (sql--alt-buffer-part, sql--alt-if-not-empty): Removed.
+ (sql--alt-buffer-part, sql--alt-if-not-empty): Remove.
(sql-make-alternate-buffer-name): Simplified.
(sql-product-interactive): Handle missing product.
(sql-connect): Support string keys, minor improvements.
@@ -8902,7 +9187,7 @@
(delete-backward-char): Implement in Lisp.
(delete-forward-char): New command.
- * mouse.el (mouse-region-delete-keys): Deleted.
+ * mouse.el (mouse-region-delete-keys): Delete.
(mouse-show-mark): Simplify.
* bindings.el (global-map): Bind delete and DEL, the former to
@@ -9018,7 +9303,7 @@
* htmlfontify.el (hfy-face-attr-for-class): Use append instead
of nconc to avoid pure storage error (Bug#6239).
-2010-06-27 Christoph <cschol2112@googlemail.com> (tiny change)
+2010-06-27 Christoph Scholtes <cschol2112@googlemail.com>
* bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window)
(bookmark-bmenu-other-window-with-mouse): Remove unnecessary
@@ -9783,9 +10068,8 @@
* net/tramp-ftp.el (tramp-ftp-file-name-handler):
Use `delete-file' instead of `tramp-compat-delete-file'.
- * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg.
- (tramp-gvfs-handle-write-region): Use `delete-file' instead of
- `tramp-compat-delete-file'.
+ * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Use
+ `delete-file' instead of `tramp-compat-delete-file'.
* net/tramp-imap.el (tramp-imap-do-copy-or-rename-file):
Use `delete-file' instead of `tramp-compat-delete-file'.
@@ -10944,7 +11228,7 @@
* textmodes/ispell.el (ispell-init-process): Fix personal dictionary
condition in default directory check.
- (ispell-init-process,ispell-kill-ispell,kill-buffer-hook):
+ (ispell-init-process, ispell-kill-ispell, kill-buffer-hook):
Kill ispell process when killing its associated buffer.
2010-04-27 Jan Djärv <jan.h.d@swipnet.se>
@@ -11201,7 +11485,7 @@
* ido.el (ido-file-internal): Fix 2009-12-02 change.
-2010-04-19 Christoph <cschol2112@googlemail.com> (tiny change)
+2010-04-19 Christoph Scholtes <cschol2112@googlemail.com>
* progmodes/grep.el (grep-compute-defaults): Fix handling of host
default settings (Bug#5928).
@@ -13211,7 +13495,7 @@
(ada-goto-label-re): New; matches goto labels.
(ada-block-label-re): New; matches block labels.
(ada-label-re): New; matches both.
- (ada-named-block-re): Deleted; callers changed to use
+ (ada-named-block-re): Delete; callers changed to use
`ada-block-label-re' instead.
(ada-get-current-indent, ada-get-indent-noindent, ada-get-indent-loop):
Use `ada-block-label-re'.
@@ -15674,7 +15958,7 @@
* vc-rcs.el (vc-rcs-print-log):
* vc-git.el (vc-git-print-log):
* vc-cvs.el (vc-cvs-print-log): Add new optional argument LIMIT,
- ignore it. Make the BUFFER argument non-optional
+ ignore it. Make the BUFFER argument non-optional.
* bindings.el (mode-line-buffer-identification): Do not purecopy.
@@ -20428,12 +20712,12 @@
2009-08-19 Magnus Henoch <magnus.henoch@gmail.com>
* log-edit.el (log-edit-strip-single-file-name): New var.
- (log-edit-insert-changelog): Use it. Bug#3571
+ (log-edit-insert-changelog): Use it. Bug#3571.
2009-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (read-passwd): Use read-key so keypad keys work as well.
- Bug#3287
+ Bug#3287.
* help.el (help-print-return-message): Rename from
print-help-return-message.
@@ -20831,7 +21115,7 @@
(def-gdb-memory-format, def-gdb-memory-unit): Update memory buffer
after changing settings.
(gdb-invalidate-disassembly): Update when first shown.
- (gdb-edit-locals-value): Fixed.
+ (gdb-edit-locals-value): Fix.
(gdb-registers-handler-custom): Print registers in right order and
allow changing register values (only for current thread yet).
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
@@ -20882,7 +21166,7 @@
2009-08-06 Dmitry Dzhus <dima@sphinx.net.ru>
- * progmodes/gdb-mi.el (gdb-var-create-regexp): Removed.
+ * progmodes/gdb-mi.el (gdb-var-create-regexp): Remove.
(gdb-var-create-handler): Rewritten using JSON parser.
(gdb-propertize-header): Move earlier.
(gdb-set-header): Remove to avoid duplication.
@@ -22197,7 +22481,7 @@
or shell command text during AUTO expansion. Suggested by Tad Truex.
(verilog-read-sub-decls-expr, verilog-read-sub-decls-line)
(verilog-read-sub-decls-sig, verilog-symbol-detick-text):
- Fix dotted nets {a.b,c.d} and excaped identifiers being mis-included
+ Fix dotted nets {a.b,c.d} and escaped identifiers being mis-included
in AUTOINOUT. Reported by Matthew Lovell.
(verilog-read-always-signals-recurse): Fix AUTORESET "if (a<=b)"
causing use of <= assignments. Reported by Alex Reed.
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 75e1e5882f6..cc5fd6d96fa 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -2013,7 +2013,7 @@ Optional FORCE means force reassignment of the region property."
;; item body), to bias the registered values.
;;
;; This is not necessary/useful when the item is being decorated, because
- ;; that always must be preceeded by a fresh item parse.
+ ;; that always must be preceded by a fresh item parse.
(if (not (eq field :body-end))
(widget-get item-widget :from)
diff --git a/lisp/allout.el b/lisp/allout.el
index 1a7d8cb1593..c75b7a22f9a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -234,7 +234,7 @@ Use vector format for the keys:
- put literal keys after a '?' question mark, eg: '?a', '?.'
- enclose control, shift, or meta-modified keys as sequences within
parentheses, with the literal key, as above, preceded by the name(s)
- of the modifers, eg: [(control ?a)]
+ of the modifiers, eg: [(control ?a)]
See the existing keys for examples.
Functions can be bound to multiple keys, but binding keys to
@@ -255,13 +255,13 @@ prevails."
This is in contrast to the majority of allout-mode bindings on
`allout-prefixed-bindings', whose bindings are created with a
-preceeding command key.
+preceding command key.
Use vector format for the keys:
- put literal keys after a '?' question mark, eg: '?a', '?.'
- enclose control, shift, or meta-modified keys as sequences within
parentheses, with the literal key, as above, preceded by the name(s)
- of the modifers, eg: [(control ?a)]
+ of the modifiers, eg: [(control ?a)]
See the existing keys for examples."
:type 'allout-keybindings-binding
:group 'allout-keybindings
@@ -339,7 +339,7 @@ The types of elements in the layout specification are:
-- positive numbers open to the relative depth indicated by the
number, but do not force already opened subtopics to be closed.
-- 0 means to close topic -- hide all subitems.
- : -- repeat spec -- apply the preceeding element to all siblings at
+ : -- repeat spec -- apply the preceding element to all siblings at
current level, *up to* those siblings that would be covered by specs
following the `:' on the list. Ie, apply to all topics at level but
trailing ones accounted for by trailing specs. (Only the first of
@@ -1642,7 +1642,7 @@ So `allout-post-command-business' should not reactivate it...")
(defun allout-init (mode)
"DEPRECATED - configure allout activation by customizing
`allout-auto-activation'. This function remains around, limited
-from what it did before, for backwards compatability.
+from what it did before, for backwards compatibility.
MODE is the activation mode - see `allout-auto-activation' for
valid values."
@@ -3125,7 +3125,7 @@ situation."
nil)
;; rationale: if any intervening items were at a lower depth, we
;; would now be on the first offspring at the target depth -- ie,
- ;; the preceeding item (per the search direction) must be at a
+ ;; the preceding item (per the search direction) must be at a
;; lesser depth. that's all we need to check.
(if backward (allout-next-heading) (allout-previous-heading))
(if (< allout-recent-depth target-depth)
@@ -4246,7 +4246,7 @@ With a negative argument, the item is shifted out using
With an argument greater than one, shift-in the item but not its
offspring, making the item into a sibling of its former children,
-and a child of sibling that formerly preceeded it.
+and a child of sibling that formerly preceded it.
You are not allowed to shift the first offspring of a topic
inwards, because that would yield a \"containment
@@ -5364,7 +5364,7 @@ header and body. The elements of that list are:
(goto-char start)
(beginning-of-line)
- ;; Goto initial topic, and register preceeding stuff, if any:
+ ;; Goto initial topic, and register preceding stuff, if any:
(if (> (allout-goto-prefix-doublechecked) start)
;; First topic follows beginning point -- register preliminary stuff:
(setq result
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index cd946e46be9..d3db54c81d4 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -2181,7 +2181,8 @@ This also runs `bookmark-exit-hook'."
(bookmark-time-to-save-p t)
(bookmark-save)))
-(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal))
(defun bookmark-unload-function ()
"Unload the Bookmark library."
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index fcc3ecc1ab1..11a26d6d125 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -423,12 +423,16 @@
(define-key calc-mode-map "l" nil)
(define-key calc-mode-map "lq" 'calc-logunits-quantity)
- (define-key calc-mode-map "ld" 'calc-logunits-dblevel)
- (define-key calc-mode-map "ln" 'calc-logunits-nplevel)
+ (define-key calc-mode-map "ld" 'calc-dblevel)
+ (define-key calc-mode-map "ln" 'calc-nplevel)
(define-key calc-mode-map "l+" 'calc-logunits-add)
(define-key calc-mode-map "l-" 'calc-logunits-sub)
(define-key calc-mode-map "l*" 'calc-logunits-mul)
(define-key calc-mode-map "l/" 'calc-logunits-divide)
+ (define-key calc-mode-map "ls" 'calc-spn)
+ (define-key calc-mode-map "lm" 'calc-midi)
+ (define-key calc-mode-map "lf" 'calc-freq)
+
(define-key calc-mode-map "l?" 'calc-l-prefix-help)
(define-key calc-mode-map "m" nil)
@@ -944,7 +948,7 @@ calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub
calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv
calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant
calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel
-calcFunc-nppowerlevel
+calcFunc-nppowerlevel calcFunc-spn calcFunc-midi calcFunc-freq
math-build-units-table math-build-units-table-buffer
math-check-unit-name math-convert-temperature math-convert-units
math-extract-units math-remove-units math-simplify-units
@@ -1061,7 +1065,7 @@ calc-full-help calc-g-prefix-help calc-help-prefix
calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help
calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help
calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help
-calc-t-prefix-help calc-u-prefix-help calc-ul-prefix-help
+calc-t-prefix-help calc-u-prefix-help calc-l-prefix-help
calc-v-prefix-help)
("calc-incom" calc-begin-complex calc-begin-vector calc-comma
@@ -1176,9 +1180,10 @@ calc-convert-temperature calc-convert-units calc-define-unit
calc-enter-units-table calc-explain-units calc-extract-units
calc-get-unit-definition calc-permanent-units calc-quick-units
calc-remove-units calc-simplify-units calc-undefine-unit
-calc-view-units-table calc-logunits-quantity calc-logunits-dblevel
-calc-logunits-nplevel calc-logunits-add calc-logunits-sub
-calc-logunits-mul calc-logunits-divide)
+calc-view-units-table calc-logunits-quantity calc-dblevel
+calc-nplevel calc-logunits-add calc-logunits-sub
+calc-logunits-mul calc-logunits-divide calc-spn calc-midi
+calc-freq)
("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
calc-conj-transpose calc-cons calc-cross calc-kron calc-diag
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 185ed18ed42..076dab31fd9 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1574,7 +1574,7 @@ If this can't be done, return NIL."
(if calc-infinite-mode
'(neg (var inf var-inf))
(math-reject-arg x "*Logarithm of zero")))
- (calc-symbolic-mode (signal 'inexact-result nil))
+ (calc-symbolic-mode (signal 'inexact-result nil))
((Math-numberp x)
(math-with-extra-prec 2
(let ((xf (math-float x)))
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 569d5d3dc35..7f0adc9fe7e 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -960,7 +960,10 @@ If EXPR is nil, return nil."
(if (eq base 'pi)
(math-pi)
expr)))
- (if (Math-primp expr)
+ (if (or
+ (Math-primp expr)
+ (and (eq (car-safe expr) 'calcFunc-subscr)
+ (eq (car-safe (nth 1 expr)) 'var)))
expr
(cons (car expr)
(mapcar 'math-to-standard-rec (cdr expr))))))
@@ -1559,6 +1562,20 @@ If EXPR is nil, return nil."
(defvar math-logunits '((var dB var-dB)
(var Np var-Np)))
+(defun math-conditional-apply (fn &rest args)
+ "Evaluate f(args) unless in symbolic mode.
+In symbolic mode, return the list (fn args)."
+ (if calc-symbolic-mode
+ (cons fn args)
+ (apply fn args)))
+
+(defun math-conditional-pow (a b)
+ "Evaluate a^b unless in symbolic mode.
+In symbolic mode, return the list (^ a b)."
+ (if calc-symbolic-mode
+ (list '^ a b)
+ (math-pow a b)))
+
(defun math-extract-logunits (expr)
(if (memq (car-safe expr) '(* /))
(cons (car expr)
@@ -1585,24 +1602,24 @@ If EXPR is nil, return nil."
(if (equal aunit '(var dB var-dB))
(let ((coef (if power 10 20)))
(math-mul coef
- (calcFunc-log10
+ (math-conditional-apply 'calcFunc-log10
(if neg
(math-sub
- (math-pow 10 (math-div acoeff coef))
- (math-pow 10 (math-div bcoeff coef)))
+ (math-conditional-pow 10 (math-div acoeff coef))
+ (math-conditional-pow 10 (math-div bcoeff coef)))
(math-add
- (math-pow 10 (math-div acoeff coef))
- (math-pow 10 (math-div bcoeff coef)))))))
+ (math-conditional-pow 10 (math-div acoeff coef))
+ (math-conditional-pow 10 (math-div bcoeff coef)))))))
(let ((coef (if power 2 1)))
(math-div
- (calcFunc-ln
+ (math-conditional-apply 'calcFunc-ln
(if neg
(math-sub
- (calcFunc-exp (math-mul coef acoeff))
- (calcFunc-exp (math-mul coef bcoeff)))
+ (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff))
+ (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff)))
(math-add
- (calcFunc-exp (math-mul coef acoeff))
- (calcFunc-exp (math-mul coef bcoeff)))))
+ (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff))
+ (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff)))))
coef)))
units)))))))
@@ -1666,14 +1683,14 @@ If EXPR is nil, return nil."
(math-add
coef
(math-mul (if power 10 20)
- (calcFunc-log10 number)))
+ (math-conditional-apply 'calcFunc-log10 number)))
units)))
(t
(math-simplify
(math-mul
(math-add
coef
- (math-div (calcFunc-ln number) (if power 2 1)))
+ (math-div (math-conditional-apply 'calcFunc-ln number) (if power 2 1)))
units))))
(calc-record-why "*Improper units" nil))))
@@ -1692,14 +1709,14 @@ If EXPR is nil, return nil."
(math-sub
coef
(math-mul (if power 10 20)
- (calcFunc-log10 b)))
+ (math-conditional-apply 'calcFunc-log10 b)))
units)))
(t
(math-simplify
(math-mul
(math-sub
coef
- (math-div (calcFunc-ln b) (if power 2 1)))
+ (math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1)))
units)))))))))
(defun calcFunc-lufieldtimes (a b)
@@ -1747,14 +1764,14 @@ If EXPR is nil, return nil."
(if (equal lunit '(var dB var-dB))
(math-mul
ref
- (math-pow
+ (math-conditional-pow
10
(math-div
coeff
(if power 10 20))))
(math-mul
ref
- (calcFunc-exp
+ (math-conditional-apply 'calcFunc-exp
(if power
(math-mul 2 coeff)
coeff))))
@@ -1787,15 +1804,16 @@ If EXPR is nil, return nil."
(defun math-logunits-level (val ref db power)
"Compute the value of VAL in decibels or nepers."
(let* ((ratio (math-simplify-units (math-div val ref)))
+ (ratiou (math-simplify-units (math-remove-units ratio)))
(units (math-simplify (math-extract-units ratio))))
(math-mul
(if db
(math-mul
(math-mul (if power 10 20)
- (calcFunc-log10 ratio))
+ (math-conditional-apply 'calcFunc-log10 ratiou))
'(var dB var-dB))
(math-mul
- (math-div (calcFunc-ln ratio) (if power 2 1))
+ (math-div (math-conditional-apply 'calcFunc-ln ratiou) (if power 2 1))
'(var Np var-Np)))
units)))
@@ -1819,7 +1837,7 @@ If EXPR is nil, return nil."
(setq ref (math-read-expr calc-logunits-power-reference)))
(math-logunits-level val ref nil t))
-(defun calc-logunits-dblevel (arg)
+(defun calc-dblevel (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-hyperbolic)
@@ -1830,7 +1848,7 @@ If EXPR is nil, return nil."
(calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg)
(calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg)))))
-(defun calc-logunits-nplevel (arg)
+(defun calc-nplevel (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-hyperbolic)
@@ -1841,6 +1859,222 @@ If EXPR is nil, return nil."
(calc-binary-op "lunp" 'calcFunc-nppowerlevel arg)
(calc-unary-op "lunp" 'calcFunc-nppowerlevel arg)))))
+;;; Musical notes
+
+
+(defvar calc-note-threshold)
+
+(defun math-midi-round (num)
+ "Round NUM to an integer N if NUM is within calc-note-threshold cents of N."
+ (let* ((n (math-round num))
+ (diff (math-abs
+ (math-sub num n))))
+ (if (< (math-compare diff
+ (math-div (math-read-expr calc-note-threshold) 100)) 0)
+ n
+ num)))
+
+(defconst math-notes
+ '(((var C var-C) . 0)
+ ((var Csharp var-Csharp) . 1)
+; ((var C♯ var-C♯) . 1)
+ ((var Dflat var-Dflat) . 1)
+; ((var D♭ var-D♭) . 1)
+ ((var D var-D) . 2)
+ ((var Dsharp var-Dsharp) . 3)
+; ((var D♯ var-D♯) . 3)
+ ((var E var-E) . 4)
+ ((var F var-F) . 5)
+ ((var Fsharp var-Fsharp) . 6)
+; ((var F♯ var-F♯) . 6)
+ ((var Gflat var-Gflat) . 6)
+; ((var G♭ var-G♭) . 6)
+ ((var G var-G) . 7)
+ ((var Gsharp var-Gsharp) . 8)
+; ((var G♯ var-G♯) . 8)
+ ((var A var-A) . 9)
+ ((var Asharp var-Asharp) . 10)
+; ((var A♯ var-A♯) . 10)
+ ((var Bflat var-Bflat) . 10)
+; ((var B♭ var-B♭) . 10)
+ ((var B var-B) . 11))
+ "An alist of notes with their number of semitones above C.")
+
+(defun math-freqp (freq)
+ "Non-nil if FREQ is a positive number times the unit Hz.
+If non-nil, return the coefficient of Hz."
+ (let ((freqcoef (math-simplify-units
+ (math-div freq '(var Hz var-Hz)))))
+ (if (Math-posp freqcoef) freqcoef)))
+
+(defun math-midip (num)
+ "Non-nil if NUM is a possible MIDI note number.
+If non-nil, return NUM."
+ (if (Math-numberp num) num))
+
+(defun math-spnp (spn)
+ "Non-nil if NUM is a scientific pitch note (note + cents).
+If non-nil, return a list consisting of the note and the cents coefficient."
+ (let (note cents rnote rcents)
+ (if (eq (car-safe spn) '+)
+ (setq note (nth 1 spn)
+ cents (nth 2 spn))
+ (setq note spn
+ cents nil))
+ (cond
+ ((and ;; NOTE is a note, CENTS is nil or cents.
+ (eq (car-safe note) 'calcFunc-subscr)
+ (assoc (nth 1 note) math-notes)
+ (integerp (nth 2 note))
+ (setq rnote note)
+ (or
+ (not cents)
+ (Math-numberp (setq rcents
+ (math-simplify
+ (math-div cents '(var cents var-cents)))))))
+ (list rnote rcents))
+ ((and ;; CENTS is a note, NOTE is cents.
+ (eq (car-safe cents) 'calcFunc-subscr)
+ (assoc (nth 1 cents) math-notes)
+ (integerp (nth 2 cents))
+ (setq rnote cents)
+ (or
+ (not note)
+ (Math-numberp (setq rcents
+ (math-simplify
+ (math-div note '(var cents var-cents)))))))
+ (list rnote rcents)))))
+
+(defun math-freq-to-midi (freq)
+ "Return the midi note number corresponding to FREQ Hz."
+ (let ((midi (math-add
+ 69
+ (math-mul
+ 12
+ (calcFunc-log
+ (math-div freq 440)
+ 2)))))
+ (math-midi-round midi)))
+
+(defun math-spn-to-midi (spn)
+ "Return the MIDI number corresponding to SPN."
+ (let* ((note (cdr (assoc (nth 1 (car spn)) math-notes)))
+ (octave (math-add (nth 2 (car spn)) 1))
+ (cents (nth 1 spn))
+ (midi (math-add
+ (math-mul 12 octave)
+ note)))
+ (if cents
+ (math-add midi (math-div cents 100))
+ midi)))
+
+(defun math-midi-to-spn (midi)
+ "Return the scientific pitch notation corresponding to midi number MIDI."
+ (let (midin cents)
+ (if (math-integerp midi)
+ (setq midin midi
+ cents nil)
+ (setq midin (math-floor midi)
+ cents (math-mul 100 (math-sub midi midin))))
+ (let* ((nr ;; This should be (math-idivmod midin 12), but with
+ ;; better behavior for negative midin.
+ (if (Math-negp midin)
+ (let ((dm (math-idivmod (math-neg midin) 12)))
+ (if (= (cdr dm) 0)
+ (cons (math-neg (car dm)) 0)
+ (cons
+ (math-sub (math-neg (car dm)) 1)
+ (math-sub 12 (cdr dm)))))
+ (math-idivmod midin 12)))
+ (n (math-sub (car nr) 1))
+ (note (car (rassoc (cdr nr) math-notes))))
+ (if cents
+ (list '+ (list 'calcFunc-subscr note n)
+ (list '* cents '(var cents var-cents)))
+ (list 'calcFunc-subscr note n)))))
+
+(defun math-freq-to-spn (freq)
+ "Return the scientific pitch notation corresponding to FREQ Hz."
+ (math-with-extra-prec 3
+ (math-midi-to-spn (math-freq-to-midi freq))))
+
+(defun math-midi-to-freq (midi)
+ "Return the frequency of the note with midi number MIDI."
+ (list '*
+ (math-mul
+ 440
+ (math-pow
+ 2
+ (math-div
+ (math-sub
+ midi
+ 69)
+ 12)))
+ '(var Hz var-Hz)))
+
+(defun math-spn-to-freq (spn)
+ "Return the frequency of the note with scientific pitch notation SPN."
+ (math-midi-to-freq (math-spn-to-midi spn)))
+
+(defun calcFunc-spn (expr)
+ "Return EXPR written as scientific pitch notation + cents."
+ ;; Get the coeffecient of Hz
+ (let (note)
+ (cond
+ ((setq note (math-freqp expr))
+ (math-freq-to-spn note))
+ ((setq note (math-midip expr))
+ (math-midi-to-spn note))
+ ((math-spnp expr)
+ expr)
+ (t
+ (math-reject-arg expr "*Improper expression")))))
+
+(defun calcFunc-midi (expr)
+ "Return EXPR written as a MIDI number."
+ (let (note)
+ (cond
+ ((setq note (math-freqp expr))
+ (math-freq-to-midi note))
+ ((setq note (math-spnp expr))
+ (math-spn-to-midi note))
+ ((math-midip expr)
+ expr)
+ (t
+ (math-reject-arg expr "*Improper expression")))))
+
+(defun calcFunc-freq (expr)
+ "Return the frequency corresponding to EXPR."
+ (let (note)
+ (cond
+ ((setq note (math-midip expr))
+ (math-midi-to-freq note))
+ ((setq note (math-spnp expr))
+ (math-spn-to-freq note))
+ ((math-freqp expr)
+ expr)
+ (t
+ (math-reject-arg expr "*Improper expression")))))
+
+(defun calc-freq (arg)
+ "Return the frequency corresponding to the expression on the stack."
+ (interactive "P")
+ (calc-slow-wrapper
+ (calc-unary-op "freq" 'calcFunc-freq arg)))
+
+(defun calc-midi (arg)
+ "Return the MIDI number corresponding to the expression on the stack."
+ (interactive "P")
+ (calc-slow-wrapper
+ (calc-unary-op "midi" 'calcFunc-midi arg)))
+
+(defun calc-spn (arg)
+ "Return the scientific pitch notation corresponding to the expression on the stack."
+ (interactive "P")
+ (calc-slow-wrapper
+ (calc-unary-op "spn" 'calcFunc-spn arg)))
+
+
(provide 'calc-units)
;; Local variables:
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index 5dfbc2d51f5..47ef3241b3e 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -759,12 +759,13 @@
(math-reject-arg n "*Index out of range")))))
(defun calcFunc-subscr (mat n &optional m)
- (setq mat (calcFunc-mrow mat n))
- (if m
- (if (math-num-integerp n)
- (calcFunc-mrow mat m)
- (calcFunc-mcol mat m))
- mat))
+ (if (eq (car-safe mat) 'var) nil
+ (setq mat (calcFunc-mrow mat n))
+ (if m
+ (if (math-num-integerp n)
+ (calcFunc-mrow mat m)
+ (calcFunc-mcol mat m))
+ mat)))
;;; Get the Nth column of a matrix.
(defun math-mat-col (mat n)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 72ddddeb32d..f4d8983eb88 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -446,6 +446,11 @@ by displaying the sub-formula in `calc-selected-face'."
:group 'calc
:type '(string))
+(defcustom calc-note-threshold "1"
+ "The number of cents that a frequency should be near a note
+to be identified as that note."
+ :type 'string
+ :group 'calc)
(defface calc-nonselected-face
'((t :inherit shadow
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index f2dfc3c51fe..63e7484e127 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -792,6 +792,20 @@ from the cursor position."
(define-obsolete-function-alias 'list-yahrzeit-dates
'calendar-hebrew-list-yahrzeits "23.1")
+(defun calendar-hebrew-birthday (date year)
+ "Absolute date of the anniversary of Hebrew birth DATE, in Hebrew YEAR."
+ (let ((b-day (calendar-extract-day date))
+ (b-month (calendar-extract-month date))
+ (b-year (calendar-extract-year date)))
+ ;; If it's Adar in a normal Hebrew year or Adar II in a Hebrew leap year...
+ (if (= b-month (calendar-hebrew-last-month-of-year b-year))
+ ;; ...then use the same day in last month of Hebrew year.
+ (calendar-hebrew-to-absolute
+ (list (calendar-hebrew-last-month-of-year year) b-day year))
+ ;; Else use the normal anniversary of the birth date,
+ ;; or the corresponding day in years without that date.
+ (+ (calendar-hebrew-to-absolute (list b-month 1 year)) b-day -1))))
+
(defvar date)
;; To be called from diary-list-sexp-entries, where DATE is bound.
@@ -800,6 +814,37 @@ from the cursor position."
"Hebrew calendar equivalent of date diary entry."
(format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date)))
+(defvar entry)
+(declare-function diary-ordinal-suffix "diary-lib" (n))
+
+;;;###diary-autoload
+(defun diary-hebrew-birthday (month day year &optional after-sunset)
+ "Hebrew birthday diary entry.
+Entry applies if date is birthdate (MONTH DAY YEAR), or the day before.
+The order of the input parameters changes according to
+`calendar-date-style' (e.g. to DAY MONTH YEAR in the European style).
+
+Assumes the associated diary entry is the name of the person.
+
+Although the date of birth is specified by the *civil* calendar,
+this function determines the proper Hebrew calendar birthday.
+If the optional argument AFTER-SUNSET is non-nil, this means the
+birth occurred after local sunset on the given civil date.
+In this case, the following civil date corresponds to the Hebrew birthday."
+ (let* ((h-date (calendar-hebrew-from-absolute
+ (+ (calendar-absolute-from-gregorian
+ (diary-make-date month day year))
+ (if after-sunset 1 0))))
+ (h-year (calendar-extract-year h-date)) ; birth-day
+ (d (calendar-absolute-from-gregorian date)) ; today
+ (h-yr (calendar-extract-year (calendar-hebrew-from-absolute d)))
+ (age (- h-yr h-year)) ; current H year - birth H-year
+ (b-date (calendar-hebrew-birthday h-date h-yr)))
+ (and (> age 0) (memq b-date (list d (1+ d)))
+ (format "%s's %d%s Hebrew birthday%s" entry age
+ (diary-ordinal-suffix age)
+ (if (= b-date d) "" " (evening)")))))
+
;;;###diary-autoload
(defun diary-hebrew-omer (&optional mark)
"Omer count diary entry.
@@ -829,8 +874,6 @@ use when highlighting the day in the calendar."
;;;###diary-autoload
(define-obsolete-function-alias 'diary-omer 'diary-hebrew-omer "23.1")
-(defvar entry)
-
(autoload 'diary-make-date "diary-lib")
(declare-function diary-ordinal-suffix "diary-lib" (n))
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index 8a0fbd5cc37..5cdd1577a6e 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -100,7 +100,7 @@ Usually bound to the dimension of a single symbol or command.")
:type list
:documentation "List of tags defining local text.
This can be nil, or a list where the last element can be a string
-representing text that may be incomplete. Preceeding elements
+representing text that may be incomplete. Preceding elements
must be semantic tags representing variables or functions
called in a dereference sequence.")
(prefixclass :initarg :prefixclass
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 31e92724a00..47cb722e005 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1264,7 +1264,7 @@ inserted into the current context.")
;; generated by a collector. This format is in semanticdb search
;; form. This vaguely standard form is a bit challenging to navigate
;; because the tags do not contain buffer info, but the file associated
-;; with the tags preceed the tag in the list.
+;; with the tags precedes the tag in the list.
;;
;; Basic displayors don't care, and can strip the results.
;; Advanced highlighting displayors need to know when they need
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index ef206fd3122..7f7e82a95c2 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -426,7 +426,7 @@ See `semantic-edits-change-leaf-tag' for details on parents."
;; confirmed as the lineage of `overlapped-tags'
;; which must have a value by now.
- ;; Loop over the search list to find the preceeding CDR.
+ ;; Loop over the search list to find the preceding CDR.
;; Fortunatly, (car overlapped-tags) happens to be
;; the first tag positionally.
(let ((tokstart (semantic-tag-start (car overlapped-tags))))
@@ -874,7 +874,7 @@ pre-positioned to a convenient location."
))
(message "To Remove Middle Tag: (%s)"
(semantic-format-tag-name first)))
- ;; Find in the cache the preceeding tag
+ ;; Find in the cache the preceding tag
(while (and cachestart (not (eq first (car (cdr cachestart)))))
(setq cachestart (cdr cachestart)))
;; Find the last tag
diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el
index ecd03ccec73..fa6e7517624 100644
--- a/lisp/cedet/semantic/format.el
+++ b/lisp/cedet/semantic/format.el
@@ -296,7 +296,7 @@ local definitions."
(define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
"Return a canonical name for TAG.
-A canonical name includes the names of any parents or namespaces preceeding
+A canonical name includes the names of any parents or namespaces preceding
the tag.
Optional argument PARENT is the parent type if TAG is a detail.
Optional argument COLOR means highlight the prototype with font-lock colors.")
diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el
index 4489d0ffae5..71a205386db 100644
--- a/lisp/cedet/semantic/java.el
+++ b/lisp/cedet/semantic/java.el
@@ -256,7 +256,7 @@ Optional argument COLOR indicates that color should be mixed in."
(define-mode-local-override semantic-documentation-for-tag
java-mode (&optional tag nosnarf)
"Find documentation from TAG and return it as a clean string.
-Java have documentation set in a comment preceeding TAG's definition.
+Java has documentation set in a comment preceding TAG's definition.
Attempt to strip out comment syntactic sugar, unless optional argument
NOSNARF is non-nil.
If NOSNARF is 'lex, then return the semantic lex token."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d43d2607c9a..88821652784 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -920,6 +920,8 @@ it were the arg to `interactive' (which see) to interactively read the value.
If the variable has a `custom-type' property, it must be a widget and the
`:prompt-value' property of that widget will be used for reading the value.
+If the variable also has a `custom-get' property, that is used for finding
+the current value of the variable, otherwise `symbol-value' is used.
If optional COMMENT argument is non-nil, also prompt for a comment and return
it as the third element in the list."
@@ -941,7 +943,9 @@ it as the third element in the list."
(widget-prompt-value type
prompt
(if (boundp var)
- (symbol-value var))
+ (funcall
+ (or (get var 'custom-get) 'symbol-value)
+ var))
(not (boundp var))))
(t
(eval-minibuffer prompt))))))
@@ -1599,7 +1603,7 @@ Otherwise use brackets."
'editable-field
:size 40 :help-echo echo
:action `(lambda (widget &optional event)
- (customize-apropos (widget-value widget))))))
+ (customize-apropos (split-string (widget-value widget)))))))
(widget-insert " ")
(widget-create-child-and-convert
search-widget 'push-button
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 4ca4cec38ff..fd5baaf020f 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -611,7 +611,8 @@ Furthermore, it clears the variables listed in `desktop-globals-to-clear'."
(delete-other-windows))
;; ----------------------------------------------------------------------------
-(add-hook 'kill-emacs-hook 'desktop-kill)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'desktop-kill))
(defun desktop-kill ()
"If `desktop-save-mode' is non-nil, do what `desktop-save' says to do.
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 986c9edfd2d..c533c81be0e 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1025,9 +1025,9 @@ See Info node `(emacs)Subdir switches' for more details."
;; Keeps any marks that may be present in column one (doing this
;; here is faster than with dired-add-entry's optional arg).
;; Does not update other dired buffers. Use dired-relist-entry for that.
- (let ((char (following-char))
- (opoint (line-beginning-position))
- (buffer-read-only))
+ (let* ((opoint (line-beginning-position))
+ (char (char-after opoint))
+ (buffer-read-only))
(delete-region opoint (progn (forward-line 1) (point)))
(if file
(progn
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 8b1dbb1ef83..a5063bb77dd 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -145,6 +145,8 @@ See Info node `(dired-x) Omitting Variables' for more information."
(let ((dired-omit-size-limit nil)) (dired-omit-expunge))
(revert-buffer)))
+(put 'dired-omit-mode 'safe-local-variable 'booleanp)
+
;; For backward compatibility
(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1")
@@ -185,15 +187,19 @@ If nil, there is no maximum size."
(defcustom dired-enable-local-variables t
"Control use of local-variables lists in Dired.
-The value can be t, nil or something else.
-A value of t means local-variables lists are obeyed;
-nil means they are ignored; anything else means query.
-
This temporarily overrides the value of `enable-local-variables' when
listing a directory. See also `dired-local-variables-file'."
- :type 'boolean
+ :risky t
+ :type '(choice (const :tag "Query Unsafe" t)
+ (const :tag "Safe Only" :safe)
+ (const :tag "Do all" :all)
+ (const :tag "Ignore" nil)
+ (other :tag "Query" other))
:group 'dired-x)
+(make-obsolete-variable 'dired-enable-local-variables
+ "use a standard `dir-locals-file' instead." "24.1")
+
(defcustom dired-guess-shell-gnutar
(catch 'found
(dolist (exe '("tar" "gtar"))
@@ -430,6 +436,7 @@ move to its line in dired."
(dired-omit-mode)
(dired-goto-file file)))))))
+;;;###autoload
(defun dired-jump-other-window (&optional file-name)
"Like \\[dired-jump] (`dired-jump') but in other window."
(interactive
@@ -698,15 +705,26 @@ Also useful for `auto-mode-alist' like this:
(dired-current-directory)
default-directory)))
"Alist of major modes and their opinion on `default-directory'.
-This is given as a Lisp expression to evaluate. A resulting value of
-nil is ignored in favor of `default-directory'.")
+Each element has the form (MAJOR . EXPRESSION).
+The function `dired-default-directory' evaluates EXPRESSION to
+determine a default directory.")
+
+(put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd
+(make-obsolete-variable 'dired-default-directory-alist
+ "this feature is due to be removed." "24.1")
(defun dired-default-directory ()
- "Usage like variable `default-directory'.
-Knows about the special cases in variable `dired-default-directory-alist'."
+ "Return the `dired-default-directory-alist' entry for the current major-mode.
+If none, return `default-directory'."
(or (eval (cdr (assq major-mode dired-default-directory-alist)))
default-directory))
+;; It looks like this was intended to be something of a "general" feature,
+;; but it only ever seems to have been used in dired-smart-shell-command,
+;; and does not seem worth keeping around (?).
+(make-obsolete 'dired-default-directory
+ "this feature is due to be removed." "24.1")
+
(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
"Like function `shell-command', but in the current Virtual Dired directory."
(interactive
@@ -717,32 +735,33 @@ Knows about the special cases in variable `dired-default-directory-alist'."
((eq major-mode 'dired-mode) (dired-get-filename t t))))
current-prefix-arg
shell-command-default-error-buffer))
- (let ((default-directory (dired-default-directory)))
+ (let ((default-directory (or (and (eq major-mode 'dired-mode)
+ (dired-current-directory))
+ default-directory)))
(shell-command command output-buffer error-buffer)))
;;; LOCAL VARIABLES FOR DIRED BUFFERS.
-;; Brief Description:
-;;;
+;; Brief Description (This feature is obsolete as of Emacs 24.1)
+;;
;; * `dired-extra-startup' is part of the `dired-mode-hook'.
-;;;
+;;
;; * `dired-extra-startup' calls `dired-hack-local-variables'
-;;;
+;;
;; * `dired-hack-local-variables' checks the value of
-;;; `dired-local-variables-file'
-;;;
+;; `dired-local-variables-file'
+;;
;; * Check if `dired-local-variables-file' is a non-nil string and is a
-;;; filename found in the directory of the Dired Buffer being created.
-;;;
+;; filename found in the directory of the Dired Buffer being created.
+;;
;; * If `dired-local-variables-file' satisfies the above, then temporarily
-;;; include it in the Dired Buffer at the bottom.
-;;;
+;; include it in the Dired Buffer at the bottom.
+;;
;; * Set `enable-local-variables' temporarily to the user variable
-;;; `dired-enable-local-variables' and run `hack-local-variables' on the
-;;; Dired Buffer.
+;; `dired-enable-local-variables' and run `hack-local-variables' on the
+;; Dired Buffer.
-;; FIXME do standard dir-locals obsolete this?
(defcustom dired-local-variables-file (convert-standard-filename ".dired")
"Filename, as string, containing local dired buffer variables to be hacked.
If this file found in current directory, then it will be inserted into dired
@@ -752,6 +771,8 @@ See also `dired-enable-local-variables'."
:type 'file
:group 'dired)
+(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
+
(defun dired-hack-local-variables ()
"Evaluate local variables in `dired-local-variables-file' for dired buffer."
(and (stringp dired-local-variables-file)
@@ -767,29 +788,42 @@ See also `dired-enable-local-variables'."
(insert "\^L\n")
(insert-file-contents dired-local-variables-file))
;; Hack 'em.
- (let ((buffer-file-name dired-local-variables-file))
- (hack-local-variables))
+ (unwind-protect
+ (let ((buffer-file-name dired-local-variables-file))
+ (hack-local-variables))
+ ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
+ (delete-region opoint (point-max)))
;; Make sure that the modeline shows the proper information.
- (dired-sort-set-modeline)
- ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
- (delete-region opoint (point-max)))))
+ (dired-sort-set-modeline))))
+(make-obsolete 'dired-hack-local-variables
+ 'hack-dir-local-variables-non-file-buffer "24.1")
+
+;; Does not seem worth a dedicated command.
+;; See the more general features in files-x.el.
(defun dired-omit-here-always ()
- "Create `dired-local-variables-file' for omitting and reverts directory.
-Sets `dired-omit-mode' to t in a local variables file that is readable by
-dired."
+ "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
+If in a Dired buffer, reverts it."
(interactive)
(if (file-exists-p dired-local-variables-file)
- (message "File `./%s' already exists." dired-local-variables-file)
- ;; Create `dired-local-variables-file'.
- (with-current-buffer (get-buffer-create " *dot-dired*")
- (erase-buffer)
- (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n")
- (write-file dired-local-variables-file)
- (kill-buffer))
+ (error "Old-style dired-local-variables-file `./%s' found;
+replace it with a dir-locals-file `./%s'"
+ dired-local-variables-file
+ dir-locals-file))
+ (if (file-exists-p dir-locals-file)
+ (message "File `./%s' already exists." dir-locals-file)
+ (with-temp-buffer
+ (insert "\
+\((dired-mode . ((subdirs . nil)
+ (dired-omit-mode . t))))\n")
+ (write-file dir-locals-file))
;; Run extra-hooks and revert directory.
- (dired-extra-startup)
- (dired-revert)))
+ (when (derived-mode-p 'dired-mode)
+ (hack-dir-local-variables-non-file-buffer)
+ (dired-extra-startup)
+ (dired-revert))))
+
+(make-obsolete 'dired-omit-here-always 'add-dir-local-variable "24.1")
;;; GUESS SHELL COMMAND.
@@ -826,11 +860,11 @@ dired."
;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not
;; install GNU zip's version of zcat.
-(declare-function Man-support-local-filenames "man" ())
+(autoload 'Man-support-local-filenames "man")
(defvar dired-guess-shell-alist-default
(list
- (list "\\.tar$"
+ (list "\\.tar\\'"
'(if dired-guess-shell-gnutar
(concat dired-guess-shell-gnutar " xvf")
"tar xvf")
@@ -848,7 +882,7 @@ dired."
;; REGEXPS for compressed archives must come before the .Z rule to
;; be recognized:
- (list "\\.tar\\.Z$"
+ (list "\\.tar\\.Z\\'"
;; Untar it.
'(if dired-guess-shell-gnutar
(concat dired-guess-shell-gnutar " zxvf")
@@ -858,7 +892,7 @@ dired."
" " dired-guess-shell-znew-switches))
;; gzip'ed archives
- (list "\\.t\\(ar\\.\\)?gz$"
+ (list "\\.t\\(ar\\.\\)?gz\\'"
'(if dired-guess-shell-gnutar
(concat dired-guess-shell-gnutar " zxvf")
(concat "gunzip -qc * | tar xvf -"))
@@ -878,7 +912,7 @@ dired."
(concat "gunzip -qc * | tar tvf -")))
;; bzip2'ed archives
- (list "\\.t\\(ar\\.bz2\\|bz\\)$"
+ (list "\\.t\\(ar\\.bz2\\|bz\\)\\'"
"bunzip2 -c * | tar xvf -"
;; Extract files into a separate subdirectory
'(concat "mkdir " (file-name-sans-extension file)
@@ -888,7 +922,7 @@ dired."
"bunzip2")
;; xz'ed archives
- (list "\\.t\\(ar\\.\\)?xz$"
+ (list "\\.t\\(ar\\.\\)?xz\\'"
"unxz -c * | tar xvf -"
;; Extract files into a separate subdirectory
'(concat "mkdir " (file-name-sans-extension file)
@@ -897,94 +931,103 @@ dired."
;; Optional decompression.
"unxz")
- '("\\.shar\\.Z$" "zcat * | unshar")
- '("\\.shar\\.g?z$" "gunzip -qc * | unshar")
+ '("\\.shar\\.Z\\'" "zcat * | unshar")
+ '("\\.shar\\.g?z\\'" "gunzip -qc * | unshar")
- '("\\.e?ps$" "ghostview" "xloadimage" "lpr")
- (list "\\.e?ps\\.g?z$" "gunzip -qc * | ghostview -"
+ '("\\.e?ps\\'" "ghostview" "xloadimage" "lpr")
+ (list "\\.e?ps\\.g?z\\'" "gunzip -qc * | ghostview -"
;; Optional decompression.
'(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
- (list "\\.e?ps\\.Z$" "zcat * | ghostview -"
+ (list "\\.e?ps\\.Z\\'" "zcat * | ghostview -"
;; Optional conversion to gzip format.
'(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
" " dired-guess-shell-znew-switches))
- '("\\.patch$" "cat * | patch")
- (list "\\.patch\\.g?z$" "gunzip -qc * | patch"
+ '("\\.patch\\'" "cat * | patch")
+ (list "\\.patch\\.g?z\\'" "gunzip -qc * | patch"
;; Optional decompression.
'(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
- (list "\\.patch\\.Z$" "zcat * | patch"
+ (list "\\.patch\\.Z\\'" "zcat * | patch"
;; Optional conversion to gzip format.
'(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
" " dired-guess-shell-znew-switches))
;; The following four extensions are useful with dired-man ("N" key)
- (list "\\.\\(?:[0-9]\\|man\\)$" '(progn (require 'man)
- (if (Man-support-local-filenames)
- "man -l"
- "cat * | tbl | nroff -man -h")))
- (list "\\.\\(?:[0-9]\\|man\\)\\.g?z$" '(progn (require 'man)
- (if (Man-support-local-filenames)
- "man -l"
- "gunzip -qc * | tbl | nroff -man -h"))
+ ;; FIXME "man ./" does not work with dired-do-shell-command,
+ ;; because there seems to be no way for us to modify the filename,
+ ;; only the command. Hmph. `dired-man' works though.
+ (list "\\.\\(?:[0-9]\\|man\\)\\'" '(let ((loc (Man-support-local-filenames)))
+ (cond ((eq loc 'man-db) "man -l")
+ ((eq loc 'man) "man ./")
+ (t
+ "cat * | tbl | nroff -man -h"))))
+ (list "\\.\\(?:[0-9]\\|man\\)\\.g?z\\'"
+ '(let ((loc (Man-support-local-filenames)))
+ (cond ((eq loc 'man-db)
+ "man -l")
+ ((eq loc 'man)
+ "man ./")
+ (t "gunzip -qc * | tbl | nroff -man -h")))
;; Optional decompression.
'(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
- (list "\\.[0-9]\\.Z$" '(progn (require 'man)
- (if (Man-support-local-filenames)
- "man -l"
- "zcat * | tbl | nroff -man -h"))
+ (list "\\.[0-9]\\.Z\\'" '(let ((loc (Man-support-local-filenames)))
+ (cond ((eq loc 'man-db) "man -l")
+ ((eq loc 'man) "man ./")
+ (t "zcat * | tbl | nroff -man -h")))
;; Optional conversion to gzip format.
'(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
" " dired-guess-shell-znew-switches))
- '("\\.pod$" "perldoc" "pod2man * | nroff -man")
-
- '("\\.dvi$" "xdvi" "dvips") ; preview and printing
- '("\\.au$" "play") ; play Sun audiofiles
- '("\\.mpe?g$\\|\\.avi$" "xine -p")
- '("\\.ogg$" "ogg123")
- '("\\.mp3$" "mpg123")
- '("\\.wav$" "play")
- '("\\.uu$" "uudecode") ; for uudecoded files
- '("\\.hqx$" "mcvert")
- '("\\.sh$" "sh") ; execute shell scripts
- '("\\.xbm$" "bitmap") ; view X11 bitmaps
- '("\\.gp$" "gnuplot")
- '("\\.p[bgpn]m$" "xloadimage")
- '("\\.gif$" "xloadimage") ; view gif pictures
- '("\\.tif$" "xloadimage")
- '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG
- '("\\.jpe?g$" "xloadimage")
- '("\\.fig$" "xfig") ; edit fig pictures
- '("\\.out$" "xgraph") ; for plotting purposes.
- '("\\.tex$" "latex" "tex")
- '("\\.texi\\(nfo\\)?$" "makeinfo" "texi2dvi")
- '("\\.pdf$" "xpdf")
- '("\\.doc$" "antiword" "strings")
- '("\\.rpm$" "rpm -qilp" "rpm -ivh")
- '("\\.dia$" "dia")
- '("\\.mgp$" "mgp")
+ '("\\.pod\\'" "perldoc" "pod2man * | nroff -man")
+
+ '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
+ '("\\.au\\'" "play") ; play Sun audiofiles
+ '("\\.mpe?g\\'\\|\\.avi\\'" "xine -p")
+ '("\\.ogg\\'" "ogg123")
+ '("\\.mp3\\'" "mpg123")
+ '("\\.wav\\'" "play")
+ '("\\.uu\\'" "uudecode") ; for uudecoded files
+ '("\\.hqx\\'" "mcvert")
+ '("\\.sh\\'" "sh") ; execute shell scripts
+ '("\\.xbm\\'" "bitmap") ; view X11 bitmaps
+ '("\\.gp\\'" "gnuplot")
+ '("\\.p[bgpn]m\\'" "xloadimage")
+ '("\\.gif\\'" "xloadimage") ; view gif pictures
+ '("\\.tif\\'" "xloadimage")
+ '("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG
+ '("\\.jpe?g\\'" "xloadimage")
+ '("\\.fig\\'" "xfig") ; edit fig pictures
+ '("\\.out\\'" "xgraph") ; for plotting purposes.
+ '("\\.tex\\'" "latex" "tex")
+ '("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi")
+ '("\\.pdf\\'" "xpdf")
+ '("\\.doc\\'" "antiword" "strings")
+ '("\\.rpm\\'" "rpm -qilp" "rpm -ivh")
+ '("\\.dia\\'" "dia")
+ '("\\.mgp\\'" "mgp")
;; Some other popular archivers.
- (list "\\.zip$" "unzip" "unzip -l"
+ (list "\\.zip\\'" "unzip" "unzip -l"
;; Extract files into a separate subdirectory
'(concat "unzip" (if dired-guess-shell-gzip-quiet " -q")
" -d " (file-name-sans-extension file)))
- '("\\.zoo$" "zoo x//")
- '("\\.lzh$" "lharc x")
- '("\\.arc$" "arc x")
- '("\\.shar$" "unshar")
+ '("\\.zoo\\'" "zoo x//")
+ '("\\.lzh\\'" "lharc x")
+ '("\\.arc\\'" "arc x")
+ '("\\.shar\\'" "unshar")
+ '("\\.rar\\'" "unrar x")
+ '("\\.7z\\'" "7z x")
;; Compression.
- (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
- (list "\\.dz$" "dictunzip")
- (list "\\.bz2$" "bunzip2")
- (list "\\.xz$" "unxz")
- (list "\\.Z$" "uncompress"
+ (list "\\.g?z\\'" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
+ (list "\\.dz\\'" "dictunzip")
+ (list "\\.bz2\\'" "bunzip2")
+ (list "\\.xz\\'" "unxz")
+ (list "\\.Z\\'" "uncompress"
;; Optional conversion to gzip format.
'(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
" " dired-guess-shell-znew-switches))
- '("\\.sign?$" "gpg --verify"))
+ '("\\.sign?\\'" "gpg --verify"))
"Default alist used for shell command guessing.
See `dired-guess-shell-alist-user'.")
diff --git a/lisp/dired.el b/lisp/dired.el
index af99d4c7413..c8343ba7561 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -249,9 +249,19 @@ Local to each dired buffer. May be a list, in which case the car is the
directory name and the cdr is the list of files to mention.
The directory name must be absolute, but need not be fully expanded.")
+;; Beware of "-l;reboot" etc. See bug#3230.
+(defun dired-safe-switches-p (switches)
+ "Return non-nil if string SWITCHES does not look risky for dired."
+ (or (not switches)
+ (and (stringp switches)
+ (< (length switches) 100) ; arbitrary
+ (string-match "\\` *-[- [:alnum:]]+\\'" switches))))
+
(defvar dired-actual-switches nil
"The value of `dired-listing-switches' used to make this buffer's text.")
+(put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p)
+
(defvar dired-re-inode-size "[0-9 \t]*"
"Regexp for optional initial inode and file size as made by `ls -i -s'.")
@@ -601,9 +611,12 @@ Don't use that together with FILTER."
(if current-prefix-arg
(read-string "Dired listing switches: "
dired-listing-switches))
- ;; If a dialog is about to be used, call read-directory-name so
- ;; the dialog code knows we want directories. Some dialogs can
- ;; only select directories or files when popped up, not both.
+ ;; If a dialog is used, call `read-directory-name' so the
+ ;; dialog code knows we want directories. Some dialogs
+ ;; can only select directories or files when popped up,
+ ;; not both. If no dialog is used, call `read-file-name'
+ ;; because the user may want completion of file names for
+ ;; use in a wildcard pattern.
(if (next-read-file-uses-dialog-p)
(read-directory-name (format "Dired %s(directory): " str)
nil default-directory nil)
@@ -1860,6 +1873,7 @@ Keybindings:
(set (make-local-variable 'desktop-save-buffer)
'dired-desktop-buffer-misc-data)
(setq dired-switches-alist nil)
+ (hack-dir-local-variables-non-file-buffer) ; before sorting
(dired-sort-other dired-actual-switches t)
(when (featurep 'dnd)
(set (make-local-variable 'dnd-protocol-alist)
@@ -3615,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;; dired-diff) "dired-aux" "dired-aux.el" "9d6333fab9c0f1b49e0bf2a536b8f245")
+;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
@@ -4073,8 +4087,8 @@ true then the type of the file linked to by FILE is printed instead.
;;;***
-;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
-;;;;;; "86d436093caa9ae80f7b73915c6a4b4c")
+;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
+;;;;;; "dired-x" "dired-x.el" "87fd4ae2fdade7e0f11c4a0b1cfdeda2")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\
@@ -4089,6 +4103,11 @@ move to its line in dired.
\(fn &optional OTHER-WINDOW FILE-NAME)" t nil)
+(autoload 'dired-jump-other-window "dired-x" "\
+Like \\[dired-jump] (`dired-jump') but in other window.
+
+\(fn &optional FILE-NAME)" t nil)
+
(autoload 'dired-do-relsymlink "dired-x" "\
Relative symlink all marked (or next ARG) files into a directory.
Otherwise make a relative symbolic link to the current file.
diff --git a/lisp/emacs-lisp/assoc.el b/lisp/emacs-lisp/assoc.el
index aa85916cc3f..31be851f2dd 100644
--- a/lisp/emacs-lisp/assoc.el
+++ b/lisp/emacs-lisp/assoc.el
@@ -1,4 +1,4 @@
-;;; assoc.el --- insert/delete/sort functions on association lists
+;;; assoc.el --- insert/delete functions on association lists
;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
@@ -35,7 +35,7 @@ head is one matching KEY. Returns the sorted list and doesn't affect
the order of any other key-value pair. Side effect sets alist to new
sorted list."
(set alist-symbol
- (sort (copy-alist (eval alist-symbol))
+ (sort (copy-alist (symbol-value alist-symbol))
(function (lambda (a b) (equal (car a) key))))))
@@ -75,7 +75,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
(lexical-let ((elem (aelement key value))
alist)
(asort alist-symbol key)
- (setq alist (eval alist-symbol))
+ (setq alist (symbol-value alist-symbol))
(cond ((null alist) (set alist-symbol elem))
((anot-head-p alist key) (set alist-symbol (nconc elem alist)))
(value (setcar alist (car elem)))
@@ -87,7 +87,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
is pair matching KEY. Returns the altered alist."
(asort alist-symbol key)
- (lexical-let ((alist (eval alist-symbol)))
+ (lexical-let ((alist (symbol-value alist-symbol)))
(cond ((null alist) nil)
((anot-head-p alist key) alist)
(t (set alist-symbol (cdr alist))))))
@@ -133,7 +133,7 @@ extra values are ignored. Returns the created alist."
(t
(amake alist-symbol keycdr valcdr)
(aput alist-symbol keycar valcar))))
- (eval alist-symbol))
+ (symbol-value alist-symbol))
(provide 'assoc)
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 7b610d11b0f..d6e7ee9e3cb 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -537,7 +537,8 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE
(defun autoload-save-buffers ()
(while autoload-modified-buffers
(with-current-buffer (pop autoload-modified-buffers)
- (save-buffer))))
+ (let ((version-control 'never))
+ (save-buffer)))))
;;;###autoload
(defun update-file-autoloads (file &optional save-after)
@@ -569,8 +570,9 @@ removes any prior now out-of-date autoload entries."
(with-current-buffer
;; We used to use `raw-text' to read this file, but this causes
;; problems when the file contains non-ASCII characters.
- (find-file-noselect
- (autoload-ensure-default-file (autoload-generated-file)))
+ (let ((enable-local-variables :safe))
+ (find-file-noselect
+ (autoload-ensure-default-file (autoload-generated-file))))
;; This is to make generated-autoload-file have Unix EOLs, so
;; that it is portable to all platforms.
(or (eq 0 (coding-system-eol-type buffer-file-coding-system))
@@ -656,8 +658,9 @@ directory or directories specified."
(autoload-modified-buffers nil))
(with-current-buffer
- (find-file-noselect
- (autoload-ensure-default-file (autoload-generated-file)))
+ (let ((enable-local-variables :safe))
+ (find-file-noselect
+ (autoload-ensure-default-file (autoload-generated-file))))
(save-excursion
;; Canonicalize file names and remove the autoload file itself.
@@ -721,7 +724,8 @@ directory or directories specified."
(current-buffer) nil nil no-autoloads this-time)
(insert generate-autoload-section-trailer))
- (save-buffer)
+ (let ((version-control 'never))
+ (save-buffer))
;; In case autoload entries were added to other files because of
;; file-local autoload-generated-file settings.
(autoload-save-buffers))))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 297655a235a..7b785c9ace6 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -238,6 +238,7 @@ the functions you loaded will not be able to run.")
(defvar byte-compile-disable-print-circle nil
"If non-nil, disable `print-circle' on printing a byte-compiled code.")
+(make-obsolete-variable 'byte-compile-disable-print-circle nil "24.1")
;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
(defcustom byte-compile-dynamic-docstrings t
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index df9460154e8..17046f1ffb4 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from
;;;;;; return block etypecase typecase ecase case load-time-value
;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp
-;;;;;; gensym) "cl-macs" "cl-macs.el" "7602128fa01003de9a8df4c752865300")
+;;;;;; gensym) "cl-macs" "cl-macs.el" "5bdba3fbbcbfcf57a2c9ca87a6318150")
;;; Generated autoloads from cl-macs.el
(autoload 'gensym "cl-macs" "\
@@ -319,7 +319,7 @@ its argument list allows full Common Lisp conventions.
\(fn FUNC)" nil (quote macro))
(autoload 'destructuring-bind "cl-macs" "\
-Not documented
+
\(fn ARGS EXPR &rest BODY)" nil (quote macro))
@@ -445,7 +445,7 @@ from OBARRAY.
\(fn (VAR [OBARRAY [RESULT]]) BODY...)" nil (quote macro))
(autoload 'do-all-symbols "cl-macs" "\
-Not documented
+
\(fn SPEC &rest BODY)" nil (quote macro))
@@ -505,7 +505,7 @@ lexical closures as in Common Lisp.
(autoload 'lexical-let* "cl-macs" "\
Like `let*', but lexically scoped.
The main visible difference is that lambdas inside BODY, and in
-successive bindings within BINDINGS, will create lexical closures
+successive bindings within VARLIST, will create lexical closures
as in Common Lisp. This is similar to the behavior of `let*' in
Common Lisp.
@@ -531,12 +531,12 @@ values. For compatibility, (values A B C) is a synonym for (list A B C).
\(fn (SYM...) FORM)" nil (quote macro))
(autoload 'locally "cl-macs" "\
-Not documented
+
\(fn &rest BODY)" nil (quote macro))
(autoload 'declare "cl-macs" "\
-Not documented
+
\(fn &rest SPECS)" nil (quote macro))
@@ -596,7 +596,7 @@ before assigning any PLACEs to the corresponding values.
\(fn PLACE VAL PLACE VAL ...)" nil (quote macro))
(autoload 'cl-do-pop "cl-macs" "\
-Not documented
+
\(fn PLACE)" nil nil)
@@ -684,7 +684,7 @@ value, that slot cannot be set via `setf'.
\(fn NAME SLOTS...)" nil (quote macro))
(autoload 'cl-struct-setf-expander "cl-macs" "\
-Not documented
+
\(fn X NAME ACCESSOR PRED-FORM POS)" nil nil)
@@ -730,7 +730,7 @@ and then returning foo.
\(fn FUNC ARGS &rest BODY)" nil (quote macro))
(autoload 'compiler-macroexpand "cl-macs" "\
-Not documented
+
\(fn FORM)" nil nil)
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 093e4fbf258..8b1fc9d5f53 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1476,7 +1476,7 @@ lexical closures as in Common Lisp.
(defmacro lexical-let* (bindings &rest body)
"Like `let*', but lexically scoped.
The main visible difference is that lambdas inside BODY, and in
-successive bindings within BINDINGS, will create lexical closures
+successive bindings within VARLIST, will create lexical closures
as in Common Lisp. This is similar to the behavior of `let*' in
Common Lisp.
\n(fn VARLIST BODY)"
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 910eff3c78f..73af3a5708f 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -630,7 +630,7 @@ displayed."
'display (list 'space :align-to column)
'face 'fixed-pitch)
title)
- (setq column (+ column 1
+ (setq column (+ column 2
(if (= column 0)
elp-field-len
(length title))))))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b3c95fcc78f..5bd8fd01b1e 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -219,7 +219,7 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'."
;; This implementation is inefficient. Rather than making it
;; efficient, let's hope bug 6581 gets fixed so that we can delete
;; it altogether.
- (not (ert--explain-not-equal-including-properties a b)))
+ (not (ert--explain-equal-including-properties a b)))
;;; Defining and locating tests.
@@ -571,16 +571,15 @@ failed."
(when (and (not firstp) (eq fast slow)) (return nil))))
(defun ert--explain-format-atom (x)
- "Format the atom X for `ert--explain-not-equal'."
+ "Format the atom X for `ert--explain-equal'."
(typecase x
(fixnum (list x (format "#x%x" x) (format "?%c" x)))
(t x)))
-(defun ert--explain-not-equal (a b)
- "Explainer function for `equal'.
+(defun ert--explain-equal-rec (a b)
+ "Returns a programmer-readable explanation of why A and B are not `equal'.
-Returns a programmer-readable explanation of why A and B are not
-`equal', or nil if they are."
+Returns nil if they are."
(if (not (equal (type-of a) (type-of b)))
`(different-types ,a ,b)
(etypecase a
@@ -598,13 +597,13 @@ Returns a programmer-readable explanation of why A and B are not
(loop for i from 0
for ai in a
for bi in b
- for xi = (ert--explain-not-equal ai bi)
+ for xi = (ert--explain-equal-rec ai bi)
do (when xi (return `(list-elt ,i ,xi)))
finally (assert (equal a b) t)))
- (let ((car-x (ert--explain-not-equal (car a) (car b))))
+ (let ((car-x (ert--explain-equal-rec (car a) (car b))))
(if car-x
`(car ,car-x)
- (let ((cdr-x (ert--explain-not-equal (cdr a) (cdr b))))
+ (let ((cdr-x (ert--explain-equal-rec (cdr a) (cdr b))))
(if cdr-x
`(cdr ,cdr-x)
(assert (equal a b) t)
@@ -618,7 +617,7 @@ Returns a programmer-readable explanation of why A and B are not
(loop for i from 0
for ai across a
for bi across b
- for xi = (ert--explain-not-equal ai bi)
+ for xi = (ert--explain-equal-rec ai bi)
do (when xi (return `(array-elt ,i ,xi)))
finally (assert (equal a b) t))))
(atom (if (not (equal a b))
@@ -627,7 +626,15 @@ Returns a programmer-readable explanation of why A and B are not
`(different-atoms ,(ert--explain-format-atom a)
,(ert--explain-format-atom b)))
nil)))))
-(put 'equal 'ert-explainer 'ert--explain-not-equal)
+
+(defun ert--explain-equal (a b)
+ "Explainer function for `equal'."
+ ;; Do a quick comparison in C to avoid running our expensive
+ ;; comparison when possible.
+ (if (equal a b)
+ nil
+ (ert--explain-equal-rec a b)))
+(put 'equal 'ert-explainer 'ert--explain-equal)
(defun ert--significant-plist-keys (plist)
"Return the keys of PLIST that have non-null values, in order."
@@ -658,8 +665,8 @@ key/value pairs in each list does not matter."
(value-b (plist-get b key)))
(assert (not (equal value-a value-b)) t)
`(different-properties-for-key
- ,key ,(ert--explain-not-equal-including-properties value-a
- value-b)))))
+ ,key ,(ert--explain-equal-including-properties value-a
+ value-b)))))
(cond (keys-in-a-not-in-b
(explain-with-key (first keys-in-a-not-in-b)))
(keys-in-b-not-in-a
@@ -681,13 +688,16 @@ If SUFFIXP is non-nil, returns a suffix of S, otherwise a prefix."
(t
(substring s 0 len)))))
-(defun ert--explain-not-equal-including-properties (a b)
+;; TODO(ohler): Once bug 6581 is fixed, rename this to
+;; `ert--explain-equal-including-properties-rec' and add a fast-path
+;; wrapper like `ert--explain-equal'.
+(defun ert--explain-equal-including-properties (a b)
"Explainer function for `ert-equal-including-properties'.
Returns a programmer-readable explanation of why A and B are not
`ert-equal-including-properties', or nil if they are."
(if (not (equal a b))
- (ert--explain-not-equal a b)
+ (ert--explain-equal a b)
(assert (stringp a) t)
(assert (stringp b) t)
(assert (eql (length a) (length b)) t)
@@ -713,7 +723,7 @@ Returns a programmer-readable explanation of why A and B are not
)))
(put 'ert-equal-including-properties
'ert-explainer
- 'ert--explain-not-equal-including-properties)
+ 'ert--explain-equal-including-properties)
;;; Implementation of `ert-info'.
@@ -1244,12 +1254,14 @@ Also changes the counters in STATS to match."
(ert-test-passed (incf (ert--stats-passed-expected stats) d))
(ert-test-failed (incf (ert--stats-failed-expected stats) d))
(null)
- (ert-test-aborted-with-non-local-exit))
+ (ert-test-aborted-with-non-local-exit)
+ (ert-test-quit))
(etypecase (aref results pos)
(ert-test-passed (incf (ert--stats-passed-unexpected stats) d))
(ert-test-failed (incf (ert--stats-failed-unexpected stats) d))
(null)
- (ert-test-aborted-with-non-local-exit)))))
+ (ert-test-aborted-with-non-local-exit)
+ (ert-test-quit)))))
;; Adjust counters to remove the result that is currently in stats.
(update -1)
;; Put new test and result into stats.
@@ -1342,7 +1354,8 @@ EXPECTEDP specifies whether the result was expected."
(ert-test-passed ".P")
(ert-test-failed "fF")
(null "--")
- (ert-test-aborted-with-non-local-exit "aA"))))
+ (ert-test-aborted-with-non-local-exit "aA")
+ (ert-test-quit "qQ"))))
(elt s (if expectedp 0 1))))
(defun ert-string-for-test-result (result expectedp)
@@ -1353,7 +1366,8 @@ EXPECTEDP specifies whether the result was expected."
(ert-test-passed '("passed" "PASSED"))
(ert-test-failed '("failed" "FAILED"))
(null '("unknown" "UNKNOWN"))
- (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED")))))
+ (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED"))
+ (ert-test-quit '("quit" "QUIT")))))
(elt s (if expectedp 0 1))))
(defun ert--pp-with-indentation-and-newline (object)
@@ -1478,7 +1492,9 @@ Returns the stats object."
(message "%s" (buffer-string))))
(ert-test-aborted-with-non-local-exit
(message "Test %S aborted with non-local exit"
- (ert-test-name test)))))
+ (ert-test-name test)))
+ (ert-test-quit
+ (message "Quit during %S" (ert-test-name test)))))
(let* ((max (prin1-to-string (length (ert--stats-tests stats))))
(format-string (concat "%9s %"
(prin1-to-string (length max))
@@ -1853,7 +1869,9 @@ non-nil, returns the face for expected results.."
(ert-test-result-with-condition-condition result))
(ert--make-xrefs-region begin (point)))))
(ert-test-aborted-with-non-local-exit
- (insert " aborted\n")))
+ (insert " aborted\n"))
+ (ert-test-quit
+ (insert " quit\n")))
(insert "\n")))))
nil)
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index bf9998695ee..a71f3c7244c 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -495,6 +495,8 @@ Return the node (or nil if we just passed the last node)."
;; Never step below the first element.
;; (unless (ewoc--filter-hf-nodes ewoc node)
;; (setq node (ewoc--node-nth dll -2)))
+ (unless node
+ (error "No next"))
(ewoc-goto-node ewoc node)))
(defun ewoc-goto-node (ewoc node)
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index b9994be3d39..61f23abf0a7 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -40,6 +40,9 @@
(defvar package-archive-upload-base nil
"Base location for uploading to package archive.")
+(defvar package-update-news-on-upload nil
+ "Whether package upload should also update NEWS and RSS feeds.")
+
(defun package--encode (string)
"Encode a string by replacing some characters with XML entities."
;; We need a special case for translating "&" to "&amp;".
@@ -86,6 +89,36 @@
(unless old-buffer
(kill-buffer (current-buffer)))))))
+(defun package--archive-contents-from-url (archive-url)
+ "Parse archive-contents file at ARCHIVE-URL.
+Return the file contents, as a string, or nil if unsuccessful."
+ (ignore-errors
+ (when archive-url
+ (let* ((buffer (url-retrieve-synchronously
+ (concat archive-url "archive-contents"))))
+ (set-buffer buffer)
+ (package-handle-response)
+ (re-search-forward "^$" nil 'move)
+ (forward-char)
+ (delete-region (point-min) (point))
+ (prog1 (package-read-from-string
+ (buffer-substring-no-properties (point-min) (point-max)))
+ (kill-buffer buffer))))))
+
+(defun package--archive-contents-from-file (file)
+ "Parse the given archive-contents file."
+ (if (not (file-exists-p file))
+ ;; no existing archive-contents, possibly a new ELPA repo.
+ (list package-archive-version)
+ (let ((dont-kill (find-buffer-visiting file)))
+ (with-current-buffer (let ((find-file-visit-truename t))
+ (find-file-noselect file))
+ (prog1
+ (package-read-from-string
+ (buffer-substring-no-properties (point-min) (point-max)))
+ (unless dont-kill
+ (kill-buffer (current-buffer))))))))
+
(defun package-maint-add-news-item (title description archive-url)
"Add a news item to the ELPA web pages.
TITLE is the title of the news item.
@@ -111,11 +144,20 @@ PKG-INFO is the package info, see `package-buffer-info'.
EXTENSION is the file extension, a string. It can be either
\"el\" or \"tar\".
+The variable `package-archive-upload-base' specifies the upload
+destination. If this is nil, signal an error.
+
Optional arg ARCHIVE-URL is the URL of the destination archive.
-If nil, the \"gnu\" archive is used."
- (unless archive-url
- (or (setq archive-url (cdr (assoc "gnu" package-archives)))
- (error "No destination URL")))
+If it is non-nil, compute the new \"archive-contents\" file
+starting from the existing \"archive-contents\" at that URL. In
+addition, if `package-update-news-on-upload' is non-nil, call
+`package--update-news' to add a news item at that URL.
+
+If ARCHIVE-URL is nil, compute the new \"archive-contents\" file
+from the \"archive-contents\" at `package-archive-upload-base',
+if it exists."
+ (unless package-archive-upload-base
+ (error "No destination specified in `package-archive-upload-base'"))
(save-excursion
(save-restriction
(let* ((file-type (cond
@@ -131,21 +173,14 @@ If nil, the \"gnu\" archive is used."
(pkg-version (aref pkg-info 3))
(commentary (aref pkg-info 4))
(split-version (version-to-list pkg-version))
- (pkg-buffer (current-buffer))
+ (pkg-buffer (current-buffer)))
- ;; Download latest archive-contents.
- (buffer (url-retrieve-synchronously
- (concat archive-url "archive-contents"))))
-
- ;; Parse archive-contents.
- (set-buffer buffer)
- (package-handle-response)
- (re-search-forward "^$" nil 'move)
- (forward-char)
- (delete-region (point-min) (point))
- (let ((contents (package-read-from-string
- (buffer-substring-no-properties (point-min)
- (point-max))))
+ ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
+ ;; from `package-archive-upload-base' otherwise.
+ (let ((contents (or (package--archive-contents-from-url archive-url)
+ (package--archive-contents-from-file
+ (concat package-archive-upload-base
+ "archive-contents"))))
(new-desc (vector split-version requires desc file-type)))
(if (> (car contents) package-archive-version)
(error "Unrecognized archive version %d" (car contents)))
@@ -176,7 +211,6 @@ If nil, the \"gnu\" archive is used."
(symbol-name pkg-name) "-readme.txt")))
(set-buffer pkg-buffer)
- (kill-buffer buffer)
(write-region (point-min) (point-max)
(concat package-archive-upload-base
file-name "-" pkg-version
@@ -184,8 +218,10 @@ If nil, the \"gnu\" archive is used."
nil nil nil 'excl)
;; Write a news entry.
- (package--update-news (concat file-name "." extension)
- pkg-version desc archive-url)
+ (and package-update-news-on-upload
+ archive-url
+ (package--update-news (concat file-name "." extension)
+ pkg-version desc archive-url))
;; special-case "package": write a second copy so that the
;; installer can easily find the latest version.
@@ -196,7 +232,9 @@ If nil, the \"gnu\" archive is used."
nil nil nil 'ask)))))))
(defun package-upload-buffer ()
- "Upload a single .el file to ELPA from the current buffer."
+ "Upload the current buffer as a single-file Emacs Lisp package.
+The variable `package-archive-upload-base' specifies the upload
+destination."
(interactive)
(save-excursion
(save-restriction
@@ -205,6 +243,13 @@ If nil, the \"gnu\" archive is used."
(package-upload-buffer-internal pkg-info "el")))))
(defun package-upload-file (file)
+ "Upload the Emacs Lisp package FILE to the package archive.
+Interactively, prompt for FILE. The package is considered a
+single-file package if FILE ends in \".el\", and a multi-file
+package if FILE ends in \".tar\".
+
+The variable `package-archive-upload-base' specifies the upload
+destination."
(interactive "fPackage file name: ")
(with-temp-buffer
(insert-file-contents-literally file)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ab5ba1bea56..2552ad4eb68 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -220,10 +220,15 @@ If VERSION is nil, the package is not loaded (it is \"disabled\")."
(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
"An alist of archives from which to fetch.
The default value points to the GNU Emacs package repository.
-Each element has the form (ID . URL), where ID is an identifier
-string for an archive and URL is a http: URL (a string)."
+
+Each element has the form (ID . LOCATION).
+ ID is an archive name, as a string.
+ LOCATION specifies the base location for the archive.
+ If it starts with \"http:\", it is treated as a HTTP URL;
+ otherwise it should be an absolute directory name.
+ (Other types of URL are currently not supported.)"
:type '(alist :key-type (string :tag "Archive name")
- :value-type (string :tag "Archive URL"))
+ :value-type (string :tag "URL or directory name"))
:risky t
:group 'package
:version "24.1")
@@ -617,8 +622,36 @@ Otherwise it uses an external `tar' program.
(let ((load-path (cons pkg-dir load-path)))
(byte-recompile-directory pkg-dir 0 t)))))
+(defmacro package--with-work-buffer (location file &rest body)
+ "Run BODY in a buffer containing the contents of FILE at LOCATION.
+LOCATION is the base location of a package archive, and should be
+one of the URLs (or file names) specified in `package-archives'.
+FILE is the name of a file relative to that base location.
+
+This macro retrieves FILE from LOCATION into a temporary buffer,
+and evaluates BODY while that buffer is current. This work
+buffer is killed afterwards. Return the last value in BODY."
+ `(let* ((http (string-match "\\`http:" ,location))
+ (buffer
+ (if http
+ (url-retrieve-synchronously (concat ,location ,file))
+ (generate-new-buffer "*package work buffer*"))))
+ (prog1
+ (with-current-buffer buffer
+ (if http
+ (progn (package-handle-response)
+ (re-search-forward "^$" nil 'move)
+ (forward-char)
+ (delete-region (point-min) (point)))
+ (unless (file-name-absolute-p ,location)
+ (error "Archive location %s is not an absolute file name"
+ ,location))
+ (insert-file-contents (expand-file-name ,file ,location)))
+ ,@body)
+ (kill-buffer buffer))))
+
(defun package-handle-response ()
- "Handle the response from the server.
+ "Handle the response from a `url-retrieve-synchronously' call.
Parse the HTTP response and throw if an error occurred.
The url package seems to require extra processing for this.
This should be called in a `save-excursion', in the download buffer.
@@ -627,7 +660,6 @@ It will move point to somewhere in the headers."
(require 'url-http)
(let ((response (url-http-parse-response)))
(when (or (< response 200) (>= response 300))
- (display-buffer (current-buffer))
(error "Error during download request:%s"
(buffer-substring-no-properties (point) (progn
(end-of-line)
@@ -635,28 +667,17 @@ It will move point to somewhere in the headers."
(defun package-download-single (name version desc requires)
"Download and install a single-file package."
- (let ((buffer (url-retrieve-synchronously
- (concat (package-archive-url name)
- (symbol-name name) "-" version ".el"))))
- (with-current-buffer buffer
- (package-handle-response)
- (re-search-forward "^$" nil 'move)
- (forward-char)
- (delete-region (point-min) (point))
- (package-unpack-single (symbol-name name) version desc requires)
- (kill-buffer buffer))))
+ (let ((location (package-archive-base name))
+ (file (concat (symbol-name name) "-" version ".el")))
+ (package--with-work-buffer location file
+ (package-unpack-single (symbol-name name) version desc requires))))
(defun package-download-tar (name version)
"Download and install a tar package."
- (let ((tar-buffer (url-retrieve-synchronously
- (concat (package-archive-url name)
- (symbol-name name) "-" version ".tar"))))
- (with-current-buffer tar-buffer
- (package-handle-response)
- (re-search-forward "^$" nil 'move)
- (forward-char)
- (package-unpack name version)
- (kill-buffer tar-buffer))))
+ (let ((location (package-archive-base name))
+ (file (concat (symbol-name name) "-" version ".tar")))
+ (package--with-work-buffer location file
+ (package-unpack name version))))
(defun package-installed-p (package &optional min-version)
"Return true if PACKAGE, of VERSION or newer, is installed.
@@ -987,31 +1008,26 @@ The file can either be a tar file or an Emacs Lisp file."
(error "Package `%s-%s' is a system package, not deleting"
name version))))
-(defun package-archive-url (name)
+(defun package-archive-base (name)
"Return the archive containing the package NAME."
(let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
(cdr (assoc (aref desc (- (length desc) 1)) package-archives))))
(defun package--download-one-archive (archive file)
- "Download an archive file FILE from ARCHIVE, and cache it locally."
- (let* ((archive-name (car archive))
- (archive-url (cdr archive))
- (dir (expand-file-name "archives" package-user-dir))
- (dir (expand-file-name archive-name dir))
- (buffer (url-retrieve-synchronously (concat archive-url file))))
- (with-current-buffer buffer
- (package-handle-response)
- (re-search-forward "^$" nil 'move)
- (forward-char)
- (delete-region (point-min) (point))
+ "Retrieve an archive file FILE from ARCHIVE, and cache it.
+ARCHIVE should be a cons cell of the form (NAME . LOCATION),
+similar to an entry in `package-alist'. Save the cached copy to
+\"archives/NAME/archive-contents\" in `package-user-dir'."
+ (let* ((dir (expand-file-name "archives" package-user-dir))
+ (dir (expand-file-name (car archive) dir)))
+ (package--with-work-buffer (cdr archive) file
;; Read the retrieved buffer to make sure it is valid (e.g. it
;; may fetch a URL redirect page).
(when (listp (read buffer))
(make-directory dir t)
(setq buffer-file-name (expand-file-name file dir))
(let ((version-control 'never))
- (save-buffer))))
- (kill-buffer buffer)))
+ (save-buffer))))))
(defun package-refresh-contents ()
"Download the ELPA archive description if needed.
@@ -1176,27 +1192,21 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(while (re-search-forward "^\\(;+ ?\\)" nil t)
(replace-match ""))))
(let ((readme (expand-file-name (concat package-name "-readme.txt")
- package-user-dir)))
+ package-user-dir))
+ readme-string)
;; For elpa packages, try downloading the commentary. If that
;; fails, try an existing readme file in `package-user-dir'.
- (cond ((let ((buffer (ignore-errors
- (url-retrieve-synchronously
- (concat (package-archive-url package)
- package-name "-readme.txt"))))
- response)
- (when buffer
- (with-current-buffer buffer
- (setq response (url-http-parse-response))
- (if (or (< response 200) (>= response 300))
- (setq response nil)
- (setq buffer-file-name
- (expand-file-name readme package-user-dir))
- (delete-region (point-min) (1+ url-http-end-of-headers))
- (save-buffer)))
- (when response
- (insert-buffer-substring buffer)
- (kill-buffer buffer)
- t))))
+ (cond ((condition-case nil
+ (package--with-work-buffer (package-archive-base package)
+ (concat package-name "-readme.txt")
+ (setq buffer-file-name
+ (expand-file-name readme package-user-dir))
+ (let ((version-control 'never))
+ (save-buffer))
+ (setq readme-string (buffer-string))
+ t)
+ (error nil))
+ (insert readme-string))
((file-readable-p readme)
(insert-file-contents readme)
(goto-char (point-max))))))))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 2300ebf721a..e95bcac2a70 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
-;; Keywords:
+;; Keywords:
;; This file is part of GNU Emacs.
@@ -32,6 +32,14 @@
;; could be defined this way, as a shorthand for (pred (lambda (_) BOOLEXP)).
;; But better would be if we could define new ways to match by having the
;; extension provide its own `pcase--split-<foo>' thingy.
+;; - provide something like (setq VAR) so a var can be set rather than
+;; let-bound.
+;; - provide a way to fallthrough to other cases.
+;; - try and be more clever to reduce the size of the decision tree, and
+;; to reduce the number of leafs that need to be turned into function:
+;; - first, do the tests shared by all remaining branches (it will have
+;; to be performed anyway, so better so it first so it's shared).
+;; - then choose the test that discriminates more (?).
;; - ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to
;; generate a lex-style DFA to decide whether to run E1 or E2.
@@ -65,12 +73,12 @@ If a SYMBOL is used twice in the same pattern (i.e. the pattern is
QPatterns can take the following forms:
(QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr.
,UPAT matches if the UPattern UPAT matches.
- STRING matches if the object is `equal' to STRING.
+ STRING matches if the object is `equal' to STRING.
ATOM matches if the object is `eq' to ATOM.
QPatterns for vectors are not implemented yet.
PRED can take the form
- FUNCTION in which case it gets called with one argument.
+ FUNCTION in which case it gets called with one argument.
(FUN ARG1 .. ARGN) in which case it gets called with N+1 arguments.
A PRED of the form FUNCTION is equivalent to one of the form (FUNCTION).
PRED patterns can refer to variables bound earlier in the pattern.
@@ -222,6 +230,7 @@ of the form (UPAT EXP)."
(defun pcase--if (test then else)
(cond
((eq else :pcase--dontcare) then)
+ ((eq then :pcase--dontcare) (debug) else) ;Can/should this ever happen?
((eq (car-safe else) 'if)
(if (equal test (nth 1 else))
;; Doing a test a second time: get rid of the redundancy.
@@ -236,6 +245,8 @@ of the form (UPAT EXP)."
`(cond (,test ,then)
;; Doing a test a second time: get rid of the redundancy, as above.
,@(remove (assoc test else) (cdr else))))
+ ;; Invert the test if that lets us reduce the depth of the tree.
+ ((memq (car-safe then) '(if cond)) (pcase--if `(not ,test) else then))
(t `(if ,test ,then ,else))))
(defun pcase--upat (qpattern)
@@ -280,6 +291,22 @@ MATCH is the pattern that needs to be matched, of the form:
(defun pcase--and (match matches)
(if matches `(and ,match ,@matches) match))
+(defconst pcase-mutually-exclusive-predicates
+ '((symbolp . integerp)
+ (symbolp . numberp)
+ (symbolp . consp)
+ (symbolp . arrayp)
+ (symbolp . stringp)
+ (integerp . consp)
+ (integerp . arrayp)
+ (integerp . stringp)
+ (numberp . consp)
+ (numberp . arrayp)
+ (numberp . stringp)
+ (consp . arrayp)
+ (consp . stringp)
+ (arrayp . stringp)))
+
(defun pcase--split-match (sym splitter match)
(cond
((eq (car match) 'match)
@@ -340,8 +367,14 @@ MATCH is the pattern that needs to be matched, of the form:
(cons `(and (match ,syma . ,(pcase--upat (car qpat)))
(match ,symd . ,(pcase--upat (cdr qpat))))
:pcase--fail)))
- ;; A QPattern but not for a cons, can only go the `else' side.
- ((eq (car-safe pat) '\`) (cons :pcase--fail nil))))
+ ;; A QPattern but not for a cons, can only go to the `else' side.
+ ((eq (car-safe pat) '\`) (cons :pcase--fail nil))
+ ((and (eq (car-safe pat) 'pred)
+ (or (member (cons 'consp (cadr pat))
+ pcase-mutually-exclusive-predicates)
+ (member (cons (cadr pat) 'consp)
+ pcase-mutually-exclusive-predicates)))
+ (cons :pcase--fail nil))))
(defun pcase--split-equal (elem pat)
(cond
@@ -353,7 +386,12 @@ MATCH is the pattern that needs to be matched, of the form:
;; (or (integerp (cadr pat)) (symbolp (cadr pat))
;; (consp (cadr pat)))
)
- (cons :pcase--fail nil))))
+ (cons :pcase--fail nil))
+ ((and (eq (car-safe pat) 'pred)
+ (symbolp (cadr pat))
+ (get (cadr pat) 'side-effect-free)
+ (funcall (cadr pat) elem))
+ (cons :pcase--succeed nil))))
(defun pcase--split-member (elems pat)
;; Based on pcase--split-equal.
@@ -370,13 +408,39 @@ MATCH is the pattern that needs to be matched, of the form:
;; (or (integerp (cadr pat)) (symbolp (cadr pat))
;; (consp (cadr pat)))
)
- (cons :pcase--fail nil))))
+ (cons :pcase--fail nil))
+ ((and (eq (car-safe pat) 'pred)
+ (symbolp (cadr pat))
+ (get (cadr pat) 'side-effect-free)
+ (let ((p (cadr pat)) (all t))
+ (dolist (elem elems)
+ (unless (funcall p elem) (setq all nil)))
+ all))
+ (cons :pcase--succeed nil))))
(defun pcase--split-pred (upat pat)
;; FIXME: For predicates like (pred (> a)), two such predicates may
;; actually refer to different variables `a'.
- (if (equal upat pat)
- (cons :pcase--succeed :pcase--fail)))
+ (cond
+ ((equal upat pat) (cons :pcase--succeed :pcase--fail))
+ ((and (eq 'pred (car upat))
+ (eq 'pred (car-safe pat))
+ (or (member (cons (cadr upat) (cadr pat))
+ pcase-mutually-exclusive-predicates)
+ (member (cons (cadr pat) (cadr upat))
+ pcase-mutually-exclusive-predicates)))
+ (cons :pcase--fail nil))
+ ;; ((and (eq 'pred (car upat))
+ ;; (eq '\` (car-safe pat))
+ ;; (symbolp (cadr upat))
+ ;; (or (symbolp (cadr pat)) (stringp (cadr pat)) (numberp (cadr pat)))
+ ;; (get (cadr upat) 'side-effect-free)
+ ;; (progn (message "Trying predicate %S" (cadr upat))
+ ;; (ignore-errors
+ ;; (funcall (cadr upat) (cadr pat)))))
+ ;; (message "Simplify pred %S against %S" upat pat)
+ ;; (cons nil :pcase--fail))
+ ))
(defun pcase--fgrep (vars sexp)
"Check which of the symbols VARS appear in SEXP."
@@ -391,7 +455,7 @@ MATCH is the pattern that needs to be matched, of the form:
;; bootstrapping problems.
(defun pcase--u1 (matches code vars rest)
"Return code that runs CODE (with VARS) if MATCHES match.
-and otherwise defers to REST which is a list of branches of the form
+Otherwise, it defers to REST which is a list of branches of the form
\(ELSE-MATCH ELSE-CODE . ELSE-VARS)."
;; Depending on the order in which we choose to check each of the MATCHES,
;; the resulting tree may be smaller or bigger. So in general, we'd want
@@ -452,8 +516,9 @@ and otherwise defers to REST which is a list of branches of the form
((eq upat 'dontcare) :pcase--dontcare)
((functionp upat) (error "Feature removed, use (pred %s)" upat))
((memq (car-safe upat) '(guard pred))
+ (if (eq (car upat) 'pred) (put sym 'pcase-used t))
(let* ((splitrest
- (pcase--split-rest
+ (pcase--split-rest
sym (apply-partially #'pcase--split-pred upat) rest))
(then-rest (car splitrest))
(else-rest (cdr splitrest)))
@@ -480,6 +545,7 @@ and otherwise defers to REST which is a list of branches of the form
(pcase--u1 matches code vars then-rest)
(pcase--u else-rest))))
((symbolp upat)
+ (put sym 'pcase-used t)
(if (not (assq upat vars))
(pcase--u1 matches code (cons (cons upat sym) vars) rest)
;; Non-linear pattern. Turn it into an `eq' test.
@@ -487,6 +553,7 @@ and otherwise defers to REST which is a list of branches of the form
matches)
code vars rest)))
((eq (car-safe upat) '\`)
+ (put sym 'pcase-used t)
(pcase--q1 sym (cadr upat) matches code vars rest))
((eq (car-safe upat) 'or)
(let ((all (> (length (cdr upat)) 1))
@@ -546,7 +613,7 @@ and otherwise defers to REST which is a list of branches of the form
(defun pcase--q1 (sym qpat matches code vars rest)
"Return code that runs CODE if SYM matches QPAT and if MATCHES match.
-and if not, defers to REST which is a list of branches of the form
+Otherwise, it defers to REST which is a list of branches of the form
\(OTHER_MATCH OTHER-CODE . OTHER-VARS)."
(cond
((eq (car-safe qpat) '\,) (error "Can't use `,UPATTERN"))
@@ -555,22 +622,28 @@ and if not, defers to REST which is a list of branches of the form
;; FIXME.
(error "Vector QPatterns not implemented yet"))
((consp qpat)
- (let ((syma (make-symbol "xcar"))
- (symd (make-symbol "xcdr")))
- (let* ((splitrest (pcase--split-rest
- sym
- (apply-partially #'pcase--split-consp syma symd)
- rest))
- (then-rest (car splitrest))
- (else-rest (cdr splitrest)))
- (pcase--if `(consp ,sym)
- `(let ((,syma (car ,sym))
- (,symd (cdr ,sym)))
- ,(pcase--u1 `((match ,syma . ,(pcase--upat (car qpat)))
- (match ,symd . ,(pcase--upat (cdr qpat)))
- ,@matches)
- code vars then-rest))
- (pcase--u else-rest)))))
+ (let* ((syma (make-symbol "xcar"))
+ (symd (make-symbol "xcdr"))
+ (splitrest (pcase--split-rest
+ sym
+ (apply-partially #'pcase--split-consp syma symd)
+ rest))
+ (then-rest (car splitrest))
+ (else-rest (cdr splitrest))
+ (then-body (pcase--u1 `((match ,syma . ,(pcase--upat (car qpat)))
+ (match ,symd . ,(pcase--upat (cdr qpat)))
+ ,@matches)
+ code vars then-rest)))
+ (pcase--if
+ `(consp ,sym)
+ ;; We want to be careful to only add bindings that are used.
+ ;; The byte-compiler could do that for us, but it would have to pay
+ ;; attention to the `consp' test in order to figure out that car/cdr
+ ;; can't signal errors and our byte-compiler is not that clever.
+ `(let (,@(if (get syma 'pcase-used) `((,syma (car ,sym))))
+ ,@(if (get symd 'pcase-used) `((,symd (cdr ,sym)))))
+ ,then-body)
+ (pcase--u else-rest))))
((or (integerp qpat) (symbolp qpat) (stringp qpat))
(let* ((splitrest (pcase--split-rest
sym (apply-partially 'pcase--split-equal qpat) rest))
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 22795a47d98..6033648298d 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -88,7 +88,8 @@ If the buffer is locked, signal error and display its name."
(if emacs-lock-buffer-locked
(setq emacs-lock-from-exiting t)))
-(add-hook 'kill-emacs-hook 'check-emacs-lock)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'check-emacs-lock))
(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index fae249da9d3..5daef7f9666 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -776,7 +776,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
(viper-copy-event (viper-seq-last-elt key))))
(if (commandp com)
- ;; pretend that current state is the state we excaped to
+ ;; pretend that current state is the state we escaped to
(let ((viper-current-state state))
(setq prefix-arg (or prefix-arg arg))
(command-execute com)))
@@ -2375,7 +2375,7 @@ problems."
(if (eq viper-intermediate-command 'viper-repeat)
(viper-change-subr (mark t) (point))
(viper-change (mark t) (point)))
- ;; com is set to ?r when we repeat this comand with dot
+ ;; com is set to ?r when we repeat this command with dot
(viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil))
))
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 2996fee9bcb..e05828dfeea 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-04 Julien Danjou <julien@danjou.info>
+
+ * erc-track.el (erc-track-visibility): Fix :type. (Bug#6369)
+
2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
* erc-list.el (erc-list-menu-mode-map): Move initialization
diff --git a/lisp/erc/ChangeLog.01 b/lisp/erc/ChangeLog.01
index 962acd5bfc6..4016586abc7 100644
--- a/lisp/erc/ChangeLog.01
+++ b/lisp/erc/ChangeLog.01
@@ -584,9 +584,9 @@
* debian/maint/conffiles.in: new file
- * debian/maint/conffiles: superceded by conffiles.in
+ * debian/maint/conffiles: superseded by conffiles.in
- * debian/scripts/startup: superceded by startup.erc
+ * debian/scripts/startup: superseded by startup.erc
2001-10-25 Mario Lang <mlang@delysid.org>
@@ -609,7 +609,7 @@
* debian/maint/postinst, debian/maint/prerm, debian/scripts/install,
debian/scripts/remove:
- removed, superceded by it's .in counterpart
+ removed, superseded by its .in counterpart
2001-10-25 Mario Lang <mlang@delysid.org>
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index a89244f695d..28c1ced91c6 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -84,8 +84,8 @@ Activity means that there was no user input in the last 10 seconds."
:type '(choice (const :tag "All frames" t)
(const :tag "All visible frames" visible)
(const :tag "Only the selected frame" nil)
- (const :tag "Only the selected frame if it was active"
- active)))
+ (const :tag "Only the selected frame if it is visible"
+ selected-visible)))
(defcustom erc-track-exclude nil
"A list targets (channel names or query targets) which should not be tracked."
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index aa138cb4dcb..4e1dbd41045 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -117,8 +117,9 @@ gained by using this module."
;; :link '(custom-manual "(eshell)Auto-correction of bad commands")
:group 'eshell-alias)
-(defcustom eshell-alias-load-hook '(eshell-alias-initialize)
+(defcustom eshell-alias-load-hook nil
"A hook that gets run when `eshell-alias' is loaded."
+ :version "24.1" ; removed eshell-alias-initialize
:type 'hook
:group 'eshell-alias)
@@ -156,7 +157,7 @@ command, which will automatically write them to the file named by
(defun eshell/alias (&optional alias &rest definition)
"Define an ALIAS in the user's alias list using DEFINITION."
(if (not alias)
- (eshell-for alias eshell-command-aliases-list
+ (dolist (alias eshell-command-aliases-list)
(eshell-print (apply 'format "alias %s %s\n" alias)))
(if (not definition)
(setq eshell-command-aliases-list
@@ -238,7 +239,7 @@ command, which will automatically write them to the file named by
"Find all possible completions for NAME.
These are all the command aliases which begin with NAME."
(let (completions)
- (eshell-for alias eshell-command-aliases-list
+ (dolist (alias eshell-command-aliases-list)
(if (string-match (concat "^" name) (car alias))
(setq completions (cons (car alias) completions))))
completions))
diff --git a/lisp/eshell/em-banner.el b/lisp/eshell/em-banner.el
index b2ebde98cee..ce987f132e3 100644
--- a/lisp/eshell/em-banner.el
+++ b/lisp/eshell/em-banner.el
@@ -64,8 +64,9 @@ This can be any sexp, and should end with at least two newlines."
(put 'eshell-banner-message 'risky-local-variable t)
-(defcustom eshell-banner-load-hook '(eshell-banner-initialize)
+(defcustom eshell-banner-load-hook nil
"A list of functions to run when `eshell-banner' is loaded."
+ :version "24.1" ; removed eshell-banner-initialize
:type 'hook
:group 'eshell-banner)
@@ -81,14 +82,6 @@ This can be any sexp, and should end with at least two newlines."
(assert msg)
(eshell-interactive-print msg))))
-(eshell-deftest banner banner-displayed
- "Startup banner is displayed at point-min"
- (assert eshell-banner-message)
- (let ((msg (eval eshell-banner-message)))
- (assert msg)
- (goto-char (point-min))
- (looking-at msg)))
-
(provide 'em-banner)
;; Local Variables:
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index f3f104c1ede..c551684210c 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -84,8 +84,9 @@ variable names, arguments, etc."
;;; User Variables:
-(defcustom eshell-cmpl-load-hook '(eshell-cmpl-initialize)
+(defcustom eshell-cmpl-load-hook nil
"A list of functions to run when `eshell-cmpl' is loaded."
+ :version "24.1" ; removed eshell-cmpl-initialize
:type 'hook
:group 'eshell-cmpl)
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 64555ab15ef..1aa2c34c395 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -58,8 +58,9 @@ they lack somewhat in feel from the typical shell equivalents."
;;; User Variables:
-(defcustom eshell-dirs-load-hook '(eshell-dirs-initialize)
+(defcustom eshell-dirs-load-hook nil
"A hook that gets run when `eshell-dirs' is loaded."
+ :version "24.1" ; removed eshell-dirs-initialize
:type 'hook
:group 'eshell-dirs)
@@ -233,7 +234,7 @@ Thus, this does not include the current directory.")
(defun eshell-save-some-last-dir ()
"Save the list-dir-ring for any open Eshell buffers."
- (eshell-for buf (buffer-list)
+ (dolist (buf (buffer-list))
(if (buffer-live-p buf)
(with-current-buffer buf
(if (and eshell-mode
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 2a565c5c827..732c6c05bfe 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -61,8 +61,9 @@ by zsh for filename generation."
;;; User Variables:
-(defcustom eshell-glob-load-hook '(eshell-glob-initialize)
+(defcustom eshell-glob-load-hook nil
"A list of functions to run when `eshell-glob' is loaded."
+ :version "24.1" ; removed eshell-glob-initialize
:type 'hook
:group 'eshell-glob)
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 5ec529f4b8f..993e9d63a94 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -70,8 +70,9 @@
;;; User Variables:
-(defcustom eshell-hist-load-hook '(eshell-hist-initialize)
+(defcustom eshell-hist-load-hook nil
"A list of functions to call when loading `eshell-hist'."
+ :version "24.1" ; removed eshell-hist-initialize
:type 'hook
:group 'eshell-hist)
@@ -292,7 +293,7 @@ element, regardless of any text on the command line. In that case,
(defun eshell-save-some-history ()
"Save the history for any open Eshell buffers."
- (eshell-for buf (buffer-list)
+ (dolist (buf (buffer-list))
(if (buffer-live-p buf)
(with-current-buffer buf
(if (and eshell-mode
@@ -730,7 +731,7 @@ matched."
(narrow-to-region here (point))
(goto-char (point-min))
(let ((modifiers (cdr (eshell-parse-modifiers))))
- (eshell-for mod modifiers
+ (dolist (mod modifiers)
(setq hist (funcall mod hist)))
hist))
(delete-region here (point)))))
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 7714629f2fa..4ef259dee4b 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -561,7 +561,7 @@ relative to that directory."
(when (or (eq listing-style 'long-listing) show-size)
(let ((total 0.0))
(setq size-width 0)
- (eshell-for e entries
+ (dolist (e entries)
(if (nth 7 (cdr e))
(setq total (+ total (nth 7 (cdr e)))
size-width
@@ -651,7 +651,7 @@ Each member of FILES is either a string or a cons cell of the form
(not (eq eshell-in-pipeline-p 'last))
(not (eq listing-style 'by-lines)))
(memq listing-style '(long-listing single-column)))
- (eshell-for file files
+ (dolist (file files)
(if file
(eshell-ls-file file size-width copy-fileinfo)))
(let ((f files)
@@ -676,7 +676,7 @@ Each member of FILES is either a string or a cons cell of the form
(setcdr f (cddr f))))))
(if (not show-size)
(setq display-files (mapcar 'eshell-ls-annotate files))
- (eshell-for file files
+ (dolist (file files)
(let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t))
(len (length str)))
(if (< len size-width)
@@ -696,7 +696,7 @@ Each member of FILES is either a string or a cons cell of the form
(columns (length col-widths))
(col-index 1)
need-return)
- (eshell-for file display-files
+ (dolist (file display-files)
(let ((name
(if (car file)
(if show-size
@@ -731,7 +731,7 @@ ROOT-DIR, if non-nil, specifies the root directory of the listing, to
which non-absolute directory names will be made relative if ever they
need to be printed."
(let (dirs files show-names need-return (size-width 0))
- (eshell-for entry entries
+ (dolist (entry entries)
(if (and (not dir-literal)
(or (eshell-ls-filetype-p (cdr entry) ?d)
(and (eshell-ls-filetype-p (cdr entry) ?l)
@@ -757,7 +757,7 @@ need to be printed."
(setq need-return t))
(setq show-names (or show-recursive
(> (+ (length files) (length dirs)) 1)))
- (eshell-for dir (eshell-ls-sort-entries dirs)
+ (dolist (dir (eshell-ls-sort-entries dirs))
(if (and need-return (not dir-literal))
(funcall insert-func "\n"))
(eshell-ls-dir dir show-names
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index 33085c067fd..f3027ea9b5e 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -59,8 +59,9 @@ ordinary strings."
;;; User Variables:
-(defcustom eshell-pred-load-hook '(eshell-pred-initialize)
+(defcustom eshell-pred-load-hook nil
"A list of functions to run when `eshell-pred' is loaded."
+ :version "24.1" ; removed eshell-pred-initialize
:type 'hook
:group 'eshell-pred)
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index 448d2cdf303..3e87acc6d1e 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -37,8 +37,9 @@ as is common with most shells."
;;; User Variables:
-(defcustom eshell-prompt-load-hook '(eshell-prompt-initialize)
+(defcustom eshell-prompt-load-hook nil
"A list of functions to call when loading `eshell-prompt'."
+ :version "24.1" ; removed eshell-prompt-initialize
:type 'hook
:group 'eshell-prompt)
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index 6def23e1b71..2c346dfcd3d 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -41,8 +41,9 @@ the behavior of normal shells while the user editing new input text."
;;; User Variables:
-(defcustom eshell-rebind-load-hook '(eshell-rebind-initialize)
+(defcustom eshell-rebind-load-hook nil
"A list of functions to call when loading `eshell-rebind'."
+ :version "24.1" ; removed eshell-rebind-initialize
:type 'hook
:group 'eshell-rebind)
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index ed4ad1c0712..d76e19cdd07 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -34,8 +34,9 @@ commands, as a script file."
;;; User Variables:
-(defcustom eshell-script-load-hook '(eshell-script-initialize)
+(defcustom eshell-script-load-hook nil
"A list of functions to call when loading `eshell-script'."
+ :version "24.1" ; removed eshell-script-initialize
:type 'hook
:group 'eshell-script)
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index 2c54930e439..f08fec8f8fa 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -84,8 +84,9 @@ it to get a real sense of how it works."
;;; User Variables:
-(defcustom eshell-smart-load-hook '(eshell-smart-initialize)
+(defcustom eshell-smart-load-hook nil
"A list of functions to call when loading `eshell-smart'."
+ :version "24.1" ; removed eshell-smart-initialize
:type 'hook
:group 'eshell-smart)
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index be394ba5b22..7d5fbbeabeb 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -46,8 +46,9 @@ which commands are considered visual in nature."
;;; User Variables:
-(defcustom eshell-term-load-hook '(eshell-term-initialize)
+(defcustom eshell-term-load-hook nil
"A list of functions to call when loading `eshell-term'."
+ :version "24.1" ; removed eshell-term-initialize
:type 'hook
:group 'eshell-term)
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index dc5650d240e..707f2ebc2ce 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -53,8 +53,9 @@ by name)."
:tag "UNIX commands in Lisp"
:group 'eshell-module)
-(defcustom eshell-unix-load-hook '(eshell-unix-initialize)
+(defcustom eshell-unix-load-hook nil
"A list of functions to run when `eshell-unix' is loaded."
+ :version "24.1" ; removed eshell-unix-initialize
:type 'hook
:group 'eshell-unix)
@@ -587,7 +588,7 @@ symlink, then revert to the system's definition of cat."
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(if (or eshell-in-pipeline-p
(catch 'special
- (eshell-for arg args
+ (dolist (arg args)
(unless (or (and (stringp arg)
(> (length arg) 0)
(eq (aref arg 0) ?-))
@@ -610,12 +611,12 @@ symlink, then revert to the system's definition of cat."
:show-usage
:usage "[OPTION] FILE...
Concatenate FILE(s), or standard input, to standard output.")
- (eshell-for file args
+ (dolist (file args)
(if (string= file "-")
(throw 'eshell-external
(eshell-external-command "cat" args))))
(let ((curbuf (current-buffer)))
- (eshell-for file args
+ (dolist (file args)
(with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
@@ -851,7 +852,7 @@ external command."
(let ((ext-du (eshell-search-path "du")))
(if (and ext-du
(not (catch 'have-ange-path
- (eshell-for arg args
+ (dolist (arg args)
(if (string-equal
(file-remote-p (expand-file-name arg) 'method) "ftp")
(throw 'have-ange-path t))))))
@@ -1055,7 +1056,7 @@ Become another USER during a login session.")
"localhost"))
(dir (or (file-remote-p default-directory 'localname)
(expand-file-name default-directory))))
- (eshell-for arg args
+ (dolist (arg args)
(if (string-equal arg "-") (setq login t) (setq user arg)))
;; `eshell-eval-using-options' does not handle "-".
(if (member "-" orig-args) (setq login t))
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index f42440ae4ec..1fb8b7f4c32 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -117,8 +117,9 @@ treated as a literal character."
;;; User Variables:
-(defcustom eshell-arg-load-hook '(eshell-arg-initialize)
+(defcustom eshell-arg-load-hook nil
"A hook that gets run when `eshell-arg' is loaded."
+ :version "24.1" ; removed eshell-arg-initialize
:type 'hook
:group 'eshell-arg)
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 0567beb9a53..bdcdc453272 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -229,8 +229,9 @@ return non-nil if the command is complex."
;;; User Variables:
-(defcustom eshell-cmd-load-hook '(eshell-cmd-initialize)
+(defcustom eshell-cmd-load-hook nil
"A hook that gets run when `eshell-cmd' is loaded."
+ :version "24.1" ; removed eshell-cmd-initialize
:type 'hook
:group 'eshell-cmd)
@@ -319,18 +320,6 @@ otherwise t.")
(add-hook 'pcomplete-try-first-hook
'eshell-complete-lisp-symbols nil t)))
-(eshell-deftest var last-result-var
- "\"last result\" variable"
- (eshell-command-result-p "+ 1 2; + $$ 2" "3\n5\n"))
-
-(eshell-deftest var last-result-var2
- "\"last result\" variable"
- (eshell-command-result-p "+ 1 2; + $$ $$" "3\n6\n"))
-
-(eshell-deftest var last-arg-var
- "\"last arg\" variable"
- (eshell-command-result-p "+ 1 2; + $_ 4" "3\n6\n"))
-
(defun eshell-complete-lisp-symbols ()
"If there is a user reference, complete it."
(let ((arg (pcomplete-actual-arg)))
@@ -440,32 +429,12 @@ hooks should be run before and after the command."
(eq (caar terms) 'eshell-command-to-value))
(car (cdar terms))))
-(eshell-deftest cmd lisp-command
- "Evaluate Lisp command"
- (eshell-command-result-p "(+ 1 2)" "3"))
-
-(eshell-deftest cmd lisp-command-args
- "Evaluate Lisp command (ignore args)"
- (eshell-command-result-p "(+ 1 2) 3" "3"))
-
(defun eshell-rewrite-initial-subcommand (terms)
"Rewrite a subcommand in initial position, such as '{+ 1 2}'."
(if (and (listp (car terms))
(eq (caar terms) 'eshell-as-subcommand))
(car terms)))
-(eshell-deftest cmd subcommand
- "Run subcommand"
- (eshell-command-result-p "{+ 1 2}" "3\n"))
-
-(eshell-deftest cmd subcommand-args
- "Run subcommand (ignore args)"
- (eshell-command-result-p "{+ 1 2} 3" "3\n"))
-
-(eshell-deftest cmd subcommand-lisp
- "Run subcommand + Lisp form"
- (eshell-command-result-p "{(+ 1 2)}" "3\n"))
-
(defun eshell-rewrite-named-command (terms)
"If no other rewriting rule transforms TERMS, assume a named command."
(let ((sym (if eshell-in-pipeline-p
@@ -477,10 +446,6 @@ hooks should be run before and after the command."
(list sym cmd (append (list 'list) (cdr terms)))
(list sym cmd))))
-(eshell-deftest cmd named-command
- "Execute named command"
- (eshell-command-result-p "+ 1 2" "3\n"))
-
(defvar eshell-command-body)
(defvar eshell-test-body)
@@ -987,7 +952,7 @@ at the moment are:
(not (member name eshell-complex-commands))
(catch 'simple
(progn
- (eshell-for pred eshell-complex-commands
+ (dolist (pred eshell-complex-commands)
(if (and (functionp pred)
(funcall pred name))
(throw 'simple nil)))
@@ -1165,7 +1130,7 @@ be finished later after the completion of an asynchronous subprocess."
(if (and (eq (car form) 'let)
(not (eq (car (cadr args)) 'eshell-do-eval)))
(eshell-manipulate "evaluating let args"
- (eshell-for letarg (car args)
+ (dolist (letarg (car args))
(if (and (listp letarg)
(not (eq (cadr letarg) 'quote)))
(setcdr letarg
@@ -1241,7 +1206,7 @@ be finished later after the completion of an asynchronous subprocess."
(defun eshell/which (command &rest names)
"Identify the COMMAND, and where it is located."
- (eshell-for name (cons command names)
+ (dolist (name (cons command names))
(let (program alias direct)
(if (eq (aref name 0) eshell-explicit-command-char)
(setq name (substring name 1)
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index f0b9a5eb083..3acbeac0b89 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -46,8 +46,9 @@ loaded into memory, thus beginning a new process."
;;; User Variables:
-(defcustom eshell-ext-load-hook '(eshell-ext-initialize)
+(defcustom eshell-ext-load-hook nil
"A hook that gets run when `eshell-ext' is loaded."
+ :version "24.1" ; removed eshell-ext-initialize
:type 'hook
:group 'eshell-ext)
@@ -202,7 +203,7 @@ causing the user to wonder if anything's really going on..."
(defun eshell-external-command (command args)
"Insert output from an external COMMAND, using ARGS."
(setq args (eshell-stringify-list (eshell-flatten-list args)))
- (if (string-equal (file-remote-p default-directory 'method) "ftp")
+ (if (file-remote-p default-directory)
(eshell-remote-command command args))
(let ((interp (eshell-find-interpreter command)))
(assert interp)
@@ -263,7 +264,7 @@ line of the form #!<interp>."
(let ((finterp
(catch 'found
(ignore
- (eshell-for possible eshell-interpreter-alist
+ (dolist (possible eshell-interpreter-alist)
(cond
((functionp (car possible))
(and (funcall (car possible) file)
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index ef8966f1d7d..71fae34b360 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -71,8 +71,9 @@ though they were files."
;;; User Variables:
-(defcustom eshell-io-load-hook '(eshell-io-initialize)
+(defcustom eshell-io-load-hook nil
"A hook that gets run when `eshell-io' is loaded."
+ :version "24.1" ; removed eshell-io-initialize
:type 'hook
:group 'eshell-io)
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 3735ee35fd5..10623dba8e3 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -89,9 +89,10 @@ That is to say, the first time during an Emacs session."
:type 'hook
:group 'eshell-mode)
-(defcustom eshell-exit-hook '(eshell-query-kill-processes)
+(defcustom eshell-exit-hook nil
"A hook that is run whenever `eshell' is exited.
This hook is only run if exiting actually kills the buffer."
+ :version "24.1" ; removed eshell-query-kill-processes
:type 'hook
:group 'eshell-mode)
@@ -287,6 +288,17 @@ This is used by `eshell-watch-for-password-prompt'."
;;; User Functions:
+(defun eshell-kill-buffer-function ()
+ "Function added to `kill-buffer-hook' in Eshell buffers.
+This runs the function `eshell-kill-processes-on-exit',
+and the hook `eshell-exit-hook'."
+ ;; It's fine to run this unconditionally since it can be customized
+ ;; via the `eshell-kill-processes-on-exit' variable.
+ (and (fboundp 'eshell-query-kill-processes)
+ (not (memq 'eshell-query-kill-processes eshell-exit-hook))
+ (eshell-query-kill-processes))
+ (run-hooks 'eshell-exit-hook))
+
;;;###autoload
(defun eshell-mode ()
"Emacs shell interactive mode.
@@ -389,7 +401,7 @@ This is used by `eshell-watch-for-password-prompt'."
;; load extension modules into memory. This will cause any global
;; variables they define to be visible, since some of the core
;; modules sometimes take advantage of their functionality if used.
- (eshell-for module eshell-modules-list
+ (dolist (module eshell-modules-list)
(let ((module-fullname (symbol-name module))
module-shortname)
(if (string-match "^eshell-\\(.*\\)" module-fullname)
@@ -403,17 +415,15 @@ This is used by `eshell-watch-for-password-prompt'."
(unless (file-exists-p eshell-directory-name)
(eshell-make-private-directory eshell-directory-name t))
- ;; load core Eshell modules for this session
- (eshell-for module (eshell-subgroups 'eshell)
- (run-hooks (intern-soft (concat (symbol-name module)
- "-load-hook"))))
-
- ;; load extension modules for this session
- (eshell-for module eshell-modules-list
- (let ((load-hook (intern-soft (concat (symbol-name module)
- "-load-hook"))))
- (if (and load-hook (boundp load-hook))
- (run-hooks load-hook))))
+ ;; Load core Eshell modules, then extension modules, for this session.
+ (dolist (module (append (eshell-subgroups 'eshell) eshell-modules-list))
+ (let ((load-hook (intern-soft (format "%s-load-hook" module)))
+ (initfunc (intern-soft (format "%s-initialize" module))))
+ (when (and load-hook (boundp load-hook))
+ (if (memq initfunc (symbol-value load-hook)) (setq initfunc nil))
+ (run-hooks load-hook))
+ ;; So we don't need the -initialize functions on the hooks (b#5375).
+ (and initfunc (fboundp initfunc) (funcall initfunc))))
(if eshell-send-direct-to-subprocesses
(add-hook 'pre-command-hook 'eshell-intercept-commands t t))
@@ -428,10 +438,7 @@ This is used by `eshell-watch-for-password-prompt'."
(add-hook 'eshell-pre-command-hook 'eshell-command-started nil t)
(add-hook 'eshell-post-command-hook 'eshell-command-finished nil t))
- (add-hook 'kill-buffer-hook
- (function
- (lambda ()
- (run-hooks 'eshell-exit-hook))) t t)
+ (add-hook 'kill-buffer-hook 'eshell-kill-buffer-function t t)
(if eshell-first-time-p
(run-hooks 'eshell-first-time-mode-hook))
@@ -440,19 +447,6 @@ This is used by `eshell-watch-for-password-prompt'."
(put 'eshell-mode 'mode-class 'special)
-(eshell-deftest mode major-mode
- "Major mode is correct"
- (eq major-mode 'eshell-mode))
-
-(eshell-deftest mode eshell-mode-variable
- "`eshell-mode' is true"
- (eq eshell-mode t))
-
-(eshell-deftest var window-height
- "LINES equals window height"
- (let ((eshell-stringify-t t))
- (eshell-command-result-p "= $LINES (window-height)" "t\n")))
-
(defun eshell-command-started ()
"Indicate in the modeline that a command has started."
(setq eshell-command-running-string "**")
@@ -463,13 +457,6 @@ This is used by `eshell-watch-for-password-prompt'."
(setq eshell-command-running-string "--")
(force-mode-line-update))
-(eshell-deftest mode command-running-p
- "Modeline shows no command running"
- (or (featurep 'xemacs)
- (not eshell-status-in-modeline)
- (and (memq 'eshell-command-running-string mode-line-format)
- (equal eshell-command-running-string "--"))))
-
;;; Internal Functions:
(defun eshell-toggle-direct-send ()
@@ -539,20 +526,6 @@ This is used by `eshell-watch-for-password-prompt'."
(= (1+ pos) limit))
(forward-char 1))))
-(eshell-deftest arg forward-arg
- "Move across command arguments"
- (eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore)
- (let ((here (point)) begin valid)
- (eshell-bol)
- (setq begin (point))
- (eshell-forward-argument 4)
- (setq valid (= here (point)))
- (eshell-backward-argument 4)
- (prog1
- (and valid (= begin (point)))
- (eshell-bol)
- (delete-region (point) (point-max)))))
-
(defun eshell-forward-argument (&optional arg)
"Move forward ARG arguments."
(interactive "p")
@@ -652,17 +625,6 @@ waiting for input."
(interactive "P")
(eshell-send-input use-region t))
-(eshell-deftest mode queue-input
- "Queue command input"
- (eshell-insert-command "sleep 2")
- (eshell-insert-command "echo alpha" 'eshell-queue-input)
- (let ((count 10))
- (while (and eshell-current-command
- (> count 0))
- (sit-for 1 0)
- (setq count (1- count))))
- (eshell-match-result "alpha\n"))
-
(defun eshell-send-input (&optional use-region queue-p no-newline)
"Send the input received to Eshell for parsing and processing.
After `eshell-last-output-end', sends all text from that marker to
@@ -741,20 +703,6 @@ newline."
(run-hooks 'eshell-post-command-hook)
(insert-and-inherit input)))))))))
-; (eshell-deftest proc send-to-subprocess
-; "Send input to a subprocess"
-; ;; jww (1999-12-06): what about when bc is unavailable?
-; (if (not (eshell-search-path "bc"))
-; t
-; (eshell-insert-command "bc")
-; (eshell-insert-command "1 + 2")
-; (sit-for 1 0)
-; (forward-line -1)
-; (prog1
-; (looking-at "3\n")
-; (eshell-insert-command "quit")
-; (sit-for 1 0))))
-
(defsubst eshell-kill-new ()
"Add the last input text to the kill ring."
(kill-ring-save eshell-last-input-start eshell-last-input-end))
@@ -900,14 +848,6 @@ Does not delete the prompt."
(insert "*** output flushed ***\n")
(delete-region (point) (eshell-end-of-output))))
-(eshell-deftest io flush-output
- "Flush previous output"
- (eshell-insert-command "echo alpha")
- (eshell-kill-output)
- (and (eshell-match-result (regexp-quote "*** output flushed ***\n"))
- (forward-line)
- (= (point) eshell-last-output-start)))
-
(defun eshell-show-output (&optional arg)
"Display start of this batch of interpreter output at top of window.
Sets mark to the value of point when this command is run.
@@ -968,12 +908,6 @@ When run interactively, widen the buffer first."
(goto-char eshell-last-output-end)
(insert-and-inherit input)))
-(eshell-deftest mode run-old-command
- "Re-run an old command"
- (eshell-insert-command "echo alpha")
- (goto-char eshell-last-input-start)
- (string= (eshell-get-old-input) "echo alpha"))
-
(defun eshell/exit ()
"Leave or kill the Eshell buffer, depending on `eshell-kill-on-exit'."
(throw 'eshell-terminal t))
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 5a62c71355c..1581d05889e 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -43,7 +43,7 @@ customizing the variable `eshell-modules-list'."
(defcustom eshell-module-unload-hook
'(eshell-unload-extension-modules)
- "*A hook run when `eshell-module' is unloaded."
+ "A hook run when `eshell-module' is unloaded."
:type 'hook
:group 'eshell-module)
@@ -61,7 +61,7 @@ customizing the variable `eshell-modules-list'."
eshell-script
eshell-term
eshell-unix)
- "*A list of optional add-on modules to be loaded by Eshell.
+ "A list of optional add-on modules to be loaded by Eshell.
Changes will only take effect in future Eshell buffers."
:type (append
(list 'set ':tag "Supported modules")
@@ -92,7 +92,7 @@ customization group. Example: `eshell-cmpl' for that module."
(defun eshell-unload-extension-modules ()
"Unload any memory resident extension modules."
- (eshell-for module (eshell-subgroups 'eshell-module)
+ (dolist (module (eshell-subgroups 'eshell-module))
(if (featurep module)
(ignore-errors
(message "Unloading %s..." (symbol-name module))
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index f697a400556..eeaccc4b890 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -38,8 +38,9 @@ finish."
;;; User Variables:
-(defcustom eshell-proc-load-hook '(eshell-proc-initialize)
+(defcustom eshell-proc-load-hook nil
"A hook that gets run when `eshell-proc' is loaded."
+ :version "24.1" ; removed eshell-proc-initialize
:type 'hook
:group 'eshell-proc)
@@ -94,13 +95,14 @@ is created."
:type 'hook
:group 'eshell-proc)
-(defcustom eshell-kill-hook '(eshell-reset-after-proc)
+(defcustom eshell-kill-hook nil
"Called when a process run by `eshell-gather-process-output' has ended.
It is passed two arguments: the process that was just ended, and the
termination status (as a string). Note that the first argument may be
nil, in which case the user attempted to send a signal, but there was
no relevant process. This can be used for displaying help
information, for example."
+ :version "24.1" ; removed eshell-reset-after-proc
:type 'hook
:group 'eshell-proc)
@@ -113,6 +115,14 @@ information, for example."
;;; Functions:
+(defun eshell-kill-process-function (proc status)
+ "Function run when killing a process.
+Runs `eshell-reset-after-proc' and `eshell-kill-hook', passing arguments
+PROC and STATUS to both."
+ (or (memq 'eshell-reset-after-proc eshell-kill-hook)
+ (eshell-reset-after-proc proc status))
+ (run-hook-with-args 'eshell-kill-hook proc status))
+
(defun eshell-proc-initialize ()
"Initialize the process handling code."
(make-local-variable 'eshell-process-list)
@@ -346,7 +356,7 @@ See `eshell-needs-pipe'."
(eshell-update-markers eshell-last-output-end)
;; Simulate the effect of eshell-sentinel.
(eshell-close-handles (if (numberp exit-status) exit-status -1))
- (run-hook-with-args 'eshell-kill-hook command exit-status)
+ (eshell-kill-process-function command exit-status)
(or eshell-in-pipeline-p
(setq eshell-last-sync-output-start nil))
(if (not (numberp exit-status))
@@ -391,14 +401,14 @@ PROC is the process that's exiting. STRING is the exit message."
(eshell-close-handles (process-exit-status proc) 'nil
(cadr entry))))
(eshell-remove-process-entry entry))))
- (run-hook-with-args 'eshell-kill-hook proc string)))))
+ (eshell-kill-process-function proc string)))))
(defun eshell-process-interact (func &optional all query)
"Interact with a process, using PROMPT if more than one, via FUNC.
If ALL is non-nil, background processes will be interacted with as well.
If QUERY is non-nil, query the user with QUERY before calling FUNC."
(let (defunct result)
- (eshell-for entry eshell-process-list
+ (dolist (entry eshell-process-list)
(if (and (memq (process-status (car entry))
'(run stop open closed))
(or all
@@ -412,7 +422,7 @@ If QUERY is non-nil, query the user with QUERY before calling FUNC."
;; clean up the process list; this can get dirty if an error
;; occurred that brought the user into the debugger, and then they
;; quit, so that the sentinel was never called.
- (eshell-for d defunct
+ (dolist (d defunct)
(eshell-remove-process-entry d))
result))
@@ -485,31 +495,29 @@ See the variable `eshell-kill-processes-on-exit'."
(kill-buffer buf)))
(message nil))))
-(custom-add-option 'eshell-exit-hook 'eshell-query-kill-processes)
-
(defun eshell-interrupt-process ()
"Interrupt a process."
(interactive)
(unless (eshell-process-interact 'interrupt-process)
- (run-hook-with-args 'eshell-kill-hook nil "interrupt")))
+ (eshell-kill-process-function nil "interrupt")))
(defun eshell-kill-process ()
"Kill a process."
(interactive)
(unless (eshell-process-interact 'kill-process)
- (run-hook-with-args 'eshell-kill-hook nil "killed")))
+ (eshell-kill-process-function nil "killed")))
(defun eshell-quit-process ()
"Send quit signal to process."
(interactive)
(unless (eshell-process-interact 'quit-process)
- (run-hook-with-args 'eshell-kill-hook nil "quit")))
+ (eshell-kill-process-function nil "quit")))
;(defun eshell-stop-process ()
; "Send STOP signal to process."
; (interactive)
; (unless (eshell-process-interact 'stop-process)
-; (run-hook-with-args 'eshell-kill-hook nil "stopped")))
+; (eshell-kill-process-function nil "stopped")))
;(defun eshell-continue-process ()
; "Send CONTINUE signal to process."
@@ -518,7 +526,7 @@ See the variable `eshell-kill-processes-on-exit'."
; ;; jww (1999-09-17): this signal is not dealt with yet. For
; ;; example, `eshell-reset' will be called, and so will
; ;; `eshell-resume-eval'.
-; (run-hook-with-args 'eshell-kill-hook nil "continue")))
+; (eshell-kill-process-function nil "continue")))
(defun eshell-send-eof-to-process ()
"Send EOF to process."
diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el
deleted file mode 100644
index f5c55dd8ae7..00000000000
--- a/lisp/eshell/esh-test.el
+++ /dev/null
@@ -1,233 +0,0 @@
-;;; esh-test.el --- Eshell test suite
-
-;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <johnw@gnu.org>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; The purpose of this module is to verify that Eshell works as
-;; expected. To run it on your system, use the command
-;; \\[eshell-test].
-
-;;; Code:
-
-(eval-when-compile
- (require 'eshell)
- (require 'esh-util))
-(require 'esh-mode)
-
-(defgroup eshell-test nil
- "This module is meant to ensure that Eshell is working correctly."
- :tag "Eshell test suite"
- :group 'eshell)
-
-;;; User Variables:
-
-(defface eshell-test-ok
- '((((class color) (background light)) (:foreground "Green" :bold t))
- (((class color) (background dark)) (:foreground "Green" :bold t)))
- "The face used to highlight OK result strings."
- :group 'eshell-test)
-(define-obsolete-face-alias 'eshell-test-ok-face 'eshell-test-ok "22.1")
-
-(defface eshell-test-failed
- '((((class color) (background light)) (:foreground "OrangeRed" :bold t))
- (((class color) (background dark)) (:foreground "OrangeRed" :bold t))
- (t (:bold t)))
- "The face used to highlight FAILED result strings."
- :group 'eshell-test)
-(define-obsolete-face-alias 'eshell-test-failed-face 'eshell-test-failed "22.1")
-
-(defcustom eshell-show-usage-metrics nil
- "If non-nil, display different usage metrics for each Eshell command."
- :set (lambda (symbol value)
- (if value
- (add-hook 'eshell-mode-hook 'eshell-show-usage-metrics)
- (remove-hook 'eshell-mode-hook 'eshell-show-usage-metrics))
- (set symbol value))
- :type '(choice (const :tag "No metrics" nil)
- (const :tag "Cons cells consumed" t)
- (const :tag "Time elapsed" 0))
- :group 'eshell-test)
-
-;;; Code:
-
-(defvar test-buffer)
-
-(defun eshell-insert-command (text &optional func)
- "Insert a command at the end of the buffer."
- (goto-char eshell-last-output-end)
- (insert-and-inherit text)
- (funcall (or func 'eshell-send-input)))
-
-(defun eshell-match-result (regexp)
- "Insert a command at the end of the buffer."
- (goto-char eshell-last-input-end)
- (looking-at regexp))
-
-(defun eshell-command-result-p (text regexp &optional func)
- "Insert a command at the end of the buffer."
- (eshell-insert-command text func)
- (eshell-match-result regexp))
-
-(defvar eshell-test-failures nil)
-
-(defun eshell-run-test (module funcsym label command)
- "Test whether FORM evaluates to a non-nil value."
- (when (let ((sym (intern-soft (concat "eshell-" (symbol-name module)))))
- (or (memq sym (eshell-subgroups 'eshell))
- (eshell-using-module sym)))
- (with-current-buffer test-buffer
- (insert-before-markers
- (format "%-70s " (substring label 0 (min 70 (length label)))))
- (insert-before-markers " ....")
- (eshell-redisplay))
- (let ((truth (eval command)))
- (with-current-buffer test-buffer
- (delete-char -6)
- (insert-before-markers
- "[" (let (str)
- (if truth
- (progn
- (setq str " OK ")
- (put-text-property 0 6 'face 'eshell-test-ok str))
- (setq str "FAILED")
- (setq eshell-test-failures (1+ eshell-test-failures))
- (put-text-property 0 6 'face 'eshell-test-failed str))
- str) "]")
- (add-text-properties (line-beginning-position) (point)
- (list 'test-func funcsym))
- (eshell-redisplay)))))
-
-(defun eshell-test-goto-func ()
- "Jump to the function that defines a particular test."
- (interactive)
- (let ((fsym (get-text-property (point) 'test-func)))
- (when fsym
- (let* ((def (symbol-function fsym))
- (library (locate-library (symbol-file fsym 'defun)))
- (name (substring (symbol-name fsym)
- (length "eshell-test--")))
- (inhibit-redisplay t))
- (find-file library)
- (goto-char (point-min))
- (re-search-forward (concat "^(eshell-deftest\\s-+\\w+\\s-+"
- name))
- (beginning-of-line)))))
-
-(defun eshell-run-one-test (&optional arg)
- "Jump to the function that defines a particular test."
- (interactive "P")
- (let ((fsym (get-text-property (point) 'test-func)))
- (when fsym
- (beginning-of-line)
- (delete-region (point) (line-end-position))
- (let ((test-buffer (current-buffer)))
- (set-buffer (let ((inhibit-redisplay t))
- (save-window-excursion (eshell t))))
- (funcall fsym)
- (unless arg
- (kill-buffer (current-buffer)))))))
-
-;;;###autoload
-(defun eshell-test (&optional arg)
- "Test Eshell to verify that it works as expected."
- (interactive "P")
- (let* ((begin (float-time))
- (test-buffer (get-buffer-create "*eshell test*")))
- (set-buffer (let ((inhibit-redisplay t))
- (save-window-excursion (eshell t))))
- (with-current-buffer test-buffer
- (erase-buffer)
- (setq major-mode 'eshell-test-mode)
- (setq mode-name "EShell Test")
- (set (make-local-variable 'eshell-test-failures) 0)
- (local-set-key [(control ?c) (control ?c)] 'eshell-test-goto-func)
- (local-set-key [(control ?c) (control ?r)] 'eshell-run-one-test)
- (local-set-key [(control ?m)] 'eshell-test-goto-func)
- (local-set-key [return] 'eshell-test-goto-func)
-
- (insert "Testing Eshell under " (emacs-version))
- (switch-to-buffer test-buffer)
- (delete-other-windows))
- (eshell-for funcname (sort (all-completions "eshell-test--"
- obarray 'functionp)
- 'string-lessp)
- (with-current-buffer test-buffer
- (insert "\n"))
- (funcall (intern-soft funcname)))
- (with-current-buffer test-buffer
- (insert (format "\n\n--- %s --- (completed in %d seconds)\n"
- (current-time-string)
- (- (float-time) begin)))
- (message "Eshell test suite completed: %s failure%s"
- (if (> eshell-test-failures 0)
- (number-to-string eshell-test-failures)
- "No")
- (if (= eshell-test-failures 1) "" "s"))))
- (goto-char eshell-last-output-end)
- (unless arg
- (kill-buffer (current-buffer))))
-
-
-(defvar eshell-metric-before-command 0)
-(defvar eshell-metric-after-command 0)
-
-(defun eshell-show-usage-metrics ()
- "If run at Eshell mode startup, metrics are shown after each command."
- (set (make-local-variable 'eshell-metric-before-command)
- (if (eq eshell-show-usage-metrics t)
- 0
- (current-time)))
- (set (make-local-variable 'eshell-metric-after-command)
- (if (eq eshell-show-usage-metrics t)
- 0
- (current-time)))
-
- (add-hook 'eshell-pre-command-hook
- (function
- (lambda ()
- (setq eshell-metric-before-command
- (if (eq eshell-show-usage-metrics t)
- (car (memory-use-counts))
- (current-time))))) nil t)
-
- (add-hook 'eshell-post-command-hook
- (function
- (lambda ()
- (setq eshell-metric-after-command
- (if (eq eshell-show-usage-metrics t)
- (car (memory-use-counts))
- (current-time)))
- (eshell-interactive-print
- (concat
- (int-to-string
- (if (eq eshell-show-usage-metrics t)
- (- eshell-metric-after-command
- eshell-metric-before-command 7)
- (- (float-time
- eshell-metric-after-command)
- (float-time
- eshell-metric-before-command))))
- "\n"))))
- nil t))
-
-(provide 'esh-test)
-
-;;; esh-test.el ends here
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 2de147acb00..dbe4f824deb 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -147,18 +147,6 @@ function `string-to-number'."
(put 'eshell-condition-case 'lisp-indent-function 2)
-(defmacro eshell-deftest (module name label &rest forms)
- (if (and (fboundp 'cl-compiling-file) (cl-compiling-file))
- nil
- (let ((fsym (intern (concat "eshell-test--" (symbol-name name)))))
- `(eval-when-compile
- (ignore
- (defun ,fsym () ,label
- (eshell-run-test (quote ,module) (quote ,fsym) ,label
- (quote (progn ,@forms)))))))))
-
-(put 'eshell-deftest 'lisp-indent-function 2)
-
(defun eshell-find-delimiter
(open close &optional bound reverse-p backslash-p)
"From point, find the CLOSE delimiter corresponding to OPEN.
@@ -285,7 +273,6 @@ Prepend remote identification of `default-directory', if any."
(setq text (replace-match " " t t text)))
text))
-;; FIXME this is just dolist.
(defmacro eshell-for (for-var for-list &rest forms)
"Iterate through a list"
`(let ((list-iter ,for-list))
@@ -296,10 +283,12 @@ Prepend remote identification of `default-directory', if any."
(put 'eshell-for 'lisp-indent-function 2)
+(make-obsolete 'eshell-for 'dolist "24.1")
+
(defun eshell-flatten-list (args)
"Flatten any lists within ARGS, so that there are no sublists."
(let ((new-list (list t)))
- (eshell-for a args
+ (dolist (a args)
(if (and (listp a)
(listp (cdr a)))
(nconc new-list (eshell-flatten-list a))
@@ -405,7 +394,7 @@ list."
(unless (listp entries)
(setq entries (list entries)
listified t))
- (eshell-for entry entries
+ (dolist (entry entries)
(unless (and exclude (string-match exclude entry))
(setq p predicates valid (null p))
(while p
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 4c42b305ec2..69004a841f1 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -109,7 +109,6 @@
(eval-when-compile
(require 'pcomplete)
- (require 'esh-test)
(require 'esh-util)
(require 'esh-opt)
(require 'esh-mode))
@@ -126,8 +125,9 @@ variable value, a subcommand, or even the result of a Lisp form."
;;; User Variables:
-(defcustom eshell-var-load-hook '(eshell-var-initialize)
+(defcustom eshell-var-load-hook nil
"A list of functions to call when loading `eshell-var'."
+ :version "24.1" ; removed eshell-var-initialize
:type 'hook
:group 'eshell-var)
@@ -351,8 +351,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
'((?h "help" nil nil "show this usage screen")
:external "env"
:usage "<no arguments>")
- (eshell-for setting (sort (eshell-environment-variables)
- 'string-lessp)
+ (dolist (setting (sort (eshell-environment-variables) 'string-lessp))
(eshell-buffered-print setting "\n"))
(eshell-flush)))
@@ -374,7 +373,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
This involves setting any variable aliases which affect the
environment, as specified in `eshell-variable-aliases-list'."
(let ((process-environment (eshell-copy-environment)))
- (eshell-for var-alias eshell-variable-aliases-list
+ (dolist (var-alias eshell-variable-aliases-list)
(if (nth 2 var-alias)
(setenv (car var-alias)
(eshell-stringify
@@ -477,30 +476,6 @@ Possible options are:
(t
(error "Invalid variable reference")))))
-(eshell-deftest var interp-cmd
- "Interpolate command result"
- (eshell-command-result-p "+ ${+ 1 2} 3" "6\n"))
-
-(eshell-deftest var interp-lisp
- "Interpolate Lisp form evalution"
- (eshell-command-result-p "+ $(+ 1 2) 3" "6\n"))
-
-(eshell-deftest var interp-concat
- "Interpolate and concat command"
- (eshell-command-result-p "+ ${+ 1 2}3 3" "36\n"))
-
-(eshell-deftest var interp-concat-lisp
- "Interpolate and concat Lisp form"
- (eshell-command-result-p "+ $(+ 1 2)3 3" "36\n"))
-
-(eshell-deftest var interp-concat2
- "Interpolate and concat two commands"
- (eshell-command-result-p "+ ${+ 1 2}${+ 1 2} 3" "36\n"))
-
-(eshell-deftest var interp-concat-lisp2
- "Interpolate and concat two Lisp forms"
- (eshell-command-result-p "+ $(+ 1 2)$(+ 1 2) 3" "36\n"))
-
(defun eshell-parse-indices ()
"Parse and return a list of list of indices."
(let (indices)
@@ -623,7 +598,7 @@ For example, to retrieve the second element of a user's record in
"Generate list of applicable variables."
(let ((argname pcomplete-stub)
completions)
- (eshell-for alias eshell-variable-aliases-list
+ (dolist (alias eshell-variable-aliases-list)
(if (string-match (concat "^" argname) (car alias))
(setq completions (cons (car alias) completions))))
(sort
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 7690a102a9b..1a9d7c97b83 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -280,26 +280,12 @@ shells such as bash, zsh, rc, 4dos."
:type 'string
:group 'eshell)
-(eshell-deftest mode same-window-buffer-names
- "`eshell-buffer-name' is a member of `same-window-buffer-names'"
- (member eshell-buffer-name same-window-buffer-names))
-
(defcustom eshell-directory-name
(locate-user-emacs-file "eshell/" ".eshell/")
"The directory where Eshell control files should be kept."
:type 'directory
:group 'eshell)
-(eshell-deftest mode eshell-directory-exists
- "`eshell-directory-name' exists and is writable"
- (file-writable-p eshell-directory-name))
-
-(eshell-deftest mode eshell-directory-modes
- "`eshell-directory-name' has correct access protections"
- (or (eshell-under-windows-p)
- (= (file-modes eshell-directory-name)
- eshell-private-directory-modes)))
-
;;;_* Running Eshell
;;
;; There are only three commands used to invoke Eshell. The first two
@@ -450,10 +436,6 @@ corresponding to a successful execution."
(set status-var eshell-last-command-status))
(cadr result))))))
-(eshell-deftest mode simple-command-result
- "`eshell-command-result' works with a simple command."
- (= (eshell-command-result "+ 1 2") 3))
-
;;;_* Reporting bugs
;;
;; If you do encounter a bug, on any system, please report
@@ -474,7 +456,7 @@ Emacs."
;; if the user set `eshell-prefer-to-shell' to t, but never loaded
;; Eshell, then `eshell-subgroups' will be unbound
(when (fboundp 'eshell-subgroups)
- (eshell-for module (eshell-subgroups 'eshell)
+ (dolist (module (eshell-subgroups 'eshell))
;; this really only unloads as many modules as possible,
;; since other `require' references (such as by customizing
;; `eshell-prefer-to-shell' to a non-nil value) might make it
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 360383aa32b..97862afb678 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -562,17 +562,23 @@ You can change the color sort order by customizing `list-colors-sort'."
(let ((lc (nthcdr (1- (display-color-cells)) list)))
(if lc
(setcdr lc nil)))))
- (let ((buf (get-buffer-create "*Colors*")))
- (with-current-buffer buf
+ (unless buffer-name
+ (setq buffer-name "*Colors*"))
+ (with-help-window buffer-name
+ (with-current-buffer standard-output
(erase-buffer)
- (setq truncate-lines t)
- ;; Display buffer before generating content to allow
- ;; `list-colors-print' to get the right window-width.
+ (setq truncate-lines t)))
+ (let ((buf (get-buffer buffer-name))
+ (inhibit-read-only t))
+ ;; Display buffer before generating content, to allow
+ ;; `list-colors-print' to get the right window-width.
+ (with-selected-window (or (get-buffer-window buf t) (selected-window))
+ (with-current-buffer buf
+ (list-colors-print list callback)
+ (set-buffer-modified-p nil)))
+ (when callback
(pop-to-buffer buf)
- (list-colors-print list callback)
- (set-buffer-modified-p nil)))
- (if callback
- (message "Click on a color to select it.")))
+ (message "Click on a color to select it."))))
(defun list-colors-print (list &optional callback)
(let ((callback-fn
diff --git a/lisp/files-x.el b/lisp/files-x.el
index a3cb5331e67..a9c32477155 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -360,18 +360,28 @@ from the MODE alist ignoring the input argument VALUE."
(catch 'exit
(unless enable-local-variables
(throw 'exit (message "Directory-local variables are disabled")))
-
(let ((variables-file (or (and (buffer-file-name)
(not (file-remote-p (buffer-file-name)))
(dir-locals-find-file (buffer-file-name)))
dir-locals-file))
variables)
-
+ (if (consp variables-file) ; result from cache
+ ;; If cache element has an mtime, assume it came from a file.
+ ;; Otherwise, assume it was set directly.
+ (setq variables-file (if (nth 2 variables-file)
+ (expand-file-name dir-locals-file
+ (car variables-file))
+ (cadr variables-file))))
+ ;; I can't be bothered to handle this case right now.
+ ;; Dir locals were set directly from a class. You need to
+ ;; directly modify the class in dir-locals-class-alist.
+ (and variables-file (not (stringp variables-file))
+ (throw 'exit (message "Directory locals were not set from a file")))
;; Don't create ".dir-locals.el" for the deletion operation.
- (when (and (eq op 'delete)
- (not (file-exists-p variables-file)))
- (throw 'exit (message "File .dir-locals.el not found")))
-
+ (and (eq op 'delete)
+ (or (not variables-file)
+ (not (file-exists-p variables-file)))
+ (throw 'exit (message "No .dir-locals.el file was found")))
(let ((auto-insert nil))
(find-file variables-file))
(widen)
diff --git a/lisp/files.el b/lisp/files.el
index 42f09f8b6da..caf0a9752c5 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -983,7 +983,8 @@ accessible."
nil)))
(defun file-truename (filename &optional counter prev-dirs)
- "Return the truename of FILENAME, which should be absolute.
+ "Return the truename of FILENAME.
+If FILENAME is not absolute, first expands it against `default-directory'.
The truename of a file name is found by chasing symbolic links
both at the level of the file and at the level of the directories
containing it, until no links are left at any level.
@@ -1893,8 +1894,8 @@ the various files."
(not nonexistent)
;; It is confusing to ask whether to visit
;; non-literally if they have the file in
- ;; hexl-mode.
- (not (eq major-mode 'hexl-mode)))
+ ;; hexl-mode or image-mode.
+ (not (memq major-mode '(hexl-mode image-mode))))
(if (buffer-modified-p)
(if (y-or-n-p
(format
@@ -2806,7 +2807,9 @@ symbol and VAL is a value that is considered safe."
:type 'alist)
(defcustom safe-local-eval-forms
- '((add-hook 'write-file-functions 'time-stamp)
+ ;; This should be here at least as long as Emacs supports write-file-hooks.
+ '((add-hook 'write-file-hooks 'time-stamp)
+ (add-hook 'write-file-functions 'time-stamp)
(add-hook 'before-save-hook 'time-stamp))
"Expressions that are considered safe in an `eval:' local variable.
Add expressions to this list if you want Emacs to evaluate them, when
@@ -2814,7 +2817,7 @@ they appear in an `eval' local variable specification, without first
asking you for confirmation."
:risky t
:group 'find-file
- :version "22.2"
+ :version "24.1" ; added write-file-hooks
:type '(repeat sexp))
;; Risky local variables:
@@ -2918,8 +2921,8 @@ variable to set.")
ALL-VARS is the list of all variables to be set up.
UNSAFE-VARS is the list of those that aren't marked as safe or risky.
RISKY-VARS is the list of those that are marked as risky.
-DIR-NAME is a directory name if these settings come from
-directory-local variables, or nil otherwise."
+If these settings come from directory-local variables, then
+DIR-NAME is the name of the associated directory. Otherwise it is nil."
(if noninteractive
nil
(save-window-excursion
@@ -3061,8 +3064,8 @@ VARIABLES is the alist of variable-value settings. This alist is
`enable-local-eval', `enable-local-variables', and (if necessary)
user interaction. The results are added to
`file-local-variables-alist', without applying them.
-DIR-NAME is a directory name if these settings come from
- directory-local variables, or nil otherwise."
+If these settings come from directory-local variables, then
+DIR-NAME is the name of the associated directory. Otherwise it is nil."
;; Find those variables that we may want to save to
;; `safe-local-variable-values'.
(let (all-vars risky-vars unsafe-vars)
@@ -3346,11 +3349,11 @@ Each element in this list has the form (DIR CLASS MTIME).
DIR is the name of the directory.
CLASS is the name of a variable class (a symbol).
MTIME is the recorded modification time of the directory-local
- variables file associated with this entry. This time is a list
- of two integers (the same format as `file-attributes'), and is
- used to test whether the cache entry is still valid.
- Alternatively, MTIME can be nil, which means the entry is always
- considered valid.")
+variables file associated with this entry. This time is a list
+of two integers (the same format as `file-attributes'), and is
+used to test whether the cache entry is still valid.
+Alternatively, MTIME can be nil, which means the entry is always
+considered valid.")
(defsubst dir-locals-get-class-variables (class)
"Return the variable list for CLASS."
@@ -3393,8 +3396,19 @@ Return the new variables list."
(cdr entry) root variables))))
((or (not key)
(derived-mode-p key))
- (setq variables (dir-locals-collect-mode-variables
- (cdr entry) variables))))))
+ (let* ((alist (cdr entry))
+ (subdirs (assq 'subdirs alist)))
+ (if (or (not subdirs)
+ (progn
+ (setq alist (delq subdirs alist))
+ (cdr-safe subdirs))
+ ;; TODO someone might want to extend this to allow
+ ;; integer values for subdir, where N means
+ ;; variables apply to this directory and N levels
+ ;; below it (0 == nil).
+ (equal root default-directory))
+ (setq variables (dir-locals-collect-mode-variables
+ alist variables))))))))
(error
;; The file's content might be invalid (e.g. have a merge conflict), but
;; that shouldn't prevent the user from opening the file.
@@ -3459,13 +3473,20 @@ across different environments and users.")
(defun dir-locals-find-file (file)
"Find the directory-local variables for FILE.
This searches upward in the directory tree from FILE.
-If the directory root of FILE has been registered in
- `dir-locals-directory-cache' and the directory-local variables
- file has not been modified, return the matching entry in
- `dir-locals-directory-cache'.
-Otherwise, if a directory-local variables file is found, return
- the file name.
-Otherwise, return nil."
+It stops at the first directory that has been registered in
+`dir-locals-directory-cache' or contains a `dir-locals-file'.
+If it finds an entry in the cache, it checks that it is valid.
+A cache entry with no modification time element (normally, one that
+has been assigned directly using `dir-locals-set-directory-class', not
+set from a file) is always valid.
+A cache entry based on a `dir-locals-file' is valid if the modification
+time stored in the cache matches the current file modification time.
+If not, the cache entry is cleared so that the file will be re-read.
+
+This function returns either nil (no directory local variables found),
+or the matching entry from `dir-locals-directory-cache' (a list),
+or the full path to the `dir-locals-file' (a string) in the case
+of no valid cache entry."
(setq file (expand-file-name file))
(let* ((dir-locals-file-name
(if (eq system-type 'ms-dos)
@@ -3474,8 +3495,8 @@ Otherwise, return nil."
(locals-file (locate-dominating-file file dir-locals-file-name))
(dir-elt nil))
;; `locate-dominating-file' may have abbreviated the name.
- (when locals-file
- (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
+ (if locals-file
+ (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
;; Find the best cached value in `dir-locals-directory-cache'.
(dolist (elt dir-locals-directory-cache)
(when (and (eq t (compare-strings file nil (length (car elt))
@@ -3484,23 +3505,32 @@ Otherwise, return nil."
'(windows-nt cygwin ms-dos))))
(> (length (car elt)) (length (car dir-elt))))
(setq dir-elt elt)))
- (let ((use-cache (and dir-elt
- (or (null locals-file)
- (<= (length (file-name-directory locals-file))
- (length (car dir-elt)))))))
- (if use-cache
- ;; Check the validity of the cache.
- (if (and (file-readable-p (car dir-elt))
- (or (null (nth 2 dir-elt))
+ (if (and dir-elt
+ (or (null locals-file)
+ (<= (length (file-name-directory locals-file))
+ (length (car dir-elt)))))
+ ;; Found a potential cache entry. Check validity.
+ ;; A cache entry with no MTIME is assumed to always be valid
+ ;; (ie, set directly, not from a dir-locals file).
+ ;; Note, we don't bother to check that there is a matching class
+ ;; element in dir-locals-class-alist, since that's done by
+ ;; dir-locals-set-directory-class.
+ (if (or (null (nth 2 dir-elt))
+ (let ((cached-file (expand-file-name dir-locals-file-name
+ (car dir-elt))))
+ (and (file-readable-p cached-file)
(equal (nth 2 dir-elt)
- (nth 5 (file-attributes (car dir-elt))))))
- ;; This cache entry is OK.
- dir-elt
- ;; This cache entry is invalid; clear it.
- (setq dir-locals-directory-cache
- (delq dir-elt dir-locals-directory-cache))
- locals-file)
- locals-file))))
+ (nth 5 (file-attributes cached-file))))))
+ ;; This cache entry is OK.
+ dir-elt
+ ;; This cache entry is invalid; clear it.
+ (setq dir-locals-directory-cache
+ (delq dir-elt dir-locals-directory-cache))
+ ;; Return the first existing dir-locals file. Might be the same
+ ;; as dir-elt's, might not (eg latter might have been deleted).
+ locals-file)
+ ;; No cache entry.
+ locals-file)))
(defun dir-locals-read-from-file (file)
"Load a variables FILE and register a new class and instance.
@@ -3530,10 +3560,8 @@ and `file-local-variables-alist', without applying them."
(dir-name nil))
(cond
((stringp variables-file)
- (setq dir-name (if (buffer-file-name)
- (file-name-directory (buffer-file-name))
- default-directory))
- (setq class (dir-locals-read-from-file variables-file)))
+ (setq dir-name (file-name-directory variables-file)
+ class (dir-locals-read-from-file variables-file)))
((consp variables-file)
(setq dir-name (nth 0 variables-file))
(setq class (nth 1 variables-file))))
@@ -3842,7 +3870,9 @@ BACKUPNAME is the backup file name, which is the old file renamed."
(set-file-selinux-context to-name context)))
(defvar file-name-version-regexp
- "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+~\\)"
+ "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)"
+ ;; The last ~[[:digit]]+ matches relative versions in git,
+ ;; e.g. `foo.js.~HEAD~1~'.
"Regular expression matching the backup/version part of a file name.
Used by `file-name-sans-versions'.")
@@ -4582,14 +4612,14 @@ See `save-some-buffers-action-alist' if you want to
change the additional actions you can take on files."
(interactive "P")
(save-window-excursion
- (let* (queried some-automatic
+ (let* (queried autosaved-buffers
files-done abbrevs-done)
(dolist (buffer (buffer-list))
;; First save any buffers that we're supposed to save unconditionally.
;; That way the following code won't ask about them.
(with-current-buffer buffer
(when (and buffer-save-without-query (buffer-modified-p))
- (setq some-automatic t)
+ (push (buffer-name) autosaved-buffers)
(save-buffer))))
;; Ask about those buffers that merit it,
;; and record the number thus saved.
@@ -4635,9 +4665,15 @@ change the additional actions you can take on files."
(setq abbrevs-changed nil)
(setq abbrevs-done t)))
(or queried (> files-done 0) abbrevs-done
- (message (if some-automatic
- "(Some special files were saved without asking)"
- "(No files need saving)"))))))
+ (cond
+ ((null autosaved-buffers)
+ (message "(No files need saving)"))
+ ((= (length autosaved-buffers) 1)
+ (message "(Saved %s)" (car autosaved-buffers)))
+ (t
+ (message "(Saved %d files: %s)"
+ (length autosaved-buffers)
+ (mapconcat 'identity autosaved-buffers ", "))))))))
(defun not-modified (&optional arg)
"Mark current buffer as unmodified, not needing to be saved.
@@ -4796,7 +4832,7 @@ given. With a prefix argument, TRASH is nil."
(let* ((trashing (and delete-by-moving-to-trash
(null current-prefix-arg)))
(dir (expand-file-name
- (read-file-name
+ (read-directory-name
(if trashing
"Move directory to trash: "
"Delete directory: ")
@@ -4864,7 +4900,7 @@ directly into NEWNAME instead."
(let ((dir (read-directory-name
"Copy directory: " default-directory default-directory t nil)))
(list dir
- (read-file-name
+ (read-directory-name
(format "Copy directory %s to: " dir)
default-directory default-directory nil nil)
current-prefix-arg t nil)))
@@ -5563,7 +5599,7 @@ Prefix arg (second arg if noninteractive) means supply -l switch to `ls'.
Actions controlled by variables `list-directory-brief-switches'
and `list-directory-verbose-switches'."
(interactive (let ((pfx current-prefix-arg))
- (list (read-file-name (if pfx "List directory (verbose): "
+ (list (read-directory-name (if pfx "List directory (verbose): "
"List directory (brief): ")
nil default-directory nil)
pfx)))
@@ -5822,6 +5858,9 @@ normally equivalent short `-D' option is just passed on to
(file-name-directory file)
(file-name-directory (expand-file-name file))))
(pattern (file-name-nondirectory file)))
+ ;; NB since switches is passed to the shell, be
+ ;; careful of malicious values, eg "-l;reboot".
+ ;; See eg dired-safe-switches-p.
(call-process
shell-file-name nil t nil
"-c"
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 7ace6ce01dc..e4285523184 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -183,7 +183,7 @@ To override this, give an argument to `ff-find-other-file'."
;;;###autoload
(defvar ff-special-constructs
`(
- ;; C/C++ include, for NeXTSTEP too
+ ;; C/C++ include, for NeXTstep too
(,(purecopy "^\#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") .
(lambda ()
(buffer-substring (match-beginning 2) (match-end 2))))
@@ -494,7 +494,7 @@ If optional IN-OTHER-WINDOW is non-nil, find the file in another window."
(setq name
(expand-file-name
- (read-file-name
+ (read-directory-name
(format "Find or create %s in: " default-name)
default-directory default-name nil)))
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index e23af4dff78..bce03331a29 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -229,7 +229,8 @@ This hook will be installed if the variable
prototype-generic-mode
resolve-conf-generic-mode
samba-generic-mode
- x-resource-generic-mode)
+ x-resource-generic-mode
+ xmodmap-generic-mode)
"List of generic modes that are defined by default on Unix.")
(defconst generic-other-modes
@@ -370,6 +371,15 @@ your changes into effect."
nil
"Generic mode for X Resource configuration files."))
+(if (memq 'xmodmap-generic-mode generic-extras-enable-list)
+(define-generic-mode xmodmap-generic-mode
+ '(?!)
+ '("add" "clear" "keycode" "keysym" "remove" "pointer")
+ nil
+ '("[xX]modmap\\(rc\\)?\\'")
+ nil
+ "Simple mode for xmodmap files."))
+
;;; Hosts
(when (memq 'hosts-generic-mode generic-extras-enable-list)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index ff48920e69c..c14c79a92cb 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,220 @@
+2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * gnus.el (gnus-interactive): Use read-directory-name.
+
+ * gnus-uu.el (gnus-uu-decode-uu-and-save)
+ (gnus-uu-decode-unshar-and-save, gnus-uu-decode-save)
+ (gnus-uu-decode-binhex, gnus-uu-decode-yenc)
+ (gnus-uu-decode-save-view, gnus-uu-decode-postscript-and-save):
+ Likewise.
+
+ * gnus-group.el (gnus-group-make-directory-group): Likewise.
+
+2011-03-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-sum.el (gnus-update-read-articles): Fix typo.
+
+ * gnus.el (gnus-valid-select-methods): Mark nnimap as a backend that
+ really have server-side marks.
+
+ * gnus-sum.el (gnus-propagate-marks): Change default back to nil again,
+ since most backends do not usefully have server-side marks.
+ (gnus-update-read-articles): Propagate marks to all backends that
+ really have server-side marks.
+
+2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * message.el (message-cite-reply-position, message-cite-style): New
+ variables.
+ (message-yank-original): Use the new citation styles.
+
+2011-03-04 Daiki Ueno <ueno@unixuser.org>
+
+ * message.el (message-options): Revert the change that's a workaround
+ for XEmacs buffer-local issue; don't mark it buffer-local when running
+ under XEmacs.
+
+2011-03-03 Tassilo Horn <tassilo@member.fsf.org>
+
+ * nnimap.el (nnimap-parse-flags): Add a workaround for FETCH lines with
+ numbers too big to be `read'.
+
+2011-03-02 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * message.el (message-options): Make buffer-local two ways to attempt
+ to fix a XEmacs bug.
+
+2011-03-02 Julien Danjou <julien@danjou.info>
+
+ * gnus-art.el (gnus-with-article-buffer): Fix buffer live check.
+
+2011-03-01 Julien Danjou <julien@danjou.info>
+
+ * gnus-art.el (list-identifier): Add list-identifier as a parameter
+ group.
+ (article-hide-list-identifiers): Use list-identifier group parameter.
+
+2011-02-28 Julien Danjou <julien@danjou.info>
+
+ * sieve.el (sieve-buffer-script-name): New local variable to store
+ sieve script name.
+ (sieve-edit-script): Store sieve script name.
+ (sieve-upload): Use sieve script name when uploading.
+ (sieve-upload): Use substitute-command-keys.
+ (sieve-edit-script): Use substitute-command-keys.
+ (sieve-refresh-scriptlist): Use substitute-command-keys.
+ (sieve-manage-mode-map): Define keymap properly.
+ (sieve-manage-mode): Do not set mode name manually, change mode-name to
+ (sieve-refresh-scriptlist): Use substitute-command-keys."Sieve-manage".
+ Remove commented code about cvs.
+ (sieve-manage-quit): New function.
+ (sieve-manage-mode-map): Bind 'q' to sieve-manage-quit.
+
+2011-02-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-group.el (gnus-import-other-newsrc-file): New function.
+
+2011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-search): Cache empty result sets.
+
+ * auth-source.el (auth-source-save-behavior): New variable to replace
+ `auth-source-never-create'.
+ (auth-source-netrc-create): Use it.
+ (auth-source-never-save): Remove.
+
+2011-02-25 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-stream): Doc fix.
+ (nnimap-open-connection-1): Reverse the order of the ports to that the
+ prompted-for port is first.
+
+ * gnus-start.el (gnus-get-unread-articles): Don't clobber the async
+ retrieval by the no-group selection.
+
+ * gnus-demon.el (gnus-demon-init): run-with-timer should be called with
+ numerical parameters.
+
+2011-02-25 Julien Danjou <julien@danjou.info>
+
+ * gnus-gravatar.el: Use gnus-with-article-buffer.
+
+ * gnus-art.el (gnus-with-article-buffer): Check that the
+ gnus-article-buffer is alive.
+
+2011-02-24 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-creation-prompts): New variable to manage
+ creation-time prompts.
+ (auth-source-search): Document it.
+ (auth-source-format-prompt): Add utility function.
+ (auth-source-netrc-create): Don't default the user name to
+ user-login-name. Use `auth-source-creation-prompts' and some default
+ prompts for user, host, port, and password (the default generic prompt
+ remains ugly).
+ (auth-source-never-save): Add customizable option to never save info.
+ (auth-source-netrc-create): Use it and improve save prompts. Fix help
+ mode excursion.
+
+2011-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * auth-source.el (auth-source-netrc-create): Use `read-char' with no
+ argument that XEmacs doesn't support.
+
+2011-02-23 Julien Danjou <julien@danjou.info>
+
+ * gnus-art.el (article-make-date-line): Ignore errors if time is
+ invalid and not convertible.
+ (article-make-date-line): Only add lapsed time if time is not nil.
+
+2011-02-23 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-netrc-create): Use `read-char' instead of
+ `read-char-choice' for backwards compatibility.
+ (auth-source-netrc-element-or-first): New function to DTRT for
+ parameter extraction.
+ (auth-source-netrc-create): Use it and fix multiple parameter print
+ bug. Use the default passed from above (given-default) or the
+ built-in (user-login-name for :user).
+
+2011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-start.el (gnus-dribble-read-file): Set
+ buffer-save-without-query, since we always want to save the dribble
+ file, probably.
+
+ * nnmail.el (nnmail-article-group): Allow a final "" split to work on
+ nnimap.
+
+ * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from
+ -summary- since it's a user-visible variable.
+
+ * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the
+ first time you use the new Gnus.
+
+2011-02-22 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el: Don't load netrc.el.
+ (auth-sources): Search ~/.netrc as well by default.
+ (auth-source-debug): Add 'trivia option for extra output.
+ (auth-source-do-trivia): Use it.
+ (auth-source-search): Simplify logic to use
+ `auth-source-search-backends'. Use `auth-source-do-trivia' where
+ appropriate. Don't keep a running count at this level. Layer :create
+ and :delete options appropriately on the first and second passes.
+ Don't track the backend with the search results.
+ (auth-source-search-backends): New function to search a list of
+ backends for a processed spec.
+ (auth-source-netrc-parse): Cache all netrc files, making
+ auth-source-netrc-cache an alist keyed by the file name and using the
+ file mtime as the caching criterion. Keep the obfuscated data secret
+ with a lexical bind.
+ (auth-source-netrc-search): Don't calculate the length of the results
+ unnecessarily.
+ (auth-source-search-backends): Fix bug.
+ (auth-source-netrc-create): Rework prompts.
+
+2011-02-22 Andrew Cohen <cohen@andy.bu.edu>
+
+ * nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key):
+ Lower case names of search constraints.
+ (nnir-run-query): Cache and reuse search constraints for all imap
+ servers.
+
+2011-02-22 Sam Steingold <sds@gnu.org>
+
+ * gnus-msg.el (gnus-setup-message): Also bind `winconf-name'.
+
+2011-02-22 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name
+ after exit.
+ (gnus-setup-message): Define missing variable from last checkin.
+
+ * gnus-sum.el (gnus-summary-show-article): When called with t as the
+ value, show the raw article.
+
+2011-02-21 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-open-connection-1): Revert last change, since
+ auth-source now accepts numbers.
+
+ * auth-source.el (auth-source-netrc-parse): Accept a number as the port
+ spec, too.
+ (auth-source-ensure-strings): New function.
+
+ * gnus-art.el (gnus-article-update-date-headers): Doc fix.
+ (gnus-article-setup-buffer): Always restart the date timer so that user
+ changes to the frequency is respected.
+
+ * nnimap.el (nnimap-open-connection-1): auth-source expects strings as
+ port numbers, so make sure it gets that if nnimap-server-port is
+ explicit.
+
+2011-02-21 Simon Josefsson <simon@josefsson.org>
+
+ * nnimap.el (nnimap-inbox): Doc fix.
+
2011-02-20 Chong Yidong <cyd@stupidchicken.com>
* shr-color.el (shr-color->hexadecimal): Use renamed function names
@@ -620,7 +837,7 @@
* shr.el: Revert change that made headings use different-sized faces.
The Emacs display engine isn't advanced enough that, for instance,
- tables can comfortably use differntly-sized faces.
+ tables can comfortably use differently-sized faces.
2011-01-25 Lars Ingebrigtsen <larsi@gnus.org>
@@ -1672,7 +1889,7 @@
2010-11-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
- * shr.el (shr-color-check): Protect against non-existant colour names.
+ * shr.el (shr-color-check): Protect against non-existent colour names.
2010-11-24 Julien Danjou <julien@danjou.info>
@@ -2986,7 +3203,7 @@
This makes nnimap work properly on Courier again.
* gnus.el (gnus-carpal): The carpal mode has been removed, but define
- the variable for backwards compatability.
+ the variable for backwards compatibility.
* mm-decode.el (mm-save-part): If given a non-directory result, expand
the file name before using to avoid setting mm-default-directory to
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index e033b01ae97..500de10b71c 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -42,7 +42,6 @@
(require 'password-cache)
(require 'mm-util)
(require 'gnus-util)
-(require 'netrc)
(require 'assoc)
(eval-when-compile (require 'cl))
(require 'eieio)
@@ -138,8 +137,21 @@ let-binding."
(defvar auth-source-creation-defaults nil
"Defaults for creating token values. Usually let-bound.")
+(defvar auth-source-creation-prompts nil
+ "Default prompts for token values. Usually let-bound.")
+
(make-obsolete 'auth-source-hide-passwords nil "Emacs 24.1")
+(defcustom auth-source-save-behavior 'ask
+ "If set, auth-source will respect it for save behavior."
+ :group 'auth-source
+ :version "23.2" ;; No Gnus
+ :type `(choice
+ :tag "auth-source new token save behavior"
+ (const :tag "Always save" t)
+ (const :tag "Never save" nil)
+ (const :tag "Ask" ask)))
+
(defvar auth-source-magic "auth-source-magic ")
(defcustom auth-source-do-cache t
@@ -164,16 +176,19 @@ If the value is a function, debug messages are logged by calling
:type `(choice
:tag "auth-source debugging mode"
(const :tag "Log using `message' to the *Messages* buffer" t)
+ (const :tag "Log all trivia with `message' to the *Messages* buffer"
+ trivia)
(function :tag "Function that takes arguments like `message'")
(const :tag "Don't log anything" nil)))
-(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo")
+(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc")
"List of authentication sources.
The default will get login and password information from
\"~/.authinfo.gpg\", which you should set up with the EPA/EPG
packages to be encrypted. If that file doesn't exist, it will
-try the unencrypted version \"~/.authinfo\".
+try the unencrypted version \"~/.authinfo\" and the famous
+\"~/.netrc\" file.
See the auth.info manual for details.
@@ -256,6 +271,11 @@ If the value is not a list, symmetric encryption will be used."
(when auth-source-debug
(apply 'auth-source-do-warn msg)))
+(defun auth-source-do-trivia (&rest msg)
+ (when (or (eq auth-source-debug 'trivia)
+ (functionp auth-source-debug))
+ (apply 'auth-source-do-warn msg)))
+
(defun auth-source-do-warn (&rest msg)
(apply
;; set logger to either the function in auth-source-debug or 'message
@@ -428,12 +448,18 @@ parameter, that parameter will be required in the resulting
token. The value for that parameter will be obtained from the
search parameters or from user input. If any queries are needed,
the alist `auth-source-creation-defaults' will be checked for the
-default prompt.
+default value. If the user, host, or port are missing, the alist
+`auth-source-creation-prompts' will be used to look up the
+prompts IN THAT ORDER (so the 'user prompt will be queried first,
+then 'host, then 'port, and finally 'secret). Each prompt string
+can use %u, %h, and %p to show the user, host, and port.
Here's an example:
\(let ((auth-source-creation-defaults '((user . \"defaultUser\")
- (A . \"default A\"))))
+ (A . \"default A\")))
+ (auth-source-creation-prompts
+ '((password . \"Enter IMAP password for %h:%p: \"))))
(auth-source-search :host '(\"nonesuch\" \"twosuch\") :type 'netrc :max 1
:P \"pppp\" :Q \"qqqq\"
:create '(A B Q)))
@@ -445,12 +471,11 @@ which says:
Create a new entry if you found none. The netrc backend will
automatically require host, user, and port. The host will be
- 'nonesuch' and Q will be 'qqqq'. We prompt for A with default
- 'default A', for B and port with default nil, and for the
- user with default 'defaultUser'. We will not prompt for Q. The
- resulting token will have keys user, host, port, A, B, and Q.
- It will not have P with any value, even though P is used in the
- search to find only entries that have P set to 'pppp'.\"
+ 'nonesuch' and Q will be 'qqqq'. We prompt for the password
+ with the shown prompt. We will not prompt for Q. The resulting
+ token will have keys user, host, port, A, B, and Q. It will not
+ have P with any value, even though P is used in the search to
+ find only entries that have P set to 'pppp'.\"
When multiple values are specified in the search parameter, the
user is prompted for which one. So :host (X Y Z) would ask the
@@ -499,17 +524,20 @@ must call it to obtain the actual value."
(keys (loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
+ (cached (auth-source-remembered-p spec))
+ ;; note that we may have cached results but found is still nil
+ ;; (there were no results from the search)
(found (auth-source-recall spec))
- filtered-backends accessor-key found-here goal matches backend)
+ filtered-backends accessor-key backend)
- (if (and found auth-source-do-cache)
+ (if (and cached auth-source-do-cache)
(auth-source-do-debug
"auth-source-search: found %d CACHED results matching %S"
(length found) spec)
(assert
(or (eq t create) (listp create)) t
- "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s")
+ "Invalid auth-source :create parameter (must be t or a list): %s %s")
(setq filtered-backends (copy-sequence backends))
(dolist (backend backends)
@@ -523,66 +551,65 @@ must call it to obtain the actual value."
(return))
(invalid-slot-name))))
- (auth-source-do-debug
+ (auth-source-do-trivia
"auth-source-search: found %d backends matching %S"
(length filtered-backends) spec)
;; (debug spec "filtered" filtered-backends)
- (setq goal max)
;; First go through all the backends without :create, so we can
;; query them all.
- (let ((uspec (copy-sequence spec)))
- (plist-put uspec :create nil)
- (dolist (backend filtered-backends)
- (let ((match (apply
- (slot-value backend 'search-function)
- :backend backend
- uspec)))
- (when match
- (push (list backend match) matches)))))
+ (setq found (auth-source-search-backends filtered-backends
+ spec
+ ;; to exit early
+ max
+ ;; create and delete
+ nil delete))
+
+ (auth-source-do-debug
+ "auth-source-search: found %d results (max %d) matching %S"
+ (length found) max spec)
+
;; If we didn't find anything, then we allow the backend(s) to
;; create the entries.
(when (and create
- (not matches))
- (dolist (backend filtered-backends)
- (unless matches
- (let ((match (apply
- (slot-value backend 'search-function)
- :backend backend
- :create create
- :delete delete
- spec)))
- (when match
- (push (list backend match) matches))))))
-
- (setq backend (caar matches)
- found-here (cadar matches))
-
- (block nil
- ;; if max is 0, as soon as we find something, return it
- (when (and (zerop max) (> 0 (length found-here)))
- (return t))
-
- ;; decrement the goal by the number of new results
- (decf goal (length found-here))
- ;; and append the new results to the full list
- (setq found (append found found-here))
-
- (auth-source-do-debug
- "auth-source-search: found %d results (max %d/%d) in %S matching %S"
- (length found-here) max goal backend spec)
-
- ;; return full list if the goal is 0 or negative
- (when (zerop (max 0 goal))
- (return found))
-
- ;; change the :max parameter in the spec to the goal
- (setq spec (plist-put spec :max goal))
-
- (when (and found auth-source-do-cache)
- (auth-source-remember spec found))))
-
- found))
+ (not found))
+ (setq found (auth-source-search-backends filtered-backends
+ spec
+ ;; to exit early
+ max
+ ;; create and delete
+ create delete))
+ (auth-source-do-warn
+ "auth-source-search: CREATED %d results (max %d) matching %S"
+ (length found) max spec))
+
+ ;; note we remember the lack of result too, if it's applicable
+ (when auth-source-do-cache
+ (auth-source-remember spec found)))
+
+ found))
+
+(defun auth-source-search-backends (backends spec max create delete)
+ (let (matches)
+ (dolist (backend backends)
+ (when (> max (length matches)) ; when we need more matches...
+ (let ((bmatches (apply
+ (slot-value backend 'search-function)
+ :backend backend
+ ;; note we're overriding whatever the spec
+ ;; has for :create and :delete
+ :create create
+ :delete delete
+ spec)))
+ (when bmatches
+ (auth-source-do-trivia
+ "auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
+ (length bmatches) max
+ (slot-value backend :type)
+ (slot-value backend :source)
+ spec)
+ (setq matches (append matches bmatches))))))
+ matches))
;;; (auth-source-search :max 1)
;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret))
@@ -631,6 +658,11 @@ Returns the deleted entries."
(password-read-from-cache
(concat auth-source-magic (format "%S" spec))))
+(defun auth-source-remembered-p (spec)
+ "Check if SPEC is remembered."
+ (password-in-cache-p
+ (concat auth-source-magic (format "%S" spec))))
+
(defun auth-source-forget (spec)
"Forget any cached data matching SPEC exactly.
@@ -641,7 +673,10 @@ Returns t or nil for forgotten or not found."
;;; (loop for sym being the symbols of password-data when (string-match (concat "^" auth-source-magic) (symbol-name sym)) collect (symbol-name sym))
;;; (auth-source-remember '(:host "wedd") '(4 5 6))
+;;; (auth-source-remembered-p '(:host "wedd"))
;;; (auth-source-remember '(:host "xedd") '(1 2 3))
+;;; (auth-source-remembered-p '(:host "xedd"))
+;;; (auth-source-remembered-p '(:host "zedd"))
;;; (auth-source-recall '(:host "xedd"))
;;; (auth-source-recall '(:host t))
;;; (auth-source-forget+ :host t)
@@ -680,6 +715,15 @@ while \(:host t) would find all host entries."
;;; Backend specific parsing: netrc/authinfo backend
+(defun auth-source-ensure-strings (values)
+ (unless (listp values)
+ (setq values (list values)))
+ (mapcar (lambda (value)
+ (if (numberp value)
+ (format "%s" value)
+ value))
+ values))
+
(defvar auth-source-netrc-cache nil)
;;; (auth-source-netrc-parse "~/.authinfo.gpg")
@@ -693,26 +737,37 @@ Note that the MAX parameter is used so we can exit the parse early."
;; We got already parsed contents; just return it.
file
(when (file-exists-p file)
+ (setq port (auth-source-ensure-strings port))
(with-temp-buffer
- (let ((tokens '("machine" "host" "default" "login" "user"
- "password" "account" "macdef" "force"
- "port" "protocol"))
- (max (or max 5000)) ; sanity check: default to stop at 5K
- (modified 0)
- alist elem result pair)
- (if (and auth-source-netrc-cache
- (equal (car auth-source-netrc-cache)
- (nth 5 (file-attributes file))))
- (insert (base64-decode-string
- (rot13-string (cdr auth-source-netrc-cache))))
- (insert-file-contents file)
- (when (string-match "\\.gpg\\'" file)
- ;; Store the contents of the file heavily encrypted in memory.
- (setq auth-source-netrc-cache
- (cons (nth 5 (file-attributes file))
- (rot13-string
- (base64-encode-string
- (buffer-string)))))))
+ (let* ((tokens '("machine" "host" "default" "login" "user"
+ "password" "account" "macdef" "force"
+ "port" "protocol"))
+ (max (or max 5000)) ; sanity check: default to stop at 5K
+ (modified 0)
+ (cached (cdr-safe (assoc file auth-source-netrc-cache)))
+ (cached-mtime (plist-get cached :mtime))
+ (cached-secrets (plist-get cached :secret))
+ alist elem result pair)
+
+ (if (and (functionp cached-secrets)
+ (equal cached-mtime
+ (nth 5 (file-attributes file))))
+ (progn
+ (auth-source-do-trivia
+ "auth-source-netrc-parse: using CACHED file data for %s"
+ file)
+ (insert (funcall cached-secrets)))
+ (insert-file-contents file)
+ ;; cache all netrc files (used to be just .gpg files)
+ ;; Store the contents of the file heavily encrypted in memory.
+ ;; (note for the irony-impaired: they are just obfuscated)
+ (aput 'auth-source-netrc-cache file
+ (list :mtime (nth 5 (file-attributes file))
+ :secret (lexical-let ((v (rot13-string
+ (base64-encode-string
+ (buffer-string)))))
+ (lambda () (base64-decode-string
+ (rot13-string v)))))))
(goto-char (point-min))
;; Go through the file, line by line.
(while (and (not (eobp))
@@ -858,7 +913,7 @@ See `auth-source-search' for details on SPEC."
;; if we need to create an entry AND none were found to match
(when (and create
- (= 0 (length results)))
+ (not results))
;; create based on the spec and record the value
(setq results (or
@@ -873,6 +928,22 @@ See `auth-source-search' for details on SPEC."
(plist-put spec :create nil)))))
results))
+(defun auth-source-netrc-element-or-first (v)
+ (if (listp v)
+ (nth 0 v)
+ v))
+
+;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
+
+(defun auth-source-format-prompt (prompt alist)
+ "Format PROMPT using %x (for any character x) specifiers in ALIST."
+ (dolist (cell alist)
+ (let ((c (nth 0 cell))
+ (v (nth 1 cell)))
+ (when (and c v)
+ (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt)))))
+ prompt)
+
;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
@@ -887,7 +958,6 @@ See `auth-source-search' for details on SPEC."
(required (append base-required create-extra))
(file (oref backend source))
(add "")
- (show "")
;; `valist' is an alist
valist
;; `artificial' will be returned if no creation is needed
@@ -918,63 +988,58 @@ See `auth-source-search' for details on SPEC."
;; for each required element
(dolist (r required)
(let* ((data (aget valist r))
+ ;; take the first element if the data is a list
+ (data (auth-source-netrc-element-or-first data))
+ ;; this is the default to be offered
(given-default (aget auth-source-creation-defaults r))
- ;; the defaults are simple
+ ;; the default supplementals are simple: for the user,
+ ;; try (user-login-name), otherwise take given-default
(default (cond
- ((and (not given-default) (eq r 'user))
- (user-login-name))
- ;; note we need this empty string
- ((and (not given-default) (eq r 'port))
- "")
+ ;; don't default the user name
+ ;; ((and (not given-default) (eq r 'user))
+ ;; (user-login-name))
(t given-default)))
- ;; the prompt's default string depends on the data so far
- (default-string (if (and default (< 0 (length default)))
- (format " (default %s)" default)
- " (no default)"))
- ;; the prompt should also show what's entered so far
- (user-value (aget valist 'user))
- (host-value (aget valist 'host))
- (port-value (aget valist 'port))
- ;; note this handles lists by just printing them
- ;; later we allow the user to use completing-read to pick
- (info-so-far (concat (if user-value
- (format "%s@" user-value)
- "[USER?]")
- (if host-value
- (format "%s" host-value)
- "[HOST?]")
- (if port-value
- ;; this distinguishes protocol between
- (if (zerop (length port-value))
- "" ; 'entered as "no default"' vs.
- (format ":%s" port-value)) ; given
- ;; and this is when the protocol is unknown
- "[PORT?]"))))
-
- ;; now prompt if the search SPEC did not include a required key;
- ;; take the result and put it in `data' AND store it in `valist'
- (aput 'valist r
- (setq data
- (cond
- ((and (null data) (eq r 'secret))
- ;; special case prompt for passwords
- (read-passwd (format "Password for %s: " info-so-far)))
- ((null data)
- (read-string
- (format "Enter %s for %s%s: "
- r info-so-far default-string)
- nil nil default))
- ((listp data)
- (completing-read
- (format "Enter %s for %s (TAB to see the choices): "
- r info-so-far)
- data
- nil ; no predicate
- t ; require a match
- ;; note the default is nil, but if the user
- ;; hits RET we'll get "", which is handled OK later
- nil))
- (t data))))
+ (printable-defaults (list
+ (cons 'user
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'user))
+ (plist-get artificial :user)
+ "[any user]"))
+ (cons 'host
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'host))
+ (plist-get artificial :host)
+ "[any host]"))
+ (cons 'port
+ (or
+ (auth-source-netrc-element-or-first
+ (aget valist 'port))
+ (plist-get artificial :port)
+ "[any port]"))))
+ (prompt (or (aget auth-source-creation-prompts r)
+ (case r
+ ('secret "%p password for user %u, host %h: ")
+ ('user "%p user name: ")
+ ('host "%p host name for user %u: ")
+ ('port "%p port for user %u and host %h: "))
+ (format "Enter %s (%%u@%%h:%%p): " r)))
+ (prompt (auth-source-format-prompt
+ prompt
+ `((?u ,(aget printable-defaults 'user))
+ (?h ,(aget printable-defaults 'host))
+ (?p ,(aget printable-defaults 'port))))))
+
+ ;; store the data, prompting for the password if needed
+ (setq data
+ (cond
+ ((and (null data) (eq r 'secret))
+ ;; special case prompt for passwords
+ (read-passwd prompt))
+ ((null data)
+ (read-string prompt default))
+ (t (or data default))))
(when data
(setq artificial (plist-put artificial
@@ -987,7 +1052,9 @@ See `auth-source-search' for details on SPEC."
;; when r is not an empty string...
(when (and (stringp data)
(< 0 (length data)))
- (let ((printer (lambda (hide)
+ ;; this function is not strictly necessary but I think it
+ ;; makes the code clearer -tzz
+ (let ((printer (lambda ()
;; append the key (the symbol name of r)
;; and the value in r
(format "%s%s %S"
@@ -995,17 +1062,14 @@ See `auth-source-search' for details on SPEC."
(if (zerop (length add)) "" " ")
;; remap auth-source tokens to netrc
(case r
- ('user "login")
- ('host "machine")
+ ('user "login")
+ ('host "machine")
('secret "password")
- ('port "port") ; redundant but clearer
+ ('port "port") ; redundant but clearer
(t (symbol-name r)))
;; the value will be printed in %S format
- (if (and hide (eq r 'secret))
- "HIDDEN_SECRET"
- data)))))
- (setq add (concat add (funcall printer nil)))
- (setq show (concat show (funcall printer t)))))))
+ data))))
+ (setq add (concat add (funcall printer)))))))
(with-temp-buffer
(when (file-exists-p file)
@@ -1022,17 +1086,55 @@ See `auth-source-search' for details on SPEC."
(goto-char (point-max))
;; ask AFTER we've successfully opened the file
- (if (y-or-n-p (format "Add to file %s: line [%s]" file show))
+ (let ((prompt (format "Save auth info to file %s? %s: "
+ file
+ "y/n/N/e/?"))
+ (done (not (eq auth-source-save-behavior 'ask)))
+ (bufname "*auth-source Help*")
+ k)
+ (while (not done)
+ (message "%s" prompt)
+ (setq k (read-char))
+ (case k
+ (?y (setq done t))
+ (?? (save-excursion
+ (with-output-to-temp-buffer bufname
+ (princ
+ (concat "(y)es, save\n"
+ "(n)o but use the info\n"
+ "(N)o and don't ask to save again\n"
+ "(e)dit the line\n"
+ "(?) for help as you can see.\n"))
+ (set-buffer standard-output)
+ (help-mode))))
+ (?n (setq add ""
+ done t))
+ (?N (setq add ""
+ done t
+ auth-source-save-behavior nil))
+ (?e (setq add (read-string "Line to add: " add)))
+ (t nil)))
+
+ (when (get-buffer-window bufname)
+ (delete-window (get-buffer-window bufname)))
+
+ ;; make sure the info is not saved
+ (when (null auth-source-save-behavior)
+ (setq add ""))
+
+ (when (< 0 (length add))
(progn
(unless (bolp)
(insert "\n"))
(insert add "\n")
(write-region (point-min) (point-max) file nil 'silent)
- (auth-source-do-debug
+ (auth-source-do-warn
"auth-source-netrc-create: wrote 1 new line to %s"
file)
- nil)
- (list artificial)))))
+ nil))
+
+ (when (eq done t)
+ (list artificial))))))
;;; Backend specific parsing: Secrets API backend
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 204d63d37e4..989488c0995 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -441,7 +441,7 @@ manipulated as follows:
(setf (gnus-agent-cat-groups old-category)
(delete group (gnus-agent-cat-groups
old-category))))))
- ;; Purge cache as preceeding loop invalidated it.
+ ;; Purge cache as preceding loop invalidated it.
(setq gnus-category-group-cache nil))
(setcdr (or (assq 'agent-groups category)
@@ -1195,7 +1195,7 @@ downloadable."
(mapc #'gnus-summary-remove-process-mark
(gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
- ;; The preceeding call to (gnus-agent-summary-fetch-group)
+ ;; The preceding call to (gnus-agent-summary-fetch-group)
;; updated the temporary gnus-newsgroup-downloadable to
;; remove each article successfully fetched. Now, I
;; update the real gnus-newsgroup-downloadable to only
@@ -1520,14 +1520,14 @@ downloaded into the agent."
header-number)
;; Check each article
(while (setq article (pop articles))
- ;; Skip alist entries preceeding this article
+ ;; Skip alist entries preceding this article
(while (> article (or (caar alist) (1+ article)))
(setq alist (cdr alist)))
;; Prune off articles that we have already fetched.
(unless (and (eq article (caar alist))
(cdar alist))
- ;; Skip headers preceeding this article
+ ;; Skip headers preceding this article
(while (> article
(setq header-number
(let* ((header (car headers)))
@@ -3437,7 +3437,7 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it.")))
;; If considering all articles is set, I can only
;; expire article IDs that are no longer in the
- ;; active range (That is, articles that preceed the
+ ;; active range (That is, articles that precede the
;; first article in the new alist).
(if (and gnus-agent-consider-all-articles
(>= article-number (car active)))
@@ -3715,7 +3715,7 @@ has been fetched."
(gnus-agent-append-to-list tail-uncached v1))
(setq arts (cdr arts))
(setq ref (cdr ref)))
- (t ; reference article (v2) preceeds the list being filtered
+ (t ; reference article (v2) precedes the list being filtered
(setq ref (cdr ref))))))
(while arts
(gnus-agent-append-to-list tail-uncached (pop arts)))
@@ -4020,7 +4020,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
;; article (with the exception of the last ID in the list - it's
;; special) that no longer appears in the overview. In this
;; situtation, the last article ID in the list implies that it,
- ;; and every article ID preceeding it, have been fetched from the
+ ;; and every article ID preceding it, have been fetched from the
;; server.
(if gnus-agent-consider-all-articles
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 19eee78ab17..c64138b43d7 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1040,7 +1040,7 @@ Some of these headers are updated automatically. See
(item :tag "User-defined" :value 'user-defined)))
(defcustom gnus-article-update-date-headers 1
- "How often to update the date header.
+ "A number that says how often to update the date header (in seconds).
If nil, don't update it at all."
:version "24.1"
:group 'gnus-article-headers
@@ -1253,6 +1253,24 @@ predicate. See Info node `(gnus)Customizing Articles'."
:link '(custom-manual "(gnus)Customizing Articles")
:type gnus-article-treat-custom)
+(gnus-define-group-parameter
+ list-identifier
+ :variable-document
+ "Alist of regexps and correspondent identifiers."
+ :variable-group gnus-article-washing
+ :parameter-type
+ '(choice :tag "Identifier"
+ :value nil
+ (symbol :tag "Item in `gnus-list-identifiers'" none)
+ regexp
+ (const :tag "None" nil))
+ :parameter-document
+ "If non-nil, specify how to remove `identifiers' from articles' subject.
+
+Any symbol is used to look up a regular expression to match the
+banner in `gnus-list-identifiers'. A string is used as a regular
+expression to match the identifier directly.")
+
(make-obsolete-variable 'gnus-treat-strip-pgp nil
"Gnus 5.10 (Emacs 22.1)")
@@ -1725,9 +1743,10 @@ Initialized from `text-mode-syntax-table.")
(put 'gnus-with-article-headers 'edebug-form-spec '(body))
(defmacro gnus-with-article-buffer (&rest forms)
- `(with-current-buffer gnus-article-buffer
- (let ((inhibit-read-only t))
- ,@forms)))
+ `(when (buffer-live-p (get-buffer gnus-article-buffer))
+ (with-current-buffer gnus-article-buffer
+ (let ((inhibit-read-only t))
+ ,@forms))))
(put 'gnus-with-article-buffer 'lisp-indent-function 0)
(put 'gnus-with-article-buffer 'edebug-form-spec '(body))
@@ -3055,10 +3074,11 @@ images if any to the browser, and deletes them when exiting the group
The `gnus-list-identifiers' variable specifies what to do."
(interactive)
(let ((inhibit-point-motion-hooks t)
- (regexp (if (consp gnus-list-identifiers)
- (mapconcat 'identity gnus-list-identifiers " *\\|")
- gnus-list-identifiers))
- (inhibit-read-only t))
+ (regexp (or (gnus-parameter-list-identifier gnus-newsgroup-name)
+ (if (consp gnus-list-identifiers)
+ (mapconcat 'identity gnus-list-identifiers " *\\|")
+ gnus-list-identifiers)))
+ (inhibit-read-only t))
(when regexp
(save-excursion
(save-restriction
@@ -3463,7 +3483,7 @@ possible values."
combined-lapsed))
(error "Unknown conversion type: %s" type))
(condition-case ()
- (let ((time (date-to-time date)))
+ (let ((time (ignore-errors (date-to-time date))))
(cond
;; Convert to the local timezone.
((eq type 'local)
@@ -3515,6 +3535,7 @@ possible values."
(segments 3)
lapsed-string)
(while (and
+ time
(setq lapsed-string
(concat " (" (article-lapsed-string time segments) ")"))
(> (+ (length date-string)
@@ -4505,13 +4526,10 @@ commands:
(setq gnus-summary-buffer
(gnus-summary-buffer-name gnus-newsgroup-name))
(gnus-summary-set-local-parameters gnus-newsgroup-name)
- (cond
- ((and gnus-article-update-date-headers
- (not article-lapsed-timer))
+ (when article-lapsed-timer
+ (gnus-stop-date-timer))
+ (when gnus-article-update-date-headers
(gnus-start-date-timer gnus-article-update-date-headers))
- ((and (not gnus-article-update-date-headers)
- article-lapsed-timer)
- (gnus-stop-date-timer)))
(current-buffer)))))
;; Set article window start at LINE, where LINE is the number of lines
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el
index 2a45b9363f4..419346b7191 100644
--- a/lisp/gnus/gnus-demon.el
+++ b/lisp/gnus/gnus-demon.el
@@ -140,7 +140,7 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
;; (func number nil)
;; Call every `time'
((and (numberp time) (null idle))
- (run-with-timer t time 'gnus-demon-run-callback func)))))
+ (run-with-timer time time 'gnus-demon-run-callback func)))))
(when timer
(add-to-list 'gnus-demon-timers timer)))))
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index 7208889a163..98b1f3bd18c 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -80,9 +80,8 @@ If nil, default to `gravatar-size'."
"Insert GRAVATAR for ADDRESS in HEADER in current article buffer.
Set image category to CATEGORY."
(unless (eq gravatar 'error)
- (with-current-buffer gnus-article-buffer
+ (gnus-with-article-buffer
(let ((mark (point-marker))
- (inhibit-read-only t)
(inhibit-point-motion-hooks t)
(case-fold-search t))
(save-restriction
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 30cd1275e7b..9ed3cf02a49 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3102,7 +3102,7 @@ The user will be prompted for a directory. The contents of this
directory will be used as a newsgroup. The directory should contain
mail messages or news articles in files that have numeric names."
(interactive
- (list (read-file-name "Create group from directory: ")))
+ (list (read-directory-name "Create group from directory: ")))
(unless (file-exists-p dir)
(error "No such directory"))
(unless (file-directory-p dir)
@@ -4400,6 +4400,21 @@ and the second element is the address."
(defun gnus-group-set-params-info (group params)
(gnus-group-set-info params group 'params))
+;; Ad-hoc function for inserting data from a different newsrc.eld
+;; file. Use with caution, if at all.
+(defun gnus-import-other-newsrc-file (file)
+ (with-temp-buffer
+ (insert-file file)
+ (let (form)
+ (while (ignore-errors
+ (setq form (read (current-buffer))))
+ (when (and (consp form)
+ (eq (cadr form) 'gnus-newsrc-alist))
+ (let ((infos (cadr (nth 2 form))))
+ (dolist (info infos)
+ (when (gnus-get-info (car info))
+ (gnus-set-info (car info) info)))))))))
+
(defun gnus-add-marked-articles (group type articles &optional info force)
;; Add ARTICLES of TYPE to the info of GROUP.
;; If INFO is non-nil, use that info. If FORCE is non-nil, don't
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index b199dcc572c..093eec33fcd 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -383,11 +383,13 @@ Thank you for your help in stamping out bugs.
(defvar gnus-article-reply nil)
(defmacro gnus-setup-message (config &rest forms)
(let ((winconf (make-symbol "gnus-setup-message-winconf"))
+ (winconf-name (make-symbol "gnus-setup-message-winconf-name"))
(buffer (make-symbol "gnus-setup-message-buffer"))
(article (make-symbol "gnus-setup-message-article"))
(yanked (make-symbol "gnus-setup-yanked-articles"))
(group (make-symbol "gnus-setup-message-group")))
`(let ((,winconf (current-window-configuration))
+ (,winconf-name gnus-current-window-configuration)
(,buffer (buffer-name (current-buffer)))
(,article gnus-article-reply)
(,yanked gnus-article-yanked-articles)
@@ -432,7 +434,7 @@ Thank you for your help in stamping out bugs.
(progn
,@forms)
(gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
- ,yanked)
+ ,yanked ',winconf-name)
(setq gnus-message-buffer (current-buffer))
(set (make-local-variable 'gnus-message-group-art)
(cons ,group ,article))
@@ -527,7 +529,8 @@ Gcc: header for archiving purposes."
(throw 'found (cons (cadr elem) (caddr elem)))))))))
(defun gnus-inews-add-send-actions (winconf buffer article
- &optional config yanked)
+ &optional config yanked
+ winconf-name)
(gnus-make-local-hook 'message-sent-hook)
(add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
'gnus-inews-do-gcc) nil t)
@@ -538,8 +541,10 @@ Gcc: header for archiving purposes."
`(lambda (&optional arg)
(gnus-post-method arg ,gnus-newsgroup-name)))
(message-add-action
- `(when (gnus-buffer-exists-p ,buffer)
- (set-window-configuration ,winconf))
+ `(progn
+ (setq gnus-current-window-configuration ',winconf-name)
+ (when (gnus-buffer-exists-p ,buffer)
+ (set-window-configuration ,winconf)))
'exit 'postpone 'kill)
(let ((to-be-marked (cond
(yanked
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index 794d1642cdd..ce5a837eaef 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -116,10 +116,10 @@ Both ranges must be in ascending order."
;; All done with range2
(setq r nil))
((< max1 min2)
- ;; No overlap: range1 preceeds range2
+ ;; No overlap: range1 precedes range2
(pop r))
((< max2 min1)
- ;; No overlap: range2 preceeds range1
+ ;; No overlap: range2 precedes range1
(pop range2))
((and (<= min2 min1) (<= max1 max2))
;; Complete overlap: range1 removed
@@ -232,10 +232,10 @@ RANGE1 and RANGE2 have to be sorted over <."
(setq range1 (cdr range1)
range2 (cdr range2))
(while (and min1 min2)
- (cond ((< max1 min2) ; range1 preceeds range2
+ (cond ((< max1 min2) ; range1 precedes range2
(setq range1 (cdr range1)
min1 nil))
- ((< max2 min1) ; range2 preceeds range1
+ ((< max2 min1) ; range2 precedes range1
(setq range2 (cdr range2)
min2 nil))
(t ; some sort of overlap is occurring
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index e5e2468058c..ebfa53f841e 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -864,6 +864,7 @@ prompt the user for the name of an NNTP server to use."
(gnus-get-buffer-create
(file-name-nondirectory dribble-file)))
(set (make-local-variable 'file-precious-flag) t)
+ (setq buffer-save-without-query t)
(erase-buffer)
(setq buffer-file-name dribble-file)
(auto-save-mode t)
@@ -1512,7 +1513,7 @@ If SCAN, request a scan of that group as well."
(num 0))
;; These checks are present in gnus-activate-group but skipped
- ;; due to setting dont-check in the preceeding call.
+ ;; due to setting dont-check in the preceding call.
;; If a cache is present, we may have to alter the active info.
(when (and gnus-use-cache info)
@@ -1689,6 +1690,16 @@ If SCAN, request a scan of that group as well."
method))
(setcar elem method))
(push (list method 'ok) methods)))))
+
+ ;; If we have primary/secondary select methods, but no groups from
+ ;; them, we still want to issue a retrieval request from them.
+ (dolist (method (cons gnus-select-method
+ gnus-secondary-select-methods))
+ (when (and (not (assoc method type-cache))
+ (gnus-check-backend-function 'request-list (car method)))
+ (with-current-buffer nntp-server-buffer
+ (gnus-read-active-file-1 method nil))))
+
;; Start early async retrieval of data.
(dolist (elem type-cache)
(destructuring-bind (method method-type infos dummy) elem
@@ -1711,15 +1722,6 @@ If SCAN, request a scan of that group as well."
(setcar (nthcdr 3 elem)
(gnus-retrieve-group-data-early method infos)))))))
- ;; If we have primary/secondary select methods, but no groups from
- ;; them, we still want to issue a retrieval request from them.
- (dolist (method (cons gnus-select-method
- gnus-secondary-select-methods))
- (when (and (not (assoc method type-cache))
- (gnus-check-backend-function 'request-list (car method)))
- (with-current-buffer nntp-server-buffer
- (gnus-read-active-file-1 method nil))))
-
;; Do the rest of the retrieval.
(dolist (elem type-cache)
(destructuring-bind (method method-type infos early-data) elem
@@ -1885,7 +1887,7 @@ If SCAN, request a scan of that group as well."
;; OK - I'm done
(setq articles nil))
((< range article)
- ;; this range preceeds the article. Leave the range unmodified.
+ ;; this range precedes the article. Leave the range unmodified.
(pop ranges)
ranges)
((= range article)
@@ -1908,11 +1910,11 @@ If SCAN, request a scan of that group as well."
(setcar ranges min)
ranges)
((< max article)
- ;; this range preceeds the article. Leave the range unmodified.
+ ;; this range precedes the article. Leave the range unmodified.
(pop ranges)
ranges)
((< article min)
- ;; this article preceeds the range. Return null to move to the
+ ;; this article precedes the range. Return null to move to the
;; next article
nil)
(t
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 789308c4ab9..a8786e39c7b 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1234,7 +1234,7 @@ For example: ((1 . cn-gb-2312) (2 . big5))."
:type 'boolean
:group 'gnus-summary-marks)
-(defcustom gnus-propagate-marks t
+(defcustom gnus-propagate-marks nil
"If non-nil, Gnus will store and retrieve marks from the backends.
This means that marks will be stored both in .newsrc.eld and in
the backend, and will slow operation down somewhat."
@@ -3853,7 +3853,7 @@ This function is intended to be used in
((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024))))
(t (format "%dM" (/ c (* 1024.0 1024)))))))
-(defcustom gnus-summary-user-date-format-alist
+(defcustom gnus-user-date-format-alist
'(((gnus-seconds-today) . "Today, %H:%M")
((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M")
(604800 . "%A %H:%M") ; That's one week
@@ -3880,11 +3880,9 @@ respectively."
:version "24.1"
:group 'gnus-summary-format
:type '(alist :key-type sexp :value-type string))
-(make-obsolete-variable 'gnus-user-date-format-alist
- 'gnus-summary-user-date-format-alist "24.1")
(defun gnus-user-date (messy-date)
- "Format the messy-date according to `gnus-summary-user-date-format-alist'.
+ "Format the messy-date according to `gnus-user-date-format-alist'.
Returns \" ? \" if there's bad input or if another error occurs.
Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
(condition-case ()
@@ -3893,7 +3891,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
;;If we don't find something suitable we'll use this one
(my-format "%b %d '%y"))
(let* ((difference (- now messy-date))
- (templist gnus-summary-user-date-format-alist)
+ (templist gnus-user-date-format-alist)
(top (eval (caar templist))))
(while (if (numberp top) (< top difference) (not top))
(progn
@@ -9525,8 +9523,7 @@ C-u g', show the raw article."
((not arg)
;; Select the article the normal way.
(gnus-summary-select-article nil 'force))
- ((or (equal arg '(16))
- (eq arg t))
+ ((equal arg '(16))
;; C-u C-u g
(let ((gnus-inhibit-article-treatments t))
(gnus-summary-select-article nil 'force)))
@@ -12438,7 +12435,10 @@ UNREAD is a sorted list."
(save-excursion
(let (setmarkundo)
;; Propagate the read marks to the backend.
- (when (and gnus-propagate-marks
+ (when (and (or gnus-propagate-marks
+ (gnus-method-option-p
+ (gnus-find-method-for-group group)
+ 'server-marks))
(gnus-check-backend-function 'request-set-mark group))
(let ((del (gnus-remove-from-range (gnus-info-read info) read))
(add (gnus-remove-from-range read (gnus-info-read info))))
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index d6aad539029..05ba3595479 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -366,7 +366,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
(interactive
(list current-prefix-arg
(file-name-as-directory
- (read-file-name "Uudecode and save in dir: "
+ (read-directory-name "Uudecode and save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir t))))
(gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t))
@@ -381,7 +381,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
(interactive
(list current-prefix-arg
(file-name-as-directory
- (read-file-name "Unshar and save in dir: "
+ (read-directory-name "Unshar and save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir t))))
(gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t))
@@ -390,12 +390,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
"Saves the current article."
(interactive
(list current-prefix-arg
- (read-file-name
- (if gnus-uu-save-separate-articles
- "Save articles in dir: "
- "Save articles in file: ")
- gnus-uu-default-dir
- gnus-uu-default-dir)))
+ (if gnus-uu-save-separate-articles
+ (read-directory-name
+ "Save articles in dir: " gnus-uu-default-dir gnus-uu-default-dir)
+ (read-file-name
+ "Save article in file: " gnus-uu-default-dir gnus-uu-default-dir))))
(setq gnus-uu-saved-article-name file)
(gnus-uu-decode-with-method 'gnus-uu-save-article n nil t))
@@ -404,7 +403,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
(interactive
(list current-prefix-arg
(file-name-as-directory
- (read-file-name "Unbinhex and save in dir: "
+ (read-directory-name "Unbinhex and save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir))))
(setq gnus-uu-binhex-article-name
@@ -416,7 +415,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
(interactive
(list current-prefix-arg
(file-name-as-directory
- (read-file-name "yEnc decode and save in dir: "
+ (read-directory-name "yEnc decode and save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir))))
(setq gnus-uu-yenc-article-name nil)
@@ -458,10 +457,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
"Saves and views the current article."
(interactive
(list current-prefix-arg
- (read-file-name (if gnus-uu-save-separate-articles
- "Save articles is dir: "
- "Save articles in file: ")
- gnus-uu-default-dir gnus-uu-default-dir)))
+ (if gnus-uu-save-separate-articles
+ (read-directory-name "Save articles in dir: "
+ gnus-uu-default-dir gnus-uu-default-dir)
+ (read-file-name "Save articles in file: "
+ gnus-uu-default-dir gnus-uu-default-dir))))
(let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic)))
(gnus-uu-decode-save n file)))
@@ -742,7 +742,7 @@ When called interactively, prompt for REGEXP."
(interactive
(list current-prefix-arg
(file-name-as-directory
- (read-file-name "Save in dir: "
+ (read-directory-name "Save in dir: "
gnus-uu-default-dir
gnus-uu-default-dir t))))
(gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 42acb65ff9f..57d085a0380 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1607,7 +1607,8 @@ slower."
("nnweb" none)
("nnrss" none)
("nnagent" post-mail)
- ("nnimap" post-mail address prompt-address physical-address respool)
+ ("nnimap" post-mail address prompt-address physical-address respool
+ server-marks)
("nnmaildir" mail respool address)
("nnnil" none))
"*An alist of valid select methods.
@@ -2545,7 +2546,7 @@ a string, be sure to use a valid format, see RFC 2616."
(defvar gnus-extended-servers nil)
;; The carpal mode has been removed, but define the variable for
-;; backwards compatability.
+;; backwards compatibility.
(defvar gnus-carpal nil)
(make-obsolete-variable 'gnus-carpal nil "Emacs 24.1")
@@ -3114,6 +3115,10 @@ Return nil if not defined."
(defmacro gnus-get-info (group)
`(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
+(defun gnus-set-info (group info)
+ (setcar (nthcdr 2 (gnus-gethash group gnus-newsrc-hashtb))
+ info))
+
;;; Load the compatibility functions.
(require 'gnus-ems)
@@ -3263,7 +3268,7 @@ g -- Group name."
((= c ?d)
(point))
((= c ?D)
- (read-file-name prompt nil default-directory 'lambda))
+ (read-directory-name prompt nil default-directory 'lambda))
((= c ?f)
(read-file-name prompt nil nil 'lambda))
((= c ?F)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 58daf1baf94..08c59b00bfc 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -129,17 +129,6 @@
:group 'message-buffers
:type '(choice function (const nil)))
-(defcustom message-cite-style nil
- "The overall style to be used when yanking cited text.
-Values are either `traditional' (cited text first),
-`top-post' (cited text at the bottom), or nil (don't override the
-individual message variables)."
- :version "24.1"
- :group 'message-various
- :type '(choice (const :tag "None" :value nil)
- (const :tag "Traditional" :value traditional)
- (const :tag "Top-post" :value top-post)))
-
(defcustom message-fcc-handler-function 'message-output
"*A function called to save outgoing articles.
This function will be called with the name of the file to store the
@@ -1088,6 +1077,71 @@ needed."
:link '(custom-manual "(message)Insertion Variables")
:group 'message-insertion)
+(defcustom message-cite-reply-position 'traditional
+ "*Where the reply should be positioned.
+If `traditional', reply inline.
+If `above', reply above quoted text.
+If `below', reply below quoted text.
+
+Note: Many newsgroups frown upon nontraditional reply styles. You
+probably want to set this variable only for specific groups,
+e.g. using `gnus-posting-styles':
+
+ (eval (set (make-local-variable 'message-cite-reply-above) 'above))"
+ :type '(choice (const :tag "Reply inline" 'traditional)
+ (const :tag "Reply above" 'above)
+ (const :tag "Reply below" 'below))
+ :group 'message-insertion)
+
+(defcustom message-cite-style nil
+ "*The overall style to be used when yanking cited text.
+Value is either `nil' (no variable overrides) or a let-style list
+of pairs (VARIABLE VALUE) that will be bound in
+`message-yank-original' to do the quoting.
+
+Presets to impersonate popular mail agents are found in the
+message-cite-style-* variables. This variable is intended for
+use in `gnus-posting-styles', such as:
+
+ ((posting-from-work-p) (eval (set (make-local-variable 'message-cite-style) message-cite-style-outlook)))"
+ :version "24.1"
+ :group 'message-insertion
+ :type '(choice (const :tag "Do not override variables" :value nil)
+ (const :tag "MS Outlook" :value message-cite-style-outlook)
+ (const :tag "Mozilla Thunderbird" :value message-cite-style-thunderbird)
+ (const :tag "Gmail" :value message-cite-style-gmail)
+ (variable :tag "User-specified")))
+
+(defconst message-cite-style-outlook
+ '((message-cite-function 'message-cite-original)
+ (message-citation-line-function 'message-insert-formatted-citation-line)
+ (message-cite-reply-position 'above)
+ (message-yank-prefix "")
+ (message-yank-cited-prefix "")
+ (message-yank-empty-prefix "")
+ (message-citation-line-format "\n\n-----------------------\nOn %a, %b %d %Y, %N wrote:\n"))
+ "Message citation style used by MS Outlook. Use with message-cite-style.")
+
+(defconst message-cite-style-thunderbird
+ '((message-cite-function 'message-cite-original)
+ (message-citation-line-function 'message-insert-formatted-citation-line)
+ (message-cite-reply-position 'above)
+ (message-yank-prefix "> ")
+ (message-yank-cited-prefix ">")
+ (message-yank-empty-prefix ">")
+ (message-citation-line-format "On %D %R %p, %N wrote:"))
+ "Message citation style used by Mozilla Thunderbird. Use with message-cite-style.")
+
+(defconst message-cite-style-gmail
+ '((message-cite-function 'message-cite-original)
+ (message-citation-line-function 'message-insert-formatted-citation-line)
+ (message-cite-reply-position 'above)
+ (message-yank-prefix " ")
+ (message-yank-cited-prefix " ")
+ (message-yank-empty-prefix " ")
+ (message-citation-line-format "On %e %B %Y %R, %f wrote:\n"))
+ "Message citation style used by Gmail. Use with message-cite-style.")
+
(defcustom message-distribution-function nil
"*Function called to return a Distribution header."
:group 'message-news
@@ -1814,7 +1868,12 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
(defvar message-options nil
"Some saved answers when sending message.")
-(make-variable-buffer-local 'message-options)
+;; FIXME: On XEmacs this causes problems since let-binding like:
+;; (let ((message-options message-options)) ...)
+;; as in `message-send' and `mml-preview' loses to buffer-local
+;; variable initialization.
+(unless (featurep 'xemacs)
+ (make-variable-buffer-local 'message-options))
(defvar message-send-mail-real-function nil
"Internal send mail function.")
@@ -3645,17 +3704,6 @@ To use this automatically, you may add this function to
(while (re-search-forward citexp nil t)
(replace-match (if remove "" "\n"))))))
-(defvar message-cite-reply-above nil
- "If non-nil, start own text above the quote.
-
-Note: Top posting is bad netiquette. Don't use it unless you
-really must. You probably want to set variable only for specific
-groups, e.g. using `gnus-posting-styles':
-
- (eval (set (make-local-variable 'message-cite-reply-above) t))
-
-This variable has no effect in news postings.")
-
(defun message-yank-original (&optional arg)
"Insert the message being replied to, if any.
Puts point before the text and mark after.
@@ -3669,49 +3717,49 @@ prefix, and don't delete any headers."
(interactive "P")
(let ((modified (buffer-modified-p))
body-text)
- (when (and message-reply-buffer
- message-cite-function)
- (when message-cite-reply-above
- (if (and (not (message-news-p))
- (or (eq message-cite-reply-above 'is-evil)
- (y-or-n-p "\
-Top posting is bad netiquette. Please don't top post unless you really must.
-Really top post? ")))
+ ;; eval the let forms contained in message-cite-style
+ (eval
+ `(let ,message-cite-style
+ (when (and message-reply-buffer
+ message-cite-function)
+ (when (equal message-cite-reply-position 'above)
(save-excursion
(setq body-text
(buffer-substring (message-goto-body)
(point-max)))
- (delete-region (message-goto-body) (point-max)))
- (set (make-local-variable 'message-cite-reply-above) nil)))
- (if (bufferp message-reply-buffer)
- (delete-windows-on message-reply-buffer t))
- (push-mark (save-excursion
- (cond
- ((bufferp message-reply-buffer)
- (insert-buffer-substring message-reply-buffer))
- ((and (consp message-reply-buffer)
- (functionp (car message-reply-buffer)))
- (apply (car message-reply-buffer)
- (cdr message-reply-buffer))))
- (unless (bolp)
- (insert ?\n))
- (point)))
- (unless arg
- (funcall message-cite-function)
- (unless (eq (char-before (mark t)) ?\n)
- (let ((pt (point)))
- (goto-char (mark t))
- (insert-before-markers ?\n)
- (goto-char pt))))
- (when message-cite-reply-above
- (message-goto-body)
- (insert body-text)
- (insert (if (bolp) "\n" "\n\n"))
- (message-goto-body))
- ;; Add a `message-setup-very-last-hook' here?
- ;; Add `gnus-article-highlight-citation' here?
- (unless modified
- (setq message-checksum (message-checksum))))))
+ (delete-region (message-goto-body) (point-max))))
+ (if (bufferp message-reply-buffer)
+ (delete-windows-on message-reply-buffer t))
+ (push-mark (save-excursion
+ (cond
+ ((bufferp message-reply-buffer)
+ (insert-buffer-substring message-reply-buffer))
+ ((and (consp message-reply-buffer)
+ (functionp (car message-reply-buffer)))
+ (apply (car message-reply-buffer)
+ (cdr message-reply-buffer))))
+ (unless (bolp)
+ (insert ?\n))
+ (point)))
+ (unless arg
+ (funcall message-cite-function)
+ (unless (eq (char-before (mark t)) ?\n)
+ (let ((pt (point)))
+ (goto-char (mark t))
+ (insert-before-markers ?\n)
+ (goto-char pt))))
+ (case message-cite-reply-position
+ ('above
+ (message-goto-body)
+ (insert body-text)
+ (insert (if (bolp) "\n" "\n\n"))
+ (message-goto-body))
+ ('below
+ (message-goto-signature)))
+ ;; Add a `message-setup-very-last-hook' here?
+ ;; Add `gnus-article-highlight-citation' here?
+ (unless modified
+ (setq message-checksum (message-checksum))))))))
(defun message-yank-buffer (buffer)
"Insert BUFFER into the current buffer and quote it."
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 83b8c416283..aa4ecbc3b0f 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -62,8 +62,9 @@ it will default to `imap'.")
(defvoo nnimap-stream 'undecided
"How nnimap will talk to the IMAP server.
-Values are `ssl', `network', `starttls' or `shell'.
-The default is to try `ssl' first, and then `network'.")
+Values are `ssl', `network', `network-only, `starttls' or
+`shell'. The default is to try `ssl' first, and then
+`network'.")
(defvoo nnimap-shell-program (if (boundp 'imap-shell-program)
(if (listp imap-shell-program)
@@ -72,14 +73,15 @@ The default is to try `ssl' first, and then `network'.")
"ssh %s imapd"))
(defvoo nnimap-inbox nil
- "The mail box where incoming mail arrives and should be split out of.")
+ "The mail box where incoming mail arrives and should be split out of.
+For example, \"INBOX\".")
(defvoo nnimap-split-methods nil
"How mail is split.
-Uses the same syntax as nnmail-split-methods")
+Uses the same syntax as `nnmail-split-methods'.")
(defvoo nnimap-split-fancy nil
- "Uses the same syntax as nnmail-split-fancy.")
+ "Uses the same syntax as `nnmail-split-fancy'.")
(defvoo nnimap-unsplittable-articles '(%Deleted %Seen)
"Articles with the flags in the list will not be considered when splitting.")
@@ -336,7 +338,7 @@ textual parts.")
(eq nnimap-stream 'starttls))
(nnheader-message 7 "Opening connection to %s..."
nnimap-address)
- '("143" "imap"))
+ '("imap" "143"))
((eq nnimap-stream 'shell)
(nnheader-message 7 "Opening connection to %s via shell..."
nnimap-address)
@@ -344,16 +346,16 @@ textual parts.")
((memq nnimap-stream '(ssl tls))
(nnheader-message 7 "Opening connection to %s via tls..."
nnimap-address)
- '("143" "993" "imap" "imaps"))
+ '("imaps" "imap" "993" "143"))
(t
(error "Unknown stream type: %s" nnimap-stream))))
(proto-stream-always-use-starttls t)
login-result credentials)
(when nnimap-server-port
- (setq ports (append ports (list nnimap-server-port))))
+ (push nnimap-server-port ports))
(destructuring-bind (stream greeting capabilities stream-type)
(open-protocol-stream
- "*nnimap*" (current-buffer) nnimap-address (car (last ports))
+ "*nnimap*" (current-buffer) nnimap-address (car ports)
:type nnimap-stream
:shell-command nnimap-shell-program
:capability-command "1 CAPABILITY\r\n"
@@ -1150,6 +1152,7 @@ textual parts.")
(setf (nnimap-examined nnimap-object) group)
(if (and qresyncp
uidvalidity
+ active
modseq)
(push
(list (nnimap-send-command "EXAMINE %S (%s (%s %s))"
@@ -1493,10 +1496,22 @@ textual parts.")
(setq start (point))
(goto-char end))
(while (re-search-forward "^\\* [0-9]+ FETCH " start t)
- (setq elems (read (current-buffer)))
- (push (cons (cadr (memq 'UID elems))
- (cadr (memq 'FLAGS elems)))
- articles))
+ (let ((p (point)))
+ ;; FIXME: For FETCH lines like "* 2971 FETCH (FLAGS (%Recent) UID
+ ;; 12509 MODSEQ (13419098521433281274))" we get an
+ ;; overflow-error. The handler simply deletes that large number
+ ;; and reads again. But maybe there's a better fix...
+ (setq elems (condition-case nil (read (current-buffer))
+ (overflow-error
+ ;; After an overflow-error, point is just after
+ ;; the too large number. So delete it and try
+ ;; again.
+ (delete-region (point) (progn (backward-word) (point)))
+ (goto-char p)
+ (read (current-buffer)))))
+ (push (cons (cadr (memq 'UID elems))
+ (cadr (memq 'FLAGS elems)))
+ articles)))
(push (nconc (list group uidnext totalp permanent-flags uidvalidity
vanished highestmodseq)
articles)
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 8e91c68b391..eaaac3f88ce 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -203,11 +203,12 @@
;; Imap variables
(defvar nnir-imap-search-arguments
- '(("Whole message" . "TEXT")
- ("Subject" . "SUBJECT")
- ("To" . "TO")
- ("From" . "FROM")
- ("Imap" . ""))
+ '(("whole message" . "TEXT")
+ ("subject" . "SUBJECT")
+ ("to" . "TO")
+ ("from" . "FROM")
+ ("body" . "BODY")
+ ("imap" . ""))
"Mapping from user readable keys to IMAP search items for use in nnir")
(defvar nnir-imap-search-other "HEADER %S"
@@ -335,7 +336,7 @@ result, `gnus-retrieve-headers' will be called instead."
:type '(function)
:group 'nnir)
-(defcustom nnir-imap-default-search-key "Whole message"
+(defcustom nnir-imap-default-search-key "whole message"
"*The default IMAP search key for an nnir search. Must be one of
the keys in `nnir-imap-search-arguments'. To use raw imap queries
by default set this to \"Imap\"."
@@ -1500,11 +1501,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
(setq search-func (cadr (assoc nnir-search-engine
nnir-engines)))
(if search-func
- (funcall search-func
- (if nnir-extra-parms
- (nnir-read-parms q nnir-search-engine)
- q)
- server (cadr x))
+ (funcall
+ search-func
+ (if nnir-extra-parms
+ (or (and (eq nnir-search-engine 'imap)
+ (assq 'criteria q) q)
+ (setq q (nnir-read-parms q nnir-search-engine)))
+ q)
+ server (cadr x))
nil)))
groups))))
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index b2336e13b64..8906a036779 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1215,7 +1215,8 @@ FUNC will be called with the group name to determine the article number."
;; This is the final group, which is used as a
;; catch-all.
(when (and (not group-art)
- (not nnmail-inhibit-default-split-group))
+ (or (equal "" (nth 1 method))
+ (not nnmail-inhibit-default-split-group)))
(setq group-art
(list (cons (car method)
(funcall func (car method))))))))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 09ecfb8f6b7..66a6365cb3b 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1672,7 +1672,7 @@ password contained in '~/.nntp-authinfo'."
;; Some nntp servers seem to have an extension to the XOVER
;; extension. On these servers, requesting an article range
- ;; preceeding the active range does not return an error as
+ ;; preceding the active range does not return an error as
;; specified in the RFC. What we instead get is the NOV entry
;; for the first available article. Obviously, a client can
;; use that entry to avoid making unnecessary requests. The
diff --git a/lisp/gnus/sieve.el b/lisp/gnus/sieve.el
index 31b2665a644..2111d34eac5 100644
--- a/lisp/gnus/sieve.el
+++ b/lisp/gnus/sieve.el
@@ -98,39 +98,40 @@ require \"fileinto\";
(defvar sieve-manage-buffer nil)
(defvar sieve-buffer-header-end nil)
+(defvar sieve-buffer-script-name nil
+ "The real script name of the buffer.")
+(make-local-variable 'sieve-buffer-script-name)
;; Sieve-manage mode:
-(defvar sieve-manage-mode-map nil
+(defvar sieve-manage-mode-map
+ (let ((map (make-sparse-keymap)))
+ ;; various
+ (define-key map "?" 'sieve-help)
+ (define-key map "h" 'sieve-help)
+ (define-key map "q" 'sieve-bury-buffer)
+ ;; activating
+ (define-key map "m" 'sieve-activate)
+ (define-key map "u" 'sieve-deactivate)
+ (define-key map "\M-\C-?" 'sieve-deactivate-all)
+ ;; navigation keys
+ (define-key map "\C-p" 'sieve-prev-line)
+ (define-key map [up] 'sieve-prev-line)
+ (define-key map "\C-n" 'sieve-next-line)
+ (define-key map [down] 'sieve-next-line)
+ (define-key map " " 'sieve-next-line)
+ (define-key map "n" 'sieve-next-line)
+ (define-key map "p" 'sieve-prev-line)
+ (define-key map "\C-m" 'sieve-edit-script)
+ (define-key map "f" 'sieve-edit-script)
+ (define-key map "o" 'sieve-edit-script-other-window)
+ (define-key map "r" 'sieve-remove)
+ (define-key map "q" 'sieve-manage-quit)
+ (define-key map [(down-mouse-2)] 'sieve-edit-script)
+ (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu)
+ map)
"Keymap for `sieve-manage-mode'.")
-(if sieve-manage-mode-map
- ()
- (setq sieve-manage-mode-map (make-sparse-keymap))
- (suppress-keymap sieve-manage-mode-map)
- ;; various
- (define-key sieve-manage-mode-map "?" 'sieve-help)
- (define-key sieve-manage-mode-map "h" 'sieve-help)
- (define-key sieve-manage-mode-map "q" 'sieve-bury-buffer)
- ;; activating
- (define-key sieve-manage-mode-map "m" 'sieve-activate)
- (define-key sieve-manage-mode-map "u" 'sieve-deactivate)
- (define-key sieve-manage-mode-map "\M-\C-?" 'sieve-deactivate-all)
- ;; navigation keys
- (define-key sieve-manage-mode-map "\C-p" 'sieve-prev-line)
- (define-key sieve-manage-mode-map [up] 'sieve-prev-line)
- (define-key sieve-manage-mode-map "\C-n" 'sieve-next-line)
- (define-key sieve-manage-mode-map [down] 'sieve-next-line)
- (define-key sieve-manage-mode-map " " 'sieve-next-line)
- (define-key sieve-manage-mode-map "n" 'sieve-next-line)
- (define-key sieve-manage-mode-map "p" 'sieve-prev-line)
- (define-key sieve-manage-mode-map "\C-m" 'sieve-edit-script)
- (define-key sieve-manage-mode-map "f" 'sieve-edit-script)
- (define-key sieve-manage-mode-map "o" 'sieve-edit-script-other-window)
- (define-key sieve-manage-mode-map "r" 'sieve-remove)
- (define-key sieve-manage-mode-map [(down-mouse-2)] 'sieve-edit-script)
- (define-key sieve-manage-mode-map [(down-mouse-3)] 'sieve-manage-mode-menu))
-
(easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map
"Sieve Menu."
'("Manage Sieve"
@@ -138,21 +139,21 @@ require \"fileinto\";
["Activate script" sieve-activate t]
["Deactivate script" sieve-deactivate t]))
-(define-derived-mode sieve-manage-mode fundamental-mode "SIEVE"
+(define-derived-mode sieve-manage-mode fundamental-mode "Sieve-manage"
"Mode used for sieve script management."
- (setq mode-name "SIEVE")
(buffer-disable-undo (current-buffer))
(setq truncate-lines t)
(easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map))
(put 'sieve-manage-mode 'mode-class 'special)
-;; This is necessary to allow correct handling of \\[cvs-mode-diff-map]
-;; in substitute-command-keys.
-;(fset 'sieve-manage-mode-map sieve-manage-mode-map)
-
;; Commands used in sieve-manage mode:
+(defun sieve-manage-quit ()
+ "Quit."
+ (interactive)
+ (kill-buffer (current-buffer)))
+
(defun sieve-activate (&optional pos)
(interactive "d")
(let ((name (sieve-script-at-point)) err)
@@ -204,7 +205,10 @@ require \"fileinto\";
(switch-to-buffer (get-buffer-create "template.siv"))
(insert sieve-template))
(sieve-mode)
- (message "Press C-c C-l to upload script to server.")))
+ (setq sieve-buffer-script-name name)
+ (message
+ (substitute-command-keys
+ "Press \\[sieve-upload] to upload script to server."))))
(defmacro sieve-change-region (&rest body)
"Turns off sieve-region before executing BODY, then re-enables it after.
@@ -337,13 +341,18 @@ Server : " server ":" (or port "2000") "
;; get list of script names and print them
(let ((scripts (sieve-manage-listscripts sieve-manage-buffer)))
(if (null scripts)
- (insert (format (concat "No scripts on server, press RET on %s to "
- "create a new script.\n") sieve-new-script))
- (insert (format (concat "%d script%s on server, press RET on a script "
- "name edits it, or\npress RET on %s to create "
- "a new script.\n") (length scripts)
- (if (eq (length scripts) 1) "" "s")
- sieve-new-script)))
+ (insert
+ (substitute-command-keys
+ (format
+ "No scripts on server, press \\[sieve-edit-script] on %s to create a new script.\n"
+ sieve-new-script)))
+ (insert
+ (substitute-command-keys
+ (format (concat "%d script%s on server, press \\[sieve-edit-script] on a script "
+ "name edits it, or\npress \\[sieve-edit-script] on %s to create "
+ "a new script.\n") (length scripts)
+ (if (eq (length scripts) 1) "" "s")
+ sieve-new-script))))
(save-excursion
(sieve-insert-scripts (list sieve-new-script))
(sieve-insert-scripts scripts)))
@@ -363,15 +372,15 @@ Server : " server ":" (or port "2000") "
;;;###autoload
(defun sieve-upload (&optional name)
(interactive)
- (unless name
- (setq name (buffer-name)))
(when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage))
(let ((script (buffer-string)) err)
(with-current-buffer (get-buffer sieve-buffer)
- (setq err (sieve-manage-putscript name script sieve-manage-buffer))
+ (setq err (sieve-manage-putscript
+ (or name sieve-buffer-script-name (buffer-name))
+ script sieve-manage-buffer))
(if (sieve-manage-ok-p err)
- (message (concat
- "Sieve upload done. Use `C-c RET' to manage scripts."))
+ (message (substitute-command-keys
+ "Sieve upload done. Use \\[sieve-manage] to manage scripts."))
(message "Sieve upload failed: %s" (nth 2 err)))))))
;;;###autoload
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 58df45bc33c..35f8c5e8e37 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -502,7 +502,8 @@ suitable file is found, return nil."
(let* ((advertised (gethash def advertised-signature-table t))
(arglist (if (listp advertised)
advertised (help-function-arglist def)))
- (doc (documentation function))
+ (doc (condition-case err (documentation function)
+ (error (format "No Doc! %S" err))))
(usage (help-split-fundoc doc function)))
(with-current-buffer standard-output
;; If definition is a keymap, skip arglist note.
@@ -773,15 +774,21 @@ it is displayed along with the global value."
(setq extra-line t)
(if (member (cons variable val) dir-local-variables-alist)
(let ((file (and (buffer-file-name)
- (not (file-remote-p (buffer-file-name)))
- (dir-locals-find-file (buffer-file-name)))))
+ (not (file-remote-p (buffer-file-name)))
+ (dir-locals-find-file
+ (buffer-file-name))))
+ (type "file"))
(princ " This variable is a directory local variable")
(when file
- (princ (concat "\n from the file \""
- (if (consp file)
- (car file)
- file)
- "\"")))
+ (if (consp file) ; result from cache
+ ;; If the cache element has an mtime, we
+ ;; assume it came from a file.
+ (if (nth 2 file)
+ (setq file (expand-file-name
+ dir-locals-file (car file)))
+ ;; Otherwise, assume it was set directly.
+ (setq type "directory")))
+ (princ (format "\n from the %s \"%s\"" type file)))
(princ ".\n"))
(princ " This variable is a file local variable.\n")))
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 724b0186679..51d18235e1b 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -409,13 +409,16 @@ restore it properly when going back."
(defun help-buffer ()
"Return the name of a buffer for inserting help.
If `help-xref-following' is non-nil, this is the name of the
-current buffer.
-Otherwise, it is *Help*; if no buffer with that name currently
-exists, it is created."
+current buffer. Signal an error if this buffer is not derived
+from `help-mode'.
+Otherwise, return \"*Help*\", creating a buffer with that name if
+it does not already exist."
(buffer-name ;for with-output-to-temp-buffer
- (if help-xref-following
- (current-buffer)
- (get-buffer-create "*Help*"))))
+ (if (not help-xref-following)
+ (get-buffer-create "*Help*")
+ (unless (derived-mode-p 'help-mode)
+ (error "Current buffer is not in Help mode"))
+ (current-buffer))))
(defvar help-xref-override-view-map
(let ((map (make-sparse-keymap)))
diff --git a/lisp/ido.el b/lisp/ido.el
index d1f2cea83f8..2e67e367a8f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1472,8 +1472,8 @@ Removes badly formatted data and ignored directories."
(add-hook 'choose-completion-string-functions 'ido-choose-completion-string))
(define-minor-mode ido-everywhere
- "Toggle using ido speed-ups everywhere file and directory names are read.
-With ARG, turn ido speed-up on if arg is positive, off otherwise."
+ "Toggle using ido-mode everywhere file and directory names are read.
+With ARG, turn ido-mode on if arg is positive, off otherwise."
:global t
:group 'ido
(when (get 'ido-everywhere 'file)
@@ -1494,8 +1494,8 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise."
;;;###autoload
(defun ido-mode (&optional arg)
- "Toggle ido speed-ups on or off.
-With ARG, turn ido speed-up on if arg is positive, off otherwise.
+ "Toggle ido mode on or off.
+With ARG, turn ido-mode on if arg is positive, off otherwise.
Turning on ido-mode will remap (via a minor-mode keymap) the default
keybindings for the `find-file' and `switch-to-buffer' families of
commands to the ido versions of these functions.
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 8fa6963b3d7..efe8262645d 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -384,7 +384,7 @@ Used together with `image-dired-cmd-read-exif-data-program-options'."
"%p -s -s -s -%t \"%f\""
"Format of command used to read EXIF data.
Available options are %p which is replaced by
-`image-dired-cmd-write-exif-data-options', %f which is replaced
+`image-dired-cmd-write-exif-data-program', %f which is replaced
by the image file name and %t which is replaced by the tag name."
:type 'string
:group 'image-dired)
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 7e317ea09c0..c0fcf19d841 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -337,7 +337,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
(erase-buffer)
(buffer-disable-undo)
(insert ";;; ja-dic.el --- dictionary for Japanese input method"
- " -*-coding: euc-japan; byte-compile-disable-print-circle:t; -*-\n"
+ " -*-coding: euc-japan; -*-\n"
";;\tGenerated by the command `skkdic-convert'\n"
";;\tDate: " (current-time-string) "\n"
";;\tOriginal SKK dictionary file: "
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8672fca3a85..5f4d3ea849e 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -366,7 +366,9 @@ This also sets the following values:
(coding-system-get coding-system 'ascii-compatible-p)))
(setq default-file-name-coding-system coding-system)))
(setq default-terminal-coding-system coding-system)
- (setq default-keyboard-coding-system coding-system)
+ ;; Prevent default-terminal-coding-system from converting ^M to ^J.
+ (setq default-keyboard-coding-system
+ (coding-system-change-eol-conversion coding-system 'unix))
;; Preserve eol-type from existing default-process-coding-systems.
;; On non-unix-like systems in particular, these may have been set
;; carefully by the user, or by the startup code, to deal with the
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 935d66c613b..e68dc8bdc17 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -272,8 +272,7 @@ SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy
(princ ";; Quail package `")
(princ package)
- (princ (format "' -*- coding:%s; " coding-system-for-write))
- (princ "byte-compile-disable-print-circle:t; -*-\n")
+ (princ (format "' -*- coding:%s -*-\n" coding-system-for-write))
(princ ";; Generated by the command `titdic-convert'\n;;\tDate: ")
(princ (current-time-string))
(princ "\n;;\tOriginal TIT dictionary file: ")
@@ -1154,8 +1153,8 @@ the generated Quail package is saved."
(setq coding-system-for-write
(coding-system-change-eol-conversion coding 'unix))
(with-temp-file (expand-file-name quailfile dirname)
- (insert (format ";; Quail package `%s' -*- coding:%s; " name coding))
- (insert "byte-compile-disable-print-circle:t; -*-\n")
+ (insert (format ";; Quail package `%s' -*- coding:%s -*-\n"
+ name coding))
(insert ";; Generated by the command `miscdic-convert'\n")
(insert ";; Date: " (current-time-string) "\n")
(insert ";; Source dictionary file: " dicfile "\n")
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5aadac4a3b1..e13d9673514 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -464,7 +464,8 @@ This is like `describe-bindings', but displays only Isearch keys."
(define-key map "\C-w" 'isearch-yank-word-or-char)
(define-key map "\M-\C-w" 'isearch-del-char)
(define-key map "\M-\C-y" 'isearch-yank-char)
- (define-key map "\C-y" 'isearch-yank-line)
+ (define-key map "\C-y" 'isearch-yank-kill)
+ (define-key map "\M-s\C-e" 'isearch-yank-line)
(define-key map (char-to-string help-char) isearch-help-map)
(define-key map [help] isearch-help-map)
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index ab9f3662745..b957d9f36c6 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -1,4 +1,4 @@
-;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*-
+;;; mailclient.el --- mail sending via system's mail client.
;; Copyright (C) 2005-2011 Free Software Foundation
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index 896400068cc..1277d1d4109 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -101,7 +101,7 @@ value."
(cons (cdr header) (funcall (cdr rule) (cdr header))))))))
headers)
-;; Advertized part of the interface; see mail-header, mail-header-set.
+;; Advertised part of the interface; see mail-header, mail-header-set.
(defvar headers)
(defsubst mail-header (header &optional header-alist)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 06867f6d92a..9a892f493d7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -503,7 +503,7 @@ FIELD is the plain text name of a field in the message, such as
\"subject\" or \"from\". A FIELD of \"to\" will automatically include
all text from the \"cc\" field as well.
-REGEXP is an expression to match in the preceeding specified FIELD.
+REGEXP is an expression to match in the preceding specified FIELD.
FIELD/REGEXP pairs continue in the list.
examples:
@@ -3443,6 +3443,16 @@ does not pop any summary buffer."
(setq yank-action (list 'insert-buffer replybuffer)))
(push (cons "cc" cc) other-headers)
(push (cons "in-reply-to" in-reply-to) other-headers)
+ (setq other-headers
+ (mapcar #'(lambda (elt)
+ (cons (car elt) (if (stringp (cdr elt))
+ (rfc2047-decode-string (cdr elt)))))
+ other-headers))
+ (if (stringp to) (setq to (rfc2047-decode-string to)))
+ (if (stringp in-reply-to)
+ (setq in-reply-to (rfc2047-decode-string in-reply-to)))
+ (if (stringp cc) (setq cc (rfc2047-decode-string cc)))
+ (if (stringp subject) (setq subject (rfc2047-decode-string subject)))
(prog1
(compose-mail to subject other-headers noerase
switch-function yank-action sendactions
@@ -3450,7 +3460,7 @@ does not pop any summary buffer."
(if (eq switch-function 'switch-to-buffer-other-frame)
;; This is not a standard frame parameter; nothing except
;; sendmail.el looks at it.
- (modify-frame-parameters (selected-frame)
+ (modify-frame-parameters (selected-frame)
'((mail-dedicated-frame . t)))))))
(defun rmail-mail-return ()
@@ -4306,7 +4316,7 @@ With prefix argument N moves forward N messages with these labels.
;;;***
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "04902da045706fb7f2b0915529ed161b")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "c530622b53038152ca84f2ec9313bd7a")
;;; Generated autoloads from rmailmm.el
(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 0bfeb121ca4..96132739b20 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -853,28 +853,33 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
((looking-at "[ \t]*\n")
(setq next (copy-marker (match-end 0) t)))
(t
- (rmail-mm-get-boundary-error-message
- "Malformed boundary" content-type content-disposition
- content-transfer-encoding)))
-
- (setq index (1+ index))
- ;; Handle the part.
- (if parse-tag
+ ;; The original code signalled an error as below, but
+ ;; this line may be a boundary of nested multipart. So,
+ ;; we just set `next' to nil to skip this line
+ ;; (rmail-mm-get-boundary-error-message
+ ;; "Malformed boundary" content-type content-disposition
+ ;; content-transfer-encoding)
+ (setq next nil)))
+
+ (when next
+ (setq index (1+ index))
+ ;; Handle the part.
+ (if parse-tag
+ (save-restriction
+ (narrow-to-region beg end)
+ (let ((child (rmail-mime-process
+ nil (format "%s/%d" parse-tag index)
+ content-type content-disposition)))
+ ;; Display a tagline.
+ (aset (aref (rmail-mime-entity-display child) 1) 1
+ (aset (rmail-mime-entity-tagline child) 2 t))
+ (push child entities)))
+
+ (delete-region end next)
(save-restriction
(narrow-to-region beg end)
- (let ((child (rmail-mime-process
- nil (format "%s/%d" parse-tag index)
- content-type content-disposition)))
- ;; Display a tagline.
- (aset (aref (rmail-mime-entity-display child) 1) 1
- (aset (rmail-mime-entity-tagline child) 2 t))
- (push child entities)))
-
- (delete-region end next)
- (save-restriction
- (narrow-to-region beg end)
- (rmail-mime-show)))
- (goto-char (setq beg next)))
+ (rmail-mime-show)))
+ (goto-char (setq beg next))))
(when parse-tag
(setq entities (nreverse entities))
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 77ae87b5449..0548f24b1dd 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -309,7 +309,6 @@ The default value matches citations like `foo-bar>' plus whitespace."
(define-key map [remap split-line] 'mail-split-line)
(define-key map "\C-c\C-q" 'mail-fill-yanked-message)
(define-key map "\C-c\C-w" 'mail-signature)
- (define-key map "\C-c\C-v" 'mail-sent-via)
(define-key map "\C-c\C-c" 'mail-send-and-exit)
(define-key map "\C-c\C-s" 'mail-send)
(define-key map "\C-c\C-i" 'mail-attach-file)
@@ -349,9 +348,6 @@ The default value matches citations like `foo-bar>' plus whitespace."
(define-key map [menu-bar headers expand-aliases]
'("Expand Aliases" . expand-mail-aliases))
- (define-key map [menu-bar headers sent-via]
- '("Sent-Via" . mail-sent-via))
-
(define-key map [menu-bar headers mail-reply-to]
'("Mail-Reply-To" . mail-mail-reply-to))
@@ -665,7 +661,6 @@ Here are commands that move to a header field (and create it if there isn't):
\\[mail-signature] mail-signature (insert `mail-signature-file' file).
\\[mail-yank-original] mail-yank-original (insert current message, in Rmail).
\\[mail-fill-yanked-message] mail-fill-yanked-message (fill what was yanked).
-\\[mail-sent-via] mail-sent-via (add a sent-via field for each To or CC).
Turning on Mail mode runs the normal hooks `text-mode-hook' and
`mail-mode-hook' (in that order)."
(make-local-variable 'mail-reply-action)
@@ -1346,6 +1341,9 @@ just append to the file, in Babyl format if necessary."
(point)))))
;; Insert a copy, with altered header field name.
(insert-before-markers "Sent-via:" to-line))))))
+
+(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1")
+
(defun mail-to ()
"Move point to end of To field, creating it if necessary."
diff --git a/lisp/man.el b/lisp/man.el
index 0b3ac537c5b..c8c2f8653e2 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -623,36 +623,32 @@ and the `Man-section-translations-alist' variables)."
(concat Man-specified-section-option section " " name))))
(defun Man-support-local-filenames ()
- "Check the availability of `-l' option of the man command.
-This option allows `man' to interpret command line arguments
-as local filenames.
-Return the value of the variable `Man-support-local-filenames'
-if it was set to nil or t before the call of this function.
-If t, the man command supports `-l' option. If nil, it doesn't.
-Otherwise, if the value of `Man-support-local-filenames'
-is neither t nor nil, then determine a new value, set it
-to the variable `Man-support-local-filenames' and return
-a new value."
- (if (or (not Man-support-local-filenames)
- (eq Man-support-local-filenames t))
- Man-support-local-filenames
- (setq Man-support-local-filenames
- (with-temp-buffer
- (and (equal (condition-case nil
- (let ((default-directory
- ;; Assure that `default-directory' exists
- ;; and is readable.
- (if (and (file-directory-p default-directory)
- (file-readable-p default-directory))
- default-directory
- (expand-file-name "~/"))))
- (call-process manual-program nil t nil "--help"))
- (error nil))
- 0)
- (progn
- (goto-char (point-min))
- (search-forward "--local-file" nil t))
- t)))))
+ "Return non-nil if the man command supports local filenames.
+Different man programs support this feature in different ways.
+The default Debian man program (\"man-db\") has a `--local-file'
+\(or `-l') option for this purpose. The default Red Hat man
+program has no such option, but interprets any name containing
+a \"/\" as a local filename. The function returns either `man-db'
+`man', or nil."
+ (if (eq Man-support-local-filenames 'auto-detect)
+ (setq Man-support-local-filenames
+ (with-temp-buffer
+ (let ((default-directory
+ ;; Ensure that `default-directory' exists and is readable.
+ (if (and (file-directory-p default-directory)
+ (file-readable-p default-directory))
+ default-directory
+ (expand-file-name "~/"))))
+ (ignore-errors
+ (call-process manual-program nil t nil "--help")))
+ (cond ((search-backward "--local-file" nil 'move)
+ 'man-db)
+ ;; This feature seems to be present in at least ver 1.4f,
+ ;; which is about 20 years old.
+ ;; I don't know if this version has an official name?
+ ((looking-at "^man, versione? [1-9]")
+ 'man))))
+ Man-support-local-filenames))
;; ======================================================================
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index f3d1682127e..4b904ed2b7a 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * mh-funcs.el (mh-store-msg, mh-store-buffer):
+ * mh-mime.el (mh-mime-save-parts): Use read-directory-name.
+
2011-01-13 Chong Yidong <cyd@stupidchicken.com>
* mh-comp.el (mh-user-agent-compose): New arg RETURN-ACTION.
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index ad508416501..c3f301e649d 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -286,7 +286,7 @@ to \"Directory\", and then enter the name of the directory for
storing the content of these messages."
(interactive (list (let ((udir (or mh-store-default-directory
default-directory)))
- (read-file-name "Store message in directory: "
+ (read-directory-name "Store message in directory: "
udir udir nil))))
(let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t))))
(with-current-buffer (get-buffer-create mh-temp-buffer)
@@ -300,7 +300,7 @@ storing the content of these messages."
See `mh-store-msg' for a description of DIRECTORY."
(interactive (list (let ((udir (or mh-store-default-directory
default-directory)))
- (read-file-name "Store buffer in directory: "
+ (read-directory-name "Store buffer in directory: "
udir udir nil))))
(let ((store-directory (expand-file-name directory))
(sh-start (save-excursion
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index de0f49e41db..ba994e73a91 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -390,11 +390,11 @@ do the work."
(equal nil mh-mime-save-parts-default-directory)
(equal t mh-mime-save-parts-default-directory))
(not mh-mime-save-parts-directory))
- (read-file-name "Store in directory: " nil nil t nil))
+ (read-directory-name "Store in directory: " nil nil t))
((and (or prompt
(equal t mh-mime-save-parts-default-directory))
mh-mime-save-parts-directory)
- (read-file-name (format
+ (read-directory-name (format
"Store in directory (default %s): "
mh-mime-save-parts-directory)
"" mh-mime-save-parts-directory t ""))
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index f0d36451b5c..8c9ead479e8 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4071,7 +4071,7 @@ directory, so that Emacs will know its current contents."
(ange-ftp-get-files dir t))))
(defun ange-ftp-make-directory (dir &optional parents)
- (interactive (list (expand-file-name (read-file-name "Make directory: "))))
+ (interactive (list (expand-file-name (read-directory-name "Make directory: "))))
(if parents
(let ((parent (file-name-directory (directory-file-name dir))))
(or (file-exists-p parent)
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 660eb3b968e..24dbfc0c30a 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -798,7 +798,12 @@ first, if that exists."
(let ((process-environment (copy-sequence process-environment))
(function (or (and (string-match "\\`mailto:" url)
browse-url-mailto-function)
- browse-url-browser-function)))
+ browse-url-browser-function))
+ ;; Ensure that `default-directory' exists and is readable (b#6077).
+ (default-directory (if (and (file-directory-p default-directory)
+ (file-readable-p default-directory))
+ default-directory
+ (expand-file-name "~/"))))
;; When connected to various displays, be careful to use the display of
;; the currently selected frame, rather than the original start display,
;; which may not even exist any more.
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1d419dbfa18..1e3ee91092d 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -204,12 +204,14 @@ The ARGUMENTS for each METHOD symbol are:
`nickserv': NICK PASSWORD [NICKSERV-NICK]
`chanserv': NICK CHANNEL PASSWORD
`bitlbee': NICK PASSWORD
+ `quakenet': ACCOUNT PASSWORD
Examples:
((\"freenode\" nickserv \"bob\" \"p455w0rd\")
(\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\")
(\"bitlbee\" bitlbee \"robert\" \"sekrit\")
- (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\"))"
+ (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\")
+ (\"quakenet.org\" quakenet \"bobby\" \"sekrit\"))"
:type '(alist :key-type (string :tag "Server")
:value-type (choice (list :tag "NickServ"
(const nickserv)
@@ -223,7 +225,11 @@ Examples:
(list :tag "BitlBee"
(const bitlbee)
(string :tag "Nick")
- (string :tag "Password"))))
+ (string :tag "Password"))
+ (list :tag "QuakeNet"
+ (const quakenet)
+ (string :tag "Account")
+ (string :tag "Password"))))
:group 'rcirc)
(defcustom rcirc-auto-authenticate-flag t
@@ -232,6 +238,13 @@ See also `rcirc-authinfo'."
:type 'boolean
:group 'rcirc)
+(defcustom rcirc-authenticate-before-join t
+ "*Non-nil means authenticate to services before joining channels.
+Currently only works with NickServ on some networks."
+ :version "24.1"
+ :type 'boolean
+ :group 'rcirc)
+
(defcustom rcirc-prompt "> "
"Prompt string to use in IRC buffers.
@@ -282,6 +295,9 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
:type 'hook
:group 'rcirc)
+(defvar rcirc-authenticated-hook nil
+ "Hook run after successfully authenticated.")
+
(defcustom rcirc-always-use-server-buffer-flag nil
"Non-nil means messages without a channel target will go to the server buffer."
:type 'boolean
@@ -524,6 +540,8 @@ If ARG is non-nil, instead prompt for connection parameters."
(setq rcirc-timeout-timer nil)
(make-local-variable 'rcirc-user-disconnect)
(setq rcirc-user-disconnect nil)
+ (make-local-variable 'rcirc-user-authenticated)
+ (setq rcirc-user-authenticated nil)
(make-local-variable 'rcirc-connecting)
(setq rcirc-connecting t)
@@ -2104,7 +2122,8 @@ CHANNELS is a comma- or space-separated string of channel names."
(let* ((split-channels (split-string channels "[ ,]" t))
(buffers (mapcar (lambda (ch)
(rcirc-get-buffer-create process ch))
- split-channels)))
+ split-channels))
+ (channels (mapconcat 'identity split-channels ",")))
(rcirc-send-string process (concat "JOIN " channels))
(when (not (eq (selected-window) (minibuffer-window)))
(dolist (b buffers) ;; order the new channel buffers in the buffer list
@@ -2427,10 +2446,23 @@ keywords when no KEYWORD is given."
(setq rcirc-server-name sender)
(setq rcirc-nick (car args))
(rcirc-update-prompt)
- (when rcirc-auto-authenticate-flag (rcirc-authenticate))
+ (if rcirc-auto-authenticate-flag
+ (if rcirc-authenticate-before-join
+ (progn
+ (with-rcirc-process-buffer process
+ (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t))
+ (rcirc-authenticate))
+ (rcirc-authenticate)
+ (rcirc-join-channels process rcirc-startup-channels))
+ (rcirc-join-channels process rcirc-startup-channels))))
+
+(defun rcirc-join-channels-post-auth (process)
+ "Join `rcirc-startup-channels' after authenticating."
+ (with-rcirc-process-buffer process
(rcirc-join-channels process rcirc-startup-channels)))
(defun rcirc-handler-PRIVMSG (process sender args text)
+ (rcirc-check-auth-status process sender args text)
(let ((target (if (rcirc-channel-p (car args))
(car args)
sender))
@@ -2443,6 +2475,7 @@ keywords when no KEYWORD is given."
(rcirc-put-nick-channel process sender target rcirc-current-line))))
(defun rcirc-handler-NOTICE (process sender args text)
+ (rcirc-check-auth-status process sender args text)
(let ((target (car args))
(message (cadr args)))
(if (string-match "^\C-a\\(.*\\)\C-a$" message)
@@ -2460,6 +2493,33 @@ keywords when no KEYWORD is given."
sender)))
message t))))
+(defun rcirc-check-auth-status (process sender args text)
+ "Check if the user just authenticated.
+If authenticated, runs `rcirc-authenticated-hook' with PROCESS as
+the only argument."
+ (with-rcirc-process-buffer process
+ (when (and (not rcirc-user-authenticated)
+ rcirc-authenticate-before-join
+ rcirc-auto-authenticate-flag)
+ (let ((target (car args))
+ (message (cadr args)))
+ (when (or
+ (and ;; nickserv
+ (string= sender "NickServ")
+ (string= target rcirc-nick)
+ (member message
+ (list
+ (format "You are now identified for \C-b%s\C-b." rcirc-nick)
+ "Password accepted - you are now recognized."
+ )))
+ (and ;; quakenet
+ (string= sender "Q")
+ (string= target rcirc-nick)
+ (string-match message "\\`You are now logged in as .+\\.\\'")))
+ (setq rcirc-user-authenticated t)
+ (run-hook-with-args 'rcirc-authenticated-hook process)
+ (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
+
(defun rcirc-handler-WALLOPS (process sender args text)
(rcirc-print process sender "WALLOPS" sender (car args) t))
@@ -2704,26 +2764,33 @@ Passwords are stored in `rcirc-authinfo' (which see)."
(nick (caddr i))
(method (cadr i))
(args (cdddr i)))
- (when (and (string-match server rcirc-server)
- (string-match nick rcirc-nick))
- (cond ((equal method 'nickserv)
- (rcirc-send-privmsg
- process
+ (when (and (string-match server rcirc-server))
+ (if (and (memq method '(nickserv chanserv bitlbee))
+ (string-match nick rcirc-nick))
+ ;; the following methods rely on the user's nickname.
+ (case method
+ (nickserv
+ (rcirc-send-privmsg
+ process
(or (cadr args) "NickServ")
- (concat "identify " (car args))))
- ((equal method 'chanserv)
- (rcirc-send-privmsg
- process
+ (concat "IDENTIFY " (car args))))
+ (chanserv
+ (rcirc-send-privmsg
+ process
"ChanServ"
- (format "identify %s %s" (car args) (cadr args))))
- ((equal method 'bitlbee)
- (rcirc-send-privmsg
- process
+ (format "IDENTIFY %s %s" (car args) (cadr args))))
+ (bitlbee
+ (rcirc-send-privmsg
+ process
"&bitlbee"
- (concat "identify " (car args))))
- (t
- (message "No %S authentication method defined"
- method))))))))
+ (concat "IDENTIFY " (car args)))))
+ ;; quakenet authentication doesn't rely on the user's nickname.
+ ;; the variable `nick' here represents the Q account name.
+ (when (eq method 'quakenet)
+ (rcirc-send-privmsg
+ process
+ "Q@CServe.quakenet.org"
+ (format "AUTH %s %s" nick (car args))))))))))
(defun rcirc-handler-INVITE (process sender args text)
(rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index b4307223ba8..b5453733d1d 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -2,9 +2,10 @@
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
-;; Author: Alexandru Harsanyi (AlexHarsanyi@gmail.com)
+;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
;; Created: December, 2009
;; Keywords: soap, web-services, comm, hypermedia
+;; Package: soap-client
;; Homepage: http://code.google.com/p/emacs-soap-client
;; This file is part of GNU Emacs.
@@ -323,13 +324,18 @@ added to the namespace."
;; if name is nil, use TARGET as a name...
(cond ((soap-element-p target)
(setq name (soap-element-name target)))
+ ((consp target) ; a fq name: (namespace . name)
+ (setq name (cdr target)))
((stringp target)
(cond ((string-match "^\\(.*\\):\\(.*\\)$" target)
(setq name (match-string 2 target)))
(t
(setq name target))))))
- (assert name) ; by now, name should be valid
+ ;; by now, name should be valid
+ (assert (and name (not (equal name "")))
+ nil
+ "Cannot determine name for namespace link")
(push (make-soap-namespace-link :name name :target target)
(gethash name (soap-namespace-elements ns))))
@@ -890,7 +896,11 @@ Return a SOAP-NAMESPACE containing the elements."
(when (consp c) ; skip string nodes, which are whitespace
(let ((node-name (soap-l2wk (xml-node-name c))))
(cond
- ((eq node-name 'xsd:sequence)
+ ;; The difference between xsd:all and xsd:sequence is that fields
+ ;; in xsd:all are not ordered and they can occur only once. We
+ ;; don't care about that difference in soap-client.el
+ ((or (eq node-name 'xsd:sequence)
+ (eq node-name 'xsd:all))
(setq type (soap-parse-complex-type-sequence c)))
((eq node-name 'xsd:complexContent)
(setq type (soap-parse-complex-type-complex-content c)))
@@ -909,9 +919,10 @@ NODE is assumed to be an xsd:sequence node. In that case, each
of its children is assumed to be a sequence element. Each
sequence element is parsed constructing the corresponding type.
A list of these types is returned."
- (assert (eq (soap-l2wk (xml-node-name node)) 'xsd:sequence)
+ (assert (let ((n (soap-l2wk (xml-node-name node))))
+ (memq n '(xsd:sequence xsd:all)))
nil
- "soap-parse-sequence: expecting xsd:sequence node, got %s"
+ "soap-parse-sequence: expecting xsd:sequence or xsd:all node, got %s"
(soap-l2wk (xml-node-name node)))
(let (elements)
(dolist (e (soap-xml-get-children1 node 'xsd:element))
diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el
index 7cce9844d76..8f67d02dc6f 100644
--- a/lisp/net/soap-inspect.el
+++ b/lisp/net/soap-inspect.el
@@ -2,9 +2,10 @@
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
-;; Author: Alexandru Harsanyi (AlexHarsanyi@gmail.com)
+;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
;; Created: October 2010
;; Keywords: soap, web-services, comm, hypermedia
+;; Package: soap-client
;; Homepage: http://code.google.com/p/emacs-soap-client
;; This file is part of GNU Emacs.
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index a98e523a68b..f8bc594e959 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -353,7 +353,8 @@ KEY identifies the connection, it is either a process or a vector."
(write-region
(point-min) (point-max) tramp-persistency-file-name))))))
-(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties))
(add-hook 'tramp-cache-unload-hook
'(lambda ()
(remove-hook 'kill-emacs-hook
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 7d266ad17d7..58f1e2c6a9e 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -281,6 +281,12 @@ buffer in your bug report.
(insert ")\n"))
(insert-buffer-substring elbuf)))
+ ;; Dump load-path shadows.
+ (insert "\nload-path shadows:\n==================\n")
+ (ignore-errors
+ (mapc (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
+ (split-string (list-load-path-shadows t) "\n")))
+
;; Append buffers only when we are in message mode.
(when (and
(eq major-mode 'message-mode)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 57cc54935dc..b3278dc312d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -142,7 +142,7 @@
(add-to-list 'tramp-methods (cons elt nil)))))
(defconst tramp-gvfs-path-tramp (concat dbus-path-emacs "/Tramp")
- "The preceeding object path for own objects.")
+ "The preceding object path for own objects.")
(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon"
"The well known name of the GVFS daemon.")
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 68d06ef34bc..a59e7871458 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -840,7 +840,8 @@ See `fast-lock-get-face-properties'."
(add-hook 'after-save-hook 'fast-lock-save-cache-after-save-file)
(add-hook 'kill-buffer-hook 'fast-lock-save-cache-before-kill-buffer)
-(add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs))
;;;###autoload
(when (fboundp 'add-minor-mode)
diff --git a/lisp/obsolete/sym-comp.el b/lisp/obsolete/sym-comp.el
index 6365a1075e0..7e9a460ea14 100644
--- a/lisp/obsolete/sym-comp.el
+++ b/lisp/obsolete/sym-comp.el
@@ -51,7 +51,7 @@ Uses `current-word' with the buffer narrowed to the part before
point."
(save-restriction
;; Narrow in case point is in the middle of a symbol -- we want
- ;; just the preceeding part.
+ ;; just the preceding part.
(narrow-to-region (point-min) (point))
(current-word)))
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 5f0908e11c6..e75821b6860 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,16 @@
+2011-03-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * org.el (org-blank-before-new-entry, org-context-in-file-links)
+ (org-refile-targets, org-log-repeat, org-insert-link)
+ (org-speed-command-default-hook, org-speed-command-hook)
+ (org-in-regexps-block-p, org-yank-generic, org-goto-first-child):
+ Fix typos in docstrings.
+ (org-toggle-pretty-entities): Fix typo in message.
+
+2011-03-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * org-id.el: Don't set `kill-emacs-hook' on noninteractive sessions.
+
2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
* org-remember.el (org-remember-mode-map):
@@ -48,7 +61,7 @@
2010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-inlinetask.el (org-inlinetask-export-templates): Add
- Sébastien Vauban's suggestion for LaTeX export in docstring. This is
+ Sébastien Vauban's suggestion for LaTeX export in docstring. This is
not default as it requires an additional LaTeX package: "todonotes".
2010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -102,7 +115,7 @@
* org.el (org-make-heading-search-string): Optionally limit number
of lines stored in file link search strings.
- (org-context-in-file-links) Add option to set to integer specifying
+ (org-context-in-file-links): Add option to set to integer specifying
number of lines.
2010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -279,7 +292,7 @@
2010-12-11 Julien Danjou <julien@danjou.info>
* org-agenda.el (org-format-agenda-item): Convert category to a string
- if it is a symbol. This fixes the following call to
+ if it is a symbol. This fixes the following call to
org-agenda-get-category-icon which fails if category is not a string.
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -305,7 +318,7 @@
* ob-python.el (org-babel-execute:python): Use a :return header
argument for external evaluation in which the code block body need
- be wrapped in a function
+ to be wrapped in a function.
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -314,7 +327,7 @@
2010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
- * org.el (org-edit-special): Edit formulas when in TBLMF line
+ * org.el (org-edit-special): Edit formulas when in TBLMF line.
2010-12-11 Allen S. Rout <asr@ufl.edu> (tiny change)
@@ -394,7 +407,7 @@
* org-macs.el (org-called-interactively-p): Wrap function call in
with-no-warnings.
- (with-silent-modifications) Declare macro for Emacs < 23.2.
+ (with-silent-modifications): Declare macro for Emacs < 23.2.
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -430,7 +443,7 @@
2010-12-11 Achim Gratz <Stromeko@Stromeko.DE> (tiny change)
* org-clock.el (org-get-clocktable): Previous patch incorrectly
- required whitespace in front of #+BEGIN: and #+END:
+ required whitespace in front of #+BEGIN: and #+END:.
2010-12-11 Dan Davison <dandavison7@gmail.com>
@@ -467,7 +480,7 @@
2010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org.el (org-indent-line-function): Drawers and blocks have no
- influence on indentation of text below. Also fix indentation
+ influence on indentation of text below. Also fix indentation
problem with a block at column 0 and add a special case for
literal examples.
@@ -480,7 +493,7 @@
* ob-ref.el (org-babel-ref-resolve): Recognize `list' as a unique
type of data
- (org-babel-ref-at-ref-p): Recognize `list' as a unique type of data
+ (org-babel-ref-at-ref-p): Recognize `list' as a unique type of data.
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -510,7 +523,7 @@
* org-clock.el (org-get-clocktable):
(org-in-clocktable-p):
(org-clocktable-shift):
- (org-clocktable-steps): Fix regexp to allow for indented clock tables
+ (org-clocktable-steps): Fix regexp to allow for indented clock tables.
2010-12-11 Puneeth Chaganti <punchagan@gmail.com>
@@ -525,7 +538,7 @@
(org-export-latex-href-format): Rename the existing variable
`org-export-latex-hyperref-format' as `org-export-latex-href-format'
(org-export-latex-links): Use `org-export-latex-hyperref-format' and
- `org-export-latex-href-format'
+ `org-export-latex-href-format'.
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -535,7 +548,7 @@
2010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-exp.el (org-export-preprocess-string): delaying code block
- processing a bit to allow correct list parsing in the export string
+ processing a bit to allow correct list parsing in the export string.
2010-12-11 Christopher Allan Webber <cwebber@dustycloud.org>
@@ -575,7 +588,7 @@
* org-exp.el (org-export-format-source-code-or-example):
Remove hard-wired configuration of minted export
- (org-export-latex-minted-with-line-numbers): Remove variable
+ (org-export-latex-minted-with-line-numbers): Remove variable.
2010-12-11 Bastien Guerry <bzg@altern.org>
@@ -592,7 +605,7 @@
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
* ob-lob.el (org-babel-lob-get-info): including pass-through
- header arguments in results variable header argument string
+ header arguments in results variable header argument string.
2010-12-11 David Maus <dmaus@ictsoc.de>
@@ -640,11 +653,11 @@
2010-12-11 Eric Schulte <schulte.eric@gmail.com>
* ob-calc.el (org-babel-execute:calc): support for variables --
- converts :var variables in calc variables
+ converts :var variables in calc variables.
2010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
- * org.el (org-sparse-tree): Mention [r] in dispatch menu
+ * org.el (org-sparse-tree): Mention [r] in dispatch menu.
2010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -743,10 +756,10 @@
* org-exp.el (org-export-format-source-code-or-example):
Use minted for latex source code export if `org-export-latex-listings'
- has the value 'minted
+ has the value 'minted.
* org-latex.el (org-export-latex-listings): Document special value
- 'minted
+ 'minted.
* org-latex.el (org-export-latex-minted): Delete variable.
@@ -786,10 +799,10 @@
2010-11-11 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>
* org-agenda.el (org-agenda-get-sexps): Handle lists as return
- values from diary entries
+ values from diary entries.
* org-bbdb.el (org-bbdb-anniversaries): Handle lists of
- anniversaries
+ anniversaries.
* org.el (org-diary-sexp-entry): Handle lists as return values
from diary entries.
@@ -1034,90 +1047,90 @@
* ob-C.el (org-babel-C-execute): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-R.el (org-babel-execute:R): Remove call to
org-babel-process-params which should no longer be called from
within a language file
(org-babel-R-variable-assignments): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-asymptote.el (org-babel-execute:asymptote): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-clojure.el (org-babel-execute:clojure): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-dot.el (org-babel-execute:dot): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Remove
call to org-babel-process-params which should no longer be called
from within a language file
(org-babel-execute:emacs-lisp): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-haskell.el (org-babel-execute:haskell): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-js.el (org-babel-execute:js): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-lisp.el (org-babel-execute:lisp): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-ocaml.el (org-babel-execute:ocaml): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-octave.el (org-babel-execute:octave): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-perl.el (org-babel-execute:perl): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-python.el (org-babel-execute:python): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-ruby.el (org-babel-execute:ruby): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-scheme.el (org-babel-execute:scheme): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-screen.el (org-babel-execute:screen): Remove call to
org-babel-process-params which should no longer be called from
within a language file
(org-babel-prep-session:screen): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-sh.el (org-babel-execute:sh): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-sql.el (org-babel-execute:sql): Remove call to
org-babel-process-params which should no longer be called from
- within a language file
+ within a language file.
* ob-haskell.el (org-babel-execute:haskell): Remove reference to
- processed params
+ processed params.
* ob-clojure.el (org-babel-execute:clojure): Remove reference to
- processed params
+ processed params.
* ob-R.el (org-babel-execute:R): Remove reference to processed
params.
@@ -1308,162 +1321,45 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
- * ob-C.el (org-babel-expand-body:c++): Remove obsoleted optional
- third argument
- (org-babel-expand-body:c++): Remove obsoleted optional third
- argument
- (org-babel-C-expand): Remove obsoleted optional third argument
-
- * ob-R.el:
- (org-babel-expand-body:R): Remove obsoleted optional third
- argument
- (org-babel-execute:R): Remove obsoleted optional third argument
- (org-babel-R-variable-assignments): Remove obsoleted optional
- third argument
-
- * ob-asymptote.el:
- (org-babel-expand-body:asymptote): Remove obsoleted optional
- third argument
- (org-babel-execute:asymptote): Remove obsoleted optional third
- argument
-
- * ob-clojure.el:
- (org-babel-expand-body:clojure): Remove obsoleted optional third
- argument
- (org-babel-execute:clojure): Remove obsoleted optional third
- argument
-
- * ob-css.el:
- (org-babel-expand-body:css): Remove obsoleted optional third
- argument
-
- * ob-ditaa.el:
- (org-babel-expand-body:ditaa): Remove obsoleted optional third
- argument
-
- * ob-dot.el:
- (org-babel-expand-body:dot): Remove obsoleted optional third
- argument
- (org-babel-execute:dot): Remove obsoleted optional third
- argument
-
- * ob-emacs-lisp.el:
- (org-babel-expand-body:emacs-lisp): Remove obsoleted optional
- third argument
- (org-babel-execute:emacs-lisp): Remove obsoleted optional third
- argument
-
- * ob-gnuplot.el:
- (org-babel-expand-body:gnuplot): Remove obsoleted optional third
- argument
-
- * ob-haskell.el:
- (org-babel-expand-body:haskell): Remove obsoleted optional third
- argument
- (org-babel-execute:haskell): Remove obsoleted optional third
- argument
- (org-babel-load-session:haskell): Remove obsoleted optional
- third
- (org-babel-prep-session:haskell): Remove obsoleted optional
- third
-
- * ob-js.el:
- (org-babel-expand-body:js): Remove obsoleted optional third
- argument
- (org-babel-execute:js): Remove obsoleted optional third argument
-
- * ob-latex.el:
- (org-babel-expand-body:latex): Remove obsoleted optional third
- argument
-
- * ob-lisp.el:
- (org-babel-expand-body:lisp): Remove obsoleted optional third
- argument
- (org-babel-execute:lisp): Remove obsoleted optional third
- argument
-
- * ob-mscgen.el:
- (org-babel-expand-body:mscgen): Remove obsoleted optional third
- argument
-
- * ob-ocaml.el:
- (org-babel-expand-body:ocaml): Remove obsoleted optional third
- argument
- (org-babel-execute:ocaml): Remove obsoleted optional third
- argument
-
- * ob-octave.el:
- (org-babel-expand-body:matlab): Remove obsoleted optional third
- argument
- (org-babel-expand-body:octave): Remove obsoleted optional third
- argument
- (org-babel-execute:octave): Remove obsoleted optional third
- argument
- (org-babel-octave-variable-assignments): Remove obsoleted
- optional third
-
- * ob-org.el:
- (org-babel-expand-body:org): Remove obsoleted optional third
- argument
-
- * ob-perl.el:
- (org-babel-expand-body:perl): Remove obsoleted optional third
- argument
- (org-babel-execute:perl): Remove obsoleted optional third
- argument
-
- * ob-plantuml.el:
- (org-babel-expand-body:plantuml): Remove obsoleted optional
- third argument
-
- * ob-python.el:
- (org-babel-expand-body:python): Remove obsoleted optional third
- argument
- (org-babel-execute:python): Remove obsoleted optional third
- argument
- (org-babel-python-variable-assignments): Remove obsoleted
- optional third
-
- * ob-ruby.el:
- (org-babel-expand-body:ruby): Remove obsoleted optional third
- argument
- (org-babel-execute:ruby): Remove obsoleted optional third
- argument
-
- * ob-sass.el:
- (org-babel-expand-body:sass): Remove obsoleted optional third
- argument
-
- * ob-scheme.el:
- (org-babel-expand-body:scheme): Remove obsoleted optional third
- argument
- (org-babel-execute:scheme): Remove obsoleted optional third
- argument
-
- * ob-screen.el:
- (org-babel-expand-body:screen): Remove obsoleted optional third
- argument
-
- * ob-sh.el:
- (org-babel-expand-body:sh): Remove obsoleted optional third
- argument
- (org-babel-execute:sh): Remove obsoleted optional third argument
- (org-babel-sh-variable-assignments): Remove obsoleted optional
- third
-
- * ob-sql.el:
- (org-babel-expand-body:sql): Remove obsoleted optional third
- argument
-
- * ob-sqlite.el:
- (org-babel-expand-body:sqlite): Remove obsoleted optional third
- argument
- (org-babel-execute:sqlite): Remove obsoleted optional third
- argument
-
- * ob.el:
- (org-babel-expand-body:generic): Remove obsoleted optional third
- argument.
+ * ob-C.el (org-babel-expand-body:c++, org-babel-C-expand):
+ * ob-R.el (org-babel-expand-body:R, org-babel-execute:R)
+ (org-babel-R-variable-assignments):
+ * ob-asymptote.el (org-babel-expand-body:asymptote)
+ (org-babel-execute:asymptote):
+ * ob-clojure.el (org-babel-expand-body:clojure)
+ (org-babel-execute:clojure):
+ * ob-css.el (org-babel-expand-body:css):
+ * ob-ditaa.el (org-babel-expand-body:ditaa):
+ * ob-dot.el (org-babel-expand-body:dot, org-babel-execute:dot):
+ * ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp)
+ (org-babel-execute:emacs-lisp):
+ * ob-gnuplot.el (org-babel-expand-body:gnuplot)
+ * ob-haskell.el (org-babel-expand-body:haskell)
+ (org-babel-execute:haskell, org-babel-load-session:haskell)
+ (org-babel-prep-session:haskell):
+ * ob-js.el (org-babel-expand-body:js, org-babel-execute:js):
+ * ob-latex.el (org-babel-expand-body:latex):
+ * ob-lisp.el (org-babel-expand-body:lisp, org-babel-execute:lisp):
+ * ob-mscgen.el (org-babel-expand-body:mscgen):
+ * ob-ocaml.el (org-babel-expand-body:ocaml, org-babel-execute:ocaml):
+ * ob-octave.el (org-babel-expand-body:matlab)
+ (org-babel-expand-body:octave, org-babel-execute:octave)
+ (org-babel-octave-variable-assignments):
+ * ob-org.el (org-babel-expand-body:org):
+ * ob-perl.el (org-babel-expand-body:perl, org-babel-execute:perl):
+ * ob-plantuml.el (org-babel-expand-body:plantuml):
+ * ob-python.el (org-babel-expand-body:python, org-babel-execute:python)
+ (org-babel-python-variable-assignments):
+ * ob-ruby.el (org-babel-expand-body:ruby, org-babel-execute:ruby):
+ * ob-sass.el (org-babel-expand-body:sass):
+ * ob-scheme.el (org-babel-expand-body:scheme, org-babel-execute:scheme):
+ * ob-screen.el (org-babel-expand-body:screen):
+ * ob-sh.el (org-babel-expand-body:sh, org-babel-execute:sh)
+ (org-babel-sh-variable-assignments):
+ * ob-sql.el (org-babel-expand-body:sql):
+ * ob-sqlite.el (org-babel-expand-body:sqlite, org-babel-execute:sqlite):
+ * ob.el (org-babel-expand-body:generic):
+ Remove obsoleted optional third argument.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
@@ -1493,7 +1389,7 @@
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
* ob-sh.el (org-babel-sh-variable-assignments): Provide missing
- docstring
+ docstring.
* ob-python.el (org-babel-python-variable-assignments):
Provide missing docstring.
@@ -1589,7 +1485,7 @@
2010-11-11 Noorul Islam <noorul@noorul.com>
- * org-latex.el (org-export-latex-links) : Replaced hard coded
+ * org-latex.el (org-export-latex-links): Replaced hard coded
hyperref format with custom variable
`org-export-latex-hyperref-format'.
@@ -1643,7 +1539,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
- * ob.el (org-babel-params-from-properties): Max line with at <=80
+ * ob.el (org-babel-params-from-properties): Max line with at <=80.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
@@ -2023,11 +1919,11 @@
2010-11-11 Jambunathan K <kjambunathan@gmail.com> (tiny change)
- * org.el (org-speed-command-hook): New. Hook for installing
- additional speed commands. Use this for enabling speed commands on
+ * org.el (org-speed-command-hook): New. Hook for installing
+ additional speed commands. Use this for enabling speed commands on
src blocks.
(org-speed-command-default-hook): The default hook for
- org-speed-command-hook. Factored out from org-self-insert-command
+ org-speed-command-hook. Factored out from org-self-insert-command
and mimics existing behaviour.
(org-self-insert-command): Modified to use org-speed-command-hook.
@@ -2091,7 +1987,7 @@
2010-11-11 Bastien Guerry <bzg@altern.org>
* org-capture.el (org-capture-templates): Update docstring to
- advertize %:org-date.
+ advertise %:org-date.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
@@ -2168,7 +2064,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* ob.el (org-babel-demarcate-block): Interactive demarcation of
- code blocks
+ code blocks.
* ob-keys.el (org-babel-key-bindings): Key bindings for block
demarcation.
@@ -2223,7 +2119,7 @@
[[elisp:(org-agenda-list)]], org-prepare-agenda erases the buffer
of the file containing the link, since that buffer is current
during org-prepare agenda (due to a with-current-buffer in
- org-agenda-open-link). An additional test now ensures that the
+ org-agenda-open-link). An additional test now ensures that the
agenda buffer is in fact current when the buffer is erased and
local variables for the agenda are set.
@@ -2281,7 +2177,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
- * ob-C.el (org): No longer requires org
+ * ob-C.el (org): No longer requires org.
* ob-ledger.el (org): No longer requires org.
@@ -2345,7 +2241,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* ob-keys.el (org-babel-key-bindings): Adding key-binding for
- `org-babel-goto-src-block-head'
+ `org-babel-goto-src-block-head'.
* ob.el (org-babel-goto-src-block-head): Jump to the head of the
current code block.
@@ -2353,7 +2249,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* ob.el (org-babel-next-src-block): Now raising more informative
- error when no further code blocks can be found
+ error when no further code blocks can be found.
(org-babel-previous-src-block): Now raising more informative error
when no previous code blocks can be found.
@@ -2365,7 +2261,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
- * ob-plantuml.el (org-babel-execute:plantuml):
+ * ob-plantuml.el (org-babel-execute:plantuml): ????
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
@@ -2464,7 +2360,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-toggle-checkbox): Ignore items in drawers when
- used from an heading. Send an error when no item is in region.
+ used from an heading. Send an error when no item is in region.
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
@@ -2517,7 +2413,7 @@
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
* org.el (org-fontify-meta-lines-and-blocks): Alter main regexp to
- match code blocks with switches and header args. Call
+ match code blocks with switches and header args. Call
`org-src-font-lock-fontify-block' for automatic fontification of
code in code blocks, controlled by variable
`org-src-fontify-natively'.
@@ -2530,14 +2426,14 @@
2010-11-11 Noorul Islam <noorul@noorul.com> (tiny change)
- * org-html.el (org-html-make-link): (Expand-file-name ) removes
- one "/" from "///path-to-file", so add one. Anything other than
+ * org-html.el (org-html-make-link): (expand-file-name) removes
+ one "/" from "///path-to-file", so add one. Anything other than
'file' type should be exported along with the type.
2010-11-11 Noorul Islam <noorul@noorul.com> (tiny change)
- * org.el (org-insert-subheading) : Fix compiler warning
- (org-insert-todo-subheading) : Fix compiler warning.
+ * org.el (org-insert-subheading): Fix compiler warning
+ (org-insert-todo-subheading): Fix compiler warning.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -2578,7 +2474,7 @@
* org.el (org-indent-line-function): Indentation of source block
is left to `org-edit-src-exit' and shouldn't be modified by
- `org-indent-line-function'. Indentation of others blocks should be
+ `org-indent-line-function'. Indentation of others blocks should be
the same as the #+begin line.
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
@@ -2610,7 +2506,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-list-ending-method): New customizable variable
- to tell Org Mode how lists end. See docstring.
+ to tell Org Mode how lists end. See docstring.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2649,14 +2545,14 @@
* org-list.el (org-list-insert-item-generic): A single item
already counting blank lines in his body should be separated with
- the next one by a blank line. Moreover, if user already provided
+ the next one by a blank line. Moreover, if user already provided
blank lines, follow his wishes.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-indent-item-tree): When moving top item of a
*-list to column 0, only the first item had its bullet changed to
- -. It now changes all items of the top-level list, as expected.
+ -. It now changes all items of the top-level list, as expected.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2687,12 +2583,12 @@
change.
* org-list.el (org-indent-item-tree): Prevent whole list from
- being moved when user is not moving subtree. Thus)
- (`org-cycle-item-indentation' will not allow to move the list.
+ being moved when user is not moving subtree. Thus
+ `org-cycle-item-indentation' will not allow to move the list.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
- * org-list.el (org-indent-item-tree): Remove region code. It was
+ * org-list.el (org-indent-item-tree): Remove region code. It was
prone to errors and undocumented.
* org-list.el (org-item-indent-positions): Better heuristics to
@@ -2708,7 +2604,7 @@
* org-list.el (org-list-bullet-string): Do not modify match-data.
* org.el (org-toggle-item): Now working again when changing list
- items into plain text. Moreover take into consideration
+ items into plain text. Moreover take into consideration
`org-list-two-spaces-after-bullet-regexp'.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2723,11 +2619,10 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-docbook.el (org-export-as-docbook): Use override="num" in
- any listitem matching [@start:num]
+ any listitem matching [@start:num].
* org-html.el (org-export-as-html): Use value="num" in any li
- matching
- [@start:num]
+ matching [@start:num].
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2803,14 +2698,14 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-indent-item-tree): Try to keep relative
- position on line. It can't if point is in white spaces before
+ position on line. It can't if point is in white spaces before
bullet because mixed tabs and spaces make some columns
unattainable.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-cycle-item-indentation): Cycle when the whole
- item only contains bullet and maybe a checkbox. Previously, TAB
+ item only contains bullet and maybe a checkbox. Previously, TAB
would cycle when the first line of the item was blank.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2843,7 +2738,7 @@
* org-list.el (org-indent-item-tree): If indent rule is activated,
it should be impossible to outdent an item having children without
- moving its subtree. Improved reordering of lists modified by
+ moving its subtree. Improved reordering of lists modified by
cycling indentation.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2864,7 +2759,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-list-insert-item-generic): When local search
- doesn't help, search the list globally for blank lines. Moreover,
+ doesn't help, search the list globally for blank lines. Moreover,
don't bother with new lists, and add 1 blank line.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2888,7 +2783,7 @@
heading.
* org-list.el (org-list-make-subtree): Add protection when used
- outside of list
+ outside of list.
* org-list.el (org-insert-item): Remove useless hack now
`org-in-item-p' is fixed.
@@ -2899,7 +2794,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-cycle-list-bullet): Prevent description items
- from being numbered. String argument is also recognized now, as
+ from being numbered. String argument is also recognized now, as
long as it is a valid bullet.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2968,8 +2863,8 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
- * org-timer.el (org-timer-item): Refactoring. Compute timer string
- before inserting it in the buffer
+ * org-timer.el (org-timer-item): Refactoring. Compute timer string
+ before inserting it in the buffer.
* org-timer.el (org-timer): Add an optional argument to return
timer string instead of inserting it.
@@ -3001,8 +2896,8 @@
a list prior to add a new item.
* org-timer.el (org-timer-item): When in a timer list, insert a
- new timer item like `org-insert-item'. If in another list, send an
- error. Otherwise, start a new timer list.
+ new timer item like `org-insert-item'. If in another list, send an
+ error. Otherwise, start a new timer list.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3047,7 +2942,7 @@
* org-list.el (org-list-send-list): We cannot count on
`org-list-top-point' and `org-list-bottom-point' before buffer is
- narrowed. Find bounds of list otherwise.
+ narrowed. Find bounds of list otherwise.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3083,7 +2978,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-docbook.el (org-export-as-docbook): Properly close any open
- list when seeing ORG-LIST-END. Removed any reference to now
+ list when seeing ORG-LIST-END. Removed any reference to now
unneeded DIDCLOSE variable.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3121,7 +3016,7 @@
recognize lists.
* org-latex.el (org-export-latex-lists): Better search for
- lists. It now only finds items not enclosed and not protected.
+ lists. It now only finds items not enclosed and not protected.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3156,10 +3051,10 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
* org-list.el (org-search-forward-unenclosed): Fix behavior when
- last occurence was enclosed.
+ last occurrence was enclosed.
* org-list.el (org-search-backward-unenclosed): Fix behavior when
- last occurence was enclosed.
+ last occurrence was enclosed.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3195,8 +3090,8 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
- * org-html.el: preprocess buffer string and add ORG-LIST-END where
- needed. Lists should not end before seeing this.
+ * org-html.el: Preprocess buffer string and add ORG-LIST-END where
+ needed. Lists should not end before seeing this.
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3269,7 +3164,7 @@
to evaluate code invisibly and block until output file exists.
* ob-R.el (org-babel-R-evaluate-session): Use `ess-eval-buffer' to
- evaluate R code in session for :results value. Write result to
+ evaluate R code in session for :results value. Write result to
file invisibly using new function
`org-babel-comint-eval-invisibly-and-wait-for-file'.
@@ -3298,7 +3193,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* ob-scheme.el: very preliminary support for evaluating scheme
- code blocks
+ code blocks.
* org.el (org-babel-load-languages): Adding scheme.
@@ -3308,16 +3203,15 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
- * ob-R.el (ess-make-buffer-current):
- Declared (ess-ask-for-ess-directory):
- Declared (ess-local-process-name):
- Declared * ob-latex.el (org-babel-latex-tex-to-pdf): Capturing free
- variable
+ * ob-R.el (ess-make-buffer-current): Declared.
+ (ess-ask-for-ess-directory): Declared.
+ (ess-local-process-name): Declared.
+ * ob-latex.el (org-babel-latex-tex-to-pdf): Capturing free variable.
- * ob.el (org-edit-src-code): Fixing arguments
- (org-edit-src-exit):
- Declared (org-outline-overlay-data):
- Declared (org-set-outline-overlay-data): Declared.
+ * ob.el (org-edit-src-code): Fixing arguments.
+ (org-edit-src-exit): Declared.
+ (org-outline-overlay-data): Declared.
+ (org-set-outline-overlay-data): Declared.
2010-11-11 Glenn Morris <rgm@gnu.org>
@@ -3365,7 +3259,7 @@
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* ob-exp.el (org-babel-exp-do-export): Remove hacky ":noeval",
- which is now an alias to ":eval no"
+ which is now an alias to ":eval no".
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
@@ -3548,7 +3442,7 @@
* ob.el (org-babel-do-in-edit-buffer): New macro to evaluate lisp
in the language major mode edit buffer.
(org-babel-do-key-sequence-in-edit-buffer): New function to call
- an arbitrary key sequence in the language major mode edit buffer
+ an arbitrary key sequence in the language major mode edit buffer.
* org-src.el (org-src-switch-to-buffer): Add new allowed value
'switch-invisibly for `org-src-window-setup'.
@@ -3574,7 +3468,7 @@
* org-src.el (org-edit-src-code): If at src block, store babel
info as buffer local variable.
(org-src-associate-babel-session): New function to associate code
- edit buffer with comint session. Does nothing unless a
+ edit buffer with comint session. Does nothing unless a
language-specific function named
`org-babel-LANG-associate-session' exists.
(org-src-babel-configure-edit-buffer): New function to be called
@@ -3712,7 +3606,7 @@
2010-11-11 Noorul Islam <noorul@noorul.com>
- * org.el: org-set-visibility-according-to-property () Use backward
+ * org.el (org-set-visibility-according-to-property): Use backward
search instead of forward, so that top hierarchy gets priority.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -3798,7 +3692,7 @@
2010-11-11 Dan Davison <davison@stats.ox.ac.uk>
* ob-octave.el: Only (require 'matlab) when necessary.
- (org-babel-octave-initiate-session) (require) octave-inf or matlab
+ (org-babel-octave-initiate-session): (require) octave-inf or matlab
as appropriate.
(org-babel-execute:matlab): Remove (require).
(org-babel-prep-session:matlab): Remove (require).
@@ -3816,7 +3710,7 @@
2010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
- * org-latex.el (org-export-latex-tables): Add label if any
+ * org-latex.el (org-export-latex-tables): Add label if any.
* org-latex.el (org-export-latex-convert-table.el-table):
Fix little mistake when inserting label.
@@ -7317,7 +7211,7 @@
New customization variable for allowing the user to create an "auto
exclusion" filter for doing context-aware auto tag filtering.
(org-agenda-filter-by-tag): Changes to support the use of
- `org-agenda-auto-exclude-function'. See the new manual addition,.
+ `org-agenda-auto-exclude-function'. See the new manual addition.
2009-11-13 John Wiegley <johnw@newartisans.com>
@@ -9387,7 +9281,7 @@
(org-export-latex-first-lines): New argument END, to force the end
of the region.
(org-export-region-as-latex): Use the property list.
- (org-export-as-latex):
+ (org-export-as-latex): ????
* org-colview-xemacs.el (org-columns-remove-overlays)
(org-columns): Fix call to `local-variable-p'.
@@ -11761,7 +11655,7 @@
2008-10-26 Carsten Dominik <dominik@science.uva.nl>
- * org-agenda.el (org-agenda-filter-tags,org-agenda-filter-form):
+ * org-agenda.el (org-agenda-filter-tags, org-agenda-filter-form):
New variables.
(org-prepare-agenda): Reset the filter tags.
(org-agenda-filter-by-tag, org-agenda-filter-by-tag-show-all):
@@ -12868,7 +12762,7 @@
* org.el (org-base-buffer): New function.
- * org-exp.el (org-icalendar-cleanup-string): Make sure ',"
+ * org-exp.el (org-icalendar-cleanup-string): Make sure ","
and ";" are escaped.
(org-print-icalendar-entries): Also apply
`org-icalendar-cleanup-string' to the headline, not only to the
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 2f64b8b0bb6..b979097dee3 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -519,7 +519,8 @@ When CHECK is given, prepare detailed information about duplicate IDs."
(puthash id (abbreviate-file-name file) org-id-locations)
(add-to-list 'org-id-files (abbreviate-file-name file))))
-(add-hook 'kill-emacs-hook 'org-id-locations-save)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'org-id-locations-save))
(defun org-id-hash-to-alist (hash)
"Turn an org-id hash into an alist, so that it can be written to a file."
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 8f1ef9e5d60..076df5f0d07 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -1078,7 +1078,7 @@ for the duration of the command."
(plain-list-item . auto))
"Should `org-insert-heading' leave a blank line before new heading/item?
The value is an alist, with `heading' and `plain-list-item' as car,
-and a boolean flag as cdr. The cdr may lso be the symbol `auto', and then
+and a boolean flag as cdr. The cdr may lso be the symbol `auto', and then
Org will look at the surrounding headings/items and try to make an
intelligent decision wether to insert a blank line or not.
@@ -1384,9 +1384,9 @@ nil Never use an ID to make a link, instead link using a text search for
(defcustom org-context-in-file-links t
"Non-nil means file links from `org-store-link' contain context.
A search string will be added to the file name with :: as separator and
-used to find the context when the link is activated by the command
-`org-open-at-point'. When this option is t, the entire active region
-will be placed in the search string of the file link. If set to a
+used to find the context when the link is activated by the command
+`org-open-at-point'. When this option is t, the entire active region
+will be placed in the search string of the file link. If set to a
positive integer, only the first n lines of context will be stored.
Using a prefix arg to the command \\[org-store-link] (`org-store-link')
@@ -1843,7 +1843,7 @@ This is list of cons cells. Each cell contains:
- a cons cell (:level . N). Any headline of level N is considered a target.
Note that, when `org-odd-levels-only' is set, level corresponds to
order in hierarchy, not to the number of stars.
- - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
+ - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
Note that, when `org-odd-levels-only' is set, level corresponds to
order in hierarchy, not to the number of stars.
@@ -2418,7 +2418,7 @@ An auto-repeating task is immediately switched back to TODO when
marked DONE. If you are not logging state changes (by adding \"@\"
or \"!\" to the TODO keyword definition), or set `org-log-done' to
record a closing note, there will be no record of the task moving
-through DONE. This variable forces taking a note anyway.
+through DONE. This variable forces taking a note anyway.
nil Don't force a record
time Record a time stamp
@@ -2624,8 +2624,8 @@ See also `org-agenda-jump-prefer-future'."
The default is to do the same as configured in `org-read-date-prefer-future'.
But you can alse set a deviating value here.
This may t or nil, or the symbol `org-read-date-prefer-future'."
- :group 'org-agenda
- :group 'org-time
+ :group 'org-agenda
+ :group 'org-time
:type '(choice
(const :tag "Use org-read-date-prefer-future"
org-read-date-prefer-future)
@@ -5575,7 +5575,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
(org-set-local 'org-pretty-entities (not org-pretty-entities))
(org-restart-font-lock)
(if org-pretty-entities
- (message "Entities are displayed as UTF8 characers")
+ (message "Entities are displayed as UTF8 characters")
(save-restriction
(widen)
(org-decompose-region (point-min) (point-max))
@@ -8525,9 +8525,9 @@ according to FMT (default from `org-email-link-description-format')."
(when (and string (integerp lines) (> lines 0))
(let ((slines (org-split-string s "\n")))
(when (< lines (length slines))
- (setq s (mapconcat
+ (setq s (mapconcat
'identity
- (reverse (nthcdr (- (length slines) lines)
+ (reverse (nthcdr (- (length slines) lines)
(reverse slines))) "\n")))))
(mapconcat 'identity (org-split-string s "[ \t]+") " ")))
@@ -8672,8 +8672,8 @@ be displayed in the buffer instead of the link.
If there is already a link at point, this command will allow you to edit link
and description parts.
-With a \\[universal-argument] prefix, prompts for a file to link to. The file name can
-be selected using completion. The path to the file will be relative to the
+With a \\[universal-argument] prefix, prompts for a file to link to. The file name can
+be selected using completion. The path to the file will be relative to the
current directory if the file is in the current directory or a subdirectory.
Otherwise, the link will be the absolute path as completed in the minibuffer
\(i.e. normally ~/path/to/file). You can configure this behavior using the
@@ -16498,8 +16498,8 @@ If not, return to the original position and throw an error."
(defun org-speed-command-default-hook (keys)
"Hook for activating single-letter speed commands.
-`org-speed-commands-default' specifies a minimal command set. Use
-`org-speed-commands-user' for further customization."
+`org-speed-commands-default' specifies a minimal command set.
+Use `org-speed-commands-user' for further customization."
(when (or (and (bolp) (looking-at outline-regexp))
(and (functionp org-use-speed-commands)
(funcall org-use-speed-commands)))
@@ -16521,11 +16521,11 @@ Each hook takes a single argument, a user-pressed command key
which is also a `self-insert-command' from the global map.
Within the hook, examine the cursor position and the command key
-and return nil or a valid handler as appropriate. Handler could
+and return nil or a valid handler as appropriate. Handler could
be one of an interactive command, a function, or a form.
Set `org-use-speed-commands' to non-nil value to enable this
-hook. The default setting is `org-speed-command-default-hook'."
+hook. The default setting is `org-speed-command-default-hook'."
:group 'org-structure
:type 'hook)
@@ -18300,11 +18300,11 @@ really on, so that the block visually is on the match."
(defun org-in-regexps-block-p (start-re end-re &optional bound)
"Return t if the current point is between matches of START-RE and END-RE.
This will also return t if point is on one of the two matches or
-in an unfinished block. END-RE can be a string or a form
+in an unfinished block. END-RE can be a string or a form
returning a string.
-An optional third argument bounds the search for START-RE. It
-defaults to previous heading or `point-min'."
+An optional third argument bounds the search for START-RE.
+It defaults to previous heading or `point-min'."
(let ((pos (point))
(limit (or bound (save-excursion (outline-previous-heading)))))
(save-excursion
@@ -19040,7 +19040,7 @@ plainly yank the text as it is.
"Perform some yank-like command.
This function implements the behavior described in the `org-yank'
-documentation. However, it has been generalized to work for any
+documentation. However, it has been generalized to work for any
interactive command with similar behavior."
;; pretend to be command COMMAND
@@ -19247,7 +19247,7 @@ move point."
(defun org-goto-first-child ()
"Goto the first child, even if it is invisible.
-Return t when a child was found. Otherwise don't move point and
+Return t when a child was found. Otherwise don't move point and
return nil."
(let (level (pos (point)) (re (concat "^" outline-regexp)))
(when (condition-case nil (org-back-to-heading t) (error nil))
diff --git a/lisp/outline.el b/lisp/outline.el
index d43afd94a3c..cedc55b3336 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -50,9 +50,9 @@ Note that Outline mode only checks this regexp at the start of a line,
so the regexp need not (and usually does not) start with `^'.
The recommended way to set this is with a Local Variables: list
in the file it applies to. See also `outline-heading-end-regexp'."
- :type '(choice regexp (const nil))
+ :type 'regexp
:group 'outlines)
-;;;###autoload(put 'outline-regexp 'safe-local-variable 'string-or-null-p)
+;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp)
(defcustom outline-heading-end-regexp "\n"
"Regular expression to match the end of a heading line.
@@ -62,6 +62,7 @@ The recommended way to set this is with a `Local Variables:' list
in the file it applies to."
:type 'regexp
:group 'outlines)
+;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
(defvar outline-mode-prefix-map
(let ((map (make-sparse-keymap)))
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 8738aa65a9f..941428d5291 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -76,6 +76,13 @@ regulate cache behavior."
key
(symbol-value (intern-soft key password-data))))
+;;;###autoload
+(defun password-in-cache-p (key)
+ "Check if KEY is in the cache."
+ (and password-cache
+ key
+ (intern-soft key password-data)))
+
(defun password-read (prompt &optional key)
"Read password, for use with KEY, from user, or from cache if wanted.
KEY indicate the purpose of the password, so the cache can
diff --git a/lisp/printing.el b/lisp/printing.el
index 99ed8c04262..e66cca25933 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5707,8 +5707,8 @@ If menu binding was not done, calls `pr-menu-bind'."
(let* ((dir-name (file-name-directory (or (buffer-file-name)
default-directory)))
(fmt-prompt (concat "%s[" mess "] Directory to print: "))
- (dir (read-file-name (format fmt-prompt "")
- "" dir-name nil dir-name))
+ (dir (read-directory-name (format fmt-prompt "")
+ "" dir-name nil dir-name))
prompt)
(while (cond ((not (file-directory-p dir))
(ding)
@@ -5718,8 +5718,8 @@ If menu binding was not done, calls `pr-menu-bind'."
(setq prompt "Directory is unreadable! "))
(t nil))
(setq dir-name (file-name-directory dir)
- dir (read-file-name (format fmt-prompt prompt)
- "" dir-name nil dir-name)))
+ dir (read-directory-name (format fmt-prompt prompt)
+ "" dir-name nil dir-name)))
(file-name-as-directory dir)))
diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el
index d7397144498..dd05ab8f310 100644
--- a/lisp/progmodes/ada-prj.el
+++ b/lisp/progmodes/ada-prj.el
@@ -227,7 +227,7 @@ If FILE-NAME is nil, ask the user for the name."
;; the user to select a directory
(let ((use-dialog-box nil))
(unless file-name
- (set 'file-name (read-file-name "Root directory: " nil nil t))))
+ (set 'file-name (read-directory-name "Root directory: " nil nil t))))
(set 'ada-prj-current-values
(plist-put ada-prj-current-values
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index de1debd6456..5ef12300195 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2023,9 +2023,9 @@ comment at the start of cc-engine.el for more info."
(defvar c-state-nonlit-pos-cache nil)
(make-variable-buffer-local 'c-state-nonlit-pos-cache)
-;; A list of buffer positions which are known not to be in a literal. This is
-;; ordered with higher positions at the front of the list. Only those which
-;; are less than `c-state-nonlit-pos-cache-limit' are valid.
+;; A list of buffer positions which are known not to be in a literal or a cpp
+;; construct. This is ordered with higher positions at the front of the list.
+;; Only those which are less than `c-state-nonlit-pos-cache-limit' are valid.
(defvar c-state-nonlit-pos-cache-limit 1)
(make-variable-buffer-local 'c-state-nonlit-pos-cache-limit)
@@ -2056,6 +2056,12 @@ comment at the start of cc-engine.el for more info."
;; This function is almost the same as `c-literal-limits'. It differs in
;; that it is a lower level function, and that it rigourously follows the
;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe position.
+ ;;
+ ;; NOTE: This function manipulates `c-state-nonlit-pos-cache'. This cache
+ ;; MAY NOT contain any positions within macros, since macros are frequently
+ ;; turned into comments by use of the `c-cpp-delimiter' category properties.
+ ;; We cannot rely on this mechanism whilst determining a cache pos since
+ ;; this function is also called from outwith `c-parse-state'.
(save-restriction
(widen)
(save-excursion
@@ -2074,6 +2080,11 @@ comment at the start of cc-engine.el for more info."
here)
(setq lit (c-state-pp-to-literal pos npos))
(setq pos (or (cdr lit) npos)) ; end of literal containing npos.
+ (goto-char pos)
+ (when (and (c-beginning-of-macro) (/= (point) pos))
+ (c-syntactic-end-of-macro)
+ (or (eobp) (forward-char))
+ (setq pos (point)))
(setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
(if (> pos c-state-nonlit-pos-cache-limit)
@@ -2158,7 +2169,7 @@ comment at the start of cc-engine.el for more info."
;; of fruitless backward scans.
(defvar c-state-brace-pair-desert nil)
(make-variable-buffer-local 'c-state-brace-pair-desert)
-;; Used only in `c-append-lower-brace-pair-to-state-cache'. It is set when an
+;; Used only in `c-append-lower-brace-pair-to-state-cache'. It is set when
;; that defun has searched backwards for a brace pair and not found one. Its
;; value is either nil or a cons (PA . FROM), where PA is the position of the
;; enclosing opening paren/brace/bracket which bounds the backwards search (or
@@ -2843,6 +2854,29 @@ comment at the start of cc-engine.el for more info."
c-state-old-cpp-end nil)
(c-state-mark-point-min-literal))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Debugging routines to dump `c-state-cache' in a "replayable" form.
+;; (defmacro c-sc-de (elt) ; "c-state-cache-dump-element"
+;; `(format ,(concat "(setq " (symbol-name elt) " %s) ") ,elt))
+;; (defmacro c-sc-qde (elt) ; "c-state-cache-quote-dump-element"
+;; `(format ,(concat "(setq " (symbol-name elt) " '%s) ") ,elt))
+;; (defun c-state-dump ()
+;; ;; For debugging.
+;; ;(message
+;; (concat
+;; (c-sc-qde c-state-cache)
+;; (c-sc-de c-state-cache-good-pos)
+;; (c-sc-qde c-state-nonlit-pos-cache)
+;; (c-sc-de c-state-nonlit-pos-cache-limit)
+;; (c-sc-qde c-state-brace-pair-desert)
+;; (c-sc-de c-state-point-min)
+;; (c-sc-de c-state-point-min-lit-type)
+;; (c-sc-de c-state-point-min-lit-start)
+;; (c-sc-de c-state-min-scan-pos)
+;; (c-sc-de c-state-old-cpp-beg)
+;; (c-sc-de c-state-old-cpp-end)))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
(defun c-invalidate-state-cache-1 (here)
;; Invalidate all info on `c-state-cache' that applies to the buffer at HERE
;; or higher and set `c-state-cache-good-pos' accordingly. The cache is
@@ -8691,841 +8725,841 @@ comment at the start of cc-engine.el for more info."
(defun c-guess-basic-syntax ()
"Return the syntactic context of the current line."
(save-excursion
- (beginning-of-line)
- (c-save-buffer-state
- ((indent-point (point))
- (case-fold-search nil)
- ;; A whole ugly bunch of various temporary variables. Have
- ;; to declare them here since it's not possible to declare
- ;; a variable with only the scope of a cond test and the
- ;; following result clauses, and most of this function is a
- ;; single gigantic cond. :P
- literal char-before-ip before-ws-ip char-after-ip macro-start
- in-macro-expr c-syntactic-context placeholder c-in-literal-cache
- step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
- containing-<
- ;; The following record some positions for the containing
- ;; declaration block if we're directly within one:
- ;; `containing-decl-open' is the position of the open
- ;; brace. `containing-decl-start' is the start of the
- ;; declaration. `containing-decl-kwd' is the keyword
- ;; symbol of the keyword that tells what kind of block it
- ;; is.
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- ;; The open paren of the closest surrounding sexp or nil if
- ;; there is none.
- containing-sexp
- ;; The position after the closest preceding brace sexp
- ;; (nested sexps are ignored), or the position after
- ;; `containing-sexp' if there is none, or (point-min) if
- ;; `containing-sexp' is nil.
- lim
- ;; The paren state outside `containing-sexp', or at
- ;; `indent-point' if `containing-sexp' is nil.
- (paren-state (c-parse-state))
- ;; There's always at most one syntactic element which got
- ;; an anchor pos. It's stored in syntactic-relpos.
- syntactic-relpos
- (c-stmt-delim-chars c-stmt-delim-chars))
-
- ;; Check if we're directly inside an enclosing declaration
- ;; level block.
- (when (and (setq containing-sexp
- (c-most-enclosing-brace paren-state))
- (progn
- (goto-char containing-sexp)
- (eq (char-after) ?{))
- (setq placeholder
- (c-looking-at-decl-block
- (c-most-enclosing-brace paren-state
- containing-sexp)
- t)))
- (setq containing-decl-open containing-sexp
- containing-decl-start (point)
- containing-sexp nil)
- (goto-char placeholder)
- (setq containing-decl-kwd (and (looking-at c-keywords-regexp)
- (c-keyword-sym (match-string 1)))))
-
- ;; Init some position variables.
- (if c-state-cache
- (progn
- (setq containing-sexp (car paren-state)
- paren-state (cdr paren-state))
- (if (consp containing-sexp)
- (progn
- (setq lim (cdr containing-sexp))
- (if (cdr c-state-cache)
- ;; Ignore balanced paren. The next entry
- ;; can't be another one.
- (setq containing-sexp (car (cdr c-state-cache))
- paren-state (cdr paren-state))
- ;; If there is no surrounding open paren then
- ;; put the last balanced pair back on paren-state.
- (setq paren-state (cons containing-sexp paren-state)
- containing-sexp nil)))
- (setq lim (1+ containing-sexp))))
- (setq lim (point-min)))
-
- ;; If we're in a parenthesis list then ',' delimits the
- ;; "statements" rather than being an operator (with the
- ;; exception of the "for" clause). This difference is
- ;; typically only noticeable when statements are used in macro
- ;; arglists.
- (when (and containing-sexp
- (eq (char-after containing-sexp) ?\())
- (setq c-stmt-delim-chars c-stmt-delim-chars-with-comma))
- ;; cache char before and after indent point, and move point to
- ;; the most likely position to perform the majority of tests
- (goto-char indent-point)
- (c-backward-syntactic-ws lim)
- (setq before-ws-ip (point)
- char-before-ip (char-before))
- (goto-char indent-point)
- (skip-chars-forward " \t")
- (setq char-after-ip (char-after))
-
- ;; are we in a literal?
- (setq literal (c-in-literal lim))
-
- ;; now figure out syntactic qualities of the current line
- (cond
+ (beginning-of-line)
+ (c-save-buffer-state
+ ((indent-point (point))
+ (case-fold-search nil)
+ ;; A whole ugly bunch of various temporary variables. Have
+ ;; to declare them here since it's not possible to declare
+ ;; a variable with only the scope of a cond test and the
+ ;; following result clauses, and most of this function is a
+ ;; single gigantic cond. :P
+ literal char-before-ip before-ws-ip char-after-ip macro-start
+ in-macro-expr c-syntactic-context placeholder c-in-literal-cache
+ step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
+ containing-<
+ ;; The following record some positions for the containing
+ ;; declaration block if we're directly within one:
+ ;; `containing-decl-open' is the position of the open
+ ;; brace. `containing-decl-start' is the start of the
+ ;; declaration. `containing-decl-kwd' is the keyword
+ ;; symbol of the keyword that tells what kind of block it
+ ;; is.
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ ;; The open paren of the closest surrounding sexp or nil if
+ ;; there is none.
+ containing-sexp
+ ;; The position after the closest preceding brace sexp
+ ;; (nested sexps are ignored), or the position after
+ ;; `containing-sexp' if there is none, or (point-min) if
+ ;; `containing-sexp' is nil.
+ lim
+ ;; The paren state outside `containing-sexp', or at
+ ;; `indent-point' if `containing-sexp' is nil.
+ (paren-state (c-parse-state))
+ ;; There's always at most one syntactic element which got
+ ;; an anchor pos. It's stored in syntactic-relpos.
+ syntactic-relpos
+ (c-stmt-delim-chars c-stmt-delim-chars))
+
+ ;; Check if we're directly inside an enclosing declaration
+ ;; level block.
+ (when (and (setq containing-sexp
+ (c-most-enclosing-brace paren-state))
+ (progn
+ (goto-char containing-sexp)
+ (eq (char-after) ?{))
+ (setq placeholder
+ (c-looking-at-decl-block
+ (c-most-enclosing-brace paren-state
+ containing-sexp)
+ t)))
+ (setq containing-decl-open containing-sexp
+ containing-decl-start (point)
+ containing-sexp nil)
+ (goto-char placeholder)
+ (setq containing-decl-kwd (and (looking-at c-keywords-regexp)
+ (c-keyword-sym (match-string 1)))))
+
+ ;; Init some position variables.
+ (if c-state-cache
+ (progn
+ (setq containing-sexp (car paren-state)
+ paren-state (cdr paren-state))
+ (if (consp containing-sexp)
+ (progn
+ (setq lim (cdr containing-sexp))
+ (if (cdr c-state-cache)
+ ;; Ignore balanced paren. The next entry
+ ;; can't be another one.
+ (setq containing-sexp (car (cdr c-state-cache))
+ paren-state (cdr paren-state))
+ ;; If there is no surrounding open paren then
+ ;; put the last balanced pair back on paren-state.
+ (setq paren-state (cons containing-sexp paren-state)
+ containing-sexp nil)))
+ (setq lim (1+ containing-sexp))))
+ (setq lim (point-min)))
+
+ ;; If we're in a parenthesis list then ',' delimits the
+ ;; "statements" rather than being an operator (with the
+ ;; exception of the "for" clause). This difference is
+ ;; typically only noticeable when statements are used in macro
+ ;; arglists.
+ (when (and containing-sexp
+ (eq (char-after containing-sexp) ?\())
+ (setq c-stmt-delim-chars c-stmt-delim-chars-with-comma))
+ ;; cache char before and after indent point, and move point to
+ ;; the most likely position to perform the majority of tests
+ (goto-char indent-point)
+ (c-backward-syntactic-ws lim)
+ (setq before-ws-ip (point)
+ char-before-ip (char-before))
+ (goto-char indent-point)
+ (skip-chars-forward " \t")
+ (setq char-after-ip (char-after))
+
+ ;; are we in a literal?
+ (setq literal (c-in-literal lim))
+
+ ;; now figure out syntactic qualities of the current line
+ (cond
- ;; CASE 1: in a string.
- ((eq literal 'string)
- (c-add-syntax 'string (c-point 'bopl)))
-
- ;; CASE 2: in a C or C++ style comment.
- ((and (memq literal '(c c++))
- ;; This is a kludge for XEmacs where we use
- ;; `buffer-syntactic-context', which doesn't correctly
- ;; recognize "\*/" to end a block comment.
- ;; `parse-partial-sexp' which is used by
- ;; `c-literal-limits' will however do that in most
- ;; versions, which results in that we get nil from
- ;; `c-literal-limits' even when `c-in-literal' claims
- ;; we're inside a comment.
- (setq placeholder (c-literal-limits lim)))
- (c-add-syntax literal (car placeholder)))
-
- ;; CASE 3: in a cpp preprocessor macro continuation.
- ((and (save-excursion
- (when (c-beginning-of-macro)
- (setq macro-start (point))))
- (/= macro-start (c-point 'boi))
- (progn
- (setq tmpsymbol 'cpp-macro-cont)
- (or (not c-syntactic-indentation-in-macros)
- (save-excursion
- (goto-char macro-start)
- ;; If at the beginning of the body of a #define
- ;; directive then analyze as cpp-define-intro
- ;; only. Go on with the syntactic analysis
- ;; otherwise. in-macro-expr is set if we're in a
- ;; cpp expression, i.e. before the #define body
- ;; or anywhere in a non-#define directive.
- (if (c-forward-to-cpp-define-body)
- (let ((indent-boi (c-point 'boi indent-point)))
- (setq in-macro-expr (> (point) indent-boi)
- tmpsymbol 'cpp-define-intro)
- (= (point) indent-boi))
- (setq in-macro-expr t)
- nil)))))
- (c-add-syntax tmpsymbol macro-start)
- (setq macro-start nil))
-
- ;; CASE 11: an else clause?
- ((looking-at "else\\>[^_]")
- (c-beginning-of-statement-1 containing-sexp)
- (c-add-stmt-syntax 'else-clause nil t
- containing-sexp paren-state))
+ ;; CASE 1: in a string.
+ ((eq literal 'string)
+ (c-add-syntax 'string (c-point 'bopl)))
+
+ ;; CASE 2: in a C or C++ style comment.
+ ((and (memq literal '(c c++))
+ ;; This is a kludge for XEmacs where we use
+ ;; `buffer-syntactic-context', which doesn't correctly
+ ;; recognize "\*/" to end a block comment.
+ ;; `parse-partial-sexp' which is used by
+ ;; `c-literal-limits' will however do that in most
+ ;; versions, which results in that we get nil from
+ ;; `c-literal-limits' even when `c-in-literal' claims
+ ;; we're inside a comment.
+ (setq placeholder (c-literal-limits lim)))
+ (c-add-syntax literal (car placeholder)))
+
+ ;; CASE 3: in a cpp preprocessor macro continuation.
+ ((and (save-excursion
+ (when (c-beginning-of-macro)
+ (setq macro-start (point))))
+ (/= macro-start (c-point 'boi))
+ (progn
+ (setq tmpsymbol 'cpp-macro-cont)
+ (or (not c-syntactic-indentation-in-macros)
+ (save-excursion
+ (goto-char macro-start)
+ ;; If at the beginning of the body of a #define
+ ;; directive then analyze as cpp-define-intro
+ ;; only. Go on with the syntactic analysis
+ ;; otherwise. in-macro-expr is set if we're in a
+ ;; cpp expression, i.e. before the #define body
+ ;; or anywhere in a non-#define directive.
+ (if (c-forward-to-cpp-define-body)
+ (let ((indent-boi (c-point 'boi indent-point)))
+ (setq in-macro-expr (> (point) indent-boi)
+ tmpsymbol 'cpp-define-intro)
+ (= (point) indent-boi))
+ (setq in-macro-expr t)
+ nil)))))
+ (c-add-syntax tmpsymbol macro-start)
+ (setq macro-start nil))
+
+ ;; CASE 11: an else clause?
+ ((looking-at "else\\>[^_]")
+ (c-beginning-of-statement-1 containing-sexp)
+ (c-add-stmt-syntax 'else-clause nil t
+ containing-sexp paren-state))
- ;; CASE 12: while closure of a do/while construct?
- ((and (looking-at "while\\>[^_]")
- (save-excursion
- (prog1 (eq (c-beginning-of-statement-1 containing-sexp)
- 'beginning)
- (setq placeholder (point)))))
- (goto-char placeholder)
- (c-add-stmt-syntax 'do-while-closure nil t
- containing-sexp paren-state))
+ ;; CASE 12: while closure of a do/while construct?
+ ((and (looking-at "while\\>[^_]")
+ (save-excursion
+ (prog1 (eq (c-beginning-of-statement-1 containing-sexp)
+ 'beginning)
+ (setq placeholder (point)))))
+ (goto-char placeholder)
+ (c-add-stmt-syntax 'do-while-closure nil t
+ containing-sexp paren-state))
- ;; CASE 13: A catch or finally clause? This case is simpler
- ;; than if-else and do-while, because a block is required
- ;; after every try, catch and finally.
- ((save-excursion
- (and (cond ((c-major-mode-is 'c++-mode)
- (looking-at "catch\\>[^_]"))
- ((c-major-mode-is 'java-mode)
- (looking-at "\\(catch\\|finally\\)\\>[^_]")))
- (and (c-safe (c-backward-syntactic-ws)
- (c-backward-sexp)
- t)
- (eq (char-after) ?{)
- (c-safe (c-backward-syntactic-ws)
- (c-backward-sexp)
- t)
- (if (eq (char-after) ?\()
- (c-safe (c-backward-sexp) t)
- t))
- (looking-at "\\(try\\|catch\\)\\>[^_]")
- (setq placeholder (point))))
- (goto-char placeholder)
- (c-add-stmt-syntax 'catch-clause nil t
- containing-sexp paren-state))
+ ;; CASE 13: A catch or finally clause? This case is simpler
+ ;; than if-else and do-while, because a block is required
+ ;; after every try, catch and finally.
+ ((save-excursion
+ (and (cond ((c-major-mode-is 'c++-mode)
+ (looking-at "catch\\>[^_]"))
+ ((c-major-mode-is 'java-mode)
+ (looking-at "\\(catch\\|finally\\)\\>[^_]")))
+ (and (c-safe (c-backward-syntactic-ws)
+ (c-backward-sexp)
+ t)
+ (eq (char-after) ?{)
+ (c-safe (c-backward-syntactic-ws)
+ (c-backward-sexp)
+ t)
+ (if (eq (char-after) ?\()
+ (c-safe (c-backward-sexp) t)
+ t))
+ (looking-at "\\(try\\|catch\\)\\>[^_]")
+ (setq placeholder (point))))
+ (goto-char placeholder)
+ (c-add-stmt-syntax 'catch-clause nil t
+ containing-sexp paren-state))
- ;; CASE 18: A substatement we can recognize by keyword.
- ((save-excursion
- (and c-opt-block-stmt-key
- (not (eq char-before-ip ?\;))
- (not (c-at-vsemi-p before-ws-ip))
- (not (memq char-after-ip '(?\) ?\] ?,)))
- (or (not (eq char-before-ip ?}))
- (c-looking-at-inexpr-block-backward c-state-cache))
- (> (point)
- (progn
- ;; Ought to cache the result from the
- ;; c-beginning-of-statement-1 calls here.
+ ;; CASE 18: A substatement we can recognize by keyword.
+ ((save-excursion
+ (and c-opt-block-stmt-key
+ (not (eq char-before-ip ?\;))
+ (not (c-at-vsemi-p before-ws-ip))
+ (not (memq char-after-ip '(?\) ?\] ?,)))
+ (or (not (eq char-before-ip ?}))
+ (c-looking-at-inexpr-block-backward c-state-cache))
+ (> (point)
+ (progn
+ ;; Ought to cache the result from the
+ ;; c-beginning-of-statement-1 calls here.
+ (setq placeholder (point))
+ (while (eq (setq step-type
+ (c-beginning-of-statement-1 lim))
+ 'label))
+ (if (eq step-type 'previous)
+ (goto-char placeholder)
(setq placeholder (point))
- (while (eq (setq step-type
- (c-beginning-of-statement-1 lim))
- 'label))
- (if (eq step-type 'previous)
- (goto-char placeholder)
- (setq placeholder (point))
- (if (and (eq step-type 'same)
- (not (looking-at c-opt-block-stmt-key)))
- ;; Step up to the containing statement if we
- ;; stayed in the same one.
- (let (step)
- (while (eq
- (setq step
- (c-beginning-of-statement-1 lim))
- 'label))
- (if (eq step 'up)
- (setq placeholder (point))
- ;; There was no containing statement afterall.
- (goto-char placeholder)))))
- placeholder))
- (if (looking-at c-block-stmt-2-key)
- ;; Require a parenthesis after these keywords.
- ;; Necessary to catch e.g. synchronized in Java,
- ;; which can be used both as statement and
- ;; modifier.
- (and (zerop (c-forward-token-2 1 nil))
- (eq (char-after) ?\())
- (looking-at c-opt-block-stmt-key))))
-
- (if (eq step-type 'up)
- ;; CASE 18A: Simple substatement.
- (progn
- (goto-char placeholder)
- (cond
- ((eq char-after-ip ?{)
- (c-add-stmt-syntax 'substatement-open nil nil
- containing-sexp paren-state))
- ((save-excursion
- (goto-char indent-point)
- (back-to-indentation)
- (c-forward-label))
- (c-add-stmt-syntax 'substatement-label nil nil
- containing-sexp paren-state))
- (t
- (c-add-stmt-syntax 'substatement nil nil
- containing-sexp paren-state))))
-
- ;; CASE 18B: Some other substatement. This is shared
- ;; with case 10.
- (c-guess-continued-construct indent-point
- char-after-ip
- placeholder
- lim
- paren-state)))
-
- ;; CASE 14: A case or default label
- ((looking-at c-label-kwds-regexp)
- (if containing-sexp
- (progn
- (goto-char containing-sexp)
- (setq lim (c-most-enclosing-brace c-state-cache
- containing-sexp))
- (c-backward-to-block-anchor lim)
- (c-add-stmt-syntax 'case-label nil t lim paren-state))
- ;; Got a bogus label at the top level. In lack of better
- ;; alternatives, anchor it on (point-min).
- (c-add-syntax 'case-label (point-min))))
-
- ;; CASE 15: any other label
- ((save-excursion
- (back-to-indentation)
- (and (not (looking-at c-syntactic-ws-start))
- (c-forward-label)))
- (cond (containing-decl-open
- (setq placeholder (c-add-class-syntax 'inclass
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- paren-state))
- ;; Append access-label with the same anchor point as
- ;; inclass gets.
- (c-append-syntax 'access-label placeholder))
-
- (containing-sexp
- (goto-char containing-sexp)
- (setq lim (c-most-enclosing-brace c-state-cache
- containing-sexp))
- (save-excursion
- (setq tmpsymbol
- (if (and (eq (c-beginning-of-statement-1 lim) 'up)
- (looking-at "switch\\>[^_]"))
- ;; If the surrounding statement is a switch then
- ;; let's analyze all labels as switch labels, so
- ;; that they get lined up consistently.
- 'case-label
- 'label)))
- (c-backward-to-block-anchor lim)
- (c-add-stmt-syntax tmpsymbol nil t lim paren-state))
+ (if (and (eq step-type 'same)
+ (not (looking-at c-opt-block-stmt-key)))
+ ;; Step up to the containing statement if we
+ ;; stayed in the same one.
+ (let (step)
+ (while (eq
+ (setq step
+ (c-beginning-of-statement-1 lim))
+ 'label))
+ (if (eq step 'up)
+ (setq placeholder (point))
+ ;; There was no containing statement afterall.
+ (goto-char placeholder)))))
+ placeholder))
+ (if (looking-at c-block-stmt-2-key)
+ ;; Require a parenthesis after these keywords.
+ ;; Necessary to catch e.g. synchronized in Java,
+ ;; which can be used both as statement and
+ ;; modifier.
+ (and (zerop (c-forward-token-2 1 nil))
+ (eq (char-after) ?\())
+ (looking-at c-opt-block-stmt-key))))
+
+ (if (eq step-type 'up)
+ ;; CASE 18A: Simple substatement.
+ (progn
+ (goto-char placeholder)
+ (cond
+ ((eq char-after-ip ?{)
+ (c-add-stmt-syntax 'substatement-open nil nil
+ containing-sexp paren-state))
+ ((save-excursion
+ (goto-char indent-point)
+ (back-to-indentation)
+ (c-forward-label))
+ (c-add-stmt-syntax 'substatement-label nil nil
+ containing-sexp paren-state))
+ (t
+ (c-add-stmt-syntax 'substatement nil nil
+ containing-sexp paren-state))))
+
+ ;; CASE 18B: Some other substatement. This is shared
+ ;; with case 10.
+ (c-guess-continued-construct indent-point
+ char-after-ip
+ placeholder
+ lim
+ paren-state)))
- (t
- ;; A label on the top level. Treat it as a class
- ;; context. (point-min) is the closest we get to the
- ;; class open brace.
- (c-add-syntax 'access-label (point-min)))))
+ ;; CASE 14: A case or default label
+ ((looking-at c-label-kwds-regexp)
+ (if containing-sexp
+ (progn
+ (goto-char containing-sexp)
+ (setq lim (c-most-enclosing-brace c-state-cache
+ containing-sexp))
+ (c-backward-to-block-anchor lim)
+ (c-add-stmt-syntax 'case-label nil t lim paren-state))
+ ;; Got a bogus label at the top level. In lack of better
+ ;; alternatives, anchor it on (point-min).
+ (c-add-syntax 'case-label (point-min))))
- ;; CASE 4: In-expression statement. C.f. cases 7B, 16A and
- ;; 17E.
- ((setq placeholder (c-looking-at-inexpr-block
- (c-safe-position containing-sexp paren-state)
- containing-sexp
- ;; Have to turn on the heuristics after
- ;; the point even though it doesn't work
- ;; very well. C.f. test case class-16.pike.
- t))
- (setq tmpsymbol (assq (car placeholder)
- '((inexpr-class . class-open)
- (inexpr-statement . block-open))))
- (if tmpsymbol
- ;; It's a statement block or an anonymous class.
- (setq tmpsymbol (cdr tmpsymbol))
- ;; It's a Pike lambda. Check whether we are between the
- ;; lambda keyword and the argument list or at the defun
- ;; opener.
- (setq tmpsymbol (if (eq char-after-ip ?{)
- 'inline-open
- 'lambda-intro-cont)))
- (goto-char (cdr placeholder))
+ ;; CASE 15: any other label
+ ((save-excursion
(back-to-indentation)
- (c-add-stmt-syntax tmpsymbol nil t
- (c-most-enclosing-brace c-state-cache (point))
- paren-state)
- (unless (eq (point) (cdr placeholder))
- (c-add-syntax (car placeholder))))
-
- ;; CASE 5: Line is inside a declaration level block or at top level.
- ((or containing-decl-open (null containing-sexp))
- (cond
-
- ;; CASE 5A: we are looking at a defun, brace list, class,
- ;; or inline-inclass method opening brace
- ((setq special-brace-list
- (or (and c-special-brace-lists
- (c-looking-at-special-brace-list))
- (eq char-after-ip ?{)))
- (cond
+ (and (not (looking-at c-syntactic-ws-start))
+ (c-forward-label)))
+ (cond (containing-decl-open
+ (setq placeholder (c-add-class-syntax 'inclass
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ paren-state))
+ ;; Append access-label with the same anchor point as
+ ;; inclass gets.
+ (c-append-syntax 'access-label placeholder))
+
+ (containing-sexp
+ (goto-char containing-sexp)
+ (setq lim (c-most-enclosing-brace c-state-cache
+ containing-sexp))
+ (save-excursion
+ (setq tmpsymbol
+ (if (and (eq (c-beginning-of-statement-1 lim) 'up)
+ (looking-at "switch\\>[^_]"))
+ ;; If the surrounding statement is a switch then
+ ;; let's analyze all labels as switch labels, so
+ ;; that they get lined up consistently.
+ 'case-label
+ 'label)))
+ (c-backward-to-block-anchor lim)
+ (c-add-stmt-syntax tmpsymbol nil t lim paren-state))
- ;; CASE 5A.1: Non-class declaration block open.
- ((save-excursion
- (let (tmp)
- (and (eq char-after-ip ?{)
- (setq tmp (c-looking-at-decl-block containing-sexp t))
- (progn
- (setq placeholder (point))
- (goto-char tmp)
- (looking-at c-symbol-key))
- (c-keyword-member
- (c-keyword-sym (setq keyword (match-string 0)))
- 'c-other-block-decl-kwds))))
- (goto-char placeholder)
- (c-add-stmt-syntax
- (if (string-equal keyword "extern")
- ;; Special case for extern-lang-open.
- 'extern-lang-open
- (intern (concat keyword "-open")))
- nil t containing-sexp paren-state))
-
- ;; CASE 5A.2: we are looking at a class opening brace
- ((save-excursion
- (goto-char indent-point)
- (skip-chars-forward " \t")
- (and (eq (char-after) ?{)
- (c-looking-at-decl-block containing-sexp t)
- (setq placeholder (point))))
- (c-add-syntax 'class-open placeholder))
-
- ;; CASE 5A.3: brace list open
- ((save-excursion
- (c-beginning-of-decl-1 lim)
- (while (looking-at c-specifier-key)
- (goto-char (match-end 1))
- (c-forward-syntactic-ws indent-point))
- (setq placeholder (c-point 'boi))
- (or (consp special-brace-list)
- (and (or (save-excursion
- (goto-char indent-point)
- (setq tmpsymbol nil)
- (while (and (> (point) placeholder)
- (zerop (c-backward-token-2 1 t))
- (/= (char-after) ?=))
- (and c-opt-inexpr-brace-list-key
- (not tmpsymbol)
- (looking-at c-opt-inexpr-brace-list-key)
- (setq tmpsymbol 'topmost-intro-cont)))
- (eq (char-after) ?=))
- (looking-at c-brace-list-key))
- (save-excursion
- (while (and (< (point) indent-point)
- (zerop (c-forward-token-2 1 t))
- (not (memq (char-after) '(?\; ?\()))))
- (not (memq (char-after) '(?\; ?\()))
- ))))
- (if (and (not c-auto-newline-analysis)
- (c-major-mode-is 'java-mode)
- (eq tmpsymbol 'topmost-intro-cont))
- ;; We're in Java and have found that the open brace
- ;; belongs to a "new Foo[]" initialization list,
- ;; which means the brace list is part of an
- ;; expression and not a top level definition. We
- ;; therefore treat it as any topmost continuation
- ;; even though the semantically correct symbol still
- ;; is brace-list-open, on the same grounds as in
- ;; case B.2.
- (progn
- (c-beginning-of-statement-1 lim)
- (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
- (c-add-syntax 'brace-list-open placeholder)))
-
- ;; CASE 5A.4: inline defun open
- ((and containing-decl-open
- (not (c-keyword-member containing-decl-kwd
- 'c-other-block-decl-kwds)))
- (c-add-syntax 'inline-open)
- (c-add-class-syntax 'inclass
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- paren-state))
-
- ;; CASE 5A.5: ordinary defun open
- (t
- (save-excursion
- (c-beginning-of-decl-1 lim)
- (while (looking-at c-specifier-key)
- (goto-char (match-end 1))
- (c-forward-syntactic-ws indent-point))
- (c-add-syntax 'defun-open (c-point 'boi))
- ;; Bogus to use bol here, but it's the legacy. (Resolved,
- ;; 2007-11-09)
- ))))
-
- ;; CASE 5B: After a function header but before the body (or
- ;; the ending semicolon if there's no body).
- ((save-excursion
- (when (setq placeholder (c-just-after-func-arglist-p lim))
- (setq tmp-pos (point))))
- (cond
+ (t
+ ;; A label on the top level. Treat it as a class
+ ;; context. (point-min) is the closest we get to the
+ ;; class open brace.
+ (c-add-syntax 'access-label (point-min)))))
+
+ ;; CASE 4: In-expression statement. C.f. cases 7B, 16A and
+ ;; 17E.
+ ((setq placeholder (c-looking-at-inexpr-block
+ (c-safe-position containing-sexp paren-state)
+ containing-sexp
+ ;; Have to turn on the heuristics after
+ ;; the point even though it doesn't work
+ ;; very well. C.f. test case class-16.pike.
+ t))
+ (setq tmpsymbol (assq (car placeholder)
+ '((inexpr-class . class-open)
+ (inexpr-statement . block-open))))
+ (if tmpsymbol
+ ;; It's a statement block or an anonymous class.
+ (setq tmpsymbol (cdr tmpsymbol))
+ ;; It's a Pike lambda. Check whether we are between the
+ ;; lambda keyword and the argument list or at the defun
+ ;; opener.
+ (setq tmpsymbol (if (eq char-after-ip ?{)
+ 'inline-open
+ 'lambda-intro-cont)))
+ (goto-char (cdr placeholder))
+ (back-to-indentation)
+ (c-add-stmt-syntax tmpsymbol nil t
+ (c-most-enclosing-brace c-state-cache (point))
+ paren-state)
+ (unless (eq (point) (cdr placeholder))
+ (c-add-syntax (car placeholder))))
- ;; CASE 5B.1: Member init list.
- ((eq (char-after tmp-pos) ?:)
- (if (or (> tmp-pos indent-point)
- (= (c-point 'bosws) (1+ tmp-pos)))
- (progn
- ;; There is no preceding member init clause.
- ;; Indent relative to the beginning of indentation
- ;; for the topmost-intro line that contains the
- ;; prototype's open paren.
- (goto-char placeholder)
- (c-add-syntax 'member-init-intro (c-point 'boi)))
- ;; Indent relative to the first member init clause.
- (goto-char (1+ tmp-pos))
- (c-forward-syntactic-ws)
- (c-add-syntax 'member-init-cont (point))))
+ ;; CASE 5: Line is inside a declaration level block or at top level.
+ ((or containing-decl-open (null containing-sexp))
+ (cond
- ;; CASE 5B.2: K&R arg decl intro
- ((and c-recognize-knr-p
- (c-in-knr-argdecl lim))
- (c-beginning-of-statement-1 lim)
- (c-add-syntax 'knr-argdecl-intro (c-point 'boi))
- (if containing-decl-open
- (c-add-class-syntax 'inclass
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- paren-state)))
-
- ;; CASE 5B.4: Nether region after a C++ or Java func
- ;; decl, which could include a `throws' declaration.
- (t
- (c-beginning-of-statement-1 lim)
- (c-add-syntax 'func-decl-cont (c-point 'boi))
- )))
+ ;; CASE 5A: we are looking at a defun, brace list, class,
+ ;; or inline-inclass method opening brace
+ ((setq special-brace-list
+ (or (and c-special-brace-lists
+ (c-looking-at-special-brace-list))
+ (eq char-after-ip ?{)))
+ (cond
- ;; CASE 5C: inheritance line. could be first inheritance
- ;; line, or continuation of a multiple inheritance
- ((or (and (c-major-mode-is 'c++-mode)
+ ;; CASE 5A.1: Non-class declaration block open.
+ ((save-excursion
+ (let (tmp)
+ (and (eq char-after-ip ?{)
+ (setq tmp (c-looking-at-decl-block containing-sexp t))
(progn
- (when (eq char-after-ip ?,)
- (skip-chars-forward " \t")
- (forward-char))
- (looking-at c-opt-postfix-decl-spec-key)))
- (and (or (eq char-before-ip ?:)
- ;; watch out for scope operator
- (save-excursion
- (and (eq char-after-ip ?:)
- (c-safe (forward-char 1) t)
- (not (eq (char-after) ?:))
- )))
- (save-excursion
- (c-backward-syntactic-ws lim)
- (if (eq char-before-ip ?:)
- (progn
- (forward-char -1)
- (c-backward-syntactic-ws lim)))
- (back-to-indentation)
- (looking-at c-class-key)))
- ;; for Java
- (and (c-major-mode-is 'java-mode)
- (let ((fence (save-excursion
- (c-beginning-of-statement-1 lim)
- (point)))
- cont done)
- (save-excursion
- (while (not done)
- (cond ((looking-at c-opt-postfix-decl-spec-key)
- (setq injava-inher (cons cont (point))
- done t))
- ((or (not (c-safe (c-forward-sexp -1) t))
- (<= (point) fence))
- (setq done t))
- )
- (setq cont t)))
- injava-inher)
- (not (c-crosses-statement-barrier-p (cdr injava-inher)
- (point)))
- ))
- (cond
-
- ;; CASE 5C.1: non-hanging colon on an inher intro
- ((eq char-after-ip ?:)
- (c-beginning-of-statement-1 lim)
- (c-add-syntax 'inher-intro (c-point 'boi))
- ;; don't add inclass symbol since relative point already
- ;; contains any class offset
- )
+ (setq placeholder (point))
+ (goto-char tmp)
+ (looking-at c-symbol-key))
+ (c-keyword-member
+ (c-keyword-sym (setq keyword (match-string 0)))
+ 'c-other-block-decl-kwds))))
+ (goto-char placeholder)
+ (c-add-stmt-syntax
+ (if (string-equal keyword "extern")
+ ;; Special case for extern-lang-open.
+ 'extern-lang-open
+ (intern (concat keyword "-open")))
+ nil t containing-sexp paren-state))
- ;; CASE 5C.2: hanging colon on an inher intro
- ((eq char-before-ip ?:)
- (c-beginning-of-statement-1 lim)
- (c-add-syntax 'inher-intro (c-point 'boi))
- (if containing-decl-open
- (c-add-class-syntax 'inclass
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- paren-state)))
-
- ;; CASE 5C.3: in a Java implements/extends
- (injava-inher
- (let ((where (cdr injava-inher))
- (cont (car injava-inher)))
- (goto-char where)
- (cond ((looking-at "throws\\>[^_]")
- (c-add-syntax 'func-decl-cont
- (progn (c-beginning-of-statement-1 lim)
- (c-point 'boi))))
- (cont (c-add-syntax 'inher-cont where))
- (t (c-add-syntax 'inher-intro
- (progn (goto-char (cdr injava-inher))
- (c-beginning-of-statement-1 lim)
- (point))))
- )))
-
- ;; CASE 5C.4: a continued inheritance line
- (t
- (c-beginning-of-inheritance-list lim)
- (c-add-syntax 'inher-cont (point))
- ;; don't add inclass symbol since relative point already
- ;; contains any class offset
- )))
-
- ;; CASE 5D: this could be a top-level initialization, a
- ;; member init list continuation, or a template argument
- ;; list continuation.
+ ;; CASE 5A.2: we are looking at a class opening brace
((save-excursion
- ;; Note: We use the fact that lim is always after any
- ;; preceding brace sexp.
- (if c-recognize-<>-arglists
- (while (and
- (progn
- (c-syntactic-skip-backward "^;,=<>" lim t)
- (> (point) lim))
- (or
- (when c-overloadable-operators-regexp
- (when (setq placeholder (c-after-special-operator-id lim))
- (goto-char placeholder)
- t))
- (cond
- ((eq (char-before) ?>)
- (or (c-backward-<>-arglist nil lim)
- (backward-char))
- t)
- ((eq (char-before) ?<)
- (backward-char)
- (if (save-excursion
- (c-forward-<>-arglist nil))
- (progn (forward-char)
- nil)
- t))
- (t nil)))))
- ;; NB: No c-after-special-operator-id stuff in this
- ;; clause - we assume only C++ needs it.
- (c-syntactic-skip-backward "^;,=" lim t))
- (memq (char-before) '(?, ?= ?<)))
- (cond
-
- ;; CASE 5D.3: perhaps a template list continuation?
- ((and (c-major-mode-is 'c++-mode)
- (save-excursion
- (save-restriction
- (c-with-syntax-table c++-template-syntax-table
- (goto-char indent-point)
- (setq placeholder (c-up-list-backward))
- (and placeholder
- (eq (char-after placeholder) ?<))))))
- (c-with-syntax-table c++-template-syntax-table
- (goto-char placeholder)
- (c-beginning-of-statement-1 lim t)
- (if (save-excursion
- (c-backward-syntactic-ws lim)
- (eq (char-before) ?<))
- ;; In a nested template arglist.
- (progn
- (goto-char placeholder)
- (c-syntactic-skip-backward "^,;" lim t)
- (c-forward-syntactic-ws))
- (back-to-indentation)))
- ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
- ;; template aware.
- (c-add-syntax 'template-args-cont (point) placeholder))
-
- ;; CASE 5D.4: perhaps a multiple inheritance line?
- ((and (c-major-mode-is 'c++-mode)
- (save-excursion
- (c-beginning-of-statement-1 lim)
- (setq placeholder (point))
- (if (looking-at "static\\>[^_]")
- (c-forward-token-2 1 nil indent-point))
- (and (looking-at c-class-key)
- (zerop (c-forward-token-2 2 nil indent-point))
- (if (eq (char-after) ?<)
- (c-with-syntax-table c++-template-syntax-table
- (zerop (c-forward-token-2 1 t indent-point)))
- t)
- (eq (char-after) ?:))))
- (goto-char placeholder)
- (c-add-syntax 'inher-cont (c-point 'boi)))
-
- ;; CASE 5D.5: Continuation of the "expression part" of a
- ;; top level construct. Or, perhaps, an unrecognised construct.
- (t
- (while (and (setq placeholder (point))
- (eq (car (c-beginning-of-decl-1 containing-sexp))
- 'same)
- (save-excursion
- (c-backward-syntactic-ws)
- (eq (char-before) ?}))
- (< (point) placeholder)))
- (c-add-stmt-syntax
- (cond
- ((eq (point) placeholder) 'statement) ; unrecognised construct
- ;; A preceding comma at the top level means that a
- ;; new variable declaration starts here. Use
- ;; topmost-intro-cont for it, for consistency with
- ;; the first variable declaration. C.f. case 5N.
- ((eq char-before-ip ?,) 'topmost-intro-cont)
- (t 'statement-cont))
- nil nil containing-sexp paren-state))
- ))
-
- ;; CASE 5F: Close of a non-class declaration level block.
- ((and (eq char-after-ip ?})
- (c-keyword-member containing-decl-kwd
- 'c-other-block-decl-kwds))
- ;; This is inconsistent: Should use `containing-decl-open'
- ;; here if it's at boi, like in case 5J.
- (goto-char containing-decl-start)
- (c-add-stmt-syntax
- (if (string-equal (symbol-name containing-decl-kwd) "extern")
- ;; Special case for compatibility with the
- ;; extern-lang syntactic symbols.
- 'extern-lang-close
- (intern (concat (symbol-name containing-decl-kwd)
- "-close")))
- nil t
- (c-most-enclosing-brace paren-state (point))
- paren-state))
-
- ;; CASE 5G: we are looking at the brace which closes the
- ;; enclosing nested class decl
- ((and containing-sexp
- (eq char-after-ip ?})
- (eq containing-decl-open containing-sexp))
- (c-add-class-syntax 'class-close
+ (goto-char indent-point)
+ (skip-chars-forward " \t")
+ (and (eq (char-after) ?{)
+ (c-looking-at-decl-block containing-sexp t)
+ (setq placeholder (point))))
+ (c-add-syntax 'class-open placeholder))
+
+ ;; CASE 5A.3: brace list open
+ ((save-excursion
+ (c-beginning-of-decl-1 lim)
+ (while (looking-at c-specifier-key)
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws indent-point))
+ (setq placeholder (c-point 'boi))
+ (or (consp special-brace-list)
+ (and (or (save-excursion
+ (goto-char indent-point)
+ (setq tmpsymbol nil)
+ (while (and (> (point) placeholder)
+ (zerop (c-backward-token-2 1 t))
+ (/= (char-after) ?=))
+ (and c-opt-inexpr-brace-list-key
+ (not tmpsymbol)
+ (looking-at c-opt-inexpr-brace-list-key)
+ (setq tmpsymbol 'topmost-intro-cont)))
+ (eq (char-after) ?=))
+ (looking-at c-brace-list-key))
+ (save-excursion
+ (while (and (< (point) indent-point)
+ (zerop (c-forward-token-2 1 t))
+ (not (memq (char-after) '(?\; ?\()))))
+ (not (memq (char-after) '(?\; ?\()))
+ ))))
+ (if (and (not c-auto-newline-analysis)
+ (c-major-mode-is 'java-mode)
+ (eq tmpsymbol 'topmost-intro-cont))
+ ;; We're in Java and have found that the open brace
+ ;; belongs to a "new Foo[]" initialization list,
+ ;; which means the brace list is part of an
+ ;; expression and not a top level definition. We
+ ;; therefore treat it as any topmost continuation
+ ;; even though the semantically correct symbol still
+ ;; is brace-list-open, on the same grounds as in
+ ;; case B.2.
+ (progn
+ (c-beginning-of-statement-1 lim)
+ (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
+ (c-add-syntax 'brace-list-open placeholder)))
+
+ ;; CASE 5A.4: inline defun open
+ ((and containing-decl-open
+ (not (c-keyword-member containing-decl-kwd
+ 'c-other-block-decl-kwds)))
+ (c-add-syntax 'inline-open)
+ (c-add-class-syntax 'inclass
containing-decl-open
containing-decl-start
containing-decl-kwd
paren-state))
- ;; CASE 5H: we could be looking at subsequent knr-argdecls
+ ;; CASE 5A.5: ordinary defun open
+ (t
+ (save-excursion
+ (c-beginning-of-decl-1 lim)
+ (while (looking-at c-specifier-key)
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws indent-point))
+ (c-add-syntax 'defun-open (c-point 'boi))
+ ;; Bogus to use bol here, but it's the legacy. (Resolved,
+ ;; 2007-11-09)
+ ))))
+
+ ;; CASE 5B: After a function header but before the body (or
+ ;; the ending semicolon if there's no body).
+ ((save-excursion
+ (when (setq placeholder (c-just-after-func-arglist-p lim))
+ (setq tmp-pos (point))))
+ (cond
+
+ ;; CASE 5B.1: Member init list.
+ ((eq (char-after tmp-pos) ?:)
+ (if (or (> tmp-pos indent-point)
+ (= (c-point 'bosws) (1+ tmp-pos)))
+ (progn
+ ;; There is no preceding member init clause.
+ ;; Indent relative to the beginning of indentation
+ ;; for the topmost-intro line that contains the
+ ;; prototype's open paren.
+ (goto-char placeholder)
+ (c-add-syntax 'member-init-intro (c-point 'boi)))
+ ;; Indent relative to the first member init clause.
+ (goto-char (1+ tmp-pos))
+ (c-forward-syntactic-ws)
+ (c-add-syntax 'member-init-cont (point))))
+
+ ;; CASE 5B.2: K&R arg decl intro
((and c-recognize-knr-p
- (not containing-sexp) ; can't be knr inside braces.
- (not (eq char-before-ip ?}))
- (save-excursion
- (setq placeholder (cdr (c-beginning-of-decl-1 lim)))
- (and placeholder
- ;; Do an extra check to avoid tripping up on
- ;; statements that occur in invalid contexts
- ;; (e.g. in macro bodies where we don't really
- ;; know the context of what we're looking at).
- (not (and c-opt-block-stmt-key
- (looking-at c-opt-block-stmt-key)))))
- (< placeholder indent-point))
- (goto-char placeholder)
- (c-add-syntax 'knr-argdecl (point)))
-
- ;; CASE 5I: ObjC method definition.
- ((and c-opt-method-key
- (looking-at c-opt-method-key))
- (c-beginning-of-statement-1 nil t)
- (if (= (point) indent-point)
- ;; Handle the case when it's the first (non-comment)
- ;; thing in the buffer. Can't look for a 'same return
- ;; value from cbos1 since ObjC directives currently
- ;; aren't recognized fully, so that we get 'same
- ;; instead of 'previous if it moved over a preceding
- ;; directive.
- (goto-char (point-min)))
- (c-add-syntax 'objc-method-intro (c-point 'boi)))
-
- ;; CASE 5P: AWK pattern or function or continuation
- ;; thereof.
- ((c-major-mode-is 'awk-mode)
- (setq placeholder (point))
- (c-add-stmt-syntax
- (if (and (eq (c-beginning-of-statement-1) 'same)
- (/= (point) placeholder))
- 'topmost-intro-cont
- 'topmost-intro)
- nil nil
- containing-sexp paren-state))
-
- ;; CASE 5N: At a variable declaration that follows a class
- ;; definition or some other block declaration that doesn't
- ;; end at the closing '}'. C.f. case 5D.5.
- ((progn
- (c-backward-syntactic-ws lim)
- (and (eq (char-before) ?})
+ (c-in-knr-argdecl lim))
+ (c-beginning-of-statement-1 lim)
+ (c-add-syntax 'knr-argdecl-intro (c-point 'boi))
+ (if containing-decl-open
+ (c-add-class-syntax 'inclass
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ paren-state)))
+
+ ;; CASE 5B.4: Nether region after a C++ or Java func
+ ;; decl, which could include a `throws' declaration.
+ (t
+ (c-beginning-of-statement-1 lim)
+ (c-add-syntax 'func-decl-cont (c-point 'boi))
+ )))
+
+ ;; CASE 5C: inheritance line. could be first inheritance
+ ;; line, or continuation of a multiple inheritance
+ ((or (and (c-major-mode-is 'c++-mode)
+ (progn
+ (when (eq char-after-ip ?,)
+ (skip-chars-forward " \t")
+ (forward-char))
+ (looking-at c-opt-postfix-decl-spec-key)))
+ (and (or (eq char-before-ip ?:)
+ ;; watch out for scope operator
+ (save-excursion
+ (and (eq char-after-ip ?:)
+ (c-safe (forward-char 1) t)
+ (not (eq (char-after) ?:))
+ )))
(save-excursion
- (let ((start (point)))
- (if (and c-state-cache
- (consp (car c-state-cache))
- (eq (cdar c-state-cache) (point)))
- ;; Speed up the backward search a bit.
- (goto-char (caar c-state-cache)))
- (c-beginning-of-decl-1 containing-sexp)
- (setq placeholder (point))
- (if (= start (point))
- ;; The '}' is unbalanced.
- nil
- (c-end-of-decl-1)
- (>= (point) indent-point))))))
- (goto-char placeholder)
- (c-add-stmt-syntax 'topmost-intro-cont nil nil
- containing-sexp paren-state))
+ (c-backward-syntactic-ws lim)
+ (if (eq char-before-ip ?:)
+ (progn
+ (forward-char -1)
+ (c-backward-syntactic-ws lim)))
+ (back-to-indentation)
+ (looking-at c-class-key)))
+ ;; for Java
+ (and (c-major-mode-is 'java-mode)
+ (let ((fence (save-excursion
+ (c-beginning-of-statement-1 lim)
+ (point)))
+ cont done)
+ (save-excursion
+ (while (not done)
+ (cond ((looking-at c-opt-postfix-decl-spec-key)
+ (setq injava-inher (cons cont (point))
+ done t))
+ ((or (not (c-safe (c-forward-sexp -1) t))
+ (<= (point) fence))
+ (setq done t))
+ )
+ (setq cont t)))
+ injava-inher)
+ (not (c-crosses-statement-barrier-p (cdr injava-inher)
+ (point)))
+ ))
+ (cond
- ;; NOTE: The point is at the end of the previous token here.
+ ;; CASE 5C.1: non-hanging colon on an inher intro
+ ((eq char-after-ip ?:)
+ (c-beginning-of-statement-1 lim)
+ (c-add-syntax 'inher-intro (c-point 'boi))
+ ;; don't add inclass symbol since relative point already
+ ;; contains any class offset
+ )
- ;; CASE 5J: we are at the topmost level, make
- ;; sure we skip back past any access specifiers
- ((and
- ;; A macro continuation line is never at top level.
- (not (and macro-start
- (> indent-point macro-start)))
- (save-excursion
- (setq placeholder (point))
- (or (memq char-before-ip '(?\; ?{ ?} nil))
- (c-at-vsemi-p before-ws-ip)
- (when (and (eq char-before-ip ?:)
- (eq (c-beginning-of-statement-1 lim)
- 'label))
- (c-backward-syntactic-ws lim)
- (setq placeholder (point)))
- (and (c-major-mode-is 'objc-mode)
- (catch 'not-in-directive
- (c-beginning-of-statement-1 lim)
- (setq placeholder (point))
- (while (and (c-forward-objc-directive)
- (< (point) indent-point))
- (c-forward-syntactic-ws)
- (if (>= (point) indent-point)
- (throw 'not-in-directive t))
- (setq placeholder (point)))
- nil)))))
- ;; For historic reasons we anchor at bol of the last
- ;; line of the previous declaration. That's clearly
- ;; highly bogus and useless, and it makes our lives hard
- ;; to remain compatible. :P
- (goto-char placeholder)
- (c-add-syntax 'topmost-intro (c-point 'bol))
+ ;; CASE 5C.2: hanging colon on an inher intro
+ ((eq char-before-ip ?:)
+ (c-beginning-of-statement-1 lim)
+ (c-add-syntax 'inher-intro (c-point 'boi))
(if containing-decl-open
- (if (c-keyword-member containing-decl-kwd
- 'c-other-block-decl-kwds)
- (progn
- (goto-char (c-brace-anchor-point containing-decl-open))
- (c-add-stmt-syntax
- (if (string-equal (symbol-name containing-decl-kwd)
- "extern")
- ;; Special case for compatibility with the
- ;; extern-lang syntactic symbols.
- 'inextern-lang
- (intern (concat "in"
- (symbol-name containing-decl-kwd))))
- nil t
- (c-most-enclosing-brace paren-state (point))
- paren-state))
- (c-add-class-syntax 'inclass
- containing-decl-open
- containing-decl-start
- containing-decl-kwd
- paren-state)))
- (when (and c-syntactic-indentation-in-macros
- macro-start
- (/= macro-start (c-point 'boi indent-point)))
- (c-add-syntax 'cpp-define-intro)
- (setq macro-start nil)))
-
- ;; CASE 5K: we are at an ObjC method definition
- ;; continuation line.
- ((and c-opt-method-key
+ (c-add-class-syntax 'inclass
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ paren-state)))
+
+ ;; CASE 5C.3: in a Java implements/extends
+ (injava-inher
+ (let ((where (cdr injava-inher))
+ (cont (car injava-inher)))
+ (goto-char where)
+ (cond ((looking-at "throws\\>[^_]")
+ (c-add-syntax 'func-decl-cont
+ (progn (c-beginning-of-statement-1 lim)
+ (c-point 'boi))))
+ (cont (c-add-syntax 'inher-cont where))
+ (t (c-add-syntax 'inher-intro
+ (progn (goto-char (cdr injava-inher))
+ (c-beginning-of-statement-1 lim)
+ (point))))
+ )))
+
+ ;; CASE 5C.4: a continued inheritance line
+ (t
+ (c-beginning-of-inheritance-list lim)
+ (c-add-syntax 'inher-cont (point))
+ ;; don't add inclass symbol since relative point already
+ ;; contains any class offset
+ )))
+
+ ;; CASE 5D: this could be a top-level initialization, a
+ ;; member init list continuation, or a template argument
+ ;; list continuation.
+ ((save-excursion
+ ;; Note: We use the fact that lim is always after any
+ ;; preceding brace sexp.
+ (if c-recognize-<>-arglists
+ (while (and
+ (progn
+ (c-syntactic-skip-backward "^;,=<>" lim t)
+ (> (point) lim))
+ (or
+ (when c-overloadable-operators-regexp
+ (when (setq placeholder (c-after-special-operator-id lim))
+ (goto-char placeholder)
+ t))
+ (cond
+ ((eq (char-before) ?>)
+ (or (c-backward-<>-arglist nil lim)
+ (backward-char))
+ t)
+ ((eq (char-before) ?<)
+ (backward-char)
+ (if (save-excursion
+ (c-forward-<>-arglist nil))
+ (progn (forward-char)
+ nil)
+ t))
+ (t nil)))))
+ ;; NB: No c-after-special-operator-id stuff in this
+ ;; clause - we assume only C++ needs it.
+ (c-syntactic-skip-backward "^;,=" lim t))
+ (memq (char-before) '(?, ?= ?<)))
+ (cond
+
+ ;; CASE 5D.3: perhaps a template list continuation?
+ ((and (c-major-mode-is 'c++-mode)
+ (save-excursion
+ (save-restriction
+ (c-with-syntax-table c++-template-syntax-table
+ (goto-char indent-point)
+ (setq placeholder (c-up-list-backward))
+ (and placeholder
+ (eq (char-after placeholder) ?<))))))
+ (c-with-syntax-table c++-template-syntax-table
+ (goto-char placeholder)
+ (c-beginning-of-statement-1 lim t)
+ (if (save-excursion
+ (c-backward-syntactic-ws lim)
+ (eq (char-before) ?<))
+ ;; In a nested template arglist.
+ (progn
+ (goto-char placeholder)
+ (c-syntactic-skip-backward "^,;" lim t)
+ (c-forward-syntactic-ws))
+ (back-to-indentation)))
+ ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
+ ;; template aware.
+ (c-add-syntax 'template-args-cont (point) placeholder))
+
+ ;; CASE 5D.4: perhaps a multiple inheritance line?
+ ((and (c-major-mode-is 'c++-mode)
(save-excursion
(c-beginning-of-statement-1 lim)
- (beginning-of-line)
- (when (looking-at c-opt-method-key)
- (setq placeholder (point)))))
- (c-add-syntax 'objc-method-args-cont placeholder))
+ (setq placeholder (point))
+ (if (looking-at "static\\>[^_]")
+ (c-forward-token-2 1 nil indent-point))
+ (and (looking-at c-class-key)
+ (zerop (c-forward-token-2 2 nil indent-point))
+ (if (eq (char-after) ?<)
+ (c-with-syntax-table c++-template-syntax-table
+ (zerop (c-forward-token-2 1 t indent-point)))
+ t)
+ (eq (char-after) ?:))))
+ (goto-char placeholder)
+ (c-add-syntax 'inher-cont (c-point 'boi)))
+
+ ;; CASE 5D.5: Continuation of the "expression part" of a
+ ;; top level construct. Or, perhaps, an unrecognised construct.
+ (t
+ (while (and (setq placeholder (point))
+ (eq (car (c-beginning-of-decl-1 containing-sexp))
+ 'same)
+ (save-excursion
+ (c-backward-syntactic-ws)
+ (eq (char-before) ?}))
+ (< (point) placeholder)))
+ (c-add-stmt-syntax
+ (cond
+ ((eq (point) placeholder) 'statement) ; unrecognised construct
+ ;; A preceding comma at the top level means that a
+ ;; new variable declaration starts here. Use
+ ;; topmost-intro-cont for it, for consistency with
+ ;; the first variable declaration. C.f. case 5N.
+ ((eq char-before-ip ?,) 'topmost-intro-cont)
+ (t 'statement-cont))
+ nil nil containing-sexp paren-state))
+ ))
+
+ ;; CASE 5F: Close of a non-class declaration level block.
+ ((and (eq char-after-ip ?})
+ (c-keyword-member containing-decl-kwd
+ 'c-other-block-decl-kwds))
+ ;; This is inconsistent: Should use `containing-decl-open'
+ ;; here if it's at boi, like in case 5J.
+ (goto-char containing-decl-start)
+ (c-add-stmt-syntax
+ (if (string-equal (symbol-name containing-decl-kwd) "extern")
+ ;; Special case for compatibility with the
+ ;; extern-lang syntactic symbols.
+ 'extern-lang-close
+ (intern (concat (symbol-name containing-decl-kwd)
+ "-close")))
+ nil t
+ (c-most-enclosing-brace paren-state (point))
+ paren-state))
+
+ ;; CASE 5G: we are looking at the brace which closes the
+ ;; enclosing nested class decl
+ ((and containing-sexp
+ (eq char-after-ip ?})
+ (eq containing-decl-open containing-sexp))
+ (c-add-class-syntax 'class-close
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ paren-state))
+
+ ;; CASE 5H: we could be looking at subsequent knr-argdecls
+ ((and c-recognize-knr-p
+ (not containing-sexp) ; can't be knr inside braces.
+ (not (eq char-before-ip ?}))
+ (save-excursion
+ (setq placeholder (cdr (c-beginning-of-decl-1 lim)))
+ (and placeholder
+ ;; Do an extra check to avoid tripping up on
+ ;; statements that occur in invalid contexts
+ ;; (e.g. in macro bodies where we don't really
+ ;; know the context of what we're looking at).
+ (not (and c-opt-block-stmt-key
+ (looking-at c-opt-block-stmt-key)))))
+ (< placeholder indent-point))
+ (goto-char placeholder)
+ (c-add-syntax 'knr-argdecl (point)))
+
+ ;; CASE 5I: ObjC method definition.
+ ((and c-opt-method-key
+ (looking-at c-opt-method-key))
+ (c-beginning-of-statement-1 nil t)
+ (if (= (point) indent-point)
+ ;; Handle the case when it's the first (non-comment)
+ ;; thing in the buffer. Can't look for a 'same return
+ ;; value from cbos1 since ObjC directives currently
+ ;; aren't recognized fully, so that we get 'same
+ ;; instead of 'previous if it moved over a preceding
+ ;; directive.
+ (goto-char (point-min)))
+ (c-add-syntax 'objc-method-intro (c-point 'boi)))
+
+ ;; CASE 5P: AWK pattern or function or continuation
+ ;; thereof.
+ ((c-major-mode-is 'awk-mode)
+ (setq placeholder (point))
+ (c-add-stmt-syntax
+ (if (and (eq (c-beginning-of-statement-1) 'same)
+ (/= (point) placeholder))
+ 'topmost-intro-cont
+ 'topmost-intro)
+ nil nil
+ containing-sexp paren-state))
+
+ ;; CASE 5N: At a variable declaration that follows a class
+ ;; definition or some other block declaration that doesn't
+ ;; end at the closing '}'. C.f. case 5D.5.
+ ((progn
+ (c-backward-syntactic-ws lim)
+ (and (eq (char-before) ?})
+ (save-excursion
+ (let ((start (point)))
+ (if (and c-state-cache
+ (consp (car c-state-cache))
+ (eq (cdar c-state-cache) (point)))
+ ;; Speed up the backward search a bit.
+ (goto-char (caar c-state-cache)))
+ (c-beginning-of-decl-1 containing-sexp)
+ (setq placeholder (point))
+ (if (= start (point))
+ ;; The '}' is unbalanced.
+ nil
+ (c-end-of-decl-1)
+ (>= (point) indent-point))))))
+ (goto-char placeholder)
+ (c-add-stmt-syntax 'topmost-intro-cont nil nil
+ containing-sexp paren-state))
+
+ ;; NOTE: The point is at the end of the previous token here.
+
+ ;; CASE 5J: we are at the topmost level, make
+ ;; sure we skip back past any access specifiers
+ ((and
+ ;; A macro continuation line is never at top level.
+ (not (and macro-start
+ (> indent-point macro-start)))
+ (save-excursion
+ (setq placeholder (point))
+ (or (memq char-before-ip '(?\; ?{ ?} nil))
+ (c-at-vsemi-p before-ws-ip)
+ (when (and (eq char-before-ip ?:)
+ (eq (c-beginning-of-statement-1 lim)
+ 'label))
+ (c-backward-syntactic-ws lim)
+ (setq placeholder (point)))
+ (and (c-major-mode-is 'objc-mode)
+ (catch 'not-in-directive
+ (c-beginning-of-statement-1 lim)
+ (setq placeholder (point))
+ (while (and (c-forward-objc-directive)
+ (< (point) indent-point))
+ (c-forward-syntactic-ws)
+ (if (>= (point) indent-point)
+ (throw 'not-in-directive t))
+ (setq placeholder (point)))
+ nil)))))
+ ;; For historic reasons we anchor at bol of the last
+ ;; line of the previous declaration. That's clearly
+ ;; highly bogus and useless, and it makes our lives hard
+ ;; to remain compatible. :P
+ (goto-char placeholder)
+ (c-add-syntax 'topmost-intro (c-point 'bol))
+ (if containing-decl-open
+ (if (c-keyword-member containing-decl-kwd
+ 'c-other-block-decl-kwds)
+ (progn
+ (goto-char (c-brace-anchor-point containing-decl-open))
+ (c-add-stmt-syntax
+ (if (string-equal (symbol-name containing-decl-kwd)
+ "extern")
+ ;; Special case for compatibility with the
+ ;; extern-lang syntactic symbols.
+ 'inextern-lang
+ (intern (concat "in"
+ (symbol-name containing-decl-kwd))))
+ nil t
+ (c-most-enclosing-brace paren-state (point))
+ paren-state))
+ (c-add-class-syntax 'inclass
+ containing-decl-open
+ containing-decl-start
+ containing-decl-kwd
+ paren-state)))
+ (when (and c-syntactic-indentation-in-macros
+ macro-start
+ (/= macro-start (c-point 'boi indent-point)))
+ (c-add-syntax 'cpp-define-intro)
+ (setq macro-start nil)))
+
+ ;; CASE 5K: we are at an ObjC method definition
+ ;; continuation line.
+ ((and c-opt-method-key
+ (save-excursion
+ (c-beginning-of-statement-1 lim)
+ (beginning-of-line)
+ (when (looking-at c-opt-method-key)
+ (setq placeholder (point)))))
+ (c-add-syntax 'objc-method-args-cont placeholder))
- ;; CASE 5L: we are at the first argument of a template
+ ;; CASE 5L: we are at the first argument of a template
;; arglist that begins on the previous line.
((and c-recognize-<>-arglists
(eq (char-before) ?<)
@@ -9539,32 +9573,32 @@ comment at the start of cc-engine.el for more info."
(c-beginning-of-statement-1 containing-sexp)
(c-add-stmt-syntax 'statement nil t containing-sexp paren-state))
- ;;CASE 5N: We are at a tompmost continuation line and the only
- ;;preceding items are annotations.
+ ;;CASE 5N: We are at a tompmost continuation line and the only
+ ;;preceding items are annotations.
((and (c-major-mode-is 'java-mode)
(setq placeholder (point))
- (c-beginning-of-statement-1)
- (progn
+ (c-beginning-of-statement-1)
+ (progn
(while (and (c-forward-annotation))
- (c-forward-syntactic-ws))
- t)
- (prog1
- (>= (point) placeholder)
- (goto-char placeholder)))
- (c-add-syntax 'annotation-top-cont (c-point 'boi)))
+ (c-forward-syntactic-ws))
+ t)
+ (prog1
+ (>= (point) placeholder)
+ (goto-char placeholder)))
+ (c-add-syntax 'annotation-top-cont (c-point 'boi)))
;; CASE 5M: we are at a topmost continuation line
(t
(c-beginning-of-statement-1 (c-safe-position (point) paren-state))
- (when (c-major-mode-is 'objc-mode)
- (setq placeholder (point))
- (while (and (c-forward-objc-directive)
- (< (point) indent-point))
- (c-forward-syntactic-ws)
- (setq placeholder (point)))
- (goto-char placeholder))
- (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
- ))
+ (when (c-major-mode-is 'objc-mode)
+ (setq placeholder (point))
+ (while (and (c-forward-objc-directive)
+ (< (point) indent-point))
+ (c-forward-syntactic-ws)
+ (setq placeholder (point)))
+ (goto-char placeholder))
+ (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
+ ))
;; (CASE 6 has been removed.)
@@ -9580,576 +9614,576 @@ comment at the start of cc-engine.el for more info."
(cond
;; CASE 7A: we are looking at the arglist closing paren.
- ;; C.f. case 7F.
- ((memq char-after-ip '(?\) ?\]))
- (goto-char containing-sexp)
- (setq placeholder (c-point 'boi))
- (if (and (c-safe (backward-up-list 1) t)
- (>= (point) placeholder))
- (progn
- (forward-char)
- (skip-chars-forward " \t"))
- (goto-char placeholder))
- (c-add-stmt-syntax 'arglist-close (list containing-sexp) t
+ ;; C.f. case 7F.
+ ((memq char-after-ip '(?\) ?\]))
+ (goto-char containing-sexp)
+ (setq placeholder (c-point 'boi))
+ (if (and (c-safe (backward-up-list 1) t)
+ (>= (point) placeholder))
+ (progn
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'arglist-close (list containing-sexp) t
(c-most-enclosing-brace paren-state (point))
paren-state))
- ;; CASE 19: line is an expression, not a statement, and is directly
- ;; contained by a template delimiter. Most likely, we are in a
- ;; template arglist within a statement. This case is based on CASE
- ;; 7. At some point in the future, we may wish to create more
- ;; syntactic symbols such as `template-intro',
- ;; `template-cont-nonempty', etc., and distinguish between them as we
- ;; do for `arglist-intro' etc. (2009-12-07).
- ((and c-recognize-<>-arglists
- (setq containing-< (c-up-list-backward indent-point containing-sexp))
- (eq (char-after containing-<) ?\<))
- (setq placeholder (c-point 'boi containing-<))
- (goto-char containing-sexp) ; Most nested Lbrace/Lparen (but not
- ; '<') before indent-point.
- (if (>= (point) placeholder)
- (progn
- (forward-char)
- (skip-chars-forward " \t"))
- (goto-char placeholder))
- (c-add-stmt-syntax 'template-args-cont (list containing-<) t
- (c-most-enclosing-brace c-state-cache (point))
- paren-state))
-
;; CASE 7B: Looking at the opening brace of an
;; in-expression block or brace list. C.f. cases 4, 16A
;; and 17E.
- ((and (eq char-after-ip ?{)
- (progn
- (setq placeholder (c-inside-bracelist-p (point)
- paren-state))
- (if placeholder
- (setq tmpsymbol '(brace-list-open . inexpr-class))
- (setq tmpsymbol '(block-open . inexpr-statement)
- placeholder
- (cdr-safe (c-looking-at-inexpr-block
- (c-safe-position containing-sexp
- paren-state)
- containing-sexp)))
- ;; placeholder is nil if it's a block directly in
- ;; a function arglist. That makes us skip out of
- ;; this case.
- )))
- (goto-char placeholder)
- (back-to-indentation)
- (c-add-stmt-syntax (car tmpsymbol) nil t
- (c-most-enclosing-brace paren-state (point))
- paren-state)
- (if (/= (point) placeholder)
- (c-add-syntax (cdr tmpsymbol))))
+ ((and (eq char-after-ip ?{)
+ (progn
+ (setq placeholder (c-inside-bracelist-p (point)
+ paren-state))
+ (if placeholder
+ (setq tmpsymbol '(brace-list-open . inexpr-class))
+ (setq tmpsymbol '(block-open . inexpr-statement)
+ placeholder
+ (cdr-safe (c-looking-at-inexpr-block
+ (c-safe-position containing-sexp
+ paren-state)
+ containing-sexp)))
+ ;; placeholder is nil if it's a block directly in
+ ;; a function arglist. That makes us skip out of
+ ;; this case.
+ )))
+ (goto-char placeholder)
+ (back-to-indentation)
+ (c-add-stmt-syntax (car tmpsymbol) nil t
+ (c-most-enclosing-brace paren-state (point))
+ paren-state)
+ (if (/= (point) placeholder)
+ (c-add-syntax (cdr tmpsymbol))))
- ;; CASE 7C: we are looking at the first argument in an empty
- ;; argument list. Use arglist-close if we're actually
- ;; looking at a close paren or bracket.
- ((memq char-before-ip '(?\( ?\[))
+ ;; CASE 7C: we are looking at the first argument in an empty
+ ;; argument list. Use arglist-close if we're actually
+ ;; looking at a close paren or bracket.
+ ((memq char-before-ip '(?\( ?\[))
+ (goto-char containing-sexp)
+ (setq placeholder (c-point 'boi))
+ (if (and (c-safe (backward-up-list 1) t)
+ (>= (point) placeholder))
+ (progn
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'arglist-intro (list containing-sexp) t
+ (c-most-enclosing-brace paren-state (point))
+ paren-state))
+
+ ;; CASE 7D: we are inside a conditional test clause. treat
+ ;; these things as statements
+ ((progn
(goto-char containing-sexp)
- (setq placeholder (c-point 'boi))
- (if (and (c-safe (backward-up-list 1) t)
- (>= (point) placeholder))
- (progn
- (forward-char)
- (skip-chars-forward " \t"))
- (goto-char placeholder))
- (c-add-stmt-syntax 'arglist-intro (list containing-sexp) t
- (c-most-enclosing-brace paren-state (point))
- paren-state))
+ (and (c-safe (c-forward-sexp -1) t)
+ (looking-at "\\<for\\>[^_]")))
+ (goto-char (1+ containing-sexp))
+ (c-forward-syntactic-ws indent-point)
+ (if (eq char-before-ip ?\;)
+ (c-add-syntax 'statement (point))
+ (c-add-syntax 'statement-cont (point))
+ ))
+
+ ;; CASE 7E: maybe a continued ObjC method call. This is the
+ ;; case when we are inside a [] bracketed exp, and what
+ ;; precede the opening bracket is not an identifier.
+ ((and c-opt-method-key
+ (eq (char-after containing-sexp) ?\[)
+ (progn
+ (goto-char (1- containing-sexp))
+ (c-backward-syntactic-ws (c-point 'bod))
+ (if (not (looking-at c-symbol-key))
+ (c-add-syntax 'objc-method-call-cont containing-sexp))
+ )))
- ;; CASE 7D: we are inside a conditional test clause. treat
- ;; these things as statements
- ((progn
- (goto-char containing-sexp)
- (and (c-safe (c-forward-sexp -1) t)
- (looking-at "\\<for\\>[^_]")))
+ ;; CASE 7F: we are looking at an arglist continuation line,
+ ;; but the preceding argument is on the same line as the
+ ;; opening paren. This case includes multi-line
+ ;; mathematical paren groupings, but we could be on a
+ ;; for-list continuation line. C.f. case 7A.
+ ((progn
(goto-char (1+ containing-sexp))
- (c-forward-syntactic-ws indent-point)
- (if (eq char-before-ip ?\;)
- (c-add-syntax 'statement (point))
- (c-add-syntax 'statement-cont (point))
- ))
-
- ;; CASE 7E: maybe a continued ObjC method call. This is the
- ;; case when we are inside a [] bracketed exp, and what
- ;; precede the opening bracket is not an identifier.
- ((and c-opt-method-key
- (eq (char-after containing-sexp) ?\[)
- (progn
- (goto-char (1- containing-sexp))
- (c-backward-syntactic-ws (c-point 'bod))
- (if (not (looking-at c-symbol-key))
- (c-add-syntax 'objc-method-call-cont containing-sexp))
- )))
+ (< (save-excursion
+ (c-forward-syntactic-ws)
+ (point))
+ (c-point 'bonl)))
+ (goto-char containing-sexp) ; paren opening the arglist
+ (setq placeholder (c-point 'boi))
+ (if (and (c-safe (backward-up-list 1) t)
+ (>= (point) placeholder))
+ (progn
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'arglist-cont-nonempty (list containing-sexp) t
+ (c-most-enclosing-brace c-state-cache (point))
+ paren-state))
- ;; CASE 7F: we are looking at an arglist continuation line,
- ;; but the preceding argument is on the same line as the
- ;; opening paren. This case includes multi-line
- ;; mathematical paren groupings, but we could be on a
- ;; for-list continuation line. C.f. case 7A.
- ((progn
- (goto-char (1+ containing-sexp))
- (< (save-excursion
- (c-forward-syntactic-ws)
- (point))
- (c-point 'bonl)))
- (goto-char containing-sexp) ; paren opening the arglist
- (setq placeholder (c-point 'boi))
- (if (and (c-safe (backward-up-list 1) t)
- (>= (point) placeholder))
- (progn
- (forward-char)
- (skip-chars-forward " \t"))
- (goto-char placeholder))
- (c-add-stmt-syntax 'arglist-cont-nonempty (list containing-sexp) t
- (c-most-enclosing-brace c-state-cache (point))
- paren-state))
+ ;; CASE 7G: we are looking at just a normal arglist
+ ;; continuation line
+ (t (c-forward-syntactic-ws indent-point)
+ (c-add-syntax 'arglist-cont (c-point 'boi)))
+ ))
- ;; CASE 7G: we are looking at just a normal arglist
- ;; continuation line
- (t (c-forward-syntactic-ws indent-point)
- (c-add-syntax 'arglist-cont (c-point 'boi)))
- ))
+ ;; CASE 8: func-local multi-inheritance line
+ ((and (c-major-mode-is 'c++-mode)
+ (save-excursion
+ (goto-char indent-point)
+ (skip-chars-forward " \t")
+ (looking-at c-opt-postfix-decl-spec-key)))
+ (goto-char indent-point)
+ (skip-chars-forward " \t")
+ (cond
- ;; CASE 8: func-local multi-inheritance line
- ((and (c-major-mode-is 'c++-mode)
- (save-excursion
- (goto-char indent-point)
- (skip-chars-forward " \t")
- (looking-at c-opt-postfix-decl-spec-key)))
- (goto-char indent-point)
- (skip-chars-forward " \t")
- (cond
+ ;; CASE 8A: non-hanging colon on an inher intro
+ ((eq char-after-ip ?:)
+ (c-backward-syntactic-ws lim)
+ (c-add-syntax 'inher-intro (c-point 'boi)))
- ;; CASE 8A: non-hanging colon on an inher intro
- ((eq char-after-ip ?:)
- (c-backward-syntactic-ws lim)
- (c-add-syntax 'inher-intro (c-point 'boi)))
+ ;; CASE 8B: hanging colon on an inher intro
+ ((eq char-before-ip ?:)
+ (c-add-syntax 'inher-intro (c-point 'boi)))
- ;; CASE 8B: hanging colon on an inher intro
- ((eq char-before-ip ?:)
- (c-add-syntax 'inher-intro (c-point 'boi)))
+ ;; CASE 8C: a continued inheritance line
+ (t
+ (c-beginning-of-inheritance-list lim)
+ (c-add-syntax 'inher-cont (point))
+ )))
+
+ ;; CASE 9: we are inside a brace-list
+ ((and (not (c-major-mode-is 'awk-mode)) ; Maybe this isn't needed (ACM, 2002/3/29)
+ (setq special-brace-list
+ (or (and c-special-brace-lists ;;;; ALWAYS NIL FOR AWK!!
+ (save-excursion
+ (goto-char containing-sexp)
+ (c-looking-at-special-brace-list)))
+ (c-inside-bracelist-p containing-sexp paren-state))))
+ (cond
- ;; CASE 8C: a continued inheritance line
- (t
- (c-beginning-of-inheritance-list lim)
- (c-add-syntax 'inher-cont (point))
- )))
+ ;; CASE 9A: In the middle of a special brace list opener.
+ ((and (consp special-brace-list)
+ (save-excursion
+ (goto-char containing-sexp)
+ (eq (char-after) ?\())
+ (eq char-after-ip (car (cdr special-brace-list))))
+ (goto-char (car (car special-brace-list)))
+ (skip-chars-backward " \t")
+ (if (and (bolp)
+ (assoc 'statement-cont
+ (setq placeholder (c-guess-basic-syntax))))
+ (setq c-syntactic-context placeholder)
+ (c-beginning-of-statement-1
+ (c-safe-position (1- containing-sexp) paren-state))
+ (c-forward-token-2 0)
+ (while (looking-at c-specifier-key)
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws))
+ (c-add-syntax 'brace-list-open (c-point 'boi))))
+
+ ;; CASE 9B: brace-list-close brace
+ ((if (consp special-brace-list)
+ ;; Check special brace list closer.
+ (progn
+ (goto-char (car (car special-brace-list)))
+ (save-excursion
+ (goto-char indent-point)
+ (back-to-indentation)
+ (or
+ ;; We were between the special close char and the `)'.
+ (and (eq (char-after) ?\))
+ (eq (1+ (point)) (cdr (car special-brace-list))))
+ ;; We were before the special close char.
+ (and (eq (char-after) (cdr (cdr special-brace-list)))
+ (zerop (c-forward-token-2))
+ (eq (1+ (point)) (cdr (car special-brace-list)))))))
+ ;; Normal brace list check.
+ (and (eq char-after-ip ?})
+ (c-safe (goto-char (c-up-list-backward (point))) t)
+ (= (point) containing-sexp)))
+ (if (eq (point) (c-point 'boi))
+ (c-add-syntax 'brace-list-close (point))
+ (setq lim (c-most-enclosing-brace c-state-cache (point)))
+ (c-beginning-of-statement-1 lim)
+ (c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
- ;; CASE 9: we are inside a brace-list
- ((and (not (c-major-mode-is 'awk-mode)) ; Maybe this isn't needed (ACM, 2002/3/29)
- (setq special-brace-list
- (or (and c-special-brace-lists ;;;; ALWAYS NIL FOR AWK!!
- (save-excursion
- (goto-char containing-sexp)
- (c-looking-at-special-brace-list)))
- (c-inside-bracelist-p containing-sexp paren-state))))
+ (t
+ ;; Prepare for the rest of the cases below by going to the
+ ;; token following the opening brace
+ (if (consp special-brace-list)
+ (progn
+ (goto-char (car (car special-brace-list)))
+ (c-forward-token-2 1 nil indent-point))
+ (goto-char containing-sexp))
+ (forward-char)
+ (let ((start (point)))
+ (c-forward-syntactic-ws indent-point)
+ (goto-char (max start (c-point 'bol))))
+ (c-skip-ws-forward indent-point)
(cond
- ;; CASE 9A: In the middle of a special brace list opener.
- ((and (consp special-brace-list)
- (save-excursion
- (goto-char containing-sexp)
- (eq (char-after) ?\())
- (eq char-after-ip (car (cdr special-brace-list))))
- (goto-char (car (car special-brace-list)))
- (skip-chars-backward " \t")
- (if (and (bolp)
- (assoc 'statement-cont
- (setq placeholder (c-guess-basic-syntax))))
- (setq c-syntactic-context placeholder)
- (c-beginning-of-statement-1
- (c-safe-position (1- containing-sexp) paren-state))
- (c-forward-token-2 0)
- (while (looking-at c-specifier-key)
- (goto-char (match-end 1))
- (c-forward-syntactic-ws))
- (c-add-syntax 'brace-list-open (c-point 'boi))))
-
- ;; CASE 9B: brace-list-close brace
- ((if (consp special-brace-list)
- ;; Check special brace list closer.
- (progn
- (goto-char (car (car special-brace-list)))
- (save-excursion
- (goto-char indent-point)
- (back-to-indentation)
- (or
- ;; We were between the special close char and the `)'.
- (and (eq (char-after) ?\))
- (eq (1+ (point)) (cdr (car special-brace-list))))
- ;; We were before the special close char.
- (and (eq (char-after) (cdr (cdr special-brace-list)))
- (zerop (c-forward-token-2))
- (eq (1+ (point)) (cdr (car special-brace-list)))))))
- ;; Normal brace list check.
- (and (eq char-after-ip ?})
- (c-safe (goto-char (c-up-list-backward (point))) t)
- (= (point) containing-sexp)))
+ ;; CASE 9C: we're looking at the first line in a brace-list
+ ((= (point) indent-point)
+ (if (consp special-brace-list)
+ (goto-char (car (car special-brace-list)))
+ (goto-char containing-sexp))
(if (eq (point) (c-point 'boi))
- (c-add-syntax 'brace-list-close (point))
+ (c-add-syntax 'brace-list-intro (point))
(setq lim (c-most-enclosing-brace c-state-cache (point)))
(c-beginning-of-statement-1 lim)
- (c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
+ (c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
- (t
- ;; Prepare for the rest of the cases below by going to the
- ;; token following the opening brace
- (if (consp special-brace-list)
- (progn
- (goto-char (car (car special-brace-list)))
- (c-forward-token-2 1 nil indent-point))
- (goto-char containing-sexp))
- (forward-char)
- (let ((start (point)))
- (c-forward-syntactic-ws indent-point)
- (goto-char (max start (c-point 'bol))))
- (c-skip-ws-forward indent-point)
- (cond
+ ;; CASE 9D: this is just a later brace-list-entry or
+ ;; brace-entry-open
+ (t (if (or (eq char-after-ip ?{)
+ (and c-special-brace-lists
+ (save-excursion
+ (goto-char indent-point)
+ (c-forward-syntactic-ws (c-point 'eol))
+ (c-looking-at-special-brace-list (point)))))
+ (c-add-syntax 'brace-entry-open (point))
+ (c-add-syntax 'brace-list-entry (point))
+ ))
+ ))))
+
+ ;; CASE 10: A continued statement or top level construct.
+ ((and (not (memq char-before-ip '(?\; ?:)))
+ (not (c-at-vsemi-p before-ws-ip))
+ (or (not (eq char-before-ip ?}))
+ (c-looking-at-inexpr-block-backward c-state-cache))
+ (> (point)
+ (save-excursion
+ (c-beginning-of-statement-1 containing-sexp)
+ (setq placeholder (point))))
+ (/= placeholder containing-sexp))
+ ;; This is shared with case 18.
+ (c-guess-continued-construct indent-point
+ char-after-ip
+ placeholder
+ containing-sexp
+ paren-state))
+
+ ;; CASE 16: block close brace, possibly closing the defun or
+ ;; the class
+ ((eq char-after-ip ?})
+ ;; From here on we have the next containing sexp in lim.
+ (setq lim (c-most-enclosing-brace paren-state))
+ (goto-char containing-sexp)
+ (cond
- ;; CASE 9C: we're looking at the first line in a brace-list
- ((= (point) indent-point)
- (if (consp special-brace-list)
- (goto-char (car (car special-brace-list)))
- (goto-char containing-sexp))
- (if (eq (point) (c-point 'boi))
- (c-add-syntax 'brace-list-intro (point))
- (setq lim (c-most-enclosing-brace c-state-cache (point)))
- (c-beginning-of-statement-1 lim)
- (c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
-
- ;; CASE 9D: this is just a later brace-list-entry or
- ;; brace-entry-open
- (t (if (or (eq char-after-ip ?{)
- (and c-special-brace-lists
- (save-excursion
- (goto-char indent-point)
- (c-forward-syntactic-ws (c-point 'eol))
- (c-looking-at-special-brace-list (point)))))
- (c-add-syntax 'brace-entry-open (point))
- (c-add-syntax 'brace-list-entry (point))
- ))
- ))))
-
- ;; CASE 10: A continued statement or top level construct.
- ((and (not (memq char-before-ip '(?\; ?:)))
- (not (c-at-vsemi-p before-ws-ip))
- (or (not (eq char-before-ip ?}))
- (c-looking-at-inexpr-block-backward c-state-cache))
- (> (point)
- (save-excursion
- (c-beginning-of-statement-1 containing-sexp)
- (setq placeholder (point))))
- (/= placeholder containing-sexp))
- ;; This is shared with case 18.
- (c-guess-continued-construct indent-point
- char-after-ip
- placeholder
- containing-sexp
- paren-state))
-
- ;; CASE 16: block close brace, possibly closing the defun or
- ;; the class
- ((eq char-after-ip ?})
- ;; From here on we have the next containing sexp in lim.
- (setq lim (c-most-enclosing-brace paren-state))
+ ;; CASE 16E: Closing a statement block? This catches
+ ;; cases where it's preceded by a statement keyword,
+ ;; which works even when used in an "invalid" context,
+ ;; e.g. a macro argument.
+ ((c-after-conditional)
+ (c-backward-to-block-anchor lim)
+ (c-add-stmt-syntax 'block-close nil t lim paren-state))
+
+ ;; CASE 16A: closing a lambda defun or an in-expression
+ ;; block? C.f. cases 4, 7B and 17E.
+ ((setq placeholder (c-looking-at-inexpr-block
+ (c-safe-position containing-sexp paren-state)
+ nil))
+ (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
+ 'inline-close
+ 'block-close))
(goto-char containing-sexp)
- (cond
+ (back-to-indentation)
+ (if (= containing-sexp (point))
+ (c-add-syntax tmpsymbol (point))
+ (goto-char (cdr placeholder))
+ (back-to-indentation)
+ (c-add-stmt-syntax tmpsymbol nil t
+ (c-most-enclosing-brace paren-state (point))
+ paren-state)
+ (if (/= (point) (cdr placeholder))
+ (c-add-syntax (car placeholder)))))
- ;; CASE 16E: Closing a statement block? This catches
- ;; cases where it's preceded by a statement keyword,
- ;; which works even when used in an "invalid" context,
- ;; e.g. a macro argument.
- ((c-after-conditional)
- (c-backward-to-block-anchor lim)
- (c-add-stmt-syntax 'block-close nil t lim paren-state))
-
- ;; CASE 16A: closing a lambda defun or an in-expression
- ;; block? C.f. cases 4, 7B and 17E.
- ((setq placeholder (c-looking-at-inexpr-block
- (c-safe-position containing-sexp paren-state)
- nil))
- (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
- 'inline-close
- 'block-close))
- (goto-char containing-sexp)
- (back-to-indentation)
- (if (= containing-sexp (point))
- (c-add-syntax tmpsymbol (point))
- (goto-char (cdr placeholder))
- (back-to-indentation)
- (c-add-stmt-syntax tmpsymbol nil t
- (c-most-enclosing-brace paren-state (point))
- paren-state)
- (if (/= (point) (cdr placeholder))
- (c-add-syntax (car placeholder)))))
-
- ;; CASE 16B: does this close an inline or a function in
- ;; a non-class declaration level block?
- ((save-excursion
- (and lim
- (progn
- (goto-char lim)
- (c-looking-at-decl-block
- (c-most-enclosing-brace paren-state lim)
- nil))
- (setq placeholder (point))))
- (c-backward-to-decl-anchor lim)
- (back-to-indentation)
- (if (save-excursion
- (goto-char placeholder)
- (looking-at c-other-decl-block-key))
- (c-add-syntax 'defun-close (point))
- (c-add-syntax 'inline-close (point))))
-
- ;; CASE 16F: Can be a defun-close of a function declared
- ;; in a statement block, e.g. in Pike or when using gcc
- ;; extensions, but watch out for macros followed by
- ;; blocks. Let it through to be handled below.
- ;; C.f. cases B.3 and 17G.
- ((save-excursion
- (and (not (c-at-statement-start-p))
- (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
- (setq placeholder (point))
- (let ((c-recognize-typeless-decls nil))
- ;; Turn off recognition of constructs that
- ;; lacks a type in this case, since that's more
- ;; likely to be a macro followed by a block.
- (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
- (back-to-indentation)
- (if (/= (point) containing-sexp)
- (goto-char placeholder))
- (c-add-stmt-syntax 'defun-close nil t lim paren-state))
-
- ;; CASE 16C: If there is an enclosing brace then this is
- ;; a block close since defun closes inside declaration
- ;; level blocks have been handled above.
- (lim
- ;; If the block is preceded by a case/switch label on
- ;; the same line, we anchor at the first preceding label
- ;; at boi. The default handling in c-add-stmt-syntax
- ;; really fixes it better, but we do like this to keep
- ;; the indentation compatible with version 5.28 and
- ;; earlier. C.f. case 17H.
- (while (and (/= (setq placeholder (point)) (c-point 'boi))
- (eq (c-beginning-of-statement-1 lim) 'label)))
- (goto-char placeholder)
- (if (looking-at c-label-kwds-regexp)
- (c-add-syntax 'block-close (point))
- (goto-char containing-sexp)
- ;; c-backward-to-block-anchor not necessary here; those
- ;; situations are handled in case 16E above.
- (c-add-stmt-syntax 'block-close nil t lim paren-state)))
-
- ;; CASE 16D: Only top level defun close left.
- (t
- (goto-char containing-sexp)
- (c-backward-to-decl-anchor lim)
- (c-add-stmt-syntax 'defun-close nil nil
- (c-most-enclosing-brace paren-state)
- paren-state))
- ))
+ ;; CASE 16B: does this close an inline or a function in
+ ;; a non-class declaration level block?
+ ((save-excursion
+ (and lim
+ (progn
+ (goto-char lim)
+ (c-looking-at-decl-block
+ (c-most-enclosing-brace paren-state lim)
+ nil))
+ (setq placeholder (point))))
+ (c-backward-to-decl-anchor lim)
+ (back-to-indentation)
+ (if (save-excursion
+ (goto-char placeholder)
+ (looking-at c-other-decl-block-key))
+ (c-add-syntax 'defun-close (point))
+ (c-add-syntax 'inline-close (point))))
+
+ ;; CASE 16F: Can be a defun-close of a function declared
+ ;; in a statement block, e.g. in Pike or when using gcc
+ ;; extensions, but watch out for macros followed by
+ ;; blocks. Let it through to be handled below.
+ ;; C.f. cases B.3 and 17G.
+ ((save-excursion
+ (and (not (c-at-statement-start-p))
+ (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
+ (setq placeholder (point))
+ (let ((c-recognize-typeless-decls nil))
+ ;; Turn off recognition of constructs that
+ ;; lacks a type in this case, since that's more
+ ;; likely to be a macro followed by a block.
+ (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
+ (back-to-indentation)
+ (if (/= (point) containing-sexp)
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'defun-close nil t lim paren-state))
+
+ ;; CASE 16C: If there is an enclosing brace then this is
+ ;; a block close since defun closes inside declaration
+ ;; level blocks have been handled above.
+ (lim
+ ;; If the block is preceded by a case/switch label on
+ ;; the same line, we anchor at the first preceding label
+ ;; at boi. The default handling in c-add-stmt-syntax
+ ;; really fixes it better, but we do like this to keep
+ ;; the indentation compatible with version 5.28 and
+ ;; earlier. C.f. case 17H.
+ (while (and (/= (setq placeholder (point)) (c-point 'boi))
+ (eq (c-beginning-of-statement-1 lim) 'label)))
+ (goto-char placeholder)
+ (if (looking-at c-label-kwds-regexp)
+ (c-add-syntax 'block-close (point))
+ (goto-char containing-sexp)
+ ;; c-backward-to-block-anchor not necessary here; those
+ ;; situations are handled in case 16E above.
+ (c-add-stmt-syntax 'block-close nil t lim paren-state)))
- ;; CASE 17: Statement or defun catchall.
+ ;; CASE 16D: Only top level defun close left.
(t
- (goto-char indent-point)
- ;; Back up statements until we find one that starts at boi.
- (while (let* ((prev-point (point))
- (last-step-type (c-beginning-of-statement-1
- containing-sexp)))
- (if (= (point) prev-point)
- (progn
- (setq step-type (or step-type last-step-type))
- nil)
- (setq step-type last-step-type)
- (/= (point) (c-point 'boi)))))
- (cond
+ (goto-char containing-sexp)
+ (c-backward-to-decl-anchor lim)
+ (c-add-stmt-syntax 'defun-close nil nil
+ (c-most-enclosing-brace paren-state)
+ paren-state))
+ ))
+
+ ;; CASE 19: line is an expression, not a statement, and is directly
+ ;; contained by a template delimiter. Most likely, we are in a
+ ;; template arglist within a statement. This case is based on CASE
+ ;; 7. At some point in the future, we may wish to create more
+ ;; syntactic symbols such as `template-intro',
+ ;; `template-cont-nonempty', etc., and distinguish between them as we
+ ;; do for `arglist-intro' etc. (2009-12-07).
+ ((and c-recognize-<>-arglists
+ (setq containing-< (c-up-list-backward indent-point containing-sexp))
+ (eq (char-after containing-<) ?\<))
+ (setq placeholder (c-point 'boi containing-<))
+ (goto-char containing-sexp) ; Most nested Lbrace/Lparen (but not
+ ; '<') before indent-point.
+ (if (>= (point) placeholder)
+ (progn
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'template-args-cont (list containing-<) t
+ (c-most-enclosing-brace c-state-cache (point))
+ paren-state))
- ;; CASE 17B: continued statement
- ((and (eq step-type 'same)
- (/= (point) indent-point))
- (c-add-stmt-syntax 'statement-cont nil nil
- containing-sexp paren-state))
-
- ;; CASE 17A: After a case/default label?
- ((progn
- (while (and (eq step-type 'label)
- (not (looking-at c-label-kwds-regexp)))
- (setq step-type
- (c-beginning-of-statement-1 containing-sexp)))
- (eq step-type 'label))
- (c-add-stmt-syntax (if (eq char-after-ip ?{)
- 'statement-case-open
- 'statement-case-intro)
- nil t containing-sexp paren-state))
-
- ;; CASE 17D: any old statement
- ((progn
- (while (eq step-type 'label)
- (setq step-type
- (c-beginning-of-statement-1 containing-sexp)))
- (eq step-type 'previous))
- (c-add-stmt-syntax 'statement nil t
- containing-sexp paren-state)
- (if (eq char-after-ip ?{)
- (c-add-syntax 'block-open)))
-
- ;; CASE 17I: Inside a substatement block.
- ((progn
- ;; The following tests are all based on containing-sexp.
- (goto-char containing-sexp)
- ;; From here on we have the next containing sexp in lim.
- (setq lim (c-most-enclosing-brace paren-state containing-sexp))
- (c-after-conditional))
- (c-backward-to-block-anchor lim)
- (c-add-stmt-syntax 'statement-block-intro nil t
- lim paren-state)
- (if (eq char-after-ip ?{)
- (c-add-syntax 'block-open)))
-
- ;; CASE 17E: first statement in an in-expression block.
- ;; C.f. cases 4, 7B and 16A.
- ((setq placeholder (c-looking-at-inexpr-block
- (c-safe-position containing-sexp paren-state)
- nil))
- (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
- 'defun-block-intro
- 'statement-block-intro))
- (back-to-indentation)
- (if (= containing-sexp (point))
- (c-add-syntax tmpsymbol (point))
- (goto-char (cdr placeholder))
- (back-to-indentation)
- (c-add-stmt-syntax tmpsymbol nil t
- (c-most-enclosing-brace c-state-cache (point))
- paren-state)
- (if (/= (point) (cdr placeholder))
- (c-add-syntax (car placeholder))))
- (if (eq char-after-ip ?{)
- (c-add-syntax 'block-open)))
-
- ;; CASE 17F: first statement in an inline, or first
- ;; statement in a top-level defun. we can tell this is it
- ;; if there are no enclosing braces that haven't been
- ;; narrowed out by a class (i.e. don't use bod here).
- ((save-excursion
- (or (not (setq placeholder (c-most-enclosing-brace
- paren-state)))
- (and (progn
- (goto-char placeholder)
- (eq (char-after) ?{))
- (c-looking-at-decl-block (c-most-enclosing-brace
- paren-state (point))
- nil))))
- (c-backward-to-decl-anchor lim)
- (back-to-indentation)
- (c-add-syntax 'defun-block-intro (point)))
+ ;; CASE 17: Statement or defun catchall.
+ (t
+ (goto-char indent-point)
+ ;; Back up statements until we find one that starts at boi.
+ (while (let* ((prev-point (point))
+ (last-step-type (c-beginning-of-statement-1
+ containing-sexp)))
+ (if (= (point) prev-point)
+ (progn
+ (setq step-type (or step-type last-step-type))
+ nil)
+ (setq step-type last-step-type)
+ (/= (point) (c-point 'boi)))))
+ (cond
- ;; CASE 17G: First statement in a function declared inside
- ;; a normal block. This can occur in Pike and with
- ;; e.g. the gcc extensions, but watch out for macros
- ;; followed by blocks. C.f. cases B.3 and 16F.
- ((save-excursion
- (and (not (c-at-statement-start-p))
- (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
- (setq placeholder (point))
- (let ((c-recognize-typeless-decls nil))
- ;; Turn off recognition of constructs that lacks
- ;; a type in this case, since that's more likely
- ;; to be a macro followed by a block.
- (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
+ ;; CASE 17B: continued statement
+ ((and (eq step-type 'same)
+ (/= (point) indent-point))
+ (c-add-stmt-syntax 'statement-cont nil nil
+ containing-sexp paren-state))
+
+ ;; CASE 17A: After a case/default label?
+ ((progn
+ (while (and (eq step-type 'label)
+ (not (looking-at c-label-kwds-regexp)))
+ (setq step-type
+ (c-beginning-of-statement-1 containing-sexp)))
+ (eq step-type 'label))
+ (c-add-stmt-syntax (if (eq char-after-ip ?{)
+ 'statement-case-open
+ 'statement-case-intro)
+ nil t containing-sexp paren-state))
+
+ ;; CASE 17D: any old statement
+ ((progn
+ (while (eq step-type 'label)
+ (setq step-type
+ (c-beginning-of-statement-1 containing-sexp)))
+ (eq step-type 'previous))
+ (c-add-stmt-syntax 'statement nil t
+ containing-sexp paren-state)
+ (if (eq char-after-ip ?{)
+ (c-add-syntax 'block-open)))
+
+ ;; CASE 17I: Inside a substatement block.
+ ((progn
+ ;; The following tests are all based on containing-sexp.
+ (goto-char containing-sexp)
+ ;; From here on we have the next containing sexp in lim.
+ (setq lim (c-most-enclosing-brace paren-state containing-sexp))
+ (c-after-conditional))
+ (c-backward-to-block-anchor lim)
+ (c-add-stmt-syntax 'statement-block-intro nil t
+ lim paren-state)
+ (if (eq char-after-ip ?{)
+ (c-add-syntax 'block-open)))
+
+ ;; CASE 17E: first statement in an in-expression block.
+ ;; C.f. cases 4, 7B and 16A.
+ ((setq placeholder (c-looking-at-inexpr-block
+ (c-safe-position containing-sexp paren-state)
+ nil))
+ (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
+ 'defun-block-intro
+ 'statement-block-intro))
+ (back-to-indentation)
+ (if (= containing-sexp (point))
+ (c-add-syntax tmpsymbol (point))
+ (goto-char (cdr placeholder))
(back-to-indentation)
- (if (/= (point) containing-sexp)
- (goto-char placeholder))
- (c-add-stmt-syntax 'defun-block-intro nil t
- lim paren-state))
+ (c-add-stmt-syntax tmpsymbol nil t
+ (c-most-enclosing-brace c-state-cache (point))
+ paren-state)
+ (if (/= (point) (cdr placeholder))
+ (c-add-syntax (car placeholder))))
+ (if (eq char-after-ip ?{)
+ (c-add-syntax 'block-open)))
+
+ ;; CASE 17F: first statement in an inline, or first
+ ;; statement in a top-level defun. we can tell this is it
+ ;; if there are no enclosing braces that haven't been
+ ;; narrowed out by a class (i.e. don't use bod here).
+ ((save-excursion
+ (or (not (setq placeholder (c-most-enclosing-brace
+ paren-state)))
+ (and (progn
+ (goto-char placeholder)
+ (eq (char-after) ?{))
+ (c-looking-at-decl-block (c-most-enclosing-brace
+ paren-state (point))
+ nil))))
+ (c-backward-to-decl-anchor lim)
+ (back-to-indentation)
+ (c-add-syntax 'defun-block-intro (point)))
- ;; CASE 17H: First statement in a block.
- (t
- ;; If the block is preceded by a case/switch label on the
- ;; same line, we anchor at the first preceding label at
- ;; boi. The default handling in c-add-stmt-syntax is
- ;; really fixes it better, but we do like this to keep the
- ;; indentation compatible with version 5.28 and earlier.
- ;; C.f. case 16C.
- (while (and (/= (setq placeholder (point)) (c-point 'boi))
- (eq (c-beginning-of-statement-1 lim) 'label)))
- (goto-char placeholder)
- (if (looking-at c-label-kwds-regexp)
- (c-add-syntax 'statement-block-intro (point))
- (goto-char containing-sexp)
- ;; c-backward-to-block-anchor not necessary here; those
- ;; situations are handled in case 17I above.
- (c-add-stmt-syntax 'statement-block-intro nil t
- lim paren-state))
- (if (eq char-after-ip ?{)
- (c-add-syntax 'block-open)))
- ))
- )
+ ;; CASE 17G: First statement in a function declared inside
+ ;; a normal block. This can occur in Pike and with
+ ;; e.g. the gcc extensions, but watch out for macros
+ ;; followed by blocks. C.f. cases B.3 and 16F.
+ ((save-excursion
+ (and (not (c-at-statement-start-p))
+ (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
+ (setq placeholder (point))
+ (let ((c-recognize-typeless-decls nil))
+ ;; Turn off recognition of constructs that lacks
+ ;; a type in this case, since that's more likely
+ ;; to be a macro followed by a block.
+ (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
+ (back-to-indentation)
+ (if (/= (point) containing-sexp)
+ (goto-char placeholder))
+ (c-add-stmt-syntax 'defun-block-intro nil t
+ lim paren-state))
- ;; now we need to look at any modifiers
- (goto-char indent-point)
- (skip-chars-forward " \t")
+ ;; CASE 17H: First statement in a block.
+ (t
+ ;; If the block is preceded by a case/switch label on the
+ ;; same line, we anchor at the first preceding label at
+ ;; boi. The default handling in c-add-stmt-syntax is
+ ;; really fixes it better, but we do like this to keep the
+ ;; indentation compatible with version 5.28 and earlier.
+ ;; C.f. case 16C.
+ (while (and (/= (setq placeholder (point)) (c-point 'boi))
+ (eq (c-beginning-of-statement-1 lim) 'label)))
+ (goto-char placeholder)
+ (if (looking-at c-label-kwds-regexp)
+ (c-add-syntax 'statement-block-intro (point))
+ (goto-char containing-sexp)
+ ;; c-backward-to-block-anchor not necessary here; those
+ ;; situations are handled in case 17I above.
+ (c-add-stmt-syntax 'statement-block-intro nil t
+ lim paren-state))
+ (if (eq char-after-ip ?{)
+ (c-add-syntax 'block-open)))
+ ))
+ )
+
+ ;; now we need to look at any modifiers
+ (goto-char indent-point)
+ (skip-chars-forward " \t")
+
+ ;; are we looking at a comment only line?
+ (when (and (looking-at c-comment-start-regexp)
+ (/= (c-forward-token-2 0 nil (c-point 'eol)) 0))
+ (c-append-syntax 'comment-intro))
+
+ ;; we might want to give additional offset to friends (in C++).
+ (when (and c-opt-friend-key
+ (looking-at c-opt-friend-key))
+ (c-append-syntax 'friend))
+
+ ;; Set syntactic-relpos.
+ (let ((p c-syntactic-context))
+ (while (and p
+ (if (integerp (c-langelem-pos (car p)))
+ (progn
+ (setq syntactic-relpos (c-langelem-pos (car p)))
+ nil)
+ t))
+ (setq p (cdr p))))
- ;; are we looking at a comment only line?
- (when (and (looking-at c-comment-start-regexp)
- (/= (c-forward-token-2 0 nil (c-point 'eol)) 0))
- (c-append-syntax 'comment-intro))
-
- ;; we might want to give additional offset to friends (in C++).
- (when (and c-opt-friend-key
- (looking-at c-opt-friend-key))
- (c-append-syntax 'friend))
-
- ;; Set syntactic-relpos.
- (let ((p c-syntactic-context))
- (while (and p
- (if (integerp (c-langelem-pos (car p)))
- (progn
- (setq syntactic-relpos (c-langelem-pos (car p)))
- nil)
- t))
- (setq p (cdr p))))
-
- ;; Start of or a continuation of a preprocessor directive?
- (if (and macro-start
- (eq macro-start (c-point 'boi))
- (not (and (c-major-mode-is 'pike-mode)
- (eq (char-after (1+ macro-start)) ?\"))))
- (c-append-syntax 'cpp-macro)
- (when (and c-syntactic-indentation-in-macros macro-start)
- (if in-macro-expr
- (when (or
- (< syntactic-relpos macro-start)
- (not (or
- (assq 'arglist-intro c-syntactic-context)
- (assq 'arglist-cont c-syntactic-context)
- (assq 'arglist-cont-nonempty c-syntactic-context)
- (assq 'arglist-close c-syntactic-context))))
- ;; If inside a cpp expression, i.e. anywhere in a
- ;; cpp directive except a #define body, we only let
- ;; through the syntactic analysis that is internal
- ;; in the expression. That means the arglist
- ;; elements, if they are anchored inside the cpp
- ;; expression.
- (setq c-syntactic-context nil)
- (c-add-syntax 'cpp-macro-cont macro-start))
- (when (and (eq macro-start syntactic-relpos)
- (not (assq 'cpp-define-intro c-syntactic-context))
- (save-excursion
- (goto-char macro-start)
- (or (not (c-forward-to-cpp-define-body))
- (<= (point) (c-point 'boi indent-point)))))
- ;; Inside a #define body and the syntactic analysis is
- ;; anchored on the start of the #define. In this case
- ;; we add cpp-define-intro to get the extra
- ;; indentation of the #define body.
- (c-add-syntax 'cpp-define-intro)))))
-
- ;; return the syntax
- c-syntactic-context)))
+ ;; Start of or a continuation of a preprocessor directive?
+ (if (and macro-start
+ (eq macro-start (c-point 'boi))
+ (not (and (c-major-mode-is 'pike-mode)
+ (eq (char-after (1+ macro-start)) ?\"))))
+ (c-append-syntax 'cpp-macro)
+ (when (and c-syntactic-indentation-in-macros macro-start)
+ (if in-macro-expr
+ (when (or
+ (< syntactic-relpos macro-start)
+ (not (or
+ (assq 'arglist-intro c-syntactic-context)
+ (assq 'arglist-cont c-syntactic-context)
+ (assq 'arglist-cont-nonempty c-syntactic-context)
+ (assq 'arglist-close c-syntactic-context))))
+ ;; If inside a cpp expression, i.e. anywhere in a
+ ;; cpp directive except a #define body, we only let
+ ;; through the syntactic analysis that is internal
+ ;; in the expression. That means the arglist
+ ;; elements, if they are anchored inside the cpp
+ ;; expression.
+ (setq c-syntactic-context nil)
+ (c-add-syntax 'cpp-macro-cont macro-start))
+ (when (and (eq macro-start syntactic-relpos)
+ (not (assq 'cpp-define-intro c-syntactic-context))
+ (save-excursion
+ (goto-char macro-start)
+ (or (not (c-forward-to-cpp-define-body))
+ (<= (point) (c-point 'boi indent-point)))))
+ ;; Inside a #define body and the syntactic analysis is
+ ;; anchored on the start of the #define. In this case
+ ;; we add cpp-define-intro to get the extra
+ ;; indentation of the #define body.
+ (c-add-syntax 'cpp-define-intro)))))
+
+ ;; return the syntax
+ c-syntactic-context)))
;; Indentation calculation.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 7c634d14e6a..f6d497569ba 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -2769,7 +2769,7 @@ Will not look before LIM."
(goto-char (cperl-beginning-of-property p look-prop))
(beginning-of-line)
(setq pre-indent-point (point)))))
- (goto-char pre-indent-point) ; Orig line skipping preceeding pod/etc
+ (goto-char pre-indent-point) ; Orig line skipping preceding pod/etc
(let* ((case-fold-search nil)
(s-s (cperl-get-state (car parse-data) (nth 1 parse-data)))
(start (or (nth 2 parse-data) ; last complete sexp terminated
@@ -2796,8 +2796,8 @@ Will not look before LIM."
(cperl-1+ char-after-pos) 'indentable)
p (1+ (cperl-beginning-of-property
(point) 'indentable))
- is-block ; misused for: preceeding line in REx
- (save-excursion ; Find preceeding line
+ is-block ; misused for: preceding line in REx
+ (save-excursion ; Find preceding line
(cperl-backward-to-noncomment p)
(beginning-of-line)
(if (<= (point) p)
@@ -2813,10 +2813,10 @@ Will not look before LIM."
prop (parse-partial-sexp p char-after-pos))
(cond ((not delim) ; End the REx, ignore is-block
(vector 'indentable 'terminator p is-block))
- (is-block ; Indent w.r.t. preceeding line
+ (is-block ; Indent w.r.t. preceding line
(vector 'indentable 'cont-line char-after-pos
is-block char-after p))
- (t ; No preceeding line...
+ (t ; No preceding line...
(vector 'indentable 'first-line p))))
((get-text-property char-after-pos 'REx-part2)
(vector 'REx-part2 (point)))
@@ -2897,7 +2897,7 @@ Will not look before LIM."
(cperl-backward-to-start-of-continued-exp containing-sexp))
(beginning-of-line)
(cperl-backward-to-noncomment containing-sexp))
- ;; Now we get non-label preceeding the indent point
+ ;; Now we get non-label preceding the indent point
(if (not (or (eq (1- (point)) containing-sexp)
(memq (preceding-char)
(append (if is-block " ;{" " ,;{") '(nil)))
@@ -4835,7 +4835,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
;;; Moreover, one takes positive approach (looks for else,grep etc)
;;; another negative (looks for bless,tr etc)
(defun cperl-after-block-p (lim &optional pre-block)
- "Return true if the preceeding } (if PRE-BLOCK, following {) delimits a block.
+ "Return true if the preceding } (if PRE-BLOCK, following {) delimits a block.
Would not look before LIM. Assumes that LIM is a good place to begin a
statement. The kind of block we treat here is one after which a new
statement would start; thus the block in ${func()} does not count."
@@ -4864,7 +4864,7 @@ statement would start; thus the block in ${func()} does not count."
(progn
(forward-sexp -1)
(looking-at "sub[ \t\n\f#]"))))))
- ;; What preceeds is not word... XXXX Last statement in sub???
+ ;; What precedes is not word... XXXX Last statement in sub???
(cperl-after-expr-p lim))))
(error nil))))
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 9f8dd79e0fc..f7965d2cd01 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -2229,8 +2229,8 @@ processed.
See also `ebnf-print-buffer'."
(interactive
- (list (read-file-name "Directory containing EBNF files (print): "
- nil default-directory)))
+ (list (read-directory-name "Directory containing EBNF files (print): "
+ nil default-directory)))
(ebnf-log-header "(ebnf-print-directory %S)" directory)
(ebnf-directory 'ebnf-print-buffer directory))
@@ -2287,8 +2287,8 @@ processed.
See also `ebnf-spool-buffer'."
(interactive
- (list (read-file-name "Directory containing EBNF files (spool): "
- nil default-directory)))
+ (list (read-directory-name "Directory containing EBNF files (spool): "
+ nil default-directory)))
(ebnf-log-header "(ebnf-spool-directory %S)" directory)
(ebnf-directory 'ebnf-spool-buffer directory))
@@ -2340,8 +2340,8 @@ processed.
See also `ebnf-eps-buffer'."
(interactive
- (list (read-file-name "Directory containing EBNF files (EPS): "
- nil default-directory)))
+ (list (read-directory-name "Directory containing EBNF files (EPS): "
+ nil default-directory)))
(ebnf-log-header "(ebnf-eps-directory %S)" directory)
(ebnf-directory 'ebnf-eps-buffer directory))
@@ -2425,8 +2425,8 @@ are processed.
See also `ebnf-syntax-buffer'."
(interactive
- (list (read-file-name "Directory containing EBNF files (syntax): "
- nil default-directory)))
+ (list (read-directory-name "Directory containing EBNF files (syntax): "
+ nil default-directory)))
(ebnf-log-header "(ebnf-syntax-directory %S)" directory)
(ebnf-directory 'ebnf-syntax-buffer directory))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 32ab52228f9..a4c9b7fccba 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -72,7 +72,9 @@ SYMBOL should be one of `grep-command', `grep-template',
Some grep programs are able to surround matches with special
markers in grep output. Such markers can be used to highlight
-matches in grep mode.
+matches in grep mode. This requires `font-lock-mode' to be active
+in grep buffers, so if you have globally disabled font-lock-mode,
+you will not get highlighting.
This option sets the environment variable GREP_COLORS to specify
markers for highlighting and GREP_OPTIONS to add the --color
@@ -462,6 +464,8 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(when (eq grep-highlight-matches 'auto-detect)
(grep-compute-defaults))
(unless (or (eq grep-highlight-matches 'auto-detect)
+ ;; Uses font-lock to parse color escapes. (Bug#8084)
+ (null font-lock-mode)
(null grep-highlight-matches))
;; `setenv' modifies `process-environment' let-bound in `compilation-start'
;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 6e175da1414..53918b903ee 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3218,7 +3218,7 @@ Treats actions as defuns."
t)
;;;###autoload
-(define-derived-mode gdb-script-mode nil "GDB-Script"
+(define-derived-mode gdb-script-mode prog-mode "GDB-Script"
"Major mode for editing GDB scripts."
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'comment-start-skip) "#+\\s-*")
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 30d9fc21867..5b7e07a5aad 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -428,7 +428,7 @@ path \(the value of !PATH). However, under Windows and MacOS
variable can be set to specify the paths where IDLWAVE can find PRO
files. The shell will only be asked for a list of paths when this
variable is nil. The value is a list of directories. A directory
-preceeded by a `+' will be searched recursively. If you set this
+preceded by a `+' will be searched recursively. If you set this
variable on a UNIX system, the shell will not be queried. See also
`idlwave-system-directory'."
:group 'idlwave-routine-info
@@ -1197,7 +1197,7 @@ As a user, you should not set this to t.")
(2 font-lock-function-name-face)))
;; Keyword parameters, like /xlog or ,xrange=[]
- ;; This is anchored to the comma preceeding the keyword.
+ ;; This is anchored to the comma preceding the keyword.
;; Treats continuation lines, works only during whole buffer
;; fontification. Slow, use it only in fancy fontification.
(keyword-parameters
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 45d967e92d9..62472edfbe4 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1715,7 +1715,7 @@ If COMPILEP is non-nil, compile, otherwise consult."
;; Font-lock stuff
;;-------------------------------------------------------------------
-;; Auxilliary functions
+;; Auxiliary functions
(defun prolog-make-keywords-regexp (keywords &optional protect)
"Create regexp from the list of strings KEYWORDS.
If PROTECT is non-nil, surround the result regexp by word breaks."
@@ -3777,7 +3777,7 @@ If the point is not on a variable then insert underscore."
(defun prolog-find-term (functor arity &optional prefix)
- "Go to the position at the start of the next occurance of a term.
+ "Go to the position at the start of the next occurrence of a term.
The term is specified with FUNCTOR and ARITY. The optional argument
PREFIX is the prefix of the search regexp."
(let* (;; If prefix is not set then use the default "\\<"
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 9e49f0e775b..1c1ffc41624 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2801,7 +2801,7 @@ server/database name."
(defun sql-rename-buffer (&optional new-name)
"Rename a SQL interactive buffer.
-Prompts for the new name if command is preceeded by
+Prompts for the new name if command is preceded by
\\[universal-argument]. If no buffer name is provided, then the
`sql-alternate-buffer-name' is used.
@@ -3262,7 +3262,7 @@ you must tell Emacs. Here's how to do that in your `~/.emacs' file:
:abbrev-table sql-mode-abbrev-table
(if sql-mode-menu
(easy-menu-add sql-mode-menu)); XEmacs
-
+
(set (make-local-variable 'comment-start) "--")
;; Make each buffer in sql-mode remember the "current" SQLi buffer.
(make-local-variable 'sql-buffer)
@@ -4257,4 +4257,3 @@ buffer.
(provide 'sql)
;;; sql.el ends here
-
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index cb1d3c24a94..75b706b74ec 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1775,7 +1775,7 @@ NOTE: Activate the new setting by restarting Emacs.
(defcustom vhdl-intelligent-tab t
"*Non-nil means `TAB' does indentation, word completion and tab insertion.
-That is, if preceeding character is part of a word then complete word,
+That is, if preceding character is part of a word then complete word,
else if not at beginning of line then insert tab,
else if last command was a `TAB' or `RET' then dedent one step,
else indent current line (i.e. `TAB' is bound to `vhdl-electric-tab').
@@ -6946,7 +6946,7 @@ only-lines."
;; Indentation commands
(defun vhdl-electric-tab (&optional prefix-arg)
- "If preceeding character is part of a word or a paren then hippie-expand,
+ "If preceding character is part of a word or a paren then hippie-expand,
else if right of non whitespace on line then insert tab,
else if last command was a tab or return then dedent one step or if a comment
toggle between normal indent and inline comment indent,
@@ -10396,7 +10396,7 @@ with double-quotes is to be inserted. DEFAULT specifies a default string."
(if vhdl-upper-case-keywords (upcase-word num) (downcase-word num)))
(defun vhdl-minibuffer-tab (&optional prefix-arg)
- "If preceeding character is part of a word or a paren then hippie-expand,
+ "If preceding character is part of a word or a paren then hippie-expand,
else insert tab (used for word completion in VHDL minibuffer)."
(interactive "P")
(cond
@@ -13056,7 +13056,7 @@ hierarchy otherwise.")
;; Scan functions
(defun vhdl-scan-context-clause ()
- "Scan the context clause that preceeds a design unit."
+ "Scan the context clause that precedes a design unit."
(let (lib-alist)
(save-excursion
(when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 19431c30d68..b51eb944696 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6645,7 +6645,8 @@ If FACE is not a valid face name, use default face."
(error "Unprinted PostScript"))))
(cond ((fboundp 'add-hook)
- (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check))
+ (unless noninteractive
+ (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)))
(kill-emacs-hook
(message "Won't override existing `kill-emacs-hook'"))
(t
diff --git a/lisp/recentf.el b/lisp/recentf.el
index d0be69b51fc..9f9baad8dbd 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -411,13 +411,14 @@ That is, if it doesn't match any of the `recentf-exclude' checks."
(checks recentf-exclude)
(keepit t))
(while (and checks keepit)
- (setq keepit (condition-case nil
- (not (if (stringp (car checks))
- ;; A regexp
- (string-match (car checks) filename)
- ;; A predicate
- (funcall (car checks) filename)))
- (error nil))
+ ;; If there was an error in a predicate, err on the side of
+ ;; keeping the file. (Bug#5843)
+ (setq keepit (not (ignore-errors
+ (if (stringp (car checks))
+ ;; A regexp
+ (string-match (car checks) filename)
+ ;; A predicate
+ (funcall (car checks) filename))))
checks (cdr checks)))
keepit))
diff --git a/lisp/replace.el b/lisp/replace.el
index 0f8adea2aca..928c3170c65 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1531,7 +1531,7 @@ N (match-string N) (where N is a string of digits)
#& (string-to-number (match-string 0))
# replace-count
-Note that these symbols must be preceeded by a backslash in order to
+Note that these symbols must be preceded by a backslash in order to
type them using Lisp syntax."
(while (consp n)
(cond
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index b7d43bd230a..c10b5cbb7ec 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -300,7 +300,8 @@ may have changed\) back to `save-place-alist'."
(add-hook 'find-file-hook 'save-place-find-file-hook t)
-(add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook))
(add-hook 'kill-buffer-hook 'save-place-to-alist)
diff --git a/lisp/shell.el b/lisp/shell.el
index ea89ce765c3..2f11cc6314c 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -569,9 +569,9 @@ Otherwise, one argument `-i' is passed to the shell.
;; of the current-buffer rather than of the *shell* buffer.
(setq default-directory
(expand-file-name
- (read-file-name
+ (read-directory-name
"Default directory: " default-directory default-directory
- t nil 'file-directory-p))))))))
+ t nil))))))))
(require 'ansi-color)
(setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))
(comint-check-proc (current-buffer)))
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index dad2a4c82ac..d160a836359 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1622,7 +1622,7 @@ Files can be renamed to new names or moved to new directories."
(let ((f (speedbar-line-file)))
(if f
(let* ((basedir (file-name-directory f))
- (nd (read-file-name "Create directory: "
+ (nd (read-directory-name "Create directory: "
basedir)))
;; Make the directory
(make-directory nd t)
diff --git a/lisp/term/screen.el b/lisp/term/screen.el
new file mode 100644
index 00000000000..4931a422e09
--- /dev/null
+++ b/lisp/term/screen.el
@@ -0,0 +1,11 @@
+;; -*- no-byte-compile: t -*-
+;; Treat a screen terminal similar to an xterm.
+(load "term/xterm")
+
+(defun terminal-init-screen ()
+ "Terminal initialization function for screen."
+ ;; Use the xterm color initialization code.
+ (xterm-register-default-colors)
+ (tty-set-up-initial-frame-faces))
+
+;; screen.el ends here
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index f1e73dcf480..5fbc8a643d8 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -422,7 +422,7 @@ be in `artist-spray-chars', or spraying will behave strangely.")
(defvar artist-mode-name " Artist"
"Name of Artist mode beginning with a space (appears in the mode-line).")
-(defvar artist-curr-go 'pen-char
+(defvar artist-curr-go 'pen-line
"Current selected graphics operation.")
(make-variable-buffer-local 'artist-curr-go)
@@ -502,6 +502,49 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(defvar artist-arrow-point-1 nil)
(defvar artist-arrow-point-2 nil)
+(defvar artist-menu-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [spray-chars]
+ '(menu-item "Characters for Spray" artist-select-spray-chars
+ :help "Choose characters for sprayed by the spray-can"))
+ (define-key map [borders]
+ '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes
+ :help "Toggle whether shapes are drawn with borders"
+ :button (:toggle . (not artist-borderless-shapes))))
+ (define-key map [trimming]
+ '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings
+ :help "Toggle trimming of line-endings"
+ :button (:toggle . artist-trim-line-endings)))
+ (define-key map [rubber-band]
+ '(menu-item "Rubber-banding" artist-toggle-rubber-banding
+ :help "Toggle rubber-banding"
+ :button (:toggle . artist-rubber-banding)))
+ (define-key map [set-erase]
+ '(menu-item "Character to Erase..." artist-select-erase-char
+ :help "Choose a specific character to erase"))
+ (define-key map [set-line]
+ '(menu-item "Character for Line..." artist-select-line-char
+ :help "Choose the character to insert when drawing lines"))
+ (define-key map [set-fill]
+ '(menu-item "Character for Fill..." artist-select-fill-char
+ :help "Choose the character to insert when filling in shapes"))
+ (define-key map [artist-separator] '(menu-item "--"))
+ (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines)
+ ("Erase" artist-select-op-erase-rectangle erase-rect)
+ ("Spray-can" artist-select-op-spray-set-size spray-get-size)
+ ("Text" artist-select-op-text-overwrite text-ovwrt)
+ ("Ellipse" artist-select-op-circle circle)
+ ("Poly-line" artist-select-op-straight-poly-line spolyline)
+ ("Rectangle" artist-select-op-square square)
+ ("Line" artist-select-op-straight-line s-line)
+ ("Pen" artist-select-op-pen-line pen-line)))
+ (define-key map (vector (nth 2 op))
+ `(menu-item ,(nth 0 op)
+ ,(nth 1 op)
+ :help ,(format "Draw using the %s style" (nth 0 op))
+ :button (:radio . (eq artist-curr-go ',(nth 2 op))))))
+ map))
+
(defvar artist-mode-map
(let ((map (make-sparse-keymap)))
(setq artist-mode-map (make-sparse-keymap))
@@ -554,6 +597,7 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(define-key map "\C-c\C-a\C-y" 'artist-select-op-paste)
(define-key map "\C-c\C-af" 'artist-select-op-flood-fill)
(define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report)
+ (define-key map [menu-bar artist] (cons "Artist" artist-menu-map))
map)
"Keymap for `artist-minor-mode'.")
@@ -4601,6 +4645,10 @@ If optional argument STATE is positive, turn borders on."
(artist-arrow-point-set-state artist-arrow-point-2 new-state)))))
+(defun artist-select-op-pen-line ()
+ "Select drawing pen lines."
+ (interactive)
+ (artist-select-operation "Pen Line"))
(defun artist-select-op-line ()
"Select drawing lines."
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 70f11cf66dc..a0892b5ebba 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -43,7 +43,7 @@ only considered as a candidate to match `paragraph-start' or
Prefix argument says to turn mode on if positive, off if negative.
When the mode is turned on, if there are newlines in the buffer but no hard
-newlines, ask the user whether to mark as hard any newlines preceeding a
+newlines, ask the user whether to mark as hard any newlines preceding a
`paragraph-start' line. From a program, second arg INSERT specifies whether
to do this; it can be `never' to change nothing, t or `always' to force
marking, `guess' to try to do the right thing with no questions, nil
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 6719a647c36..7e150bff997 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -567,7 +567,7 @@ on the menu bar.
"Save RefTeX's parse file for this buffer if the information has changed."
;; Save the parsing information if it was modified.
;; This function should be installed in `kill-buffer-hook'.
- ;; We are careful to make sure nothing goes wring in this function.
+ ;; We are careful to make sure nothing goes wrong in this function.
(when (and (boundp 'reftex-mode) reftex-mode
(boundp 'reftex-save-parse-info) reftex-save-parse-info
(boundp 'reftex-docstruct-symbol) reftex-docstruct-symbol
@@ -2397,7 +2397,7 @@ IGNORE-WORDS List of words which should be removed from the string."
(define-key reftex-mode-map
reftex-extra-bindings-prefix
reftex-extra-bindings-map))
-
+
;;; =========================================================================
;;;
@@ -2568,7 +2568,8 @@ With optional NODE, go directly to that node."
;;; Install the kill-buffer and kill-emacs hooks ------------------------------
(add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook)
-(add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook))
;;; Run Hook ------------------------------------------------------------------
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 2229dc6c9e8..314fbf9671b 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -427,7 +427,12 @@ a DOCTYPE or an XML declaration."
(format-mode-line mode-name))))))
(defun sgml-fill-nobreak ()
- ;; Don't break between a tag name and its first argument.
+ "Don't break between a tag name and its first argument.
+This function is designed for use in `fill-nobreak-predicate'.
+
+ <a href=\"some://where\" type=\"text/plain\">
+ ^ ^
+ | no break here | but still allowed here"
(save-excursion
(skip-chars-backward " \t")
(and (not (zerop (skip-syntax-backward "w_")))
diff --git a/lisp/time.el b/lisp/time.el
index 1bc1cca1112..2e9dd252bd6 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -157,7 +157,7 @@ LABEL is a string to display as the label of that TIMEZONE's time."
;; Determine if zoneinfo style timezones are supported by testing that
;; America/New York and Europe/London return different timezones.
(let (gmt nyt)
- (set-time-zone-rule "America/New York")
+ (set-time-zone-rule "America/New_York")
(setq nyt (format-time-string "%z"))
(set-time-zone-rule "Europe/London")
(setq gmt (format-time-string "%z"))
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 59e442a89c3..8e5fe27f965 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1266,7 +1266,7 @@ a diff with \\[diff-reverse-direction].
;; Set up `whitespace-mode' so that turning it on will show trailing
;; whitespace problems on the modified lines of the diff.
- (set (make-local-variable 'whitespace-style) '(trailing))
+ (set (make-local-variable 'whitespace-style) '(face trailing))
(set (make-local-variable 'whitespace-trailing-regexp)
"^[-\+!<>].*?\\([\t ]+\\)$")
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index ff1f7f6b017..0d904ec85c4 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -560,7 +560,6 @@ See the documentation string of `ediff-focus-on-regexp-matches' for details.")
:group 'ediff)
-(ediff-defvar-local ediff-use-faces t "")
(defcustom ediff-use-faces t
"If t, differences are highlighted using faces, if device supports faces.
If nil, differences are highlighted using ASCII flags, ediff-before-flag
@@ -568,6 +567,7 @@ and ediff-after-flag. On a non-window system, differences are always
highlighted using ASCII flags."
:type 'boolean
:group 'ediff-highlighting)
+(ediff-defvar-local ediff-use-faces t "")
;; this indicates that diff regions are word-size, so fine diffs are
;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
@@ -604,13 +604,13 @@ meaning of this variable."
:type 'boolean
:group 'ediff)
-(ediff-defvar-local ediff-highlight-all-diffs t "")
(defcustom ediff-highlight-all-diffs t
"If nil, only the selected differences are highlighted.
Otherwise, all difference regions are highlighted, but the selected region is
shown in brighter colors."
:type 'boolean
:group 'ediff-highlighting)
+(ediff-defvar-local ediff-highlight-all-diffs t "")
;; The suffix of the control buffer name.
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index ee34944e448..601b6b1e597 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -1271,10 +1271,10 @@ Otherwise, the A or B file present is copied to the output file."
(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
(interactive
(list
- (read-file-name "A directory: " nil nil 'confirm)
- (read-file-name "B directory: " nil nil 'confirm)
- (read-file-name "Ancestor directory (null for none): " nil nil 'confirm)
- (read-file-name "Output directory (null for none): " nil nil 'confirm)))
+ (read-directory-name "A directory: " nil nil 'confirm)
+ (read-directory-name "B directory: " nil nil 'confirm)
+ (read-directory-name "Ancestor directory (null for none): " nil nil 'confirm)
+ (read-directory-name "Output directory (null for none): " nil nil 'confirm)))
;; Check that we're not on a line
(if (not (and (bolp) (eolp)))
(error "There is text on this line"))
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 5e6e054924c..a0a16601ed7 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -182,10 +182,19 @@ in the repository root directory of FILE."
;; format 3' in the first line.
;; If the `checkout/dirstate' file cannot be parsed, fall back to
;; running `vc-bzr-state'."
+ ;;
+ ;; The format of the dirstate file is explained in bzrlib/dirstate.py
+ ;; in the bzr distribution. Basically:
+ ;; header-line giving the version of the file format in use.
+ ;; a few lines of stuff
+ ;; entries, one per line, with null-separated fields. Each line:
+ ;; entry_key = dirname (may be empty), basename, file-id
+ ;; current = common ( = kind, fingerprint, size, executable )
+ ;; + working ( = packed_stat )
+ ;; parent = common ( as above ) + history ( = rev_id )
+ ;; kinds = (r)elocated, (a)bsent, (d)irectory, (f)ile, (l)ink
(lexical-let ((root (vc-bzr-root file)))
(when root ; Short cut.
- ;; This looks at internal files. May break if they change
- ;; their format.
(lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root)))
(condition-case nil
(with-temp-buffer
@@ -210,13 +219,14 @@ in the repository root directory of FILE."
;; was executable the last time bzr checked?
"[^\0]*\0"
"[^\0]*\0" ;?
- "\\([^\0]*\\)\0" ;"a/f/d" a=added?
+ ;; Parent information. Absent in a new repo.
+ "\\(?:\\([^\0]*\\)\0" ;"a/f/d" a=added?
"\\([^\0]*\\)\0" ;sha1 again?
"\\([^\0]*\\)\0" ;size again?
;; y/n. Whether or not the repo thinks
;; the file should be executable?
"\\([^\0]*\\)\0"
- "[^\0]*\0" ;last revid?
+ "[^\0]*\0\\)?" ;last revid?
;; There are more fields when merges are pending.
)
nil t)
@@ -226,7 +236,10 @@ in the repository root directory of FILE."
;; conflict markers).
(cond
((eq (char-after (match-beginning 1)) ?a) 'removed)
- ((eq (char-after (match-beginning 4)) ?a) 'added)
+ ;; If there is no parent, this must be a new repo.
+ ;; If file is in dirstate, can only be added (b#8025).
+ ((or (not (match-beginning 4))
+ (eq (char-after (match-beginning 4)) ?a)) 'added)
((or (and (eq (string-to-number (match-string 3))
(nth 7 (file-attributes file)))
(equal (match-string 5)
@@ -866,38 +879,40 @@ stream. Standard error output is discarded."
(result nil))
(goto-char (point-min))
(while (not (eobp))
- (setq status-str
- (buffer-substring-no-properties (point) (+ (point) 3)))
- (setq translated (cdr (assoc status-str translation)))
- (cond
- ((eq translated 'conflict)
- ;; For conflicts the file appears twice in the listing: once
- ;; with the M flag and once with the C flag, so take care
- ;; not to add it twice to `result'. Ugly.
- (let* ((file
- (buffer-substring-no-properties
- ;;For files with conflicts the format is:
- ;;C Text conflict in FILENAME
- ;; Bah.
- (+ (point) 21) (line-end-position)))
- (entry (assoc file result)))
- (when entry
- (setf (nth 1 entry) 'conflict))))
- ((eq translated 'renamed)
- (re-search-forward "R[ M] \\(.*\\) => \\(.*\\)$" (line-end-position) t)
- (let ((new-name (file-relative-name (match-string 2) relative-dir))
- (old-name (file-relative-name (match-string 1) relative-dir)))
- (push (list new-name 'edited
- (vc-bzr-create-extra-fileinfo old-name)) result)))
- ;; do nothing for non existent files
- ((eq translated 'not-found))
- (t
- (push (list (file-relative-name
- (buffer-substring-no-properties
- (+ (point) 4)
- (line-end-position)) relative-dir)
- translated) result)))
- (forward-line))
+ ;; Bzr 2.3.0 added this if there are shelves. (Bug#8170)
+ (unless (looking-at "[1-9]+ shel\\(f\\|ves\\) exists?\\.")
+ (setq status-str
+ (buffer-substring-no-properties (point) (+ (point) 3)))
+ (setq translated (cdr (assoc status-str translation)))
+ (cond
+ ((eq translated 'conflict)
+ ;; For conflicts the file appears twice in the listing: once
+ ;; with the M flag and once with the C flag, so take care
+ ;; not to add it twice to `result'. Ugly.
+ (let* ((file
+ (buffer-substring-no-properties
+ ;;For files with conflicts the format is:
+ ;;C Text conflict in FILENAME
+ ;; Bah.
+ (+ (point) 21) (line-end-position)))
+ (entry (assoc file result)))
+ (when entry
+ (setf (nth 1 entry) 'conflict))))
+ ((eq translated 'renamed)
+ (re-search-forward "R[ M] \\(.*\\) => \\(.*\\)$" (line-end-position) t)
+ (let ((new-name (file-relative-name (match-string 2) relative-dir))
+ (old-name (file-relative-name (match-string 1) relative-dir)))
+ (push (list new-name 'edited
+ (vc-bzr-create-extra-fileinfo old-name)) result)))
+ ;; do nothing for non existent files
+ ((eq translated 'not-found))
+ (t
+ (push (list (file-relative-name
+ (buffer-substring-no-properties
+ (+ (point) 4)
+ (line-end-position)) relative-dir)
+ translated) result))))
+ (forward-line))
(funcall update-function result)))
(defun vc-bzr-dir-status (dir update-function)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 38fbaaedd32..d4970207b94 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -265,6 +265,7 @@ See `run-hooks'."
(define-key map [C-up] 'vc-dir-previous-directory)
;; The remainder.
(define-key map "f" 'vc-dir-find-file)
+ (define-key map "e" 'vc-dir-find-file) ; dired-mode compatibility
(define-key map "\C-m" 'vc-dir-find-file)
(define-key map "o" 'vc-dir-find-file-other-window)
(define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
@@ -1184,9 +1185,9 @@ These are the commands available for use in the file status buffer:
;; therefore it makes sense to always do that.
;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
;; you may get a new *vc-dir* buffer, different from the original
- (file-truename (read-file-name "VC status for directory: "
- default-directory default-directory t
- nil #'file-directory-p))
+ (file-truename (read-directory-name "VC status for directory: "
+ default-directory default-directory t
+ nil))
(if current-prefix-arg
(intern
(completing-read
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index d3a64f15f9e..488efaa3522 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -25,14 +25,10 @@
;; See vc.el
-;; Some features will not work with old RCS versions. Where
+;; Some features will not work with ancient RCS versions. Where
;; appropriate, VC finds out which version you have, and allows or
-;; disallows those features (stealing locks, for example, works only
-;; from 5.6.2 onwards).
-;; Even initial checkins will fail if your RCS version is so old that ci
-;; doesn't understand -t-; this has been known to happen to people running
-;; NExTSTEP 3.0.
-;;
+;; disallows those features.
+
;; You can support the RCS -x option by customizing vc-rcs-master-templates.
;;; Code:
@@ -391,7 +387,7 @@ whether to remove it."
(vc-rcs-set-default-branch file
(if (vc-rcs-trunk-p new-version) nil
(vc-branch-part new-version)))
- ;; If this is an old RCS release, we might have
+ ;; If this is an old (pre-1992!) RCS release, we might have
;; to remove a remaining lock.
(if (not (vc-rcs-release-p "5.6.2"))
;; exit status of 1 is also accepted.
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 20c7689f401..7362258a42d 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -174,7 +174,9 @@ If you want to force an empty list of arguments, use t."
(while (re-search-forward re nil t)
(let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
(propstat (cdr (assq (aref (match-string 2) 0) state-map)))
- (filename (match-string 4)))
+ (filename (if (memq system-type '(windows-nt ms-dos))
+ (replace-regexp-in-string "\\\\" "/" (match-string 4))
+ (match-string 4))))
(and (memq propstat '(conflict edited))
(not (eq state 'conflict)) ; conflict always wins
(setq state propstat))
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 02743847800..200291bd925 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1954,7 +1954,7 @@ checked out in that new branch."
;; For VC's that do not work at file level, it's pointless
;; to ask for a directory, branches are created at repository level.
default-directory
- (read-file-name "Directory: " default-directory default-directory t))
+ (read-directory-name "Directory: " default-directory default-directory t))
(read-string (if current-prefix-arg "New branch name: " "New tag name: "))
current-prefix-arg)))
(message "Making %s... " (if branchp "branch" "tag"))
@@ -1980,7 +1980,7 @@ allowed and simply skipped)."
;; For VC's that do not work at file level, it's pointless
;; to ask for a directory, branches are created at repository level.
default-directory
- (read-file-name "Directory: " default-directory default-directory t))
+ (read-directory-name "Directory: " default-directory default-directory t))
(read-string "Tag name to retrieve (default latest revisions): "))))
(let ((update (yes-or-no-p "Update any affected buffers? "))
(msg (if (or (not name) (string= name ""))
diff --git a/lisp/window.el b/lisp/window.el
index af5d9a5b16b..c3f8de6f9dd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -106,11 +106,12 @@ even if it is active. Otherwise, the minibuffer is counted
when it is active.
The optional arg ALL-FRAMES t means count windows on all frames.
-If it is `visible', count windows on all visible frames.
-ALL-FRAMES nil or omitted means count only the selected frame,
-plus the minibuffer it uses (which may be on another frame).
-ALL-FRAMES 0 means count all windows in all visible or iconified frames.
-If ALL-FRAMES is anything else, count only the selected frame."
+If it is `visible', count windows on all visible frames on the
+current terminal. ALL-FRAMES nil or omitted means count only the
+selected frame, plus the minibuffer it uses (which may be on
+another frame). ALL-FRAMES 0 means count all windows in all
+visible or iconified frames on the current terminal. If
+ALL-FRAMES is anything else, count only the selected frame."
(let ((base-window (selected-window)))
(if (and nomini (eq base-window (minibuffer-window)))
(setq base-window (next-window base-window)))
@@ -169,9 +170,9 @@ ALL-FRAMES nil or omitted means cycle through all windows on the
ALL-FRAMES t means cycle through all windows on all existing
frames.
ALL-FRAMES `visible' means cycle through all windows on all
- visible frames.
+ visible frames on the current terminal.
ALL-FRAMES 0 means cycle through all windows on all visible and
- iconified frames.
+ iconified frames on the current terminal.
ALL-FRAMES a frame means cycle through all windows on that frame
only.
Anything else means cycle through all windows on the selected
@@ -1067,9 +1068,11 @@ when the specified buffer is already displayed. If the buffer is
already displayed in some window on one of these frames simply
return that window. Possible values of FRAME are:
-`visible' - consider windows on all visible frames.
+`visible' - consider windows on all visible frames on the current
+terminal.
-0 - consider windows on all visible or iconified frames.
+0 - consider windows on all visible or iconified frames on the
+current terminal.
t - consider windows on all frames.
@@ -1079,7 +1082,7 @@ nil - consider windows on the selected frame \(actually the
last non-minibuffer frame\) only. If, however, either
`display-buffer-reuse-frames' or `pop-up-frames' is non-nil
\(non-nil and not graphic-only on a text-only terminal),
-consider all visible or iconified frames."
+consider all visible or iconified frames on the current terminal."
(interactive "BDisplay buffer:\nP")
(let* ((can-use-selected-window
;; The selected window is usable unless either NOT-THIS-WINDOW