aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2010-11-17 22:54:14 -0500
committerStefan Monnier <[email protected]>2010-11-17 22:54:14 -0500
commit4a47c2757309e338321da1e7a2f6d399a306ce7d (patch)
treede441bac2c90c3302459c5f0ffe9c53ec4b31c2f /lisp
parent8bbb7dd8a6d08540a81a7a2baa2274d8e6d65c92 (diff)
parentb916cbefa481920a49eac03c7025693f38afc882 (diff)
Merge from emacs-23
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog81
-rw-r--r--lisp/calendar/calendar.el13
-rw-r--r--lisp/comint.el1
-rw-r--r--lisp/emacs-lisp/autoload.el4
-rw-r--r--lisp/emacs-lisp/bytecomp.el17
-rw-r--r--lisp/emacs-lisp/smie.el202
-rw-r--r--lisp/files.el5
-rw-r--r--lisp/ls-lisp.el12
-rw-r--r--lisp/mouse-sel.el2
-rw-r--r--lisp/novice.el11
-rw-r--r--lisp/printing.el8
-rw-r--r--lisp/progmodes/python.el2
-rw-r--r--lisp/server.el2
-rw-r--r--lisp/simple.el21
-rw-r--r--lisp/speedbar.el3
-rw-r--r--lisp/subr.el3
-rw-r--r--lisp/textmodes/picture.el32
-rw-r--r--lisp/vc/vc-hg.el12
-rw-r--r--lisp/wid-edit.el8
19 files changed, 302 insertions, 137 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dc5761109d..9fa66ca802 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,86 @@
2010-11-18 Stefan Monnier <[email protected]>
+ * simple.el (kill-new, kill-append, kill-region):
+ * comint.el (comint-kill-region): Make the yank-handler argument obsolete.
+
+2010-11-18 Stefan Monnier <[email protected]>
+
+ * emacs-lisp/smie.el (smie-bnf-classify): Signal errors for tokens
+ that are both openers (resp. closers) and something else.
+ (smie-grammar): Loosen definition of valid values.
+ (smie-next-sexp, smie-down-list, smie-blink-matching-open)
+ (smie-indent--parent, smie-rule-parent, smie-indent-keyword)
+ (smie-indent-after-keyword): Adjust users.
+ (smie-indent-keyword): Don't indent empty lines.
+
+ * vc-hg.el (vc-hg-program): New var.
+ Suggested by Norman Gray <[email protected]>.
+ (vc-hg-state, vc-hg-working-revision, vc-hg-command): Use it.
+
+2010-11-18 Glenn Morris <[email protected]>
+
+ * emacs-lisp/autoload.el (autoload-find-destination): The function
+ coding-system-eol-type may return non-numeric values. (Bug#7414)
+
+2010-11-18 Ulrich Mueller <[email protected]>
+
+ * server.el (server-force-stop): Ensure the server is stopped (Bug#7409).
+
+2010-11-18 Eli Zaretskii <[email protected]>
+
+ * subr.el (posn-col-row): Pay attention to header line. (Bug#7390)
+
+2010-11-18 Chong Yidong <[email protected]>
+
+ * textmodes/picture.el (picture-mouse-set-point): Don't use
+ posn-col-row; explicitly compute the motion based on the posn at
+ the window-start (Bug#7390).
+
+2010-11-18 Glenn Morris <[email protected]>
+
+ * novice.el (disabled-command-function):
+ Fix 2009-11-15 change. (Bug#7384)
+
+2010-11-18 Glenn Morris <[email protected]>
+
+ * calendar/calendar.el (diary-iso-date-forms): Make elements
+ mutually exclusive. (Bug#7377)
+
+2010-11-18 Stefan Monnier <[email protected]>
+
+ * emacs-lisp/smie.el (smie-prec2->grammar): Obey equality constraints
+ when filling the remaining "unconstrained" values.
+
+2010-11-18 Stefan Monnier <[email protected]>
+
+ * emacs-lisp/bytecomp.el (byte-compile-warnings): Simplify the
+ safety predicate.
+
+ * files.el (safe-local-variable-p): Gracefully handle errors.
+
+ * emacs-lisp/smie.el (smie-rule-parent, smie-indent--rule):
+ Use smie-indent-virtual when indenting relative to an opener.
+ (smie-rule-separator): Use smie-rule-parent.
+ (smie-indent-keyword): Consult rules, even for openers at bol.
+ (smie-indent-comment-close): Try to align closer's content.
+
+2010-11-18 Glenn Morris <[email protected]>
+
+ * ls-lisp.el (ls-lisp-dired-ignore-case): Make it an obsolete alias.
+
+2010-11-18 Glenn Morris <[email protected]>
+
+ * printing.el (pr-menu-bind): Doc fix.
+
+ * speedbar.el (speedbar-toggle-images): Doc fix.
+
+ * progmodes/python.el (python-shell): Doc fix.
+
+ * wid-edit.el (widget-field-use-before-change)
+ (widget-use-overlay-change): Doc fixes.
+
+2010-11-18 Stefan Monnier <[email protected]>
+
Minor cleanup to improve style.
* textmodes/rst.el (rst-update-section): Use point-marker.
(rst-get-decoration): Eliminate unneeded assignment.
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 418f740bb8..24ebb19a58 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -736,14 +736,16 @@ calendar package is already loaded). Rather, use either
(defcustom diary-iso-date-forms
'((month "[-/]" day "[^-/0-9]")
(year "[-/]" month "[-/]" day "[^0-9]")
- (monthname "-" day "[^-0-9]")
- (year "-" monthname "-" day "[^0-9]")
+ ;; Cannot allow [-/] as separators here, since it would also match
+ ;; the first element (bug#7377).
+ (monthname " *" day "[^-0-9]")
+ (year " *" monthname " *" day "[^0-9]")
(dayname "\\W"))
"List of pseudo-patterns describing the ISO style of dates.
-The defaults are: MONTH[-/]DAY; YEAR[-/]MONTH[-/]DAY; MONTHNAME-DAY;
-YEAR-MONTHNAME-DAY; DAYNAME. Normally you should not customize this,
+The defaults are: MONTH[-/]DAY; YEAR[-/]MONTH[-/]DAY; MONTHNAME DAY;
+YEAR MONTHNAME DAY; DAYNAME. Normally you should not customize this,
but `diary-date-forms' (which see)."
- :version "23.1"
+ :version "23.3" ; bug#7377
:type '(repeat (choice (cons :tag "Backup"
:value (backup . nil)
(const backup)
@@ -2570,5 +2572,4 @@ If called by a mouse-event, pops up a menu with the result."
;; byte-compile-dynamic: t
;; End:
-;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8
;;; calendar.el ends here
diff --git a/lisp/comint.el b/lisp/comint.el
index 0eee4128a2..2d03d1679a 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2648,6 +2648,7 @@ updated using `comint-update-fence', if necessary."
(let ((inhibit-read-only t))
(kill-region beg end yank-handler)
(comint-update-fence))))))
+(set-advertised-calling-convention 'comint-kill-region '(beg end) "23.3")
;; Support for source-file processing commands.
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 532d68245d..4dd1a118eb 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -575,8 +575,8 @@ removes any prior now out-of-date autoload entries."
(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.
- (unless (zerop (coding-system-eol-type buffer-file-coding-system))
- (set-buffer-file-coding-system 'unix))
+ (or (eq 0 (coding-system-eol-type buffer-file-coding-system))
+ (set-buffer-file-coding-system 'unix))
(or (> (buffer-size) 0)
(error "Autoloads file %s lacks boilerplate" buffer-file-name))
(or (file-writable-p buffer-file-name)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index f1adc5b496..f04aad994f 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -301,21 +301,12 @@ suppress. For example, (not mapcar) will suppress warnings about mapcar."
(set :menu-tag "Some"
,@(mapcar (lambda (x) `(const ,x))
byte-compile-warning-types))))
-;;;###autoload(put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p)
;;;###autoload
-(defun byte-compile-warnings-safe-p (x)
- "Return non-nil if X is valid as a value of `byte-compile-warnings'."
- (or (booleanp x)
- (and (listp x)
- (if (eq (car x) 'not) (setq x (cdr x))
- t)
- (equal (mapcar
- (lambda (e)
- (when (memq e byte-compile-warning-types)
- e))
- x)
- x))))
+(put 'byte-compile-warnings 'safe-local-variable
+ (lambda (v)
+ (or (symbolp v)
+ (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v))))))
(defun byte-compile-warning-enabled-p (warning)
"Return non-nil if WARNING is enabled, according to `byte-compile-warnings'."
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 03c03126d2..179e0a9f09 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -63,10 +63,31 @@
;; Since then, some of that code has been beaten into submission, but the
;; smie-indent-keyword is still pretty obscure.
-;;; Code:
+;; Conflict resolution:
+;;
+;; - One source of conflicts is when you have:
+;; (exp ("IF" exp "ELSE" exp "END") ("CASE" cases "END"))
+;; (cases (cases "ELSE" insts) ...)
+;; The IF-rule implies ELSE=END and the CASE-rule implies ELSE>END.
+;; FIXME: we could try to resolve such conflicts automatically by changing
+;; the way BNF rules such as the IF-rule is handled. I.e. rather than
+;; IF=ELSE and ELSE=END, we could turn them into IF<ELSE and ELSE>END
+;; and IF=END,
+
+;; TODO & BUGS:
+;;
+;; - FIXME: I think the behavior on empty lines is wrong. It shouldn't
+;; look at the next token on subsequent lines.
+;; - Using the structural information SMIE gives us, it should be possible to
+;; implement a `smie-align' command that would automatically figure out what
+;; there is to align and how to do it (something like: align the token of
+;; lowest precedence that appears the same number of times on all lines,
+;; and then do the same on each side of that token).
+;; - Maybe accept two juxtaposed non-terminals in the BNF under the condition
+;; that the first always ends with a terminal, or that the second always
+;; starts with a terminal.
-;; FIXME: I think the behavior on empty lines is wrong. It shouldn't
-;; look at the next token on subsequent lines.
+;;; Code:
(eval-when-compile (require 'cl))
@@ -155,6 +176,11 @@ one of those elements share the same precedence level and associativity."
(put 'smie-bnf->prec2 'pure t)
(defun smie-bnf->prec2 (bnf &rest precs)
+ ;; FIXME: Add repetition operator like (repeat <separator> <elems>).
+ ;; Maybe also add (or <elem1> <elem2>...) for things like
+ ;; (exp (exp (or "+" "*" "=" ..) exp)).
+ ;; Basically, make it EBNF (except for the specification of a separator in
+ ;; the repetition).
(let ((nts (mapcar 'car bnf)) ;Non-terminals
(first-ops-table ())
(last-ops-table ())
@@ -327,6 +353,7 @@ from the table, e.g. the table will not include things like (\"if\" . \"else\").
"Return a table classifying terminals.
Each terminal can either be an `opener', a `closer', or neither."
(let ((table (make-hash-table :test #'equal))
+ (nts (mapcar #'car bnf))
(alist '()))
(dolist (category bnf)
(puthash (car category) 'neither table) ;Remove non-terminals.
@@ -336,14 +363,22 @@ Each terminal can either be an `opener', a `closer', or neither."
(let ((first (pop rhs)))
(puthash first
(if (memq (gethash first table) '(nil opener))
- 'opener 'neither)
+ 'opener
+ (unless (member first nts)
+ (error "SMIE: token %s is both opener and non-opener"
+ first))
+ 'neither)
table))
(while (cdr rhs)
(puthash (pop rhs) 'neither table)) ;Remove internals.
(let ((last (pop rhs)))
(puthash last
(if (memq (gethash last table) '(nil closer))
- 'closer 'neither)
+ 'closer
+ (unless (member last nts)
+ (error "SMIE: token %s is both closer and non-closer"
+ last))
+ 'neither)
table)))))
(maphash (lambda (tok v)
(when (memq v '(closer opener))
@@ -385,6 +420,18 @@ CSTS is a list of pairs representing arcs in a graph."
(append names (list (car names)))
" < ")))
+;; (defun smie-check-grammar (grammar prec2 &optional dummy)
+;; (maphash (lambda (k v)
+;; (when (consp k)
+;; (let ((left (nth 2 (assoc (car k) grammar)))
+;; (right (nth 1 (assoc (cdr k) grammar))))
+;; (when (and left right)
+;; (cond
+;; ((< left right) (assert (eq v '<)))
+;; ((> left right) (assert (eq v '>)))
+;; (t (assert (eq v '=))))))))
+;; prec2))
+
(put 'smie-prec2->grammar 'pure t)
(defun smie-prec2->grammar (prec2)
"Take a 2D precedence table and turn it into an alist of precedence levels.
@@ -453,6 +500,7 @@ PREC2 is a table as returned by `smie-precs->prec2' or
;; left = right).
(unless (caar cst)
(setcar (car cst) i)
+ ;; (smie-check-grammar table prec2 'step1)
(incf i))
(setq csts (delq cst csts))))
(unless progress
@@ -462,8 +510,19 @@ PREC2 is a table as returned by `smie-precs->prec2' or
(incf i 10))
;; Propagate equalities back to their source.
(dolist (eq (nreverse eqs))
- (assert (or (null (caar eq)) (eq (car eq) (cdr eq))))
- (setcar (car eq) (cadr eq)))
+ (when (null (cadr eq))
+ ;; There's an equality constraint, but we still haven't given
+ ;; it a value: that means it binds tighter than anything else,
+ ;; and it can't be an opener/closer (those don't have equality
+ ;; constraints).
+ ;; So set it here rather than below since doing it below
+ ;; makes it more difficult to obey the equality constraints.
+ (setcar (cdr eq) i)
+ (incf i))
+ (assert (or (null (caar eq)) (eq (caar eq) (cadr eq))))
+ (setcar (car eq) (cadr eq))
+ ;; (smie-check-grammar table prec2 'step2)
+ )
;; Finally, fill in the remaining vars (which only appeared on the
;; right side of the < constraints).
(let ((classification-table (gethash :smie-open/close-alist prec2)))
@@ -484,6 +543,7 @@ PREC2 is a table as returned by `smie-precs->prec2' or
(incf i))))) ;See other (incf i) above.
(let ((ca (gethash :smie-closer-alist prec2)))
(when ca (push (cons :smie-closer-alist ca) table)))
+ ;; (smie-check-grammar table prec2 'step3)
table))
;;; Parsing using a precedence level table.
@@ -493,9 +553,9 @@ PREC2 is a table as returned by `smie-precs->prec2' or
This list is normally built by `smie-prec2->grammar'.
Each element is of the form (TOKEN LEFT-LEVEL RIGHT-LEVEL).
Parsing is done using an operator precedence parser.
-LEFT-LEVEL and RIGHT-LEVEL can be either numbers or nil, where nil
+LEFT-LEVEL and RIGHT-LEVEL can be either numbers or a list, where a list
means that this operator does not bind on the corresponding side,
-i.e. a LEFT-LEVEL of nil means this is a token that behaves somewhat like
+e.g. a LEFT-LEVEL of nil means this is a token that behaves somewhat like
an open-paren, whereas a RIGHT-LEVEL of nil would correspond to something
like a close-paren.")
@@ -579,9 +639,10 @@ Possible return values:
(if (eq pos (point))
;; We did not move, so let's abort the loop.
(throw 'return (list t (point))))))
- ((null (funcall op-back toklevels))
+ ((not (numberp (funcall op-back toklevels)))
;; A token like a paren-close.
- (assert (funcall op-forw toklevels)) ;Otherwise, why mention it?
+ (assert (numberp ; Otherwise, why mention it in smie-grammar.
+ (funcall op-forw toklevels)))
(push toklevels levels))
(t
(while (and levels (< (funcall op-back toklevels)
@@ -589,7 +650,7 @@ Possible return values:
(setq levels (cdr levels)))
(cond
((null levels)
- (if (and halfsexp (funcall op-forw toklevels))
+ (if (and halfsexp (numberp (funcall op-forw toklevels)))
(push toklevels levels)
(throw 'return
(prog1 (list (or (car toklevels) t) (point) token)
@@ -605,15 +666,15 @@ Possible return values:
;; Keep looking as long as we haven't matched the
;; topmost operator.
(levels
- (if (funcall op-forw toklevels)
+ (if (numberp (funcall op-forw toklevels))
(push toklevels levels)))
;; We matched the topmost operator. If the new operator
;; is the last in the corresponding BNF rule, we're done.
- ((null (funcall op-forw toklevels))
+ ((not (numberp (funcall op-forw toklevels)))
;; It is the last element, let's stop here.
(throw 'return (list nil (point) token)))
;; If the new operator is not the last in the BNF rule,
- ;; ans is not associative, it's one of the inner operators
+ ;; and is not associative, it's one of the inner operators
;; (like the "in" in "let .. in .. end"), so keep looking.
((not (smie--associative-p toklevels))
(push toklevels levels))
@@ -714,7 +775,7 @@ Possible return values:
;; intervention, e.g. for Octave's use of `until'
;; as a pseudo-closer of `do'.
(closer)
- ((or (equal levels '(nil)) (nth 1 (car levels)))
+ ((or (equal levels '(nil)) (numberp (nth 1 (car levels))))
(error "Doesn't look like a block"))
(t
;; Now that smie-setup automatically sets smie-closer-alist
@@ -725,7 +786,7 @@ Possible return values:
(when (and (eq (nth 2 level) (nth 1 other))
(not (memq other seen)))
(push other seen)
- (if (nth 2 other)
+ (if (numberp (nth 2 other))
(push other levels)
(push (car other) found))))))
(cond
@@ -766,8 +827,8 @@ This command assumes point is not in a string or comment."
(progn (goto-char start) (down-list inc) nil)
(forward-sexp inc)
(/= (point) pos)))
- ((and levels (null (nth (+ 1 offset) levels))) nil)
- ((and levels (null (nth (- 2 offset) levels)))
+ ((and levels (not (numberp (nth (+ 1 offset) levels)))) nil)
+ ((and levels (not (numberp (nth (- 2 offset) levels))))
(let ((end (point)))
(goto-char start)
(signal 'scan-error
@@ -852,7 +913,7 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
(not (memq (char-before)
smie-blink-matching-triggers)))
(or smie-blink-matching-inners
- (null (nth 2 (assoc token smie-grammar)))))
+ (not (numberp (nth 2 (assoc token smie-grammar))))))
;; The major mode might set blink-matching-check-function
;; buffer-locally so that interactive calls to
;; blink-matching-open work right, but let's not presume
@@ -928,7 +989,7 @@ the beginning of a line."
(save-excursion
(let* ((pos (point))
(tok (funcall smie-forward-token-function)))
- (unless (cadr (assoc tok smie-grammar))
+ (unless (numberp (cadr (assoc tok smie-grammar)))
(goto-char pos))
(setq smie--parent
(smie-backward-sexp 'halfsexp))))))
@@ -969,8 +1030,14 @@ Only meaningful when called from within `smie-rules-function'."
(goto-char (cadr (smie-indent--parent)))
(cons 'column
(+ (or offset 0)
- (if (smie-indent--hanging-p)
- (smie-indent-virtual) (current-column))))))
+ ;; Use smie-indent-virtual when indenting relative to an opener:
+ ;; this will also by default use current-column unless
+ ;; that opener is hanging, but will additionally consult
+ ;; rules-function, so it gives it a chance to tweak
+ ;; indentation (e.g. by forcing indentation relative to
+ ;; its own parent, as in fn a => fn b => fn c =>).
+ (if (or (listp (car smie--parent)) (smie-indent--hanging-p))
+ (smie-indent-virtual) (current-column))))))
(defvar smie-rule-separator-outdent 2)
@@ -1030,11 +1097,7 @@ Only meaningful when called from within `smie-rules-function'."
;; FIXME: Rather than consult the number of spaces, we could *set* the
;; number of spaces so as to align the separator with the close-paren
;; while aligning the content with the rest.
- (let ((parent-col
- (save-excursion
- (goto-char (cadr smie--parent))
- (if (smie-indent--hanging-p)
- (smie-indent-virtual) (current-column))))
+ (let ((parent-col (cdr (smie-rule-parent)))
(parent-pos-col ;FIXME: we knew this when computing smie--parent.
(save-excursion
(goto-char (cadr smie--parent))
@@ -1083,7 +1146,16 @@ BASE-POS is the position relative to which offsets should be applied."
(+ offset
(if (null base-pos) 0
(goto-char base-pos)
- (if (smie-indent--hanging-p)
+ ;; Use smie-indent-virtual when indenting relative to an opener:
+ ;; this will also by default use current-column unless
+ ;; that opener is hanging, but will additionally consult
+ ;; rules-function, so it gives it a chance to tweak indentation
+ ;; (e.g. by forcing indentation relative to its own parent, as in
+ ;; fn a => fn b => fn c =>).
+ ;; When parent==nil it doesn't matter because the only case
+ ;; where it's really used is when the base-pos is hanging anyway.
+ (if (or (and parent (null (car parent)))
+ (smie-indent--hanging-p))
(smie-indent-virtual) (current-column)))))
(t (error "Unknown indentation offset %s" offset))))))
@@ -1160,27 +1232,30 @@ in order to figure out the indentation of some other (further down) point."
(let* ((pos (point))
(toklevels (smie-indent-forward-token))
(token (pop toklevels)))
- (if (null (car toklevels))
- (save-excursion
- (goto-char pos)
- ;; Different cases:
- ;; - smie-indent--bolp: "indent according to others".
- ;; - common hanging: "indent according to others".
- ;; - SML-let hanging: "indent like parent".
- ;; - if-after-else: "indent-like parent".
- ;; - middle-of-line: "trust current position".
- (cond
- ((null (cdr toklevels)) nil) ;Not a keyword.
- ((smie-indent--bolp)
- ;; For an open-paren-like thingy at BOL, always indent only
- ;; based on other rules (typically smie-indent-after-keyword).
- nil)
- ;; We're only ever here for virtual-indent.
- ((smie-indent--rule :before token))
- (t
- ;; By default use point unless we're hanging.
- (unless (smie-indent--hanging-p) (current-column)))))
-
+ (cond
+ ((< pos (line-beginning-position))
+ ;; The token we just read is actually not on the line where we started.
+ nil)
+ ((not (numberp (car toklevels)))
+ (save-excursion
+ (goto-char pos)
+ ;; Different cases:
+ ;; - smie-indent--bolp: "indent according to others".
+ ;; - common hanging: "indent according to others".
+ ;; - SML-let hanging: "indent like parent".
+ ;; - if-after-else: "indent-like parent".
+ ;; - middle-of-line: "trust current position".
+ (cond
+ ((null (cdr toklevels)) nil) ;Not a keyword.
+ ((smie-indent--rule :before token))
+ ((smie-indent--bolp) ;I.e. non-virtual indent.
+ ;; For an open-paren-like thingy at BOL, always indent only
+ ;; based on other rules (typically smie-indent-after-keyword).
+ nil)
+ (t
+ ;; By default use point unless we're hanging.
+ (unless (smie-indent--hanging-p) (current-column))))))
+ (t
;; FIXME: This still looks too much like black magic!!
(let* ((parent (smie-backward-sexp 'halfsexp)))
;; Different behaviors:
@@ -1260,7 +1335,7 @@ in order to figure out the indentation of some other (further down) point."
;; So we use a heuristic here, which is that we only use virtual
;; if the parent is tightly linked to the child token (they're
;; part of the same BNF rule).
- (if (car parent) (current-column) (smie-indent-virtual))))))))))
+ (if (car parent) (current-column) (smie-indent-virtual)))))))))))
(defun smie-indent-comment ()
"Compute indentation of a comment."
@@ -1298,10 +1373,19 @@ in order to figure out the indentation of some other (further down) point."
comment-end-skip
(not (looking-at " \t*$")) ;Not just a \n comment-closer.
(looking-at comment-end-skip)
- (nth 4 (syntax-ppss))
- (save-excursion
- (goto-char (nth 8 (syntax-ppss)))
- (current-column))))
+ (let ((end (match-string 0)))
+ (and (nth 4 (syntax-ppss))
+ (save-excursion
+ (goto-char (nth 8 (syntax-ppss)))
+ (and (looking-at comment-start-skip)
+ (let ((start (match-string 0)))
+ ;; Align the common substring between starter
+ ;; and ender, if possible.
+ (if (string-match "\\(.+\\).*\n\\(.*?\\)\\1"
+ (concat start "\n" end))
+ (+ (current-column) (match-beginning 0)
+ (- (match-beginning 2) (match-end 2)))
+ (current-column)))))))))
(defun smie-indent-comment-inside ()
(and (nth 4 (syntax-ppss))
@@ -1319,11 +1403,11 @@ in order to figure out the indentation of some other (further down) point."
;; The default indentation after a keyword/operator is
;; 0 for infix, t for prefix, and use another rule
;; for postfix.
- ((null (nth 2 toklevel)) nil) ;A closer.
- ((or (null (nth 1 toklevel)) ;An opener.
- (rassoc tok smie-closer-alist)) ;An inner.
+ ((not (numberp (nth 2 toklevel))) nil) ;A closer.
+ ((or (not (numberp (nth 1 toklevel))) ;An opener.
+ (rassoc tok smie-closer-alist)) ;An inner.
(+ (smie-indent-virtual) (smie-indent--offset 'basic))) ;
- (t (smie-indent-virtual)))))) ;An infix.
+ (t (smie-indent-virtual)))))) ;An infix.
(defun smie-indent-exps ()
;; Indentation of sequences of simple expressions without
diff --git a/lisp/files.el b/lisp/files.el
index ca698cab33..3b130a20d2 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3224,7 +3224,10 @@ It is safe if any of these conditions are met:
evaluates to a non-nil value with VAL as an argument."
(or (member (cons sym val) safe-local-variable-values)
(let ((safep (get sym 'safe-local-variable)))
- (and (functionp safep) (funcall safep val)))))
+ (and (functionp safep)
+ ;; If the function signals an error, that means it
+ ;; can't assure us that the value is safe.
+ (with-demoted-errors (funcall safep val))))))
(defun risky-local-variable-p (sym &optional ignored)
"Non-nil if SYM could be dangerous as a file-local variable.
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 5f76c1bab7..58ed6685dc 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -103,10 +103,16 @@ update the dependent variables."
(ls-lisp-set-options)))
:group 'ls-lisp)
+;; Only made an obsolete alias in 23.3. Before that, the initial
+;; value was set according to:
+;; (or (memq ls-lisp-emulation '(MS-Windows MacOS))
+;; (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case))
+;; Which isn't the right thing to do.
+(define-obsolete-variable-alias 'ls-lisp-dired-ignore-case
+ 'ls-lisp-ignore-case "21.1")
+
(defcustom ls-lisp-ignore-case
- ;; Name change for consistency with other option names.
- (or (memq ls-lisp-emulation '(MS-Windows MacOS))
- (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case))
+ (memq ls-lisp-emulation '(MS-Windows MacOS))
"Non-nil causes ls-lisp alphabetic sorting to ignore case."
:set-after '(ls-lisp-emulation)
:type 'boolean
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el
index b9f0011e96..9b4a048131 100644
--- a/lisp/mouse-sel.el
+++ b/lisp/mouse-sel.el
@@ -1,4 +1,4 @@
-;;; mouse-sel.el --- multi-click selection support for Emacs 19
+;;; mouse-sel.el --- multi-click selection support
;; Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
diff --git a/lisp/novice.el b/lisp/novice.el
index c7cbccfa02..47b32fcde8 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -1,7 +1,7 @@
;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
-;; Copyright (C) 1985, 1986, 1987, 1994, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1987, 1994, 2001, 2002, 2003, 2004, 2005,
+;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal, help
@@ -110,9 +110,9 @@ SPC to try the command just this once, but leave it disabled.
(not (string= "" user-init-file))
(y-or-n-p "Enable command for future editing sessions also? "))
(enable-command cmd)
- (put cmd 'disabled nil)))
- (?n nil)
- (t (call-interactively cmd)))))
+ (put cmd 'disabled nil))))
+ (or (char-equal char ?n)
+ (call-interactively cmd))))
(defun en/disable-command (command disable)
(unless (commandp command)
@@ -169,5 +169,4 @@ to future sessions."
(provide 'novice)
-;; arch-tag: f83c0f96-497e-4db6-a430-8703716c6dd9
;;; novice.el ends here
diff --git a/lisp/printing.el b/lisp/printing.el
index aacd8d42ae..ecbc82e014 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -3438,12 +3438,7 @@ See `pr-ps-printer-alist'.")
(defun pr-menu-bind ()
"Install `printing' menu in the menubar.
-
-On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu.
-
-On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print
-menu.
-
+This replaces the File/Print* menu entries with a File/Print sub-menu.
Calls `pr-update-menus' to adjust menus."
(interactive)
(pr-global-menubar pr-menu-spec)
@@ -6670,5 +6665,4 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
(provide 'printing)
-;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18
;;; printing.el ends here
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a19445f47f..7754dc6c87 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2807,7 +2807,7 @@ command is used to switch to an existing process, only when a new
process is started. If you use this, you will probably want to ensure
that the current arguments are retained (they will be included in the
prompt). This argument is ignored when this function is called
-programmatically, or when running in Emacs 19.34 or older.
+programmatically.
Note: You can toggle between using the CPython interpreter and the
JPython interpreter by hitting \\[python-toggle-shells]. This toggles
diff --git a/lisp/server.el b/lisp/server.el
index ecc9b16cce..e3af82231a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -609,7 +609,7 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
(defun server-force-stop ()
"Kill all connections to the current server.
This function is meant to be called from `kill-emacs-hook'."
- (server-start nil t))
+ (server-start t t))
;;;###autoload
(defun server-force-delete (&optional name)
diff --git a/lisp/simple.el b/lisp/simple.el
index 55118553fb..aa4b9a9718 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2990,11 +2990,6 @@ If `interprogram-cut-function' is non-nil, apply it to STRING.
Optional second argument REPLACE non-nil means that STRING will replace
the front of the kill ring, rather than being added to the list.
-Optional third arguments YANK-HANDLER controls how the STRING is later
-inserted into a buffer; see `insert-for-yank' for details.
-When a yank handler is specified, STRING must be non-empty (the yank
-handler, if non-nil, is stored as a `yank-handler' text property on STRING).
-
When `save-interprogram-paste-before-kill' and `interprogram-paste-function'
are non-nil, saves the interprogram paste string(s) into `kill-ring' before
STRING.
@@ -3034,22 +3029,19 @@ argument should still be a \"useful\" string for such uses."
(setq kill-ring-yank-pointer kill-ring)
(if interprogram-cut-function
(funcall interprogram-cut-function string)))
+(set-advertised-calling-convention
+ 'kill-new '(string &optional replace) "23.3")
(defun kill-append (string before-p &optional yank-handler)
"Append STRING to the end of the latest kill in the kill ring.
If BEFORE-P is non-nil, prepend STRING to the kill.
-Optional third argument YANK-HANDLER, if non-nil, specifies the
-yank-handler text property to be set on the combined kill ring
-string. If the specified yank-handler arg differs from the
-yank-handler property of the latest kill string, this function
-adds the combined string to the kill ring as a new element,
-instead of replacing the last kill with it.
If `interprogram-cut-function' is set, pass the resulting kill to it."
(let* ((cur (car kill-ring)))
(kill-new (if before-p (concat string cur) (concat cur string))
(or (= (length cur) 0)
(equal yank-handler (get-text-property 0 'yank-handler cur)))
yank-handler)))
+(set-advertised-calling-convention 'kill-append '(string before-p) "23.3")
(defcustom yank-pop-change-selection nil
"If non-nil, rotating the kill ring changes the window system selection."
@@ -3130,11 +3122,7 @@ Supply two arguments, character positions indicating the stretch of text
Any command that calls this function is a \"kill command\".
If the previous command was also a kill command,
the text killed this time appends to the text killed last time
-to make one entry in the kill ring.
-
-In Lisp code, optional third arg YANK-HANDLER, if non-nil,
-specifies the yank-handler text property to be set on the killed
-text. See `insert-for-yank'."
+to make one entry in the kill ring."
;; Pass point first, then mark, because the order matters
;; when calling kill-append.
(interactive (list (point) (mark)))
@@ -3166,6 +3154,7 @@ text. See `insert-for-yank'."
(barf-if-buffer-read-only)
;; If the buffer isn't read-only, the text is.
(signal 'text-read-only (list (current-buffer)))))))
+(set-advertised-calling-convention 'kill-region '(beg end) "23.3")
;; copy-region-as-kill no longer sets this-command, because it's confusing
;; to get two copies of the text when the user accidentally types M-w and
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index f3b7531ba2..7413f73ee5 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1692,8 +1692,7 @@ variable `speedbar-obj-alist'."
(speedbar-enable-update)))
(defun speedbar-toggle-images ()
- "Toggle use of images in the speedbar frame.
-Images are not available in Emacs 20 or earlier."
+ "Toggle use of images in the speedbar frame."
(interactive)
(setq speedbar-use-images (not speedbar-use-images))
(speedbar-refresh))
diff --git a/lisp/subr.el b/lisp/subr.el
index c9300ad971..70d8b76faa 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -954,7 +954,8 @@ and `event-end' functions."
((null spacing)
(setq spacing 0)))
(cons (/ (car pair) (frame-char-width frame))
- (/ (cdr pair) (+ (frame-char-height frame) spacing))))))))
+ (- (/ (cdr pair) (+ (frame-char-height frame) spacing))
+ (if (null header-line-format) 0 1))))))))
(defun posn-actual-col-row (position)
"Return the actual column and row in POSITION, measured in characters.
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 961be29cc8..98add4cfd2 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -226,16 +226,30 @@ Do \\[command-apropos] picture-movement to see commands which control motion."
(picture-motion (- arg)))
(defun picture-mouse-set-point (event)
- "Move point to the position clicked on, making whitespace if necessary."
+ "Move point to the position of EVENT, making whitespace if necessary."
(interactive "e")
- (let* ((pos (posn-col-row (event-start event)))
- (x (car pos))
- (y (cdr pos))
- (current-row (count-lines (window-start) (line-beginning-position))))
- (unless (equal x (current-column))
- (picture-forward-column (- x (current-column))))
- (unless (equal y current-row)
- (picture-move-down (- y current-row)))))
+ (let ((position (event-start event)))
+ (unless (posn-area position) ; Ignore EVENT unless in text area
+ (let* ((window (posn-window position))
+ (frame (if (framep window) window (window-frame window)))
+ (pair (posn-x-y position))
+ (start-pos (window-start window))
+ (start-pair (posn-x-y (posn-at-point start-pos)))
+ (dx (- (car pair) (car start-pair)))
+ (dy (- (cdr pair) (cdr start-pair)))
+ (char-ht (frame-char-height frame))
+ (spacing (when (display-graphic-p frame)
+ (or (with-current-buffer (window-buffer window)
+ line-spacing)
+ (frame-parameter frame 'line-spacing))))
+ rows cols)
+ (cond ((floatp spacing)
+ (setq spacing (truncate (* spacing char-ht))))
+ ((null spacing)
+ (setq spacing 0)))
+ (goto-char start-pos)
+ (picture-move-down (/ dy (+ char-ht spacing)))
+ (picture-forward-column (/ dx (frame-char-width frame)))))))
;; Picture insertion and deletion.
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 689cd4d12b..2a2879aadb 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -134,6 +134,10 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
:version "23.1"
:group 'vc)
+(defcustom vc-hg-program "hg"
+ "Name of the Mercurial executable (excluding any arguments)."
+ :type 'string
+ :group 'vc)
;;; Properties of the backend
@@ -174,7 +178,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(append (list "TERM=dumb" "LANGUAGE=C")
process-environment)))
(process-file
- "hg" nil t nil
+ vc-hg-program nil t nil
"--config" "alias.status=status"
"--config" "defaults.status="
"status" "-A" (file-relative-name file)))
@@ -212,7 +216,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(let ((process-environment avoid-local-env))
;; Ignore all errors.
(process-file
- "hg" nil t nil
+ vc-hg-program nil t nil
"--config" "alias.parents=parents"
"--config" "defaults.parents="
"parents" "--template" "{rev}" (file-relative-name file)))
@@ -227,7 +231,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(condition-case nil
(let ((process-environment avoid-local-env))
(process-file
- "hg" nil nil nil
+ vc-hg-program nil nil nil
;; We use "log" here, if there's a faster command
;; that returns true for an 'added file and false
;; for an 'unregistered one, we could use that.
@@ -620,7 +624,7 @@ REV is the revision to check out into WORKFILE."
"A wrapper around `vc-do-command' for use in vc-hg.el.
The difference to vc-do-command is that this function always invokes `hg',
and that it passes `vc-hg-global-switches' to it before FLAGS."
- (apply 'vc-do-command (or buffer "*vc*") okstatus "hg" file-or-list
+ (apply 'vc-do-command (or buffer "*vc*") okstatus vc-hg-program file-or-list
(if (stringp vc-hg-global-switches)
(cons vc-hg-global-switches flags)
(append vc-hg-global-switches
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index e905e8f2a8..9c7de61d7c 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -316,9 +316,8 @@ size field.")
(defvar widget-field-use-before-change t
"Non-nil means use `before-change-functions' to track editable fields.
-This enables the use of undo, but doesn't work on Emacs 19.34 and earlier.
-Using before hooks also means that the :notify function can't know the
-new value.")
+This enables the use of undo. Using before hooks also means that
+the :notify function can't know the new value.")
(defun widget-specify-field (widget from to)
"Specify editable button for WIDGET between FROM and TO."
@@ -1053,7 +1052,7 @@ POS defaults to the value of (point)."
(defvar widget-use-overlay-change t
"If non-nil, use overlay change functions to tab around in the buffer.
-This is much faster, but doesn't work reliably on Emacs 19.34.")
+This is much faster.")
(defun widget-move (arg)
"Move point to the ARG next field or button.
@@ -3782,5 +3781,4 @@ example:
(provide 'wid-edit)
-;; arch-tag: a076e75e-18a1-4b46-8be5-3f317bcbc707
;;; wid-edit.el ends here