summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa <handa@etlken>2010-05-19 10:10:29 +0900
committerKenichi Handa <handa@etlken>2010-05-19 10:10:29 +0900
commit134d1bcded02e066727ece838f14ffc767f76419 (patch)
tree2187c2ac9748400146394bdaefd59f314598685d /lisp
parent2833d9158d6315b59415173df5d47515faac5310 (diff)
parent1fc0ce04bc651fe8adbe822515e4ea7a4e904249 (diff)
downloademacs-134d1bcded02e066727ece838f14ffc767f76419.tar.gz
emacs-134d1bcded02e066727ece838f14ffc767f76419.tar.bz2
emacs-134d1bcded02e066727ece838f14ffc767f76419.zip
merge trunk
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog129
-rw-r--r--lisp/Makefile.in9
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/calc/README2
-rw-r--r--lisp/calc/calc-aent.el21
-rw-r--r--lisp/calc/calc-bin.el2
-rw-r--r--lisp/calc/calc-ext.el5
-rw-r--r--lisp/calc/calc-lang.el24
-rw-r--r--lisp/calc/calc-store.el2
-rw-r--r--lisp/calc/calc-units.el22
-rw-r--r--lisp/calc/calc-vec.el71
-rw-r--r--lisp/calc/calc.el3
-rw-r--r--lisp/calc/calccomp.el8
-rw-r--r--lisp/dos-fns.el35
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
-rw-r--r--lisp/emacs-lisp/smie.el688
-rw-r--r--lisp/files.el26
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-sum.el8
-rw-r--r--lisp/international/mule-cmds.el2
-rw-r--r--lisp/language/hebrew.el4
-rw-r--r--lisp/org/org-docview.el5
-rw-r--r--lisp/pcomplete.el17
-rw-r--r--lisp/progmodes/asm-mode.el12
-rw-r--r--lisp/progmodes/prolog.el135
-rw-r--r--lisp/progmodes/sh-script.el125
-rw-r--r--lisp/progmodes/sql.el32
-rw-r--r--lisp/simple.el19
-rw-r--r--lisp/subr.el25
-rw-r--r--lisp/version.el6
-rw-r--r--lisp/w32-fns.el13
31 files changed, 1172 insertions, 293 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 21d0e827f67..d0fc357c4ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,10 +4,127 @@
composition-function-table only for combining characters (Mn, Mc,
Me).
+2010-05-18 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/prolog.el (smie-indent-basic): Declare for byte-compiler.
+
+ * emacs-lisp/smie.el (smie-precs-precedence-table, smie-backward-sexp)
+ (smie-forward-sexp, smie-indent-calculate): Fix typos in docstrings.
+
+2010-05-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Provide a simple generic indentation engine and use it for Prolog.
+ * emacs-lisp/smie.el: New file.
+ * progmodes/prolog.el (prolog-smie-op-levels)
+ (prolog-smie-indent-rules): New var.
+ (prolog-mode-variables): Use them to configure SMIE.
+ (prolog-indent-line, prolog-indent-level): Remove.
+
+2010-05-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-vec.el (math-vector-avg): Put the vector elements in
+ order before computing the averages.
+
+2010-05-16 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-vec.el (calc-histogram):
+ (calcFunc-histogram): Allow vectors as inputs.
+ (math-vector-avg): New function.
+
+ * calc/calc-ext.el (math-group-float): Have the number of digits
+ being grouped depend on the radix (Bug#6189).
+
+2010-05-15 Ken Raeburn <raeburn@raeburn.org>
+
+ * version.el (emacs-copyright, emacs-version): Don't define here,
+ now that emacs.c defines it.
+
+2010-05-15 Eli Zaretskii <eliz@gnu.org>
+
+ * international/mule-cmds.el (mule-menu-keymap): Fix definition of
+ "Describe Language Environment" menu item.
+
+ * language/hebrew.el ("Hebrew", "Windows-1255"): Doc fix.
+
+ Bidi-sensitive movement with arrow keys.
+ * subr.el (right-arrow-command, left-arrow-command): New functions.
+
+ * bindings.el (global-map): Bind them to right and left arrow keys.
+
+ Don't override standard definition of convert-standard-filename.
+ * files.el (convert-standard-filename): Call
+ w32-convert-standard-filename and dos-convert-standard-filename on
+ the corresponding systems.
+
+ * w32-fns.el (w32-convert-standard-filename): Rename from
+ convert-standard-filename. Doc fix.
+
+ * dos-fns.el (dos-convert-standard-filename): Doc fix.
+ (convert-standard-filename): Don't defalias.
+ (register-name-alist, make-register, register-value)
+ (set-register-value, intdos): Obsolete aliases for the
+ corresponding dos-* functions and variables.
+ (dos-intdos): Add a doc string.
+
+2010-05-15 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-aent.el (math-read-token, math-find-user-tokens):
+ * calc/calc-lang.el (math-read-big-rec, math-lang-read-symbol):
+ (math-compose-tex-func):
+ * calc/calccomp.el (math-compose-expr):
+ * calc/calc-ext.el (math-format-flat-expr-fancy):
+ * calc/calc-store.el (calc-read-var-name):
+ * calc/calc-units.el (calc-explain-units-rec): Allow Greek letters.
+
+ * calc/calc.el (var-π, var-φ, var-γ): New variables.
+ * calc/calc-aent.el (math-read-replacement-list): Add "micro" symbol.
+ * calc/calc-units.el (math-unit-prefixes): Add mu for micro.
+ (math-standard-units): Add units.
+
+2010-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/asm-mode.el (asm-mode):
+ * progmodes/prolog.el (prolog-mode): Use define-derived-mode.
+
+ * pcomplete.el (pcomplete-completions-at-point): New function,
+ extracted from pcomplete-std-complete.
+ (pcomplete-std-complete): Use it.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
+ Remove references to CVS, RCS and Old directories.
+
+2010-05-14 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-bin.el (math-format-twos-complement): Group digits when
+ appropriate.
+
+2010-05-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sh-script.el (sh-mode-default-syntax-table): Remove.
+ (sh-mode-syntax-table): Give it a default value instead.
+ (sh-header-marker): Make buffer-local.
+ (sh-mode): Move make-local-variable to the corresponding setq.
+ (sh-add-completer): Avoid gratuitously let-binding a buffer-local var.
+ Use complete-with-action.
+
+ * simple.el (prog-mode): New (abstract) major mode.
+ * emacs-lisp/lisp-mode.el (emacs-lisp-mode, lisp-mode): Use it.
+ * progmodes/sh-script.el (sh-mode): Remove redundant var assignment.
+
+2010-05-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/sql.el (sql-oracle-program): Reflow docstring.
+ (sql-oracle-scan-on, sql-sybase-program, sql-product-font-lock)
+ (sql-add-product-keywords, sql-highlight-product, sql-set-product)
+ (sql-make-alternate-buffer-name, sql-placeholders-filter)
+ (sql-escape-newlines-filter, sql-input-sender)
+ (sql-send-magic-terminator, sql-sybase): Fix typos in docstrings.
+
2010-05-13 Chong Yidong <cyd@stupidchicken.com>
- Add TeX open-block and close-block keybindings to SGML, and vice
- versa.
+ Add TeX open-block and close-block keybindings to SGML, and vice versa.
* textmodes/tex-mode.el (tex-mode-map): Bind C-c C-t to
latex-open-block and C-c / to latex-close-block.
@@ -21,8 +138,8 @@
only when the message would be displayed. Handled nested calls.
(tramp-handle-load, tramp-handle-file-local-copy)
(tramp-handle-insert-file-contents, tramp-handle-write-region)
- (tramp-maybe-send-script, tramp-find-shell): Use
- `with-progress-reporter'.
+ (tramp-maybe-send-script, tramp-find-shell):
+ Use `with-progress-reporter'.
(tramp-handle-dired-compress-file, tramp-maybe-open-connection):
Fix message text.
@@ -313,7 +430,7 @@
* Version 23.2 released.
-2010-05-07 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
+2010-05-07 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
Stefan Monnier <monnier@iro.umontreal.ca>
Highlight vendor specific properties.
@@ -334,7 +451,7 @@
* simple.el (auto-save-mode): Move from files.el.
* minibuffer.el (completion--common-suffix): Fix copy&paste error.
-2010-05-07 Christian von Roques <roques@mti.ag> (tiny change)
+2010-05-07 Christian von Roques <roques@mti.ag> (tiny change)
* lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592).
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index fe7dcfa4e99..4effdddff6a 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -84,28 +84,25 @@ COMPILE_FIRST = \
emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
# Common command to find subdirectories
-
setwins=subdirs=`(find . -type d -print)`; \
for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
+ case $$file in */.* | */.*/* | */=* ) ;; \
*) wins="$$wins $$file" ;; \
esac; \
done
# Find all subdirectories except `obsolete' and `term'.
-
setwins_almost=subdirs=`(find . -type d -print)`; \
for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
+ case $$file in */.* | */.*/* | */=* | */obsolete | */term ) ;; \
*) wins="$$wins $$file" ;; \
esac; \
done
# Find all subdirectories in which we might want to create subdirs.el
-
setwins_for_subdirs=subdirs=`(find . -type d -print)`; \
for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \
+ case $$file in */.* | */.*/* | */=* | */cedet* ) ;; \
*) wins="$$wins $$file" ;; \
esac; \
done
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 05a0ac8bc11..14cebfeda8f 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -828,9 +828,9 @@ is okay. See `mode-line-format'.")
(define-key global-map [C-home] 'beginning-of-buffer)
(define-key global-map [M-home] 'beginning-of-buffer-other-window)
(define-key esc-map [home] 'beginning-of-buffer-other-window)
-(define-key global-map [left] 'backward-char)
+(define-key global-map [left] 'left-arrow-command)
(define-key global-map [up] 'previous-line)
-(define-key global-map [right] 'forward-char)
+(define-key global-map [right] 'right-arrow-command)
(define-key global-map [down] 'next-line)
(define-key global-map [prior] 'scroll-down-command)
(define-key global-map [next] 'scroll-up-command)
diff --git a/lisp/calc/README b/lisp/calc/README
index 3e3acaebb27..4b32ada63ad 100644
--- a/lisp/calc/README
+++ b/lisp/calc/README
@@ -74,6 +74,8 @@ Summary of changes to "Calc"
Emacs 24.1
+* Gave `calc-histogram' the option of using a vector to determine the bins.
+
* Added "O" option prefix.
* Used "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode.
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index 58e30a237f9..77a02b58c73 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -510,6 +510,7 @@ The value t means abort and give an error message.")
("≥" ">=")
("≦" "<=")
("≧" ">=")
+ ("µ" "μ")
;; fractions
("¼" "(1:4)") ; 1/4
("½" "(1:2)") ; 1/2
@@ -675,11 +676,11 @@ in Calc algebraic input.")
(cond ((and (stringp (car p))
(or (> (length (car p)) 1) (equal (car p) "$")
(equal (car p) "\""))
- (string-match "[^a-zA-Z0-9]" (car p)))
+ (string-match "[^a-zA-Zα-ωΑ-Ω0-9]" (car p)))
(let ((s (regexp-quote (car p))))
- (if (string-match "\\`[a-zA-Z0-9]" s)
+ (if (string-match "\\`[a-zA-Zα-ωΑ-Ω0-9]" s)
(setq s (concat "\\<" s)))
- (if (string-match "[a-zA-Z0-9]\\'" s)
+ (if (string-match "[a-zA-Zα-ωΑ-Ω0-9]\\'" s)
(setq s (concat s "\\>")))
(or (assoc s math-toks)
(progn
@@ -718,15 +719,17 @@ in Calc algebraic input.")
math-expr-data (math-match-substring math-exp-str 0)
math-exp-pos (match-end 0)))
((or (and (>= ch ?a) (<= ch ?z))
- (and (>= ch ?A) (<= ch ?Z)))
+ (and (>= ch ?A) (<= ch ?Z))
+ (and (>= ch ?α) (<= ch ?ω))
+ (and (>= ch ?Α) (<= ch ?Ω)))
(string-match
(cond
((and (memq calc-language calc-lang-allow-underscores)
(memq calc-language calc-lang-allow-percentsigns))
- "[a-zA-Z0-9_'#]*")
+ "[a-zA-Zα-ωΑ-Ω0-9_'#]*")
((memq calc-language calc-lang-allow-underscores)
- "[a-zA-Z0-9_#]*")
- (t "[a-zA-Z0-9'#]*"))
+ "[a-zA-Zα-ωΑ-Ω0-9_#]*")
+ (t "[a-zA-Zα-ωΑ-Ω0-9'#]*"))
math-exp-str math-exp-pos)
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
@@ -744,12 +747,12 @@ in Calc algebraic input.")
(or (eq math-exp-pos 0)
(and (not (memq calc-language
calc-lang-allow-underscores))
- (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
+ (eq (string-match "[^])}\"a-zA-Zα-ωΑ-Ω0-9'$]_"
math-exp-str (1- math-exp-pos))
(1- math-exp-pos))))))
(or (and (memq calc-language calc-lang-c-type-hex)
(string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
- (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
+ (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
math-exp-str math-exp-pos))
(setq math-exp-token 'number
math-expr-data (math-match-substring math-exp-str 0)
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index 0e31fbe681c..4ab698ea640 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -845,6 +845,8 @@ the size of a Calc bignum digit.")
(len (length num)))
(if (< len digs)
(setq num (concat (make-string (- digs len) ?0) num))))
+ (when calc-group-digits
+ (setq num (math-group-float num)))
(concat
(number-to-string calc-number-radix)
"##"
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index f6f8e3d03d9..17dc9293237 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -3283,7 +3283,7 @@ If X is not an error form, return 1."
(concat "-" (math-format-flat-expr (nth 1 a) 1000)))
(t
(concat (math-remove-dashes
- (if (string-match "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+ (if (string-match "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
(symbol-name (car a)))
(math-match-substring (symbol-name (car a)) 1)
(symbol-name (car a))))
@@ -3469,7 +3469,8 @@ If X is not an error form, return 1."
(defun math-group-float (str) ; [X X]
(let* ((pt (or (string-match "[^0-9a-zA-Z]" str) (length str)))
- (g (if (integerp calc-group-digits) (math-abs calc-group-digits) 3))
+ (g (if (integerp calc-group-digits) (math-abs calc-group-digits)
+ (if (memq calc-number-radix '(2 16)) 4 3)))
(i pt))
(if (and (integerp calc-group-digits) (< calc-group-digits 0))
(while (< (setq i (+ (1+ i) g)) (length str))
diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el
index cd30232feee..0ebf1a18fef 100644
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
@@ -214,7 +214,7 @@
(put 'pascal 'math-lang-read-symbol
'((?\$
(eq (string-match
- "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)"
+ "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)"
math-exp-str math-exp-pos)
math-exp-pos)
(setq math-exp-token 'number
@@ -312,7 +312,7 @@
(put 'fortran 'math-lang-read-symbol
'((?\.
- (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\."
+ (eq (string-match "\\.[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω]?\\."
math-exp-str math-exp-pos) math-exp-pos)
(setq math-exp-token 'punc
math-expr-data (upcase (math-match-substring math-exp-str 0))
@@ -603,9 +603,9 @@
'((?\\
(< math-exp-pos (1- (length math-exp-str)))
(progn
- (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+ (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+ (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
math-exp-str math-exp-pos))
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
@@ -691,7 +691,7 @@
(defun math-compose-tex-var (a prec)
(if (and calc-language-option
(not (= calc-language-option 0))
- (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'"
+ (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'"
(symbol-name (nth 1 a))))
(if (eq calc-language 'latex)
(format "\\text{%s}" (symbol-name (nth 1 a)))
@@ -702,7 +702,7 @@
(let (left right)
(if (and calc-language-option
(not (= calc-language-option 0))
- (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" func))
+ (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'" func))
(if (< (prefix-numeric-value calc-language-option) 0)
(setq func (format "\\%s" func))
(setq func (if (eq calc-language 'latex)
@@ -824,11 +824,11 @@
'((?\\
(< math-exp-pos (1- (length math-exp-str)))
(progn
- (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+ (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\\\text *{\\([a-zA-Z0-9]+\\)}"
+ (string-match "\\\\text *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+ (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
math-exp-str math-exp-pos))
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
@@ -2301,9 +2301,11 @@ order to Calc's."
;; Variable name or function call.
((or (and (>= other-char ?a) (<= other-char ?z))
- (and (>= other-char ?A) (<= other-char ?Z)))
+ (and (>= other-char ?A) (<= other-char ?Z))
+ (and (>= other-char ?α) (<= other-char ?ω))
+ (and (>= other-char ?Α) (<= other-char ?Ω)))
(setq line (nth v math-read-big-lines))
- (string-match "\\([a-zA-Z'_]+\\) *" line math-rb-h1)
+ (string-match "\\([a-zA-Zα-ωΑ-Ω'_]+\\) *" line math-rb-h1)
(setq h (match-end 1)
widest (match-end 0)
p (math-match-substring line 1))
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index 5ec21eee887..8f73e71b0f9 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -202,7 +202,7 @@
'calc-read-var-name-history)))))
(setq calc-aborted-prefix "")
(and (not (equal var "var-"))
- (if (string-match "\\`\\([-a-zA-Z0-9]+\\) *:?=" var)
+ (if (string-match "\\`\\([-a-zA-Zα-ωΑ-Ω0-9]+\\) *:?=" var)
(if (null calc-given-value-flag)
(error "Assignment is not allowed in this command")
(let ((svar (intern (substring var 0 (match-end 1)))))
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 6dd3e4911b7..6881db3fb12 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -36,13 +36,13 @@
;;; Units table last updated 9-Jan-91 by Ulrich Mueller (ulm@vsnhd1.cern.ch)
;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov)
-;;; Updated April 2002 by Jochen Küpper
+;;; Updated April 2002 by Jochen Küpper
;;; Updated August 2007, using
;;; CODATA (http://physics.nist.gov/cuu/Constants/index.html)
;;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html)
;;; ESUWM (Encyclopaedia of Scientific Units, Weights and
-;;; Measures, by François Cardarelli)
+;;; Measures, by François Cardarelli)
;;; All conversions are exact unless otherwise noted.
(defvar math-standard-units
@@ -210,6 +210,7 @@
"1.602176487 10^-19 C (*)") ;;(approx) CODATA
( V "W/A" "Volt" )
( ohm "V/A" "Ohm" )
+ ( Ω "ohm" "Ohm" )
( mho "A/V" "Mho" )
( S "A/V" "Siemens" )
( F "C/V" "Farad" )
@@ -259,7 +260,9 @@
"6.62606896 10^-34 J s (*)")
( hbar "h / (2 pi)" "Planck's constant" ) ;; Exact
( mu0 "4 pi 10^(-7) H/m" "Permeability of vacuum") ;; Exact
+ ( μ0 "mu0" "Permeability of vacuum") ;; Exact
( eps0 "1 / (mu0 c^2)" "Permittivity of vacuum" )
+ ( ε0 "eps0" "Permittivity of vacuum" )
( G "6.67428*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil
"6.67428 10^-11 m^3/(kg s^2) (*)")
( Nav "6.02214179*10^(23) / mol" "Avogadro's constant" nil
@@ -272,12 +275,16 @@
"1.674927211 10^-27 kg (*)")
( mmu "1.88353130*10^(-28) kg" "Muon rest mass" nil
"1.88353130 10^-28 kg (*)")
+ ( mμ "mmu" "Muon rest mass" nil
+ "1.88353130 10^-28 kg (*)")
( Ryd "10973731.568527 /m" "Rydberg's constant" nil
"10973731.568527 /m (*)")
( k "1.3806504*10^(-23) J/K" "Boltzmann's constant" nil
"1.3806504 10^-23 J/K (*)")
( alpha "7.2973525376*10^(-3)" "Fine structure constant" nil
"7.2973525376 10^-3 (*)")
+ ( α "alpha" "Fine structure constant" nil
+ "7.2973525376 10^-3 (*)")
( muB "927.400915*10^(-26) J/T" "Bohr magneton" nil
"927.400915 10^-26 J/T (*)")
( muN "5.05078324*10^(-27) J/T" "Nuclear magneton" nil
@@ -316,6 +323,7 @@ that the combined units table will be rebuilt.")
( ?c (^ 10 -2) "Centi" )
( ?m (^ 10 -3) "Milli" )
( ?u (^ 10 -6) "Micro" )
+ ( ?μ (^ 10 -6) "Micro" )
( ?n (^ 10 -9) "Nano" )
( ?p (^ 10 -12) "Pico" )
( ?f (^ 10 -15) "Femto" )
@@ -581,8 +589,8 @@ If EXPR is nil, return nil."
(let ((name (or (nth 2 u) (symbol-name (car u)))))
(if (eq (aref name 0) ?\*)
(setq name (substring name 1)))
- (if (string-match "[^a-zA-Z0-9']" name)
- (if (string-match "^[a-zA-Z0-9' ()]*$" name)
+ (if (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
+ (if (string-match "^[a-zA-Zα-ωΑ-Ω0-9' ()]*$" name)
(while (setq pos (string-match "[ ()]" name))
(setq name (concat (substring name 0 pos)
(if (eq (aref name pos) 32) "-" "")
@@ -592,7 +600,7 @@ If EXPR is nil, return nil."
(setq name (concat (nth 2 (assq (aref (symbol-name
(nth 1 expr)) 0)
math-unit-prefixes))
- (if (and (string-match "[^a-zA-Z0-9']" name)
+ (if (and (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
(not (memq (car u) '(mHg gf))))
(concat "-" name)
(downcase name)))))
@@ -1540,9 +1548,5 @@ If EXPR is nil, return nil."
(provide 'calc-units)
-;; Local Variables:
-;; coding: iso-latin-1
-;; End:
-
;; arch-tag: e993314f-3adc-4191-be61-4ef8874881c4
;;; calc-units.el ends here
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index c4de362ab36..5b807a55491 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -451,16 +451,18 @@
(calc-enter-result 1 "grad" (list 'calcFunc-grade (calc-top-n 1))))))
(defun calc-histogram (n)
- (interactive "NNumber of bins: ")
+ (interactive "P")
+ (unless (natnump n)
+ (setq n (math-read-expr (read-string "Centers of bins: "))))
(calc-slow-wrapper
(if calc-hyperbolic-flag
(calc-enter-result 2 "hist" (list 'calcFunc-histogram
(calc-top-n 2)
(calc-top-n 1)
- (prefix-numeric-value n)))
+ n))
(calc-enter-result 1 "hist" (list 'calcFunc-histogram
(calc-top-n 1)
- (prefix-numeric-value n))))))
+ n)))))
(defun calc-transpose (arg)
(interactive "P")
@@ -1135,22 +1137,53 @@
(if (Math-vectorp wts)
(or (= (length vec) (length wts))
(math-dimension-error)))
- (or (natnump n)
- (math-reject-arg n 'fixnatnump))
- (let ((res (make-vector n 0))
- (vp vec)
- (wvec (Math-vectorp wts))
- (wp wts)
- bin)
- (while (setq vp (cdr vp))
- (setq bin (car vp))
- (or (natnump bin)
- (setq bin (math-floor bin)))
- (and (natnump bin)
- (< bin n)
- (aset res bin (math-add (aref res bin)
- (if wvec (car (setq wp (cdr wp))) wts)))))
- (cons 'vec (append res nil))))
+ (cond ((natnump n)
+ (let ((res (make-vector n 0))
+ (vp vec)
+ (wvec (Math-vectorp wts))
+ (wp wts)
+ bin)
+ (while (setq vp (cdr vp))
+ (setq bin (car vp))
+ (or (natnump bin)
+ (setq bin (math-floor bin)))
+ (and (natnump bin)
+ (< bin n)
+ (aset res bin
+ (math-add (aref res bin)
+ (if wvec (car (setq wp (cdr wp))) wts)))))
+ (cons 'vec (append res nil))))
+ ((Math-vectorp n) ;; n is a vector of midpoints
+ (let* ((bds (math-vector-avg n))
+ (res (make-vector (1- (length n)) 0))
+ (vp (cdr vec))
+ (wvec (Math-vectorp wts))
+ (wp wts)
+ num)
+ (while vp
+ (setq num (car vp))
+ (let ((tbds (cdr bds))
+ (i 0))
+ (while (and tbds (Math-lessp (car tbds) num))
+ (setq i (1+ i))
+ (setq tbds (cdr tbds)))
+ (aset res i
+ (math-add (aref res i)
+ (if wvec (car (setq wp (cdr wp))) wts))))
+ (setq vp (cdr vp)))
+ (cons 'vec (append res nil))))
+ (t
+ (math-reject-arg n "*Expecting an integer or vector"))))
+
+;;; Replace a vector [a b c ...] with a vector of averages
+;;; [(a+b)/2 (b+c)/2 ...]
+(defun math-vector-avg (vec)
+ (let ((vp (sort (copy-sequence (cdr vec)) 'math-beforep))
+ (res nil))
+ (while (and vp (cdr vp))
+ (setq res (cons (math-div (math-add (car vp) (cadr vp)) 2) res)
+ vp (cdr vp)))
+ (cons 'vec (reverse res))))
;;; Set operations.
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 07fa4414dda..73a865cab1a 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -999,9 +999,12 @@ Used by `calc-user-invocation'.")
(defvar math-working-step-2 nil)
(defvar var-i '(special-const (math-imaginary 1)))
(defvar var-pi '(special-const (math-pi)))
+(defvar var-Ï€ '(special-const (math-pi)))
(defvar var-e '(special-const (math-e)))
(defvar var-phi '(special-const (math-phi)))
+(defvar var-φ '(special-const (math-phi)))
(defvar var-gamma '(special-const (math-gamma-const)))
+(defvar var-γ '(special-const (math-gamma-const)))
(defvar var-Modes '(special-const (math-get-modes-vec)))
(mapc (lambda (v) (or (boundp v) (set v nil)))
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index c7d3469abe0..c8efded9270 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -663,6 +663,8 @@
(and prevc nextc
(or (and (>= nextc ?a) (<= nextc ?z))
(and (>= nextc ?A) (<= nextc ?Z))
+ (and (>= nextc ?α) (<= nextc ?ω))
+ (and (>= nextc ?Α) (<= nextc ?Ω))
(and (>= nextc ?0) (<= nextc ?9))
(memq nextc '(?. ?_ ?#
?\( ?\[ ?\{))
@@ -732,7 +734,7 @@
(not (math-tex-expr-is-flat (nth 1 a))))))
(list 'horiz
(if lr "\\left" "")
- (if (string-match "\\`u\\([^a-zA-Z]\\)\\'" (car op))
+ (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'" (car op))
(substring (car op) 1)
(car op))
(if (or lr (> (length (car op)) 2)) " " "")
@@ -758,7 +760,7 @@
(t
(let ((rhs (math-compose-expr (nth 1 a) (nth 3 op))))
(list 'horiz
- (let ((ops (if (string-match "\\`u\\([^a-zA-Z]\\)\\'"
+ (let ((ops (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'"
(car op))
(substring (car op) 1)
(car op))))
@@ -806,7 +808,7 @@
(setq func (car func2)))
(setq func (math-remove-dashes
(if (string-match
- "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+ "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
(symbol-name func))
(math-match-substring (symbol-name func) 1)
(symbol-name func))))
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index 5834afae8bc..e343446a366 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -30,16 +30,16 @@
(declare-function int86 "dosfns.c")
(declare-function msdos-long-file-names "msdos.c")
-;; This overrides a trivial definition in files.el.
+;; See convert-standard-filename in files.el.
(defun dos-convert-standard-filename (filename)
- "Convert a standard file's name to something suitable for the current OS.
+ "Convert a standard file's name to something suitable for MS-DOS.
This means to guarantee valid names and perhaps to canonicalize
certain patterns.
+This function is called by `convert-standard-filename'.
+
On Windows and DOS, replace invalid characters. On DOS, make
-sure to obey the 8.3 limitations. On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+sure to obey the 8.3 limitations."
(if (or (not (stringp filename))
;; This catches the case where FILENAME is "x:" or "x:/" or
;; "/", thus preventing infinite recursion.
@@ -128,11 +128,6 @@ shell requires it (see `w32-shell-dos-semantics')."
(dos-convert-standard-filename dir))
string))))))
-;; Only redirect convert-standard-filename if it has a chance of working,
-;; otherwise loading dos-fns.el might make your non-DOS Emacs misbehave.
-(when (fboundp 'msdos-long-file-names)
- (defalias 'convert-standard-filename 'dos-convert-standard-filename))
-
(defun dos-8+3-filename (filename)
"Truncate FILENAME to DOS 8+3 limits."
(if (or (not (stringp filename))
@@ -243,9 +238,14 @@ returned unaltered."
(al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0))
(ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1))))
+(define-obsolete-variable-alias
+ 'register-name-alist 'dos-register-name-alist "24.1")
+
(defun dos-make-register ()
(make-vector 8 0))
+(define-obsolete-function-alias 'make-register 'dos-make-register "24.1")
+
(defun dos-register-value (regs name)
(let ((where (cdr (assoc name dos-register-name-alist))))
(cond ((consp where)
@@ -257,6 +257,8 @@ returned unaltered."
(aref regs where))
(t nil))))
+(define-obsolete-function-alias 'register-value 'dos-register-value "24.1")
+
(defun dos-set-register-value (regs name value)
(and (numberp value)
(>= value 0)
@@ -273,9 +275,18 @@ returned unaltered."
(aset regs where (logand value 65535))))))
regs)
+(define-obsolete-function-alias
+ 'set-register-value 'dos-set-register-value "24.1")
+
(defsubst dos-intdos (regs)
+ "Issue the DOS Int 21h with registers REGS.
+
+REGS should be a vector produced by `dos-make-register'
+and `dos-set-register-value', which see."
(int86 33 regs))
+(define-obsolete-function-alias 'intdos 'dos-intdos "24.1")
+
;; Backward compatibility for obsolescent functions which
;; set screen size.
@@ -284,6 +295,8 @@ returned unaltered."
(interactive)
(set-frame-size (selected-frame) 80 25))
+(define-obsolete-function-alias 'mode25 'dos-mode25 "24.1")
+
(defun dos-mode4350 ()
"Changes the number of rows to 43 or 50.
Emacs always tries to set the screen height to 50 rows first.
@@ -295,6 +308,8 @@ that your video hardware might not support 50-line mode."
nil ; the original built-in function returned nil
(set-frame-size (selected-frame) 80 43)))
+(define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1")
+
(provide 'dos-fns)
;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 4a7f59e26fb..02477baf74f 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -221,8 +221,6 @@ font-lock keywords will not be case sensitive."
;;(set (make-local-variable 'adaptive-fill-mode) nil)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'lisp-indent-line)
- (make-local-variable 'parse-sexp-ignore-comments)
- (setq parse-sexp-ignore-comments t)
(make-local-variable 'outline-regexp)
(setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
(make-local-variable 'outline-level)
@@ -431,7 +429,7 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
:type 'hook
:group 'lisp)
-(define-derived-mode emacs-lisp-mode nil "Emacs-Lisp"
+(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp"
"Major mode for editing Lisp code to run in Emacs.
Commands:
Delete converts tabs to spaces as it moves back.
@@ -466,7 +464,7 @@ if that value is non-nil."
"Keymap for ordinary Lisp mode.
All commands in `lisp-mode-shared-map' are inherited by this map.")
-(define-derived-mode lisp-mode nil "Lisp"
+(define-derived-mode lisp-mode prog-mode "Lisp"
"Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
Commands:
Delete converts tabs to spaces as it moves back.
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
new file mode 100644
index 00000000000..27ddeb762af
--- /dev/null
+++ b/lisp/emacs-lisp/smie.el
@@ -0,0 +1,688 @@
+;;; smie.el --- Simple Minded Indentation Engine
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords: languages, lisp, internal, parsing, indentation
+
+;; 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; While working on the SML indentation code, the idea grew that maybe
+;; I could write something generic to do the same thing, and at the
+;; end of working on the SML code, I had a pretty good idea of what it
+;; could look like. That idea grew stronger after working on
+;; LaTeX indentation.
+;;
+;; So at some point I decided to try it out, by writing a new
+;; indentation code for Coq while trying to keep most of the code
+;; "table driven", where only the tables are Coq-specific. The result
+;; (which was used for Beluga-mode as well) turned out to be based on
+;; something pretty close to an operator precedence parser.
+
+;; So here is another rewrite, this time following the actual principles of
+;; operator precedence grammars. Why OPG? Even though they're among the
+;; weakest kinds of parsers, these parsers have some very desirable properties
+;; for Emacs:
+;; - most importantly for indentation, they work equally well in either
+;; direction, so you can use them to parse backward from the indentation
+;; point to learn the syntactic context;
+;; - they work locally, so there's no need to keep a cache of
+;; the parser's state;
+;; - because of that locality, indentation also works just fine when earlier
+;; parts of the buffer are syntactically incorrect since the indentation
+;; looks at "as little as possible" of the buffer make an indentation
+;; decision.
+;; - they typically have no error handling and can't even detect a parsing
+;; error, so we don't have to worry about what to do in case of a syntax
+;; error because the parser just automatically does something. Better yet,
+;; we can afford to use a sloppy grammar.
+
+;; The development (especially the parts building the 2D precedence
+;; tables and then computing the precedence levels from it) is largely
+;; inspired from page 187-194 of "Parsing techniques" by Dick Grune
+;; and Ceriel Jacobs (BookBody.pdf available at
+;; http://www.cs.vu.nl/~dick/PTAPG.html).
+;;
+;; OTOH we had to kill many chickens, read many coffee grounds, and practiced
+;; untold numbers of black magic spells.
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+;;; Building precedence level tables from BNF specs.
+
+(defun smie-set-prec2tab (table x y val &optional override)
+ (assert (and x y))
+ (let* ((key (cons x y))
+ (old (gethash key table)))
+ (if (and old (not (eq old val)))
+ (if (gethash key override)
+ ;; FIXME: The override is meant to resolve ambiguities,
+ ;; but it also hides real conflicts. It would be great to
+ ;; be able to distinguish the two cases so that overrides
+ ;; don't hide real conflicts.
+ (puthash key (gethash key override) table)
+ (display-warning 'smie (format "Conflict: %s %s/%s %s" x old val y)))
+ (puthash key val table))))
+
+(defun smie-precs-precedence-table (precs)
+ "Compute a 2D precedence table from a list of precedences.
+PRECS should be a list, sorted by precedence (e.g. \"+\" will
+come before \"*\"), of elements of the form \(left OP ...)
+or (right OP ...) or (nonassoc OP ...) or (assoc OP ...). All operators in
+one of those elements share the same precedence level and associativity."
+ (let ((prec2-table (make-hash-table :test 'equal)))
+ (dolist (prec precs)
+ (dolist (op (cdr prec))
+ (let ((selfrule (cdr (assq (car prec)
+ '((left . >) (right . <) (assoc . =))))))
+ (when selfrule
+ (dolist (other-op (cdr prec))
+ (smie-set-prec2tab prec2-table op other-op selfrule))))
+ (let ((op1 '<) (op2 '>))
+ (dolist (other-prec precs)
+ (if (eq prec other-prec)
+ (setq op1 '> op2 '<)
+ (dolist (other-op (cdr other-prec))
+ (smie-set-prec2tab prec2-table op other-op op2)
+ (smie-set-prec2tab prec2-table other-op op op1)))))))
+ prec2-table))
+
+(defun smie-merge-prec2s (tables)
+ (if (null (cdr tables))
+ (car tables)
+ (let ((prec2 (make-hash-table :test 'equal)))
+ (dolist (table tables)
+ (maphash (lambda (k v)
+ (smie-set-prec2tab prec2 (car k) (cdr k) v))
+ table))
+ prec2)))
+
+(defun smie-bnf-precedence-table (bnf &rest precs)
+ (let ((nts (mapcar 'car bnf)) ;Non-terminals
+ (first-ops-table ())
+ (last-ops-table ())
+ (first-nts-table ())
+ (last-nts-table ())
+ (prec2 (make-hash-table :test 'equal))
+ (override (smie-merge-prec2s
+ (mapcar 'smie-precs-precedence-table precs)))
+ again)
+ (dolist (rules bnf)
+ (let ((nt (car rules))
+ (last-ops ())
+ (first-ops ())
+ (last-nts ())
+ (first-nts ()))
+ (dolist (rhs (cdr rules))
+ (assert (consp rhs))
+ (if (not (member (car rhs) nts))
+ (pushnew (car rhs) first-ops)
+ (pushnew (car rhs) first-nts)
+ (when (consp (cdr rhs))
+ ;; If the first is not an OP we add the second (which
+ ;; should be an OP if BNF is an "operator grammar").
+ ;; Strictly speaking, this should only be done if the
+ ;; first is a non-terminal which can expand to a phrase
+ ;; without any OP in it, but checking doesn't seem worth
+ ;; the trouble, and it lets the writer of the BNF
+ ;; be a bit more sloppy by skipping uninteresting base
+ ;; cases which are terminals but not OPs.
+ (assert (not (member (cadr rhs) nts)))
+ (pushnew (cadr rhs) first-ops)))
+ (let ((shr (reverse rhs)))
+ (if (not (member (car shr) nts))
+ (pushnew (car shr) last-ops)
+ (pushnew (car shr) last-nts)
+ (when (consp (cdr shr))
+ (assert (not (member (cadr shr) nts)))
+ (pushnew (cadr shr) last-ops)))))
+ (push (cons nt first-ops) first-ops-table)
+ (push (cons nt last-ops) last-ops-table)
+ (push (cons nt first-nts) first-nts-table)
+ (push (cons nt last-nts) last-nts-table)))
+ ;; Compute all first-ops by propagating the initial ones we have
+ ;; now, according to first-nts.
+ (setq again t)
+ (while (prog1 again (setq again nil))
+ (dolist (first-nts first-nts-table)
+ (let* ((nt (pop first-nts))
+ (first-ops (assoc nt first-ops-table)))
+ (dolist (first-nt first-nts)
+ (dolist (op (cdr (assoc first-nt first-ops-table)))
+ (unless (member op first-ops)
+ (setq again t)
+ (push op (cdr first-ops))))))))
+ ;; Same thing for last-ops.
+ (setq again t)
+ (while (prog1 again (setq again nil))
+ (dolist (last-nts last-nts-table)
+ (let* ((nt (pop last-nts))
+ (last-ops (assoc nt last-ops-table)))
+ (dolist (last-nt last-nts)
+ (dolist (op (cdr (assoc last-nt last-ops-table)))
+ (unless (member op last-ops)
+ (setq again t)
+ (push op (cdr last-ops))))))))
+ ;; Now generate the 2D precedence table.
+ (dolist (rules bnf)
+ (dolist (rhs (cdr rules))
+ (while (cdr rhs)
+ (cond
+ ((member (car rhs) nts)
+ (dolist (last (cdr (assoc (car rhs) last-ops-table)))
+ (smie-set-prec2tab prec2 last (cadr rhs) '> override)))
+ ((member (cadr rhs) nts)
+ (dolist (first (cdr (assoc (cadr rhs) first-ops-table)))
+ (smie-set-prec2tab prec2 (car rhs) first '< override))
+ (if (and (cddr rhs) (not (member (car (cddr rhs)) nts)))
+ (smie-set-prec2tab prec2 (car rhs) (car (cddr rhs))
+ '= override)))
+ (t (smie-set-prec2tab prec2 (car rhs) (cadr rhs) '= override)))
+ (setq rhs (cdr rhs)))))
+ prec2))
+
+(defun smie-prec2-levels (prec2)
+ "Take a 2D precedence table and turn it into an alist of precedence levels.
+PREC2 is a table as returned by `smie-precs-precedence-table' or
+`smie-bnf-precedence-table'."
+ ;; For each operator, we create two "variables" (corresponding to
+ ;; the left and right precedence level), which are represented by
+ ;; cons cells. Those are the vary cons cells that appear in the
+ ;; final `table'. The value of each "variable" is kept in the `car'.
+ (let ((table ())
+ (csts ())
+ (eqs ())
+ tmp x y)
+ ;; From `prec2' we construct a list of constraints between
+ ;; variables (aka "precedence levels"). These can be either
+ ;; equality constraints (in `eqs') or `<' constraints (in `csts').
+ (maphash (lambda (k v)
+ (if (setq tmp (assoc (car k) table))
+ (setq x (cddr tmp))
+ (setq x (cons nil nil))
+ (push (cons (car k) (cons nil x)) table))
+ (if (setq tmp (assoc (cdr k) table))
+ (setq y (cdr tmp))
+ (setq y (cons nil (cons nil nil)))
+ (push (cons (cdr k) y) table))
+ (ecase v
+ (= (push (cons x y) eqs))
+ (< (push (cons x y) csts))
+ (> (push (cons y x) csts))))
+ prec2)
+ ;; First process the equality constraints.
+ (let ((eqs eqs))
+ (while eqs
+ (let ((from (caar eqs))
+ (to (cdar eqs)))
+ (setq eqs (cdr eqs))
+ (if (eq to from)
+ (debug) ;Can it happen?
+ (dolist (other-eq eqs)
+ (if (eq from (cdr other-eq)) (setcdr other-eq to))
+ (when (eq from (car other-eq))
+ ;; This can happen because of `assoc' settings in precs
+ ;; or because of a rhs like ("op" foo "op").
+ (setcar other-eq to)))
+ (dolist (cst csts)
+ (if (eq from (cdr cst)) (setcdr cst to))
+ (if (eq from (car cst)) (setcar cst to)))))))
+ ;; Then eliminate trivial constraints iteratively.
+ (let ((i 0))
+ (while csts
+ (let ((rhvs (mapcar 'cdr csts))
+ (progress nil))
+ (dolist (cst csts)
+ (unless (memq (car cst) rhvs)
+ (setq progress t)
+ (setcar (car cst) i)
+ (setq csts (delq cst csts))))
+ (unless progress
+ (error "Can't resolve the precedence table to precedence levels")))
+ (incf i))
+ ;; Propagate equalities back to their source.
+ (dolist (eq (nreverse eqs))
+ (assert (null (caar eq)))
+ (setcar (car eq) (cadr eq)))
+ ;; Finally, fill in the remaining vars (which only appeared on the
+ ;; right side of the < constraints).
+ ;; Tho leaving them at nil is not a bad choice, since it makes
+ ;; it clear that these don't bind at all.
+ ;; (dolist (x table)
+ ;; (unless (nth 1 x) (setf (nth 1 x) i))
+ ;; (unless (nth 2 x) (setf (nth 2 x) i)))
+ )
+ table))
+
+;;; Parsing using a precedence level table.
+
+(defvar smie-op-levels 'unset
+ "List of token parsing info.
+Each element is of the form (TOKEN LEFT-LEVEL RIGHT-LEVEL).
+Parsing is done using an operator precedence parser.")
+
+(defun smie-backward-token ()
+ ;; FIXME: This may be an OK default but probably needs a hook.
+ (buffer-substring (point)
+ (progn (if (zerop (skip-syntax-backward "."))
+ (skip-syntax-backward "w_'"))
+ (point))))
+
+(defun smie-forward-token ()
+ ;; FIXME: This may be an OK default but probably needs a hook.
+ (buffer-substring (point)
+ (progn (if (zerop (skip-syntax-forward "."))
+ (skip-syntax-forward "w_'"))
+ (point))))
+
+(defun smie-backward-sexp (&optional halfsexp)
+ "Skip over one sexp.
+HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
+first token we see is an operator, skip over its left-hand-side argument.
+Possible return values:
+ (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
+ is too high. LEFT-LEVEL is the left-level of TOKEN,
+ POS is its start position in the buffer.
+ (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
+ (nil POS TOKEN): we skipped over a paren-like pair.
+ nil: we skipped over an identifier, matched parentheses, ..."
+ (if (bobp) (list t (point))
+ (catch 'return
+ (let ((levels ()))
+ (while
+ (let* ((pos (point))
+ (token (progn (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ (toklevels (cdr (assoc token smie-op-levels))))
+
+ (cond
+ ((null toklevels)
+ (if (equal token "")
+ (condition-case err
+ (progn (goto-char pos) (backward-sexp 1) nil)
+ (scan-error (throw 'return (list t (caddr err)))))))
+ ((null (nth 1 toklevels))
+ ;; A token like a paren-close.
+ (assert (nth 0 toklevels)) ;Otherwise, why mention it?
+ (push (nth 0 toklevels) levels))
+ (t
+ (while (and levels (< (nth 1 toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (if (and halfsexp (nth 0 toklevels))
+ (push (nth 0 toklevels) levels)
+ (throw 'return
+ (prog1 (list (or (car toklevels) t) (point) token)
+ (goto-char pos)))))
+ (t
+ (while (and levels (= (nth 1 toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (cond
+ ((null (nth 0 toklevels))
+ (throw 'return (list nil (point) token)))
+ ((eq (nth 0 toklevels) (nth 1 toklevels))
+ (throw 'return
+ (prog1 (list (or (car toklevels) t) (point) token)
+ (goto-char pos))))
+ (t (debug)))) ;Not sure yet what to do here.
+ (t
+ (if (nth 0 toklevels)
+ (push (nth 0 toklevels) levels))))))))
+ levels)
+ (setq halfsexp nil))))))
+
+;; Mirror image, not used for indentation.
+(defun smie-forward-sexp (&optional halfsexp)
+ "Skip over one sexp.
+HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
+first token we see is an operator, skip over its left-hand-side argument.
+Possible return values:
+ (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level
+ is too high. RIGHT-LEVEL is the right-level of TOKEN,
+ POS is its end position in the buffer.
+ (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
+ (nil POS TOKEN): we skipped over a paren-like pair.
+ nil: we skipped over an identifier, matched parentheses, ..."
+ (if (eobp) (list t (point))
+ (catch 'return
+ (let ((levels ()))
+ (while
+ (let* ((pos (point))
+ (token (progn (forward-comment (point-max))
+ (smie-forward-token)))
+ (toklevels (cdr (assoc token smie-op-levels))))
+
+ (cond
+ ((null toklevels)
+ (if (equal token "")
+ (condition-case err
+ (progn (goto-char pos) (forward-sexp 1) nil)
+ (scan-error (throw 'return (list t (caddr err)))))))
+ ((null (nth 0 toklevels))
+ ;; A token like a paren-close.
+ (assert (nth 1 toklevels)) ;Otherwise, why mention it?
+ (push (nth 1 toklevels) levels))
+ (t
+ (while (and levels (< (nth 0 toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (if (and halfsexp (nth 1 toklevels))
+ (push (nth 1 toklevels) levels)
+ (throw 'return
+ (prog1 (list (or (nth 1 toklevels) t) (point) token)
+ (goto-char pos)))))
+ (t
+ (while (and levels (= (nth 0 toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (cond
+ ((null (nth 1 toklevels))
+ (throw 'return (list nil (point) token)))
+ ((eq (nth 1 toklevels) (nth 0 toklevels))
+ (throw 'return
+ (prog1 (list (or (nth 1 toklevels) t) (point) token)
+ (goto-char pos))))
+ (t (debug)))) ;Not sure yet what to do here.
+ (t
+ (if (nth 1 toklevels)
+ (push (nth 1 toklevels) levels))))))))
+ levels)
+ (setq halfsexp nil))))))
+
+(defun smie-backward-sexp-command (&optional n)
+ "Move backward through N logical elements."
+ (interactive "p")
+ (if (< n 0)
+ (smie-forward-sexp-command (- n))
+ (let ((forward-sexp-function nil))
+ (while (> n 0)
+ (decf n)
+ (let ((pos (point))
+ (res (smie-backward-sexp 'halfsexp)))
+ (if (and (car res) (= pos (point)) (not (bolp)))
+ (signal 'scan-error
+ (list "Containing expression ends prematurely"
+ (cadr res) (cadr res)))
+ nil))))))
+
+(defun smie-forward-sexp-command (&optional n)
+ "Move forward through N logical elements."
+ (interactive "p")
+ (if (< n 0)
+ (smie-backward-sexp-command (- n))
+ (let ((forward-sexp-function nil))
+ (while (> n 0)
+ (decf n)
+ (let ((pos (point))
+ (res (smie-forward-sexp 'halfsexp)))
+ (if (and (car res) (= pos (point)) (not (bolp)))
+ (signal 'scan-error
+ (list "Containing expression ends prematurely"
+ (cadr res) (cadr res)))
+ nil))))))
+
+;;; The indentation engine.
+
+(defcustom smie-indent-basic 4
+ "Basic amount of indentation."
+ :type 'integer)
+
+(defvar smie-indent-rules 'unset
+ "Rules of the following form.
+\(TOK OFFSET) how to indent right after TOK.
+\(TOK O1 O2) how to indent right after TOK:
+ O1 is the default;
+ O2 is used if TOK is \"hanging\".
+\((T1 . T2) . OFFSET) how to indent token T2 w.r.t T1.
+\((t . TOK) . OFFSET) how to indent TOK with respect to its parent.
+\(list-intro . TOKENS) declare TOKENS as being followed by what may look like
+ a funcall but is just a sequence of expressions.
+\(t . OFFSET) basic indentation step.
+\(args . OFFSET) indentation of arguments.
+A nil offset defaults to `smie-indent-basic'.")
+
+(defun smie-indent-hanging-p ()
+ ;; A Hanging keyword is one that's at the end of a line except it's not at
+ ;; the beginning of a line.
+ (and (save-excursion (smie-forward-token)
+ (skip-chars-forward " \t") (eolp))
+ (save-excursion (skip-chars-backward " \t") (not (bolp)))))
+
+(defun smie-bolp ()
+ (save-excursion (skip-chars-backward " \t") (bolp)))
+
+(defun smie-indent-offset (elem)
+ (or (cdr (assq elem smie-indent-rules))
+ (cdr (assq t smie-indent-rules))
+ smie-indent-basic))
+
+(defun smie-indent-calculate (&optional virtual)
+ "Compute the indentation to use for point.
+If VIRTUAL is non-nil, it means we're not trying to indent point but just
+need to compute the column at which point should be indented
+in order to figure out the indentation of some other (further down) point.
+VIRTUAL can take two different non-nil values:
+- :bolp: means that the current indentation of point can be trusted
+ to be good only if it follows a line break.
+- :hanging: means that the current indentation of point can be
+ trusted to be good except if the following token is hanging."
+ ;; FIXME: This has accumulated a lot of rules, some of which aren't
+ ;; clearly orthogonal any more, so we should probably try and
+ ;; restructure it somewhat.
+ (or
+ ;; Trust pre-existing indentation on other lines.
+ (and virtual
+ (if (eq virtual :hanging) (not (smie-indent-hanging-p)) (smie-bolp))
+ (current-column))
+ ;; Align close paren with opening paren.
+ (save-excursion
+ ;; (forward-comment (point-max))
+ (when (looking-at "\\s)")
+ (while (not (zerop (skip-syntax-forward ")")))
+ (skip-chars-forward " \t"))
+ (condition-case nil
+ (progn
+ (backward-sexp 1)
+ (smie-indent-calculate :hanging))
+ (scan-error nil))))
+ ;; Align closing token with the corresponding opening one.
+ ;; (e.g. "of" with "case", or "in" with "let").
+ (save-excursion
+ (let* ((pos (point))
+ (token (smie-forward-token))
+ (toklevels (cdr (assoc token smie-op-levels))))
+ (when (car toklevels)
+ (let ((res (smie-backward-sexp 'halfsexp)) tmp)
+ ;; If we didn't move at all, that means we didn't really skip
+ ;; what we wanted.
+ (when (< (point) pos)
+ (cond
+ ((eq (car res) (car toklevels))
+ ;; We bumped into a same-level operator. align with it.
+ (goto-char (cadr res))
+ ;; Don't use (smie-indent-calculate :hanging) here, because we
+ ;; want to jump back over a sequence of same-level ops such as
+ ;; a -> b -> c
+ ;; -> d
+ ;; So as to align with the earliest appropriate place.
+ (smie-indent-calculate :bolp))
+ ((equal token (save-excursion
+ (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ ;; in cases such as "fn x => fn y => fn z =>",
+ ;; jump back to the very first fn.
+ ;; FIXME: should we only do that for special tokens like "=>"?
+ (smie-indent-calculate :bolp))
+ ((setq tmp (assoc (cons (caddr res) token)
+ smie-indent-rules))
+ (goto-char (cadr res))
+ (+ (cdr tmp) (smie-indent-calculate :hanging)))
+ (t
+ (+ (or (cdr (assoc (cons t token) smie-indent-rules)) 0)
+ (current-column)))))))))
+ ;; Indentation of a comment.
+ (and (looking-at comment-start-skip)
+ (save-excursion
+ (forward-comment (point-max))
+ (skip-chars-forward " \t\r\n")
+ (smie-indent-calculate nil)))
+ ;; Indentation inside a comment.
+ (and (looking-at "\\*") (nth 4 (syntax-ppss))
+ (let ((ppss (syntax-ppss)))
+ (save-excursion
+ (forward-line -1)
+ (if (<= (point) (nth 8 ppss))
+ (progn (goto-char (1+ (nth 8 ppss))) (current-column))
+ (skip-chars-forward " \t")
+ (if (looking-at "\\*")
+ (current-column))))))
+ ;; Indentation right after a special keyword.
+ (save-excursion
+ (let* ((tok (progn (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ (tokinfo (assoc tok smie-indent-rules))
+ (toklevel (assoc tok smie-op-levels)))
+ (when (or tokinfo (and toklevel (null (cadr toklevel))))
+ (if (or (smie-indent-hanging-p)
+ ;; If calculating the virtual indentation point, prefer
+ ;; looking up the virtual indentation of the alignment
+ ;; point as well. This is used for indentation after
+ ;; "fn x => fn y =>".
+ virtual)
+ (+ (smie-indent-calculate :bolp)
+ (or (caddr tokinfo) (cadr tokinfo) (smie-indent-offset t)))
+ (+ (current-column)
+ (or (cadr tokinfo) (smie-indent-offset t)))))))
+ ;; Main loop (FIXME: whatever that means!?).
+ (save-excursion
+ (let ((positions nil)
+ (begline nil)
+ arg)
+ (while (and (null (car (smie-backward-sexp)))
+ (push (point) positions)
+ (not (setq begline (smie-bolp)))))
+ (save-excursion
+ ;; Figure out if the atom we just skipped is an argument rather
+ ;; than a function.
+ (setq arg (or (null (car (smie-backward-sexp)))
+ (member (progn (forward-comment (- (point-max)))
+ (smie-backward-token))
+ (cdr (assoc 'list-intro smie-indent-rules))))))
+ (cond
+ ((and arg positions)
+ (goto-char (car positions))
+ (current-column))
+ ((and (null begline) (cdr positions))
+ ;; We skipped some args plus the function and bumped into something.
+ ;; Align with the first arg.
+ (goto-char (cadr positions))
+ (current-column))
+ ((and (null begline) positions)
+ ;; We're the first arg.
+ ;; FIXME: it might not be a funcall, in which case we might be the
+ ;; second element.
+ (goto-char (car positions))
+ (+ (smie-indent-offset 'args)
+ ;; We used to use (smie-indent-calculate :bolp), but that
+ ;; doesn't seem right since it might then indent args less than
+ ;; the function itself.
+ (current-column)))
+ ((and (null arg) (null positions))
+ ;; We're the function itself. Not sure what to do here yet.
+ (if virtual (current-column)
+ (save-excursion
+ (let* ((pos (point))
+ (tok (progn (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ (toklevels (cdr (assoc tok smie-op-levels))))
+ (cond
+ ((numberp (car toklevels))
+ ;; We're right after an infix token. Let's skip over the
+ ;; lefthand side.
+ (goto-char pos)
+ (let (res)
+ (while (progn (setq res (smie-backward-sexp 'halfsexp))
+ (and (not (smie-bolp))
+ (equal (car res) (car toklevels)))))
+ ;; We should be right after a token of equal or
+ ;; higher precedence.
+ (cond
+ ((and (consp res) (memq (car res) '(t nil)))
+ ;; The token of higher-precedence is like an open-paren.
+ ;; Sample case for t: foo { bar, \n[TAB] baz }.
+ ;; Sample case for nil: match ... with \n[TAB] | toto ...
+ ;; (goto-char (cadr res))
+ (smie-indent-calculate :hanging))
+ ((and (consp res) (<= (car res) (car toklevels)))
+ ;; We stopped at a token of equal or higher precedence
+ ;; because we found a place with which to align.
+ (current-column))
+ )))
+ ;; For other cases.... hmm... we'll see when we get there.
+ )))))
+ ((null positions)
+ (smie-backward-token)
+ (+ (smie-indent-offset 'args) (smie-indent-calculate :bolp)))
+ ((car (smie-backward-sexp))
+ ;; No arg stands on its own line, but the function does:
+ (if (cdr positions)
+ (progn
+ (goto-char (cadr positions))
+ (current-column))
+ (goto-char (car positions))
+ (+ (current-column) (smie-indent-offset 'args))))
+ (t
+ ;; We've skipped to a previous arg on its own line: align.
+ (goto-char (car positions))
+ (current-column)))))))
+
+(defun smie-indent-line ()
+ "Indent current line using the SMIE indentation engine."
+ (interactive)
+ (let* ((savep (point))
+ (indent (condition-case nil
+ (save-excursion
+ (forward-line 0)
+ (skip-chars-forward " \t")
+ (if (>= (point) savep) (setq savep nil))
+ (or (smie-indent-calculate) 0))
+ (error 0))))
+ (if (not (numberp indent))
+ ;; If something funny is used (e.g. `noindent'), return it.
+ indent
+ (if (< indent 0) (setq indent 0)) ;Just in case.
+ (if savep
+ (save-excursion (indent-line-to indent))
+ (indent-line-to indent)))))
+
+;;;###autoload
+(defun smie-setup (op-levels indent-rules)
+ (set (make-local-variable 'smie-indent-rules) indent-rules)
+ (set (make-local-variable 'smie-op-levels) op-levels)
+ (set (make-local-variable 'indent-line-function) 'smie-indent-line))
+
+
+(provide 'smie)
+;;; smie.el ends here
diff --git a/lisp/files.el b/lisp/files.el
index 83ae91dd63a..d4c05bdc5d6 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -574,6 +574,9 @@ Runs the usual ange-ftp hook, but only for completion operations."
(inhibit-file-name-operation op))
(apply op args))))
+(declare-function dos-convert-standard-filename "dos-fns.el" (filename))
+(declare-function w32-convert-standard-filename "w32-fns.el" (filename))
+
(defun convert-standard-filename (filename)
"Convert a standard file's name to something suitable for the OS.
This means to guarantee valid names and perhaps to canonicalize
@@ -591,15 +594,20 @@ and also turn slashes into backslashes if the shell requires it (see
`w32-shell-dos-semantics').
See Info node `(elisp)Standard File Names' for more details."
- (if (eq system-type 'cygwin)
- (let ((name (copy-sequence filename))
- (start 0))
- ;; Replace invalid filename characters with !
- (while (string-match "[?*:<>|\"\000-\037]" name start)
- (aset name (match-beginning 0) ?!)
- (setq start (match-end 0)))
- name)
- filename))
+ (cond
+ ((eq system-type 'cygwin)
+ (let ((name (copy-sequence filename))
+ (start 0))
+ ;; Replace invalid filename characters with !
+ (while (string-match "[?*:<>|\"\000-\037]" name start)
+ (aset name (match-beginning 0) ?!)
+ (setq start (match-end 0)))
+ name))
+ ((eq system-type 'windows-nt)
+ (w32-convert-standard-filename filename))
+ ((eq system-type 'ms-dos)
+ (dos-convert-standard-filename filename))
+ (t filename)))
(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
"Read directory name, prompting with PROMPT and completing in directory DIR.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 0b7eaf7ed72..395cca72a93 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-sum.el (gnus-summary-save-article): Don't bother to re-fetch
+ article unless decoding article to be saved.
+
2010-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
* mml1991.el (mml1991-mailcrypt-encrypt, mml1991-gpg-encrypt)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 3a2c944ed2f..3626d0bd904 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -11664,12 +11664,8 @@ will not be marked as saved."
(gnus-message 1 "Article %d is unsaveable" article))
;; This is a real article.
(save-window-excursion
- (let ((gnus-display-mime-function (when decode
- gnus-display-mime-function))
- (gnus-article-prepare-hook (when decode
- gnus-article-prepare-hook)))
- (gnus-summary-select-article t t nil article)
- (gnus-summary-goto-subject article)))
+ (gnus-summary-select-article decode decode nil article)
+ (gnus-summary-goto-subject article))
(with-current-buffer save-buffer
(erase-buffer)
(insert-buffer-substring (if decode
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index fb13df54045..d97320da861 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -140,7 +140,7 @@
(define-key-after map [describe-language-environment]
`(menu-item ,(purecopy "Describe Language Environment")
- describe-language-environment-map
+ ,describe-language-environment-map
:help ,(purecopy "Show multilingual settings for a specific language")))
(define-key-after map [describe-input-method]
`(menu-item ,(purecopy "Describe Input Method...") describe-input-method
diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el
index 993df98b3a6..fd98fcfecb7 100644
--- a/lisp/language/hebrew.el
+++ b/lisp/language/hebrew.el
@@ -60,14 +60,14 @@
(input-method . "hebrew")
(unibyte-display . hebrew-iso-8bit)
(sample-text . "Hebrew ,Hylem(B")
- (documentation . "Right-to-left writing is not yet supported.")))
+ (documentation . "Bidirectional editing is supported.")))
(set-language-info-alist
"Windows-1255" '((coding-priority windows-1255)
(coding-system windows-1255)
(documentation . "\
Support for Windows-1255 encoding, e.g. for Yiddish.
-Right-to-left writing is not yet supported.")))
+Bidirectional editing is supported.")))
(define-coding-system 'windows-1255
"windows-1255 (Hebrew) encoding (MIME: WINDOWS-1255)"
diff --git a/lisp/org/org-docview.el b/lisp/org/org-docview.el
index 612d6cf053b..ad507546696 100644
--- a/lisp/org/org-docview.el
+++ b/lisp/org/org-docview.el
@@ -1,9 +1,8 @@
;;; org-docview.el --- support for links to doc-view-mode buffers
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;; Author: Jan Böcker <jan.boecker at jboecker dot de>
+;; Author: Jan Böcker <jan.boecker at jboecker dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.35i
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 65c05ae7487..cf199e69a33 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -444,12 +444,14 @@ in the same way as TABLE completes strings of the form (concat S2 S)."
;; I don't think such commands are usable before first setting up buffer-local
;; variables to parse args, so there's no point autoloading it.
;; ;;;###autoload
-(defun pcomplete-std-complete ()
+(defun pcomplete-completions-at-point ()
"Provide standard completion using pcomplete's completion tables.
Same as `pcomplete' but using the standard completion UI."
- (interactive)
;; FIXME: it only completes the text before point, whereas the
;; standard UI may also consider text after point.
+ ;; FIXME: the `pcomplete' UI may be used internally during
+ ;; pcomplete-completions and then throw to `pcompleted', thus
+ ;; imposing the pcomplete UI over the standard UI.
(catch 'pcompleted
(let* ((pcomplete-stub)
pcomplete-seen pcomplete-norm-func
@@ -516,7 +518,7 @@ Same as `pcomplete' but using the standard completion UI."
(directory-file-name f))
pcomplete-seen))))))
- (completion-in-region
+ (list
beg (point)
;; Add a space at the end of completion. Use a terminator-regexp
;; that never matches since the terminator cannot appear
@@ -527,7 +529,14 @@ Same as `pcomplete' but using the standard completion UI."
(cons pcomplete-termination-string
"\\`a\\`")
table))
- pred))))
+ :predicate pred))))
+
+ ;; I don't think such commands are usable before first setting up buffer-local
+ ;; variables to parse args, so there's no point autoloading it.
+ ;; ;;;###autoload
+(defun pcomplete-std-complete ()
+ (let ((completion-at-point-functions '(pcomplete-completions-at-point)))
+ (completion-at-point)))
;;; Pcomplete's native UI.
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index 0ce7d780d1f..f5fef76a009 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -109,7 +109,7 @@
"Additional expressions to highlight in Assembler mode.")
;;;###autoload
-(defun asm-mode ()
+(define-derived-mode asm-mode prog-mode "Assembler"
"Major mode for editing typical assembler code.
Features a private abbrev table and the following bindings:
@@ -128,13 +128,8 @@ Turning on Asm mode runs the hook `asm-mode-hook' at the end of initialization.
Special commands:
\\{asm-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq mode-name "Assembler")
- (setq major-mode 'asm-mode)
(setq local-abbrev-table asm-mode-abbrev-table)
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults '(asm-font-lock-keywords))
+ (set (make-local-variable 'font-lock-defaults) '(asm-font-lock-keywords))
(set (make-local-variable 'indent-line-function) 'asm-indent-line)
;; Stay closer to the old TAB behavior (was tab-to-tab-stop).
(set (make-local-variable 'tab-always-indent) nil)
@@ -157,8 +152,7 @@ Special commands:
(setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
(make-local-variable 'comment-end)
(setq comment-end "")
- (setq fill-prefix "\t")
- (run-mode-hooks 'asm-mode-hook))
+ (setq fill-prefix "\t"))
(defun asm-indent-line ()
"Auto-indent the current line."
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 197b41506bd..64277dc4f82 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -31,6 +31,7 @@
(defvar comint-prompt-regexp)
(defvar comint-process-echoes)
+(defvar smie-indent-basic)
(defgroup prolog nil
"Major mode for editing and running Prolog under Emacs."
@@ -98,6 +99,61 @@ When nil, send actual operating system end of file."
(defvar prolog-mode-abbrev-table nil)
(define-abbrev-table 'prolog-mode-abbrev-table ())
+(defconst prolog-smie-op-levels
+ ;; Rather than construct the operator levels table from the BNF,
+ ;; we directly provide the operator precedences from GNU Prolog's
+ ;; manual. The only problem is that GNU Prolog's manual uses
+ ;; precedence levels in the opposite sense (higher numbers bind less
+ ;; tightly) than SMIE, so we use negative numbers.
+ '(("." -10000 -10000)
+ (":-" -1200 -1200)
+ ("-->" -1200 -1200)
+ (";" -1100 -1100)
+ ("->" -1050 -1050)
+ ("," -1000 -1000)
+ ("\\+" -900 -900)
+ ("=" -700 -700)
+ ("\\=" -700 -700)
+ ("=.." -700 -700)
+ ("==" -700 -700)
+ ("\\==" -700 -700)
+ ("@<" -700 -700)
+ ("@=<" -700 -700)
+ ("@>" -700 -700)
+ ("@>=" -700 -700)
+ ("is" -700 -700)
+ ("=:=" -700 -700)
+ ("=\\=" -700 -700)
+ ("<" -700 -700)
+ ("=<" -700 -700)
+ (">" -700 -700)
+ (">=" -700 -700)
+ (":" -600 -600)
+ ("+" -500 -500)
+ ("-" -500 -500)
+ ("/\\" -500 -500)
+ ("\\/" -500 -500)
+ ("*" -400 -400)
+ ("/" -400 -400)
+ ("//" -400 -400)
+ ("rem" -400 -400)
+ ("mod" -400 -400)
+ ("<<" -400 -400)
+ (">>" -400 -400)
+ ("**" -200 -200)
+ ("^" -200 -200)
+ ;; Prefix
+ ;; ("+" 200 200)
+ ;; ("-" 200 200)
+ ;; ("\\" 200 200)
+ )
+ "Precedence levels of infix operators.")
+
+(defconst prolog-smie-indent-rules
+ '((":-")
+ ("->"))
+ "Prolog indentation rules.")
+
(defun prolog-mode-variables ()
(make-local-variable 'paragraph-separate)
(setq paragraph-separate (concat "%%\\|$\\|" page-delimiter)) ;'%%..'
@@ -105,8 +161,10 @@ When nil, send actual operating system end of file."
(setq paragraph-ignore-fill-prefix t)
(make-local-variable 'imenu-generic-expression)
(setq imenu-generic-expression '((nil "^\\sw+" 0)))
- (make-local-variable 'indent-line-function)
- (setq indent-line-function 'prolog-indent-line)
+ (smie-setup prolog-smie-op-levels prolog-smie-indent-rules)
+ (set (make-local-variable 'forward-sexp-function)
+ 'smie-forward-sexp-command)
+ (set (make-local-variable 'smie-indent-basic) prolog-indent-width)
(make-local-variable 'comment-start)
(setq comment-start "%")
(make-local-variable 'comment-start-skip)
@@ -122,7 +180,7 @@ When nil, send actual operating system end of file."
(define-key map "\C-c\C-l" 'inferior-prolog-load-file)
(define-key map "\C-c\C-z" 'switch-to-prolog)
map))
-
+
(easy-menu-define prolog-mode-menu prolog-mode-map "Menu for Prolog mode."
;; Mostly copied from scheme-mode's menu.
;; Not tremendously useful, but it's a start.
@@ -136,85 +194,18 @@ When nil, send actual operating system end of file."
))
;;;###autoload
-(defun prolog-mode ()
+(define-derived-mode prolog-mode prog-mode "Prolog"
"Major mode for editing Prolog code for Prologs.
Blank lines and `%%...' separate paragraphs. `%'s start comments.
Commands:
\\{prolog-mode-map}
Entry to this mode calls the value of `prolog-mode-hook'
if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (use-local-map prolog-mode-map)
- (set-syntax-table prolog-mode-syntax-table)
- (setq major-mode 'prolog-mode)
- (setq mode-name "Prolog")
(prolog-mode-variables)
(set (make-local-variable 'comment-add) 1)
- ;; font lock
(setq font-lock-defaults '(prolog-font-lock-keywords
nil nil nil
- beginning-of-line))
- (run-mode-hooks 'prolog-mode-hook))
-
-(defun prolog-indent-line ()
- "Indent current line as Prolog code.
-With argument, indent any additional lines of the same clause
-rigidly along with this one (not yet)."
- (interactive "p")
- (let ((indent (prolog-indent-level))
- (pos (- (point-max) (point))))
- (beginning-of-line)
- (indent-line-to indent)
- (if (> (- (point-max) pos) (point))
- (goto-char (- (point-max) pos)))))
-
-(defun prolog-indent-level ()
- "Compute Prolog indentation level."
- (save-excursion
- (beginning-of-line)
- (skip-chars-forward " \t")
- (cond
- ((looking-at "%%%") 0) ;Large comment starts
- ((looking-at "%[^%]") comment-column) ;Small comment starts
- ((bobp) 0) ;Beginning of buffer
- (t
- (let ((empty t) ind more less)
- (if (looking-at ")")
- (setq less t) ;Find close
- (setq less nil))
- ;; See previous indentation
- (while empty
- (forward-line -1)
- (beginning-of-line)
- (if (bobp)
- (setq empty nil)
- (skip-chars-forward " \t")
- (if (not (or (looking-at "%[^%]") (looking-at "\n")))
- (setq empty nil))))
- (if (bobp)
- (setq ind 0) ;Beginning of buffer
- (setq ind (current-column))) ;Beginning of clause
- ;; See its beginning
- (if (looking-at "%%[^%]")
- ind
- ;; Real prolog code
- (if (looking-at "(")
- (setq more t) ;Find open
- (setq more nil))
- ;; See its tail
- (end-of-prolog-clause)
- (or (bobp) (forward-char -1))
- (cond ((looking-at "[,(;>]")
- (if (and more (looking-at "[^,]"))
- (+ ind prolog-indent-width) ;More indentation
- (max tab-width ind))) ;Same indentation
- ((looking-at "-") tab-width) ;TAB
- ((or less (looking-at "[^.]"))
- (max (- ind prolog-indent-width) 0)) ;Less indentation
- (t 0)) ;No indentation
- )))
- )))
+ beginning-of-line)))
(defun end-of-prolog-clause ()
"Go to end of clause in this line."
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index eca6d5fbe7b..5f4028af89a 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -411,11 +411,7 @@ the car and cdr are the same symbol.")
(modify-syntax-entry (pop list) (pop list) table))
table)
-(defvar sh-mode-syntax-table nil
- "The syntax table to use for Shell-Script mode.
-This is buffer-local in every such buffer.")
-
-(defvar sh-mode-default-syntax-table
+(defvar sh-mode-syntax-table
(sh-mode-syntax-table ()
?\# "<"
?\n ">#"
@@ -436,7 +432,8 @@ This is buffer-local in every such buffer.")
?= "."
?< "."
?> ".")
- "Default syntax table for shell mode.")
+ "The syntax table to use for Shell-Script mode.
+This is buffer-local in every such buffer.")
(defvar sh-mode-syntax-table-input
'((sh . nil))
@@ -611,7 +608,7 @@ sign. See `sh-feature'."
(defvar sh-header-marker nil
"When non-nil is the end of header for prepending by \\[sh-execute-region].
That command is also used for setting this variable.")
-
+(make-variable-buffer-local 'sh-header-marker)
(defcustom sh-beginning-of-command
"\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"
@@ -1533,57 +1530,41 @@ indicate what shell it is use `sh-alias-alist' to translate.
If your shell gives error messages with line numbers, you can use \\[executable-interpret]
with your script for an edit-interpret-debug cycle."
- (make-local-variable 'skeleton-end-hook)
- (make-local-variable 'paragraph-start)
- (make-local-variable 'paragraph-separate)
- (make-local-variable 'comment-start)
- (make-local-variable 'comment-start-skip)
- (make-local-variable 'require-final-newline)
- (make-local-variable 'sh-header-marker)
(make-local-variable 'sh-shell-file)
(make-local-variable 'sh-shell)
- (make-local-variable 'skeleton-pair-alist)
- (make-local-variable 'skeleton-pair-filter-function)
- (make-local-variable 'comint-dynamic-complete-functions)
- (make-local-variable 'comint-prompt-regexp)
- (make-local-variable 'font-lock-defaults)
- (make-local-variable 'skeleton-filter-function)
- (make-local-variable 'skeleton-newline-indent-rigidly)
- (make-local-variable 'sh-shell-variables)
- (make-local-variable 'sh-shell-variables-initialized)
- (make-local-variable 'imenu-generic-expression)
- (make-local-variable 'sh-indent-supported-here)
- (make-local-variable 'skeleton-pair-default-alist)
- (setq skeleton-pair-default-alist sh-skeleton-pair-default-alist)
- (setq skeleton-end-hook (lambda ()
- (or (eolp) (newline) (indent-relative)))
- paragraph-start (concat page-delimiter "\\|$")
- paragraph-separate paragraph-start
- comment-start "# "
- comment-start-skip "#+[\t ]*"
- local-abbrev-table sh-mode-abbrev-table
- comint-dynamic-complete-functions sh-dynamic-complete-functions
- ;; we can't look if previous line ended with `\'
- comint-prompt-regexp "^[ \t]*"
- imenu-case-fold-search nil
- font-lock-defaults
- `((sh-font-lock-keywords
- sh-font-lock-keywords-1 sh-font-lock-keywords-2)
- nil nil
- ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
- (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
- (font-lock-syntactic-face-function
- . sh-font-lock-syntactic-face-function))
- skeleton-pair-alist '((?` _ ?`))
- skeleton-pair-filter-function 'sh-quoted-p
- skeleton-further-elements '((< '(- (min sh-indentation
- (current-column)))))
- skeleton-filter-function 'sh-feature
- skeleton-newline-indent-rigidly t
- sh-indent-supported-here nil)
+
+ (set (make-local-variable 'skeleton-pair-default-alist)
+ sh-skeleton-pair-default-alist)
+ (set (make-local-variable 'skeleton-end-hook)
+ (lambda () (or (eolp) (newline) (indent-relative))))
+
+ (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$"))
+ (set (make-local-variable 'paragraph-separate) paragraph-start)
+ (set (make-local-variable 'comment-start) "# ")
+ (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
+ (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
+ (set (make-local-variable 'comint-dynamic-complete-functions)
+ sh-dynamic-complete-functions)
+ ;; we can't look if previous line ended with `\'
+ (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
+ (set (make-local-variable 'imenu-case-fold-search) nil)
+ (set (make-local-variable 'font-lock-defaults)
+ `((sh-font-lock-keywords
+ sh-font-lock-keywords-1 sh-font-lock-keywords-2)
+ nil nil
+ ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
+ (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
+ (font-lock-syntactic-face-function
+ . sh-font-lock-syntactic-face-function)))
+ (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`)))
+ (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
+ (set (make-local-variable 'skeleton-further-elements)
+ '((< '(- (min sh-indentation (current-column))))))
+ (set (make-local-variable 'skeleton-filter-function) 'sh-feature)
+ (set (make-local-variable 'skeleton-newline-indent-rigidly) t)
+ (set (make-local-variable 'sh-indent-supported-here) nil)
(set (make-local-variable 'defun-prompt-regexp)
(concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
;; Parse or insert magic number for exec, and set all variables depending
;; on the shell thus determined.
(sh-set-shell
@@ -1737,21 +1718,20 @@ Calls the value of `sh-set-shell-hook' if set."
no-query-flag insert-flag)))
(let ((tem (sh-feature sh-require-final-newline)))
(if (eq tem t)
- (setq require-final-newline mode-require-final-newline)))
- (setq
- mode-line-process (format "[%s]" sh-shell)
- sh-shell-variables nil
- sh-shell-variables-initialized nil
- imenu-generic-expression (sh-feature sh-imenu-generic-expression))
- (make-local-variable 'sh-mode-syntax-table)
+ (set (make-local-variable 'require-final-newline)
+ mode-require-final-newline)))
+ (setq mode-line-process (format "[%s]" sh-shell))
+ (set (make-local-variable 'sh-shell-variables) nil)
+ (set (make-local-variable 'sh-shell-variables-initialized) nil)
+ (set (make-local-variable 'imenu-generic-expression)
+ (sh-feature sh-imenu-generic-expression))
(let ((tem (sh-feature sh-mode-syntax-table-input)))
- (setq sh-mode-syntax-table
- (if tem (apply 'sh-mode-syntax-table tem)
- sh-mode-default-syntax-table)))
- (set-syntax-table sh-mode-syntax-table)
+ (when tem
+ (set (make-local-variable 'sh-mode-syntax-table)
+ (apply 'sh-mode-syntax-table tem))
+ (set-syntax-table sh-mode-syntax-table)))
(dolist (var (sh-feature sh-variables))
(sh-remember-variable var))
- (make-local-variable 'indent-line-function)
(if (setq sh-indent-supported-here (sh-feature sh-indent-supported))
(progn
(message "Setting up indent for shell type %s" sh-shell)
@@ -1764,7 +1744,7 @@ Calls the value of `sh-set-shell-hook' if set."
(message "setting up indent stuff")
;; sh-mode has already made indent-line-function local
;; but do it in case this is called before that.
- (setq indent-line-function 'sh-indent-line)
+ (set (make-local-variable 'indent-line-function) 'sh-indent-line)
(if sh-make-vars-local
(sh-make-vars-local))
(message "Indentation setup for shell type %s" sh-shell))
@@ -3463,20 +3443,15 @@ CODE can be nil, t or `lambda'.
nil means to return the best completion of STRING, or nil if there is none.
t means to return a list of all possible completions of STRING.
`lambda' means to return t if STRING is a valid completion as it stands."
- (let ((sh-shell-variables
+ (let ((vars
(with-current-buffer sh-add-buffer
(or sh-shell-variables-initialized
(sh-shell-initialize-variables))
(nconc (mapcar (lambda (var)
- (let ((name
- (substring var 0 (string-match "=" var))))
- (cons name name)))
+ (substring var 0 (string-match "=" var)))
process-environment)
sh-shell-variables))))
- (case code
- ((nil) (try-completion string sh-shell-variables predicate))
- (lambda (test-completion string sh-shell-variables predicate))
- (t (all-completions string sh-shell-variables predicate)))))
+ (complete-with-action code vars string predicate)))
(defun sh-add (var delta)
"Insert an addition of VAR and prefix DELTA for Bourne (type) shell."
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 1f981e5a3d7..e4df102f542 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -663,9 +663,9 @@ is changed."
Starts `sql-interactive-mode' after doing some setup.
-On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to
-start the sqlplus console, use \"plus33\" or something similar. You
-will find the file in your Orant\\bin directory."
+On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order
+to start the sqlplus console, use \"plus33\" or something similar.
+You will find the file in your Orant\\bin directory."
:type 'file
:group 'SQL)
@@ -690,7 +690,7 @@ will find the file in your Orant\\bin directory."
When non-nil, Emacs will scan text sent to sqlplus and prompt
for replacement text for & placeholders as sqlplus does. This
-is needed on Windows where sqlplus output is buffer and the
+is needed on Windows where sqlplus output is buffered and the
prompts are not shown until after the text is entered.
You will probably want to issue the following command in sqlplus
@@ -772,10 +772,10 @@ Starts `sql-interactive-mode' after doing some setup."
:version "24.1"
:group 'SQL)
-;; Customization for SyBase
+;; Customization for Sybase
(defcustom sql-sybase-program "isql"
- "Command to start isql by SyBase.
+ "Command to start isql by Sybase.
Starts `sql-interactive-mode' after doing some setup."
:type 'file
@@ -2042,7 +2042,7 @@ See `sql-product-alist' for a list of products and supported features."
(message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
(defun sql-product-font-lock (keywords-only imenu)
- "Configures font-lock and imenu with product-specific settings.
+ "Configure font-lock and imenu with product-specific settings.
The KEYWORDS-ONLY flag is passed to font-lock to specify whether
only keywords should be hilighted and syntactic hilighting
@@ -2098,7 +2098,7 @@ also be configured."
(defun sql-add-product-keywords (product keywords &optional append)
"Add highlighting KEYWORDS for SQL PRODUCT.
-PRODUCT should be a symbol, the name of a sql product, such as
+PRODUCT should be a symbol, the name of a SQL product, such as
`oracle'. KEYWORDS should be a list; see the variable
`font-lock-keywords'. By default they are added at the beginning
of the current highlighting list. If optional argument APPEND is
@@ -2131,7 +2131,7 @@ adds a fontification pattern to fontify identifiers ending in
;;; Functions to switch highlighting
(defun sql-highlight-product ()
- "Turns on the font highlighting for the SQL product selected."
+ "Turn on the font highlighting for the SQL product selected."
(when (derived-mode-p 'sql-mode)
;; Setup font-lock
(sql-product-font-lock nil t)
@@ -2141,7 +2141,7 @@ adds a fontification pattern to fontify identifiers ending in
(symbol-name sql-product)) "]"))))
(defun sql-set-product (product)
- "Set `sql-product' to product and enable appropriate highlighting."
+ "Set `sql-product' to PRODUCT and enable appropriate highlighting."
(interactive
(list (completing-read "SQL product: "
(mapcar (lambda (info) (symbol-name (car info)))
@@ -2416,7 +2416,7 @@ variable `sql-buffer'. See `sql-help' on how to create such a buffer."
(message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
(defun sql-make-alternate-buffer-name ()
- "Returns a string that can be used to rename a SQLi buffer.
+ "Return a string that can be used to rename a SQLi buffer.
This is used to set `sql-alternate-buffer-name' within
`sql-interactive-mode'."
@@ -2475,7 +2475,7 @@ Inserts SELECT or commas if appropriate."
(defun sql-placeholders-filter (string)
"Replace placeholders in STRING.
-Placeholders are words starting with and ampersand like &this."
+Placeholders are words starting with an ampersand like &this."
(when sql-oracle-scan-on
(while (string-match "&\\(\\sw+\\)" string)
@@ -2489,7 +2489,7 @@ Placeholders are words starting with and ampersand like &this."
;; Using DB2 interactively, newlines must be escaped with " \".
;; The space before the backslash is relevant.
(defun sql-escape-newlines-filter (string)
- "Escapes newlines in STRING.
+ "Escape newlines in STRING.
Every newline in STRING will be preceded with a space and a backslash."
(let ((result "") (start 0) mb me)
(while (string-match "\n" string start)
@@ -2508,7 +2508,7 @@ Every newline in STRING will be preceded with a space and a backslash."
;;; Input sender for SQLi buffers
(defun sql-input-sender (proc string)
- "Sends STRING to PROC after applying filters."
+ "Send STRING to PROC after applying filters."
(let* ((product (with-current-buffer (process-buffer proc) sql-product))
(filter (sql-get-product-feature product :input-filter)))
@@ -2575,7 +2575,7 @@ Every newline in STRING will be preceded with a space and a backslash."
(sql-send-region (point-min) (point-max)))
(defun sql-send-magic-terminator (buf str terminator)
- "Sends TERMINATOR to buffer BUF if its not present in STR."
+ "Send TERMINATOR to buffer BUF if its not present in STR."
(let (pat term)
;; If flag is merely on(t), get product-specific terminator
(if (eq terminator t)
@@ -2961,7 +2961,7 @@ The default comes from `process-coding-system-alist' and
;;;###autoload
(defun sql-sybase ()
- "Run isql by SyBase as an inferior process.
+ "Run isql by Sybase as an inferior process.
If buffer `*SQL*' exists but no process is running, make a new process.
If buffer exists and a process is running, just switch to buffer
diff --git a/lisp/simple.el b/lisp/simple.el
index 5948536262c..48e1148ae6b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -422,6 +422,13 @@ Other major modes are defined by comparison with this one."
"Parent major mode from which special major modes should inherit."
(setq buffer-read-only t))
+;; Major mode meant to be the parent of programming modes.
+
+(define-derived-mode prog-mode fundamental-mode "Prog"
+ "Major mode for editing programming language source code."
+ (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+ (set (make-local-variable 'parse-sexp-ignore-comments) t))
+
;; Making and deleting lines.
(defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))
@@ -2070,7 +2077,11 @@ to `shell-command-history'."
Like `shell-command' but if COMMAND doesn't end in ampersand, adds `&'
surrounded by whitespace and executes the command asynchronously.
-The output appears in the buffer `*Async Shell Command*'."
+The output appears in the buffer `*Async Shell Command*'.
+
+In Elisp, you will often be better served by calling `start-process'
+directly, since it offers more control and does not impose the use of a
+shell (with its need to quote arguments)."
(interactive
(list
(read-shell-command "Async shell command: " nil nil
@@ -2131,7 +2142,11 @@ If the optional third argument ERROR-BUFFER is non-nil, it is a buffer
or buffer name to which to direct the command's standard error output.
If it is nil, error output is mingled with regular output.
In an interactive call, the variable `shell-command-default-error-buffer'
-specifies the value of ERROR-BUFFER."
+specifies the value of ERROR-BUFFER.
+
+In Elisp, you will often be better served by calling `call-process' or
+`start-process' directly, since it offers more control and does not impose
+the use of a shell (with its need to quote arguments)."
(interactive
(list
diff --git a/lisp/subr.el b/lisp/subr.el
index 0cc05a78bc7..1c399f89b9c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3804,5 +3804,30 @@ which is higher than \"1alpha\"."
(prin1-to-string (make-hash-table)))))
(provide 'hashtable-print-readable))
+;; Moving with arrows in bidi-sensitive direction.
+(defun right-arrow-command (&optional n)
+ "Move point N characters to the right (to the left if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either forward
+or backward in the buffer. This is in contrast with \\[forward-char]
+and \\[backward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (forward-char n)
+ (backward-char n)))
+
+(defun left-arrow-command ( &optional n)
+ "Move point N characters to the left (to the right if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either backward
+or forward in the buffer. This is in contrast with \\[backward-char]
+and \\[forward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (backward-char n)
+ (forward-char n)))
+
;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc
;;; subr.el ends here
diff --git a/lisp/version.el b/lisp/version.el
index 5cd0cc8d634..770409b9487 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -29,12 +29,6 @@
;;; Code:
-(defconst emacs-copyright "Copyright (C) 2010 Free Software Foundation, Inc." "\
-Short copyright string for this version of Emacs.")
-
-(defconst emacs-version "24.0.50" "\
-Version numbers of this version of Emacs.")
-
(defconst emacs-major-version (progn (string-match "^[0-9]+" emacs-version) (string-to-number (match-string 0 emacs-version))) "\
Major version number of this version of Emacs.
This variable first existed in version 19.23.")
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index efdf26b529c..0b97b184d22 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -253,15 +253,16 @@ You should set this to t when using a non-system shell.\n\n"))))
;; (setq source-directory (file-name-as-directory
;; (expand-file-name ".." exec-directory)))))
-(defun convert-standard-filename (filename)
- "Convert a standard file's name to something suitable for the current OS.
+(defun w32-convert-standard-filename (filename)
+ "Convert a standard file's name to something suitable for the MS-Windows.
This means to guarantee valid names and perhaps to canonicalize
certain patterns.
-On Windows and DOS, replace invalid characters. On DOS, make
-sure to obey the 8.3 limitations. On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+This function is called by `convert-standard-filename'.
+
+Replace invalid characters and turn Cygwin names into native
+names, and also turn slashes into backslashes if the shell
+requires it (see `w32-shell-dos-semantics')."
(save-match-data
(let ((name
(if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)