------------------------------------------------------------ revno: 116952 committer: Leo Liu branch nick: trunk timestamp: Tue 2014-04-08 11:32:37 +0800 message: Use lexical-binding and require cl-lib * net/rcirc.el (rcirc, rcirc-handler-ctcp-KEEPALIVE) (rcirc-handler-generic, rcirc-fill-paragraph) (rcirc-format-response-string, rcirc-target-buffer) (rcirc-last-line, rcirc-record-activity, rcirc-split-activity) (rcirc-activity-string, rcirc-make-trees, rcirc-cmd-ctcp) (rcirc-ctcp-sender-PING, rcirc-browse-url) (rcirc-markup-timestamp, rcirc-markup-attributes) (rcirc-markup-my-nick, rcirc-markup-urls) (rcirc-markup-bright-nicks, rcirc-markup-fill) (rcirc-check-auth-status, rcirc-handler-WALLOPS) (rcirc-handler-JOIN, rcirc-handler-PART-or-KICK) (rcirc-handler-PART, rcirc-handler-KICK, rcirc-handler-QUIT) (rcirc-handler-NICK, rcirc-handler-PING, rcirc-handler-PONG) (rcirc-handler-TOPIC, rcirc-handler-301, rcirc-handler-317) (rcirc-handler-332, rcirc-handler-333, rcirc-handler-477) (rcirc-handler-MODE, rcirc-handler-353, rcirc-handler-366) (rcirc-authenticate, rcirc-handler-INVITE, rcirc-handler-ERROR) (rcirc-handler-ctcp-VERSION, rcirc-handler-ctcp-TIME) (rcirc-handler-CTCP-response): Fix unused arguments warnings and use cl-lib. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-07 21:19:31 +0000 +++ lisp/ChangeLog 2014-04-08 03:32:37 +0000 @@ -1,3 +1,27 @@ +2014-04-08 Leo Liu + + Use lexical-binding and require cl-lib. + * net/rcirc.el (rcirc, rcirc-handler-ctcp-KEEPALIVE) + (rcirc-handler-generic, rcirc-fill-paragraph) + (rcirc-format-response-string, rcirc-target-buffer) + (rcirc-last-line, rcirc-record-activity, rcirc-split-activity) + (rcirc-activity-string, rcirc-make-trees, rcirc-cmd-ctcp) + (rcirc-ctcp-sender-PING, rcirc-browse-url) + (rcirc-markup-timestamp, rcirc-markup-attributes) + (rcirc-markup-my-nick, rcirc-markup-urls) + (rcirc-markup-bright-nicks, rcirc-markup-fill) + (rcirc-check-auth-status, rcirc-handler-WALLOPS) + (rcirc-handler-JOIN, rcirc-handler-PART-or-KICK) + (rcirc-handler-PART, rcirc-handler-KICK, rcirc-handler-QUIT) + (rcirc-handler-NICK, rcirc-handler-PING, rcirc-handler-PONG) + (rcirc-handler-TOPIC, rcirc-handler-301, rcirc-handler-317) + (rcirc-handler-332, rcirc-handler-333, rcirc-handler-477) + (rcirc-handler-MODE, rcirc-handler-353, rcirc-handler-366) + (rcirc-authenticate, rcirc-handler-INVITE, rcirc-handler-ERROR) + (rcirc-handler-ctcp-VERSION, rcirc-handler-ctcp-TIME) + (rcirc-handler-CTCP-response): Fix unused arguments warnings and + use cl-lib. + 2014-04-07 João Távora * elec-pair.el (electric-pair--syntax-ppss): === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2014-01-01 07:43:34 +0000 +++ lisp/net/rcirc.el 2014-04-08 03:32:37 +0000 @@ -1,10 +1,10 @@ -;;; rcirc.el --- default, simple IRC client. +;;; rcirc.el --- default, simple IRC client -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2014 Free Software Foundation, Inc. ;; Author: Ryan Yeske ;; Maintainers: Ryan Yeske , -;; Deniz Dogan +;; Leo Liu ;; Keywords: comm ;; This file is part of GNU Emacs. @@ -43,9 +43,9 @@ ;;; Code: +(require 'cl-lib) (require 'ring) (require 'time-date) -(eval-when-compile (require 'cl)) (defgroup rcirc nil "Simple IRC client." @@ -489,7 +489,7 @@ (when (string= server (process-name p)) (setq connected p))) (if (not connected) - (condition-case e + (condition-case nil (rcirc-connect server port nick user-name full-name channels password encryption) (quit (message "Quit connecting to %s" server))) @@ -629,7 +629,7 @@ (cancel-timer rcirc-keepalive-timer)) (setq rcirc-keepalive-timer nil))) -(defun rcirc-handler-ctcp-KEEPALIVE (process target sender message) +(defun rcirc-handler-ctcp-KEEPALIVE (process _target _sender message) (with-rcirc-process-buffer process (setq header-line-format (format "%f" (- (rcirc-float-time) (string-to-number message)))))) @@ -752,7 +752,7 @@ (defvar rcirc-responses-no-activity '("305" "306") "Responses that don't trigger activity in the mode-line indicator.") -(defun rcirc-handler-generic (process response sender args text) +(defun rcirc-handler-generic (process response sender args _text) "Generic server response handler." (rcirc-print process sender response nil (mapconcat 'identity (cdr args) " ") @@ -1222,13 +1222,13 @@ (ring-insert rcirc-input-ring input) (setq rcirc-input-ring-index 0)))))) -(defun rcirc-fill-paragraph (&optional arg) - (interactive "p") +(defun rcirc-fill-paragraph (&optional justify) + (interactive "P") (when (> (point) rcirc-prompt-end-marker) (save-restriction (narrow-to-region rcirc-prompt-end-marker (point-max)) (let ((fill-column rcirc-max-message-length)) - (fill-region (point-min) (point-max)))))) + (fill-region (point-min) (point-max) justify))))) (defun rcirc-process-input-line (line) (if (string-match "^/\\([^ ]+\\) ?\\(.*\\)$" line) @@ -1393,9 +1393,9 @@ (rcirc-add-face start (match-beginning 0) face) (setq start (match-beginning 0)) (replace-match - (case (aref (match-string 1) 0) + (cl-case (aref (match-string 1) 0) (?f (setq face - (case (string-to-char (match-string 3)) + (cl-case (string-to-char (match-string 3)) (?w 'font-lock-warning-face) (?p 'rcirc-server-prefix) (?s 'rcirc-server) @@ -1431,9 +1431,9 @@ (rcirc-add-face start (match-beginning 0) face)) (buffer-substring (point-min) (point-max)))) -(defun rcirc-target-buffer (process sender response target text) +(defun rcirc-target-buffer (process sender response target _text) "Return a buffer to print the server response." - (assert (not (bufferp target))) + (cl-assert (not (bufferp target))) (with-rcirc-process-buffer process (cond ((not target) (rcirc-any-buffer process)) @@ -1474,11 +1474,10 @@ (defun rcirc-last-line (process nick target) "Return the line from the last activity from NICK in TARGET." - (let* ((chanbuf (rcirc-get-buffer process target)) - (line (or (cdr (assoc-string target - (gethash nick (with-rcirc-server-buffer - rcirc-nick-table)) t)) - (rcirc-last-quit-line process nick target)))) + (let ((line (or (cdr (assoc-string target + (gethash nick (with-rcirc-server-buffer + rcirc-nick-table)) t)) + (rcirc-last-quit-line process nick target)))) (if line line ;;(message "line is nil for %s in %s" nick target) @@ -1956,7 +1955,7 @@ (let ((t1 (with-current-buffer b1 rcirc-last-post-time)) (t2 (with-current-buffer b2 rcirc-last-post-time))) (time-less-p t2 t1))))) - (pushnew type rcirc-activity-types) + (cl-pushnew type rcirc-activity-types) (unless (and (equal rcirc-activity old-activity) (member type old-types)) (rcirc-update-activity-string))))) @@ -1977,13 +1976,13 @@ (defun rcirc-split-activity (activity) "Return a cons cell with ACTIVITY split into (lopri . hipri)." (let (lopri hipri) - (dolist (buf rcirc-activity) + (dolist (buf activity) (with-current-buffer buf (if (and rcirc-low-priority-flag (not (member 'nick rcirc-activity-types))) - (add-to-list 'lopri buf t) - (add-to-list 'hipri buf t)))) - (cons lopri hipri))) + (push buf lopri) + (push buf hipri)))) + (cons (nreverse lopri) (nreverse hipri)))) (defvar rcirc-update-activity-string-hook nil "Hook run whenever the activity string is updated.") @@ -2015,7 +2014,7 @@ (with-current-buffer b (dolist (type rcirc-activity-types) (rcirc-add-face 0 (length s) - (case type + (cl-case type (nick 'rcirc-track-nick) (keyword 'rcirc-track-keyword)) s))) @@ -2123,7 +2122,7 @@ (when (and (listp x) (listp (cadr x))) (setcdr x (if (> (length (cdr x)) 1) (rcirc-make-trees (cdr x)) - (setcdr x (list (cdadr x))))))) + (setcdr x (list (cl-cdadr x))))))) alist))) ;;; /commands these are called with 3 args: PROCESS, TARGET, which is @@ -2281,7 +2280,7 @@ (mapconcat 'identity (cdr arglist) " ")))) (rcirc-send-string process (concat "KICK " target " " argstring)))) -(defun rcirc-cmd-ctcp (args &optional process target) +(defun rcirc-cmd-ctcp (args &optional process _target) (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args) (let* ((target (match-string 1 args)) (request (upcase (match-string 2 args))) @@ -2292,7 +2291,7 @@ (rcirc-print process (rcirc-nick process) "ERROR" nil "usage: /ctcp NICK REQUEST"))) -(defun rcirc-ctcp-sender-PING (process target request) +(defun rcirc-ctcp-sender-PING (process target _request) "Send a CTCP PING message to TARGET." (let ((timestamp (format "%.0f" (rcirc-float-time)))) (rcirc-send-ctcp process target "PING" timestamp))) @@ -2412,21 +2411,20 @@ (lambda (x) (>= point (cdr x))) rcirc-urls)) (completions (mapcar (lambda (x) (car x)) filtered)) - (initial-input (caar filtered)) - (history (mapcar (lambda (x) (car x)) (cdr filtered)))) - (browse-url (completing-read "rcirc browse-url: " - completions nil nil initial-input 'history) + (defaults (mapcar (lambda (x) (car x)) filtered))) + (browse-url (completing-read "Rcirc browse-url: " + completions nil nil (car defaults) nil defaults) arg))) -(defun rcirc-markup-timestamp (sender response) +(defun rcirc-markup-timestamp (_sender _response) (goto-char (point-min)) (insert (rcirc-facify (format-time-string rcirc-time-format) 'rcirc-timestamp))) -(defun rcirc-markup-attributes (sender response) +(defun rcirc-markup-attributes (_sender _response) (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t) (rcirc-add-face (match-beginning 0) (match-end 0) - (case (char-after (match-beginning 1)) + (cl-case (char-after (match-beginning 1)) (?\C-b 'bold) (?\C-v 'italic) (?\C-_ 'underline))) @@ -2440,7 +2438,7 @@ (while (re-search-forward "\C-o+" nil t) (delete-region (match-beginning 0) (match-end 0)))) -(defun rcirc-markup-my-nick (sender response) +(defun rcirc-markup-my-nick (_sender response) (with-syntax-table rcirc-nick-syntax-table (while (re-search-forward (concat "\\b" (regexp-quote (rcirc-nick @@ -2454,7 +2452,7 @@ 'rcirc-nick-in-message-full-line) (rcirc-record-activity (current-buffer) 'nick))))) -(defun rcirc-markup-urls (sender response) +(defun rcirc-markup-urls (_sender _response) (while (and rcirc-url-regexp ;; nil means disable URL catching (re-search-forward rcirc-url-regexp nil t)) (let* ((start (match-beginning 0)) @@ -2485,7 +2483,7 @@ (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword) (rcirc-record-activity (current-buffer) 'keyword)))))) -(defun rcirc-markup-bright-nicks (sender response) +(defun rcirc-markup-bright-nicks (_sender response) (when (and rcirc-bright-nicks (string= response "NAMES")) (with-syntax-table rcirc-nick-syntax-table @@ -2493,7 +2491,7 @@ (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-bright-nick))))) -(defun rcirc-markup-fill (sender response) +(defun rcirc-markup-fill (_sender response) (when (not (string= response "372")) ; /motd (let ((fill-prefix (or rcirc-fill-prefix @@ -2574,7 +2572,7 @@ sender))) message t)))) -(defun rcirc-check-auth-status (process sender args text) +(defun rcirc-check-auth-status (process sender args _text) "Check if the user just authenticated. If authenticated, runs `rcirc-authenticated-hook' with PROCESS as the only argument." @@ -2602,10 +2600,10 @@ (run-hook-with-args 'rcirc-authenticated-hook process) (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t)))))) -(defun rcirc-handler-WALLOPS (process sender args text) +(defun rcirc-handler-WALLOPS (process sender args _text) (rcirc-print process sender "WALLOPS" sender (car args) t)) -(defun rcirc-handler-JOIN (process sender args text) +(defun rcirc-handler-JOIN (process sender args _text) (let ((channel (car args))) (with-current-buffer (rcirc-get-buffer-create process channel) ;; when recently rejoining, restore the linestamp @@ -2626,7 +2624,7 @@ (rcirc-print process sender "JOIN" sender channel)))) ;; PART and KICK are handled the same way -(defun rcirc-handler-PART-or-KICK (process response channel sender nick args) +(defun rcirc-handler-PART-or-KICK (process _response channel _sender nick _args) (rcirc-ignore-update-automatic nick) (if (not (string= nick (rcirc-nick process))) ;; this is someone else leaving @@ -2643,7 +2641,7 @@ (when buffer (rcirc-disconnect-buffer buffer))))) -(defun rcirc-handler-PART (process sender args text) +(defun rcirc-handler-PART (process sender args _text) (let* ((channel (car args)) (reason (cadr args)) (message (concat channel " " reason))) @@ -2654,10 +2652,10 @@ (rcirc-handler-PART-or-KICK process "PART" channel sender sender reason))) -(defun rcirc-handler-KICK (process sender args text) +(defun rcirc-handler-KICK (process sender args _text) (let* ((channel (car args)) (nick (cadr args)) - (reason (caddr args)) + (reason (cl-caddr args)) (message (concat nick " " channel " " reason))) (rcirc-print process sender "KICK" channel message t) ;; print in private chat buffer if it exists @@ -2682,7 +2680,7 @@ (cons (cons nick line) rcirc-recent-quit-alist)))))))))) -(defun rcirc-handler-QUIT (process sender args text) +(defun rcirc-handler-QUIT (process sender args _text) (rcirc-ignore-update-automatic sender) (mapc (lambda (channel) ;; broadcast quit message each channel @@ -2692,7 +2690,7 @@ (rcirc-nick-channels process sender)) (rcirc-nick-remove process sender)) -(defun rcirc-handler-NICK (process sender args text) +(defun rcirc-handler-NICK (process sender args _text) (let* ((old-nick sender) (new-nick (car args)) (channels (rcirc-nick-channels process old-nick))) @@ -2723,25 +2721,25 @@ ;; reauthenticate (when rcirc-auto-authenticate-flag (rcirc-authenticate)))))) -(defun rcirc-handler-PING (process sender args text) +(defun rcirc-handler-PING (process _sender args _text) (rcirc-send-string process (concat "PONG :" (car args)))) -(defun rcirc-handler-PONG (process sender args text) +(defun rcirc-handler-PONG (_process _sender _args _text) ;; do nothing ) -(defun rcirc-handler-TOPIC (process sender args text) +(defun rcirc-handler-TOPIC (process sender args _text) (let ((topic (cadr args))) (rcirc-print process sender "TOPIC" (car args) topic) (with-current-buffer (rcirc-get-buffer process (car args)) (setq rcirc-topic topic)))) (defvar rcirc-nick-away-alist nil) -(defun rcirc-handler-301 (process sender args text) +(defun rcirc-handler-301 (process _sender args text) "RPL_AWAY" (let* ((nick (cadr args)) (rec (assoc-string nick rcirc-nick-away-alist)) - (away-message (caddr args))) + (away-message (cl-caddr args))) (when (or (not rec) (not (string= (cdr rec) away-message))) ;; away message has changed @@ -2751,7 +2749,7 @@ (setq rcirc-nick-away-alist (cons (cons nick away-message) rcirc-nick-away-alist)))))) -(defun rcirc-handler-317 (process sender args text) +(defun rcirc-handler-317 (process sender args _text) "RPL_WHOISIDLE" (let* ((nick (nth 1 args)) (idle-secs (string-to-number (nth 2 args))) @@ -2765,31 +2763,31 @@ nick idle-string signon-string))) (rcirc-print process sender "317" nil message t))) -(defun rcirc-handler-332 (process sender args text) +(defun rcirc-handler-332 (process _sender args _text) "RPL_TOPIC" (let ((buffer (or (rcirc-get-buffer process (cadr args)) (rcirc-get-temp-buffer-create process (cadr args))))) (with-current-buffer buffer - (setq rcirc-topic (caddr args))))) + (setq rcirc-topic (cl-caddr args))))) -(defun rcirc-handler-333 (process sender args text) +(defun rcirc-handler-333 (process sender args _text) "333 says who set the topic and when. Not in rfc1459.txt" (let ((buffer (or (rcirc-get-buffer process (cadr args)) (rcirc-get-temp-buffer-create process (cadr args))))) (with-current-buffer buffer - (let ((setter (caddr args)) + (let ((setter (cl-caddr args)) (time (current-time-string (seconds-to-time - (string-to-number (cadddr args)))))) + (string-to-number (cl-cadddr args)))))) (rcirc-print process sender "TOPIC" (cadr args) (format "%s (%s on %s)" rcirc-topic setter time)))))) -(defun rcirc-handler-477 (process sender args text) +(defun rcirc-handler-477 (process sender args _text) "ERR_NOCHANMODES" - (rcirc-print process sender "477" (cadr args) (caddr args))) + (rcirc-print process sender "477" (cadr args) (cl-caddr args))) -(defun rcirc-handler-MODE (process sender args text) +(defun rcirc-handler-MODE (process sender args _text) (let ((target (car args)) (msg (mapconcat 'identity (cdr args) " "))) (rcirc-print process sender "MODE" @@ -2809,7 +2807,7 @@ (let ((tmpnam (concat " " (downcase channel) "TMP" (process-name process)))) (get-buffer-create tmpnam))) -(defun rcirc-handler-353 (process sender args text) +(defun rcirc-handler-353 (process _sender args _text) "RPL_NAMREPLY" (let ((channel (nth 2 args)) (names (or (nth 3 args) ""))) @@ -2822,7 +2820,7 @@ (goto-char (point-max)) (insert (car (last args)) " ")))) -(defun rcirc-handler-366 (process sender args text) +(defun rcirc-handler-366 (process sender args _text) "RPL_ENDOFNAMES" (let* ((channel (cadr args)) (buffer (rcirc-get-temp-buffer-create process channel))) @@ -2847,14 +2845,14 @@ (dolist (i rcirc-authinfo) (let ((process (rcirc-buffer-process)) (server (car i)) - (nick (caddr i)) + (nick (cl-caddr i)) (method (cadr i)) - (args (cdddr i))) + (args (cl-cdddr i))) (when (and (string-match server rcirc-server)) (if (and (memq method '(nickserv chanserv bitlbee)) (string-match nick rcirc-nick)) ;; the following methods rely on the user's nickname. - (case method + (cl-case method (nickserv (rcirc-send-privmsg process @@ -2878,10 +2876,10 @@ "Q@CServe.quakenet.org" (format "AUTH %s %s" nick (car args)))))))))) -(defun rcirc-handler-INVITE (process sender args text) +(defun rcirc-handler-INVITE (process sender args _text) (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t)) -(defun rcirc-handler-ERROR (process sender args text) +(defun rcirc-handler-ERROR (process sender args _text) (rcirc-print process sender "ERROR" nil (mapconcat 'identity args " "))) (defun rcirc-handler-CTCP (process target sender text) @@ -2899,7 +2897,7 @@ (rcirc-print process sender "CTCP" target (format "%s" text) t)))))) -(defun rcirc-handler-ctcp-VERSION (process target sender args) +(defun rcirc-handler-ctcp-VERSION (process _target sender _args) (rcirc-send-string process (concat "NOTICE " sender " :\C-aVERSION " rcirc-id-string @@ -2908,12 +2906,12 @@ (defun rcirc-handler-ctcp-ACTION (process target sender args) (rcirc-print process sender "ACTION" target args t)) -(defun rcirc-handler-ctcp-TIME (process target sender args) +(defun rcirc-handler-ctcp-TIME (process _target sender _args) (rcirc-send-string process (concat "NOTICE " sender " :\C-aTIME " (current-time-string) "\C-a"))) -(defun rcirc-handler-CTCP-response (process target sender message) +(defun rcirc-handler-CTCP-response (process _target sender message) (rcirc-print process sender "CTCP" nil message t)) (defgroup rcirc-faces nil ------------------------------------------------------------ revno: 116951 committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-04-07 17:19:31 -0400 message: ChangeLog fixes Merged entries get today's date. May as well combine consecutive separate entries by same author into one. Backported entries should not appear twice. diff: === modified file 'ChangeLog' --- ChangeLog 2014-04-07 20:54:16 +0000 +++ ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,4 +1,4 @@ -2014-04-03 Ken Brown +2014-04-07 Ken Brown * configure.ac (EMACS_MANIFEST, UPDATE_MANIFEST): Leave these variables empty on Cygwin. (Bug#17176) === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-04-07 20:54:16 +0000 +++ doc/emacs/ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,9 +1,7 @@ -2014-04-05 Glenn Morris +2014-04-07 Glenn Morris * trouble.texi (Checklist): Dribble files may contain passwords. -2014-04-04 Glenn Morris - * files.texi (Backup Names): * arevert-xtra.texi (Supporting additional buffers): Update for default values of some -function vars no longer being nil. === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-04-07 20:54:16 +0000 +++ doc/lispref/ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,9 +1,7 @@ -2014-04-05 Glenn Morris +2014-04-07 Glenn Morris * os.texi (Recording Input): Dribble files may contain passwords. -2014-04-04 Glenn Morris - * backups.texi (Making Backups, Reverting): Update for default values of some -function vars no longer being nil. (Reverting): Update for buffer-stale-function === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-07 20:54:16 +0000 +++ lisp/ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,8 +1,7 @@ 2014-04-07 João Távora - * elec-pair.el: - (electric-pair--syntax-ppss): When inside comments parse from - comment beginning. + * elec-pair.el (electric-pair--syntax-ppss): + When inside comments parse from comment beginning. (electric-pair--balance-info): Fix typo in comment. (electric-pair--in-unterminated-string-p): Delete. (electric-pair--unbalanced-strings-p): New function. @@ -10,12 +9,9 @@ (electric-pair-inhibit-if-helps-balance): Decide quote pairing according to `electric-pair--in-unterminated-string-p' -2014-04-07 João Távora - - * elec-pair.el (electric-pair-inhibit-if-helps-balance): Inhibit - quote pairing if point-max is inside an unterminated string. - (electric-pair--looking-at-unterminated-string-p): - Delete. + * elec-pair.el (electric-pair-inhibit-if-helps-balance): + Inhibit quote pairing if point-max is inside an unterminated string. + (electric-pair--looking-at-unterminated-string-p): Delete. (electric-pair--in-unterminated-string-p): New function. 2014-04-07 Glenn Morris @@ -23,7 +19,7 @@ * shell.el (shell-directory-tracker): Go back to just ignoring failures. (Bug#17159) -2014-04-06 João Távora +2014-04-07 João Távora Fix `electric-pair-delete-adjacent-pairs' in modes binding backspace. (bug#16981) @@ -33,33 +29,29 @@ a new `electric-pair-delete-pair' command. (electric-pair-delete-pair): New command. -2014-04-06 João Távora - - * progmodes/python.el (python-electric-pair-string-delimiter): Fix - triple-quoting electricity. (Bug#17192) - -2014-04-06 João Távora - - * elec-pair.el (electric-pair-post-self-insert-function): Don't - skip whitespace when `electric-pair-text-pairs' and + * progmodes/python.el (python-electric-pair-string-delimiter): + Fix triple-quoting electricity. (Bug#17192) + + * elec-pair.el (electric-pair-post-self-insert-function): + Don't skip whitespace when `electric-pair-text-pairs' and `electric-pair-pairs' were used. syntax to electric-pair--skip-whitespace. (Bug#17183) -2014-04-06 Eli Zaretskii +2014-04-07 Eli Zaretskii * leim/quail/ipa.el (ipa-x-sampa): Fix the character produced for "". (Bug#17199) -2014-04-06 Stefan Monnier +2014-04-07 Stefan Monnier * mpc.el (mpc--status-timer-run): Disable timer if not displayed. (mpc--status-idle-timer-run): Use mpc--status-timer-run. -2014-04-05 Glenn Morris +2014-04-07 Glenn Morris * help.el (view-lossage): Doc tweak. -2014-04-05 Matthias Dahl +2014-04-07 Matthias Dahl * faces.el (face-spec-recalc): Call make-face-x-resource-internal only when inhibit-x-resources is nil, and do that earlier in the @@ -74,30 +66,30 @@ (face-set-after-frame-default): Don't call make-face-x-resource-internal here. (Bug#16434) -2014-04-04 Tassilo Horn +2014-04-07 Tassilo Horn * doc-view.el (doc-view-bookmark-jump): Use `bookmark-after-jump-hook' to jump to the right page after the buffer is shown in a window. (bug#16090) -2014-04-04 Eli Zaretskii +2014-04-07 Eli Zaretskii * international/characters.el (mirroring): Fix last change: instead of loading uni-mirrored.el explicitly, do that implicitly by creating the 'mirroring' uniprop table. This avoids announcing the loading of uni-mirrored.el. -2014-04-04 Glenn Morris +2014-04-07 Glenn Morris * files.el (buffer-stale--default-function) (buffer-stale-function, revert-buffer--default): * autorevert.el (auto-revert-buffers): Doc tweaks. -2014-04-03 Eli Zaretskii +2014-04-07 Eli Zaretskii * international/characters.el: Preload uni-mirrored.el. (Bug#17169) -2014-04-03 Glenn Morris +2014-04-07 Glenn Morris * files.el (make-backup-file-name-function) (make-backup-file-name, make-backup-file-name--default-function) @@ -111,12 +103,10 @@ (make-backup-file-name-function): Bump :version. Restore nil as a valid but deprecated custom type. -2014-04-03 Stefan Monnier - - * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $' - used as a variable (bug#17174). - -2014-04-02 Stefan Monnier +2014-04-07 Stefan Monnier + + * progmodes/perl-mode.el (perl-syntax-propertize-function): + Handle $' used as a variable (bug#17174). * progmodes/perl-mode.el (perl-indent-new-calculate): Handle forward-sexp failure (bug#16985). @@ -613,19 +603,6 @@ (tty-color-approximate, tty-color-by-index, tty-color-values) (tty-color-desc): Remove superfluous backslashes. -2014-03-20 Stefan Monnier - - * electric.el (electric-newline-and-maybe-indent): New command. - Bind it globally to C-j. - (electric-indent-mode): Don't mess with the global map any more. - Don't drop the post-self-insert-hook is some buffer is still using it - (bug#16770). - - * bindings.el (global-map): Remove C-j binding. - - * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find - the docstring of functions advised before dumping (bug#16993). - 2014-03-21 Glenn Morris * cus-start.el (history-length): Bump :version. @@ -654,6 +631,19 @@ * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. +2014-03-20 Stefan Monnier + + * electric.el (electric-newline-and-maybe-indent): New command. + Bind it globally to C-j. + (electric-indent-mode): Don't mess with the global map any more. + Don't drop the post-self-insert-hook is some buffer is still using it + (bug#16770). + + * bindings.el (global-map): Remove C-j binding. + + * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find + the docstring of functions advised before dumping (bug#16993). + 2014-03-19 Stefan-W. Hahn (tiny change) * ps-print.el (ps-generate-postscript-with-faces): === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-04-03 19:10:35 +0000 +++ nt/ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,4 +1,4 @@ -2014-04-03 Ken Brown +2014-04-07 Ken Brown * emacs.rc: Don't use manifest on Cygwin. (Bug#17176) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-07 20:54:16 +0000 +++ src/ChangeLog 2014-04-07 21:19:31 +0000 @@ -13,22 +13,11 @@ (Fgarbage_collect): Use it. (gc_sweep): Remove hack made unnecessary. -2014-04-05 Glenn Morris +2014-04-07 Glenn Morris * keyboard.c (Fopen_dribble_file): Doc tweak. -2014-04-04 Jan Djärv - - Backport from trunk. - * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool - bar is zero height, just return (Bug#16976). - (initFrameFromEmacs:): Initialize wait_for_tool_bar. - * nsterm.h (EmacsView): Add wait_for_tool_bar. - * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar - is nil. If waiting for toolbar to complete, force a redraw. - (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976). - -2014-04-03 Ken Brown +2014-04-07 Ken Brown * Makefile.in (EMACS_MANIFEST): Update comment. (Bug#17176) === modified file 'test/ChangeLog' --- test/ChangeLog 2014-04-07 20:54:16 +0000 +++ test/ChangeLog 2014-04-07 21:19:31 +0000 @@ -1,32 +1,18 @@ 2014-04-07 João Távora - * automated/electric-tests.el (define-electric-pair-test): Don't - overtest.. - (inhibit-in-mismatched-string-inside-ruby-comments): New test. - (inhibit-in-mismatched-string-inside-c-comments): New test. - -2014-04-07 João Távora - - * automated/electric-tests.el (inhibit-if-strings-mismatched): - New test, change from `inhibit-only-of-next-is-mismatched'. - -2014-04-06 João Távora - * automated/python-tests.el (python-triple-quote-pairing): New test. (python-syntax-after-python-backspace): New test. -2014-04-06 João Távora - * automated/electric-tests.el (electric-pair-define-test-form): More readable test docstrings. (whitespace-skipping-for-quotes-not-ouside) (whitespace-skipping-for-quotes-only-inside) - (whitespace-skipping-for-quotes-in-text-mode): New tests. + (whitespace-skipping-quotes-not-without-proper-syntax): New tests. 2014-04-04 João Távora - * automated/electric-tests.el (define-electric-pair-test): Don't - overtest.. + * automated/electric-tests.el (define-electric-pair-test): + Don't overtest. (inhibit-in-mismatched-string-inside-ruby-comments): New test. (inhibit-in-mismatched-string-inside-c-comments): New test. ------------------------------------------------------------ revno: 116950 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Mon 2014-04-07 13:54:16 -0700 message: Merge from emacs-24; up to r116924 diff: === modified file 'ChangeLog' --- ChangeLog 2014-04-03 01:16:18 +0000 +++ ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,8 @@ +2014-04-03 Ken Brown + + * configure.ac (EMACS_MANIFEST, UPDATE_MANIFEST): Leave these + variables empty on Cygwin. (Bug#17176) + 2014-04-03 Glenn Morris * make-dist: Further update AC_INIT regexp. === modified file 'configure.ac' --- configure.ac 2014-04-02 15:14:50 +0000 +++ configure.ac 2014-04-07 20:54:16 +0000 @@ -1835,11 +1835,6 @@ W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" EMACSRES="emacs.res" - case "$canonical" in - x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;; - *) EMACS_MANIFEST="emacs-x86.manifest" ;; - esac - UPDATE_MANIFEST=update-game-score.exe.manifest if test "${opsys}" = "cygwin"; then W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" @@ -1847,6 +1842,11 @@ # the rc file), not a linker script. W32_RES_LINK="-Wl,emacs.res" else + case "$canonical" in + x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;; + *) EMACS_MANIFEST="emacs-x86.manifest" ;; + esac + UPDATE_MANIFEST=update-game-score.exe.manifest W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-03-28 01:29:54 +0000 +++ doc/emacs/ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,15 @@ +2014-04-05 Glenn Morris + + * trouble.texi (Checklist): Dribble files may contain passwords. + +2014-04-04 Glenn Morris + + * files.texi (Backup Names): + * arevert-xtra.texi (Supporting additional buffers): + Update for default values of some -function vars no longer being nil. + (Supporting additional buffers): + Update for buffer-stale-function also applying to file-buffers. + 2014-03-28 Glenn Morris * custom.texi (Terminal Init): Mention term-file-aliases. === modified file 'doc/emacs/arevert-xtra.texi' --- doc/emacs/arevert-xtra.texi 2014-01-01 07:43:34 +0000 +++ doc/emacs/arevert-xtra.texi 2014-04-04 02:09:35 +0000 @@ -103,15 +103,15 @@ This section is intended for Elisp programmers who would like to add support for auto-reverting new types of buffers. -To support auto-reverting the buffer must first of all have a +To support auto-reverting the buffer must first of all have a suitable @code{revert-buffer-function}. @xref{Definition of revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. -In addition, it @emph{must} have a @code{buffer-stale-function}. +In addition, it must have a suitable @code{buffer-stale-function}. @c FIXME only defvar in all of doc/emacs! @defvar buffer-stale-function -The value of this variable is a function to check whether a non-file +The value of this variable is a function to check whether a buffer needs reverting. This should be a function with one optional argument @var{noconfirm}. The function should return non-@code{nil} if the buffer should be reverted. The buffer is current when this @@ -132,7 +132,7 @@ @code{auto-revert-interval} seconds (like the Buffer Menu), use: @example -(set (make-local-variable 'buffer-stale-function) +(setq-local buffer-stale-function #'(lambda (&optional noconfirm) 'fast)) @end example @@ -149,7 +149,7 @@ auto-reverting. @end defvar -Once the buffer has a @code{revert-buffer-function} and a +Once the buffer has a suitable @code{revert-buffer-function} and @code{buffer-stale-function}, several problems usually remain. The buffer will only auto-revert if it is marked unmodified. Hence, === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2014-01-24 03:34:31 +0000 +++ doc/emacs/files.texi 2014-04-04 01:49:28 +0000 @@ -594,8 +594,8 @@ backup. @vindex make-backup-file-name-function - If you define the variable @code{make-backup-file-name-function} to -a suitable Lisp function, that overrides the usual way Emacs + If you set the variable @code{make-backup-file-name-function} to +a suitable Lisp function, you can override the usual way Emacs constructs backup file names. @node Backup Deletion === modified file 'doc/emacs/trouble.texi' --- doc/emacs/trouble.texi 2014-02-18 18:15:29 +0000 +++ doc/emacs/trouble.texi 2014-04-05 18:33:55 +0000 @@ -759,7 +759,9 @@ One way to record the input to Emacs precisely is to write a dribble file. To start the file, use the @kbd{M-x open-dribble-file @key{RET}} command. From then on, Emacs copies all your input to the -specified dribble file until the Emacs process is killed. +specified dribble file until the Emacs process is killed. Be aware +that sensitive information (such as passwords) may end up recorded in +the dribble file. @item @findex open-termscript === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-31 02:25:02 +0000 +++ doc/lispref/ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,14 @@ +2014-04-05 Glenn Morris + + * os.texi (Recording Input): Dribble files may contain passwords. + +2014-04-04 Glenn Morris + + * backups.texi (Making Backups, Reverting): + Update for default values of some -function vars no longer being nil. + (Reverting): Update for buffer-stale-function + also applying to file-buffers. + 2014-03-31 Daniel Colascione * minibuf.texi (Completion in Buffers): Discuss using lazy === modified file 'doc/lispref/backups.texi' --- doc/lispref/backups.texi 2014-01-05 23:36:13 +0000 +++ doc/lispref/backups.texi 2014-04-04 02:09:35 +0000 @@ -90,8 +90,7 @@ @smallexample @group (add-hook 'rmail-mode-hook - (lambda () - (set (make-local-variable 'make-backup-files) nil))) + (lambda () (setq-local make-backup-files nil))) @end group @end smallexample @end defopt @@ -150,13 +149,12 @@ @end defopt @defopt make-backup-file-name-function -This variable's value is a function to use for making backups instead -of the default @code{make-backup-file-name}. A value of @code{nil} -gives the default @code{make-backup-file-name} behavior. +This variable's value is a function to use for making backup file names. +The function @code{make-backup-file-name} calls it. @xref{Backup Names,, Naming Backup Files}. This could be buffer-local to do something special for specific -files. If you define it, you may need to change +files. If you change it, you may need to change @code{backup-file-name-p} and @code{file-name-sans-versions} too. @end defopt @@ -727,25 +725,24 @@ @defvar revert-buffer-function @anchor{Definition of revert-buffer-function} The value of this variable is the function to use to revert this -buffer. If non-@code{nil}, it should be a function with two optional +buffer. It should be a function with two optional arguments to do the work of reverting. The two optional arguments, @var{ignore-auto} and @var{noconfirm}, are the arguments that -@code{revert-buffer} received. If the value is @code{nil}, reverting -works the usual way. +@code{revert-buffer} received. Modes such as Dired mode, in which the text being edited does not consist of a file's contents but can be regenerated in some other -fashion, can give this variable a buffer-local value that is a function to -regenerate the contents. +fashion, can give this variable a buffer-local value that is a special +function to regenerate the contents. @end defvar @defvar revert-buffer-insert-file-contents-function -The value of this variable, if non-@code{nil}, specifies the function to use to +The value of this variable specifies the function to use to insert the updated contents when reverting this buffer. The function receives two arguments: first the file name to use; second, @code{t} if the user has asked to read the auto-save file. -The reason for a mode to set this variable instead of +The reason for a mode to change this variable instead of @code{revert-buffer-function} is to avoid duplicating or replacing the rest of what @code{revert-buffer} does: asking for confirmation, clearing the undo list, deciding the proper major mode, and running the @@ -753,21 +750,23 @@ @end defvar @defvar before-revert-hook -This normal hook is run by @code{revert-buffer} before -inserting the modified contents---but only if -@code{revert-buffer-function} is @code{nil}. +This normal hook is run by the default @code{revert-buffer-function} +before inserting the modified contents. A custom @code{revert-buffer-function} +may or may not run this hook. @end defvar @defvar after-revert-hook -This normal hook is run by @code{revert-buffer} after inserting -the modified contents---but only if @code{revert-buffer-function} is -@code{nil}. +This normal hook is run by the default @code{revert-buffer-function} +after inserting the modified contents. A custom @code{revert-buffer-function} +may or may not run this hook. @end defvar @c FIXME? Move this section from arevert-xtra to here? @defvar buffer-stale-function -The value of this variable, if non-@code{nil}, specifies a function -to call to check whether a non-file buffer needs reverting +The value of this variable specifies a function to call to check +whether a buffer needs reverting. The default value only handles +buffers that are visiting files, by checking their modification time. +Buffers that are not visiting files require a custom function @iftex (@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs Features}). @end iftex === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2014-03-28 01:39:30 +0000 +++ doc/lispref/os.texi 2014-04-07 20:54:16 +0000 @@ -2001,20 +2001,11 @@ dribble file is open, each input event from the keyboard or mouse (but not those from keyboard macros) is written in that file. A non-character event is expressed using its printed representation -surrounded by @samp{<@dots{}>}. +surrounded by @samp{<@dots{}>}. Be aware that sensitive information +(such as passwords) may end up recorded in the dribble file. You close the dribble file by calling this function with an argument of @code{nil}. - -This function is normally used to record the input necessary to -trigger an Emacs bug, for the sake of a bug report. - -@example -@group -(open-dribble-file "~/dribble") - @result{} nil -@end group -@end example @end deffn See also the @code{open-termscript} function (@pxref{Terminal Output}). === modified file 'etc/NEWS' --- etc/NEWS 2014-04-02 15:14:50 +0000 +++ etc/NEWS 2014-04-07 20:54:16 +0000 @@ -219,6 +219,10 @@ ** In keymaps where SPC scrolls forward, S-SPC now scrolls backward. This affects View mode, etc. ++++ +** The default value of `make-backup-file-name-function' is no longer nil. +Instead it defaults to a function that does what the nil value used to. + ** Help changes +++ @@ -1457,9 +1461,13 @@ ** Revert and Autorevert changes -*** The default value of `revert-buffer-function' is no longer nil. -Instead it defaults to a function that does what the nil value used to. -The same applies for `revert-buffer-insert-file-contents-function'. ++++ +*** The default values of `buffer-stale-function', `revert-buffer-function', +and `revert-buffer-insert-file-contents-function' are no longer nil. +Instead they default to functions that do what the nil value used to. + ++++ +*** `buffer-stale-function' is now used for buffers visiting files too. --- *** If Emacs is compiled with file notification support, it uses notifications === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-07 00:51:52 +0000 +++ lisp/ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,128 @@ +2014-04-07 João Távora + + * elec-pair.el: + (electric-pair--syntax-ppss): When inside comments parse from + comment beginning. + (electric-pair--balance-info): Fix typo in comment. + (electric-pair--in-unterminated-string-p): Delete. + (electric-pair--unbalanced-strings-p): New function. + (electric-pair-string-bound-function): New var. + (electric-pair-inhibit-if-helps-balance): Decide quote pairing + according to `electric-pair--in-unterminated-string-p' + +2014-04-07 João Távora + + * elec-pair.el (electric-pair-inhibit-if-helps-balance): Inhibit + quote pairing if point-max is inside an unterminated string. + (electric-pair--looking-at-unterminated-string-p): + Delete. + (electric-pair--in-unterminated-string-p): New function. + +2014-04-07 Glenn Morris + + * shell.el (shell-directory-tracker): + Go back to just ignoring failures. (Bug#17159) + +2014-04-06 João Távora + + Fix `electric-pair-delete-adjacent-pairs' in modes binding + backspace. (bug#16981) + * elec-pair.el (electric-pair-backward-delete-char): Delete. + (electric-pair-backward-delete-char-untabify): Delete. + (electric-pair-mode-map): Bind backspace to a menu item filtering + a new `electric-pair-delete-pair' command. + (electric-pair-delete-pair): New command. + +2014-04-06 João Távora + + * progmodes/python.el (python-electric-pair-string-delimiter): Fix + triple-quoting electricity. (Bug#17192) + +2014-04-06 João Távora + + * elec-pair.el (electric-pair-post-self-insert-function): Don't + skip whitespace when `electric-pair-text-pairs' and + `electric-pair-pairs' were used. syntax to + electric-pair--skip-whitespace. (Bug#17183) + +2014-04-06 Eli Zaretskii + + * leim/quail/ipa.el (ipa-x-sampa): Fix the character produced for + "". (Bug#17199) + +2014-04-06 Stefan Monnier + + * mpc.el (mpc--status-timer-run): Disable timer if not displayed. + (mpc--status-idle-timer-run): Use mpc--status-timer-run. + +2014-04-05 Glenn Morris + + * help.el (view-lossage): Doc tweak. + +2014-04-05 Matthias Dahl + + * faces.el (face-spec-recalc): Call make-face-x-resource-internal + only when inhibit-x-resources is nil, and do that earlier in the + function. Doc fix. (Bug#16694) + (face-spec-choose): Accept additional optional argument, whose + value is returned if no matching attributes are found. + (face-spec-recalc): Use the new optional argument when calling + face-spec-choose. (Bug#16378) + (make-face-x-resource-internal): Do nothing when + inhibit-x-resources is non-nil. Don't touch the default face if + reversed video is given--as was done in previous versions of Emacs. + (face-set-after-frame-default): Don't call + make-face-x-resource-internal here. (Bug#16434) + +2014-04-04 Tassilo Horn + + * doc-view.el (doc-view-bookmark-jump): + Use `bookmark-after-jump-hook' to jump to the right page after the + buffer is shown in a window. (bug#16090) + +2014-04-04 Eli Zaretskii + + * international/characters.el (mirroring): Fix last change: + instead of loading uni-mirrored.el explicitly, do that implicitly + by creating the 'mirroring' uniprop table. This avoids announcing + the loading of uni-mirrored.el. + +2014-04-04 Glenn Morris + + * files.el (buffer-stale--default-function) + (buffer-stale-function, revert-buffer--default): + * autorevert.el (auto-revert-buffers): Doc tweaks. + +2014-04-03 Eli Zaretskii + + * international/characters.el: Preload uni-mirrored.el. (Bug#17169) + +2014-04-03 Glenn Morris + + * files.el (make-backup-file-name-function) + (make-backup-file-name, make-backup-file-name--default-function) + (make-backup-file-name-1, find-backup-file-name) + (revert-buffer-function, revert-buffer-insert-file-contents-function) + (buffer-stale--default-function, buffer-stale-function) + (before-revert-hook, after-revert-hook, revert-buffer-in-progress-p) + (revert-buffer, revert-buffer--default) + (revert-buffer-insert-file-contents--default-function): + Doc fixes related to defaults no longer being nil. + (make-backup-file-name-function): Bump :version. + Restore nil as a valid but deprecated custom type. + +2014-04-03 Stefan Monnier + + * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $' + used as a variable (bug#17174). + +2014-04-02 Stefan Monnier + + * progmodes/perl-mode.el (perl-indent-new-calculate): + Handle forward-sexp failure (bug#16985). + (perl-syntax-propertize-function): Add "foreach" and "for" statement + modifiers introducing expressions (bug#17116). + 2014-04-06 Stefan Monnier * dired-aux.el (dired-file-set-difference): Use lexical-scoping. @@ -488,6 +613,19 @@ (tty-color-approximate, tty-color-by-index, tty-color-values) (tty-color-desc): Remove superfluous backslashes. +2014-03-20 Stefan Monnier + + * electric.el (electric-newline-and-maybe-indent): New command. + Bind it globally to C-j. + (electric-indent-mode): Don't mess with the global map any more. + Don't drop the post-self-insert-hook is some buffer is still using it + (bug#16770). + + * bindings.el (global-map): Remove C-j binding. + + * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find + the docstring of functions advised before dumping (bug#16993). + 2014-03-21 Glenn Morris * cus-start.el (history-length): Bump :version. @@ -516,18 +654,6 @@ * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. -2014-03-20 Stefan Monnier - - * electric.el (electric-newline-and-maybe-indent): New command. - Bind it globally to C-j. - (electric-indent-mode): Don't mess with the global map any more. - Don't drop the post-self-insert-hook is some buffer is still using it - (bug#16770). - * bindings.el (global-map): Remove C-j binding. - - * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find - the docstring of functions advised before dumping (bug#16993). - 2014-03-19 Stefan-W. Hahn (tiny change) * ps-print.el (ps-generate-postscript-with-faces): @@ -2154,7 +2280,6 @@ * net/shr.el (shr-tag-img): Prefer the title over the alt text (bug#16537). ->>>>>>> MERGE-SOURCE 2014-01-24 Juanma Barranquero * net/eww.el (eww-download-callback): === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2014-01-01 07:43:34 +0000 +++ lisp/autorevert.el 2014-04-04 02:09:35 +0000 @@ -672,7 +672,7 @@ are checked. Non-file buffers that have a custom `revert-buffer-function' and -a `buffer-stale-function' are reverted either when Auto-Revert +`buffer-stale-function' are reverted either when Auto-Revert Mode is active in that buffer, or when the variable `global-auto-revert-non-file-buffers' is non-nil and Global Auto-Revert Mode is active. === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2014-01-01 07:43:34 +0000 +++ lisp/doc-view.el 2014-04-04 17:42:55 +0000 @@ -1862,20 +1862,23 @@ `((page . ,(doc-view-current-page)) (handler . doc-view-bookmark-jump)))) - ;;;###autoload (defun doc-view-bookmark-jump (bmk) ;; This implements the `handler' function interface for record type ;; returned by `doc-view-bookmark-make-record', which see. - (prog1 (bookmark-default-handler bmk) - (let ((page (bookmark-prop-get bmk 'page))) - (when (not (eq major-mode 'doc-view-mode)) - (doc-view-toggle-display)) - (with-selected-window - (or (get-buffer-window (current-buffer) 0) - (selected-window)) - (doc-view-goto-page page))))) - + (let ((page (bookmark-prop-get bmk 'page)) + (show-fn-sym (make-symbol "doc-view-bookmark-after-jump-hook"))) + (fset show-fn-sym + (lambda () + (remove-hook 'bookmark-after-jump-hook show-fn-sym) + (when (not (eq major-mode 'doc-view-mode)) + (doc-view-toggle-display)) + (with-selected-window + (or (get-buffer-window (current-buffer) 0) + (selected-window)) + (doc-view-goto-page page)))) + (add-hook 'bookmark-after-jump-hook show-fn-sym) + (bookmark-default-handler bmk))) (provide 'doc-view) === modified file 'lisp/elec-pair.el' --- lisp/elec-pair.el 2014-04-04 23:31:02 +0000 +++ lisp/elec-pair.el 2014-04-07 20:54:16 +0000 @@ -166,36 +166,6 @@ quotes or comments. If lookup fails here, `electric-pair-text-pairs' will be considered.") -(defun electric-pair-backward-delete-char (n &optional killflag untabify) - "Delete characters backward, and maybe also two adjacent paired delimiters. - -Remaining behavior is given by `backward-delete-char' or, if UNTABIFY is -non-nil, `backward-delete-char-untabify'." - (interactive "*p\nP") - (let* ((prev (char-before)) - (next (char-after)) - (syntax-info (and prev - (electric-pair-syntax-info prev))) - (syntax (car syntax-info)) - (pair (cadr syntax-info))) - (when (and next pair - (if (functionp electric-pair-delete-adjacent-pairs) - (funcall electric-pair-delete-adjacent-pairs) - electric-pair-delete-adjacent-pairs) - (memq syntax '(?\( ?\" ?\$)) - (eq pair next)) - (delete-char 1 killflag)) - (if untabify - (backward-delete-char-untabify n killflag) - (backward-delete-char n killflag)))) - -(defun electric-pair-backward-delete-char-untabify (n &optional killflag) - "Delete characters backward, and maybe also two adjacent paired delimiters. - -Remaining behavior is given by `backward-delete-char-untabify'." - (interactive "*p\nP") - (electric-pair-backward-delete-char n killflag t)) - (defun electric-pair-conservative-inhibit (char) (or ;; I find it more often preferable not to pair when the @@ -503,10 +473,12 @@ (funcall electric-pair-skip-self last-command-event) electric-pair-skip-self)) (save-excursion - (when (setq skip-whitespace-info - (if (functionp electric-pair-skip-whitespace) - (funcall electric-pair-skip-whitespace) - electric-pair-skip-whitespace)) + (when (and (not (and unconditional + (eq syntax ?\"))) + (setq skip-whitespace-info + (if (functionp electric-pair-skip-whitespace) + (funcall electric-pair-skip-whitespace) + electric-pair-skip-whitespace))) (electric-pair--skip-whitespace)) (eq (char-after) last-command-event)))) ;; This is too late: rather than insert&delete we'd want to only @@ -546,14 +518,34 @@ (memq (car (electric-pair-syntax-info last-command-event)) '(?\( ?\) ?\" ?\$)))) +(defun electric-pair-delete-pair (arg &optional killp) + "When between adjacent paired delimiters, delete both of them. +ARG and KILLP are passed directly to +`backward-delete-char-untabify', which see." + (interactive "*p\nP") + (delete-char 1) + (backward-delete-char-untabify arg killp)) + (defvar electric-pair-mode-map (let ((map (make-sparse-keymap))) - (define-key map [remap backward-delete-char-untabify] - 'electric-pair-backward-delete-char-untabify) - (define-key map [remap backward-delete-char] - 'electric-pair-backward-delete-char) - (define-key map [remap delete-backward-char] - 'electric-pair-backward-delete-char) + (define-key map "\177" + `(menu-item + "" electric-pair-delete-pair + :filter + ,(lambda (cmd) + (let* ((prev (char-before)) + (next (char-after)) + (syntax-info (and prev + (electric-pair-syntax-info prev))) + (syntax (car syntax-info)) + (pair (cadr syntax-info))) + (and next pair + (memq syntax '(?\( ?\" ?\$)) + (eq pair next) + (if (functionp electric-pair-delete-adjacent-pairs) + (funcall electric-pair-delete-adjacent-pairs) + electric-pair-delete-adjacent-pairs) + cmd))))) map) "Keymap used by `electric-pair-mode'.") === modified file 'lisp/faces.el' --- lisp/faces.el 2014-03-28 07:16:42 +0000 +++ lisp/faces.el 2014-04-07 20:54:16 +0000 @@ -354,11 +354,16 @@ (defun make-face-x-resource-internal (face &optional frame) "Fill frame-local FACE on FRAME from X resources. -FRAME nil or not specified means do it for all frames." - (if (null frame) - (dolist (frame (frame-list)) - (set-face-attributes-from-resources face frame)) - (set-face-attributes-from-resources face frame))) +FRAME nil or not specified means do it for all frames. + +If `inhibit-x-resources' is non-nil, this function does nothing." + (unless inhibit-x-resources + (dolist (frame (if (null frame) (frame-list) (list frame))) + ;; `x-create-frame' already took care of correctly handling + ;; the reverse video case-- do _not_ touch the default face + (unless (and (eq face 'default) + (frame-parameter frame 'reverse)) + (set-face-attributes-from-resources face frame))))) @@ -1532,13 +1537,15 @@ match)) -(defun face-spec-choose (spec &optional frame) - "Choose the proper attributes for FRAME, out of SPEC. -If SPEC is nil, return nil." +(defun face-spec-choose (spec &optional frame no-match-retval) + "Return the proper attributes for FRAME, out of SPEC. + +If no match is found or SPEC is nil, return nil, unless NO-MATCH-RETVAL +is given, in which case return its value instead." (unless frame (setq frame (selected-frame))) (let ((tail spec) - result defaults) + result defaults match-found) (while tail (let* ((entry (pop tail)) (display (car entry)) @@ -1558,9 +1565,18 @@ (setq defaults thisval) ;; Otherwise, if it matches, use it. (when (face-spec-set-match-display display frame) - (setq result thisval) - (setq tail nil))))) - (if defaults (append result defaults) result))) + (setq result thisval + tail nil + match-found t))))) + ;; If defaults have been found, it's safe to just append those to the result + ;; list (which at this point will be either nil or contain actual specs) and + ;; return it to the caller. Since there will most definitely be something to + ;; return in this case, there's no need to know/check if a match was found. + (if defaults + (append result defaults) + (if match-found + result + no-match-retval)))) (defun face-spec-reset-face (face &optional frame) @@ -1639,19 +1655,27 @@ (defun face-spec-recalc (face frame) "Reset the face attributes of FACE on FRAME according to its specs. -This applies the defface/custom spec first, then the custom theme specs, -then the override spec." +After the reset, the specs are applied from the following sources in this order: + X resources (if applicable) + | + (theme and user customization) + or, if nonexistent or does not match the current frame, + (defface default spec) + | + defface override spec" (while (get face 'face-alias) (setq face (get face 'face-alias))) (face-spec-reset-face face frame) + (make-face-x-resource-internal face frame) ;; If FACE is customized or themed, set the custom spec from ;; `theme-face' records. (let ((theme-faces (get face 'theme-face)) + (no-match-found 0) spec theme-face-applied) (if theme-faces (dolist (elt (reverse theme-faces)) - (setq spec (face-spec-choose (cadr elt) frame)) - (when spec + (setq spec (face-spec-choose (cadr elt) frame no-match-found)) + (unless (eq spec no-match-found) (face-spec-set-2 face frame spec) (setq theme-face-applied t)))) ;; If there was a spec applicable to FRAME, that overrides the @@ -1661,8 +1685,7 @@ (setq spec (face-spec-choose (face-default-spec face) frame)) (face-spec-set-2 face frame spec)) (setq spec (face-spec-choose (get face 'face-override-spec) frame)) - (face-spec-set-2 face frame spec)) - (make-face-x-resource-internal face frame)) + (face-spec-set-2 face frame spec))) (defun face-spec-set-2 (face frame spec) "Set the face attributes of FACE on FRAME according to SPEC." @@ -2046,10 +2069,6 @@ (progn ;; Initialize faces from face spec and custom theme. (face-spec-recalc face frame) - ;; X resources for the default face are applied during - ;; `x-create-frame'. - (and (not (eq face 'default)) window-system-p - (make-face-x-resource-internal face frame)) ;; Apply attributes specified by face-new-frame-defaults (internal-merge-in-global-face face frame)) ;; Don't let invalid specs prevent frame creation. === modified file 'lisp/files.el' --- lisp/files.el 2014-03-26 01:14:44 +0000 +++ lisp/files.el 2014-04-07 20:54:16 +0000 @@ -4207,15 +4207,22 @@ (defcustom make-backup-file-name-function #'make-backup-file-name--default-function - "A function to use instead of the default `make-backup-file-name'. - -This could be buffer-local to do something special for specific -files. If you define it, you may need to change `backup-file-name-p' -and `file-name-sans-versions' too. + "A function that `make-backup-file-name' uses to create backup file names. +The function receives a single argument, the original file name. + +If you change this, you may need to change `backup-file-name-p' and +`file-name-sans-versions' too. + +You could make this buffer-local to do something special for specific files. + +For historical reasons, a value of nil means to use the default function. +This should not be relied upon. See also `backup-directory-alist'." + :version "24.4" ; nil -> make-backup-file-name--default-function :group 'backup - :type '(function :tag "Your function")) + :type '(choice (const :tag "Deprecated way to get the default function" nil) + (function :tag "Function"))) (defcustom backup-directory-alist nil "Alist of filename patterns and backup directory names. @@ -4272,20 +4279,17 @@ (defun make-backup-file-name (file) "Create the non-numeric backup file name for FILE. -Normally this will just be the file's name with `~' appended. -Customization hooks are provided as follows. - -The value of `make-backup-file-name-function' should be a function which -will be called with FILE as its argument; the resulting name is used. - -By default, a match for FILE is sought in `backup-directory-alist'; see -the documentation of that variable. If the directory for the backup -doesn't exist, it is created." +This calls the function that `make-backup-file-name-function' specifies, +with a single argument FILE." (funcall (or make-backup-file-name-function #'make-backup-file-name--default-function) file)) (defun make-backup-file-name--default-function (file) + "Default function for `make-backup-file-name'. +Normally this just returns FILE's name with `~' appended. +It searches for a match for FILE in `backup-directory-alist'. +If the directory for the backup doesn't exist, it is created." (if (and (eq system-type 'ms-dos) (not (msdos-long-file-names))) (let ((fn (file-name-nondirectory file))) @@ -4297,7 +4301,8 @@ (concat (make-backup-file-name-1 file) "~"))) (defun make-backup-file-name-1 (file) - "Subroutine of `make-backup-file-name' and `find-backup-file-name'." + "Subroutine of `make-backup-file-name--default-function'. +The function `find-backup-file-name' also uses this." (let ((alist backup-directory-alist) elt backup-directory abs-backup-directory) (while alist @@ -4374,8 +4379,8 @@ Value is a list whose car is the name for the backup file and whose cdr is a list of old versions to consider deleting now. If the value is nil, don't make a backup. -Uses `backup-directory-alist' in the same way as does -`make-backup-file-name'." +Uses `backup-directory-alist' in the same way as +`make-backup-file-name--default-function' does." (let ((handler (find-file-name-handler fn 'find-backup-file-name))) ;; Run a handler for this function so that ange-ftp can refuse to do it. (if handler @@ -5312,28 +5317,41 @@ (put 'revert-buffer-function 'permanent-local t) (defvar revert-buffer-function #'revert-buffer--default - "Function to use to revert this buffer, or nil to do the default. + "Function to use to revert this buffer. The function receives two arguments IGNORE-AUTO and NOCONFIRM, which are the arguments that `revert-buffer' received. It also has access to the `preserve-modes' argument of `revert-buffer' -via the `revert-buffer-preserve-modes' dynamic variable.") +via the `revert-buffer-preserve-modes' dynamic variable. + +For historical reasons, a value of nil means to use the default function. +This should not be relied upon.") (put 'revert-buffer-insert-file-contents-function 'permanent-local t) (defvar revert-buffer-insert-file-contents-function #'revert-buffer-insert-file-contents--default-function "Function to use to insert contents when reverting this buffer. -Gets two args, first the nominal file name to use, -and second, t if reading the auto-save file. - -The function you specify is responsible for updating (or preserving) point.") +The function receives two arguments: the first the nominal file name to use; +the second is t if reading the auto-save file. + +The function is responsible for updating (or preserving) point. + +For historical reasons, a value of nil means to use the default function. +This should not be relied upon.") (defun buffer-stale--default-function (&optional _noconfirm) + "Default function to use for `buffer-stale-function'. +This function ignores its argument. +This returns non-nil if the current buffer is visiting a readable file +whose modification time does not match that of the buffer. + +This function only handles buffers that are visiting files. +Non-file buffers need a custom function" (and buffer-file-name (file-readable-p buffer-file-name) (not (verify-visited-file-modtime (current-buffer))))) (defvar buffer-stale-function #'buffer-stale--default-function - "Function to check whether a non-file buffer needs reverting. + "Function to check whether a buffer needs reverting. This should be a function with one optional argument NOCONFIRM. Auto Revert Mode passes t for NOCONFIRM. The function should return non-nil if the buffer should be reverted. A return value of @@ -5346,13 +5364,16 @@ user. In such situations, one has to be careful with potentially time consuming operations. +For historical reasons, a value of nil means to use the default function. +This should not be relied upon. + For more information on how this variable is used by Auto Revert mode, see Info node `(emacs)Supporting additional buffers'.") (defvar before-revert-hook nil "Normal hook for `revert-buffer' to run before reverting. -If `revert-buffer-function' is used to override the normal revert -mechanism, this hook is not used.") +The function `revert-buffer--default' runs this. +A customized `revert-buffer-function' need not run this hook.") (defvar after-revert-hook nil "Normal hook for `revert-buffer' to run after reverting. @@ -5360,12 +5381,11 @@ before reverting; that makes a difference if you have buffer-local hook functions. -If `revert-buffer-function' is used to override the normal revert -mechanism, this hook is not used.") +The function `revert-buffer--default' runs this. +A customized `revert-buffer-function' need not run this hook.") (defvar revert-buffer-in-progress-p nil - "Non-nil if a `revert-buffer' operation is in progress, nil otherwise. -This is true even if a `revert-buffer-function' is being used.") + "Non-nil if a `revert-buffer' operation is in progress, nil otherwise.") (defvar revert-buffer-internal-hook) @@ -5402,12 +5422,10 @@ This function binds `revert-buffer-in-progress-p' non-nil while it operates. -If the value of `revert-buffer-function' is non-nil, it is called to -do all the work for this command. Otherwise, the hooks -`before-revert-hook' and `after-revert-hook' are run at the beginning -and the end, and if `revert-buffer-insert-file-contents-function' is -non-nil, it is called instead of rereading visited file contents." - +This function calls the function that `revert-buffer-function' specifies +to do the work, with arguments IGNORE-AUTO and NOCONFIRM. +The default function runs the hooks `before-revert-hook' and +`after-revert-hook'." ;; I admit it's odd to reverse the sense of the prefix argument, but ;; there is a lot of code out there which assumes that the first ;; argument should be t to avoid consulting the auto-save file, and @@ -5419,7 +5437,19 @@ (revert-buffer-preserve-modes preserve-modes)) (funcall (or revert-buffer-function #'revert-buffer--default) ignore-auto noconfirm))) + (defun revert-buffer--default (ignore-auto noconfirm) + "Default function for `revert-buffer'. +The arguments IGNORE-AUTO and NOCONFIRM are as described for `revert-buffer'. +Runs the hooks `before-revert-hook' and `after-revert-hook' at the +start and end. + +Calls `revert-buffer-insert-file-contents-function' to reread the +contents of the visited file, with two arguments: the first is the file +name, the second is non-nil if reading an auto-save file. + +This function only handles buffers that are visiting files. +Non-file buffers need a custom function." (with-current-buffer (or (buffer-base-buffer (current-buffer)) (current-buffer)) (let* ((auto-save-p (and (not ignore-auto) @@ -5473,6 +5503,10 @@ t))))) (defun revert-buffer-insert-file-contents--default-function (file-name auto-save-p) + "Default function for `revert-buffer-insert-file-contents-function'. +The function `revert-buffer--default' calls this. +FILE-NAME is the name of the file. AUTO-SAVE-P is non-nil if this is +an auto-save file." (cond ((not (file-exists-p file-name)) (error (if buffer-file-number === modified file 'lisp/help.el' --- lisp/help.el 2014-03-22 23:47:20 +0000 +++ lisp/help.el 2014-04-07 20:54:16 +0000 @@ -446,7 +446,7 @@ (defun view-lossage () "Display last 300 input keystrokes. -To record all your input on a file, use `open-dribble-file'." +To record all your input, use `open-dribble-file'." (interactive) (help-setup-xref (list #'view-lossage) (called-interactively-p 'interactive)) === modified file 'lisp/international/characters.el' --- lisp/international/characters.el 2014-01-06 06:25:30 +0000 +++ lisp/international/characters.el 2014-04-04 08:26:00 +0000 @@ -495,6 +495,13 @@ (modify-category-entry key ?L)))) table))) +;; Load uni-mirrored.el if available, so that it gets dumped into +;; Emacs. This allows to start Emacs with force-load-messages in +;; ~/.emacs, and avoid infinite recursion in bidi_initialize, which +;; needs to load uni-mirrored.el in order to display the "Loading" +;; messages. +(unicode-property-table-internal 'mirroring) + ;; Latin (modify-category-entry '(#x80 . #x024F) ?l) === modified file 'lisp/leim/quail/ipa.el' --- lisp/leim/quail/ipa.el 2014-01-16 06:24:06 +0000 +++ lisp/leim/quail/ipa.el 2014-04-06 15:21:35 +0000 @@ -475,7 +475,7 @@ ("_d" "̪") ;; Dental U+032A ("_e" "̴") ;; Velarized or pharyngeal U+0334 - ("" "↙") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than + ("" "↘") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than ;; intended. ("_F" "̂") ;; Falling tone U+0302 ("_G" "ˠ") ;; Velarized U+02E0 === modified file 'lisp/mpc.el' --- lisp/mpc.el 2014-01-01 07:43:34 +0000 +++ lisp/mpc.el 2014-04-06 13:08:00 +0000 @@ -491,9 +491,13 @@ (cancel-timer mpc--status-timer) (setq mpc--status-timer nil))) (defun mpc--status-timer-run () - (with-demoted-errors "MPC: %s" + (with-demoted-errors "MPC: %S" (when (process-get (mpc-proc) 'ready) - (with-local-quit (mpc-status-refresh))))) + (let* ((buf (mpc-proc-buffer (mpc-proc) 'status)) + (win (get-buffer-window buf t))) + (if (not win) + (mpc--status-timer-stop) + (with-local-quit (mpc-status-refresh))))))) (defvar mpc--status-idle-timer nil) (defun mpc--status-idle-timer-start () @@ -518,10 +522,8 @@ ;; client starts playback, we may get a chance to notice it. (run-with-idle-timer 10 t 'mpc--status-idle-timer-run)))) (defun mpc--status-idle-timer-run () - (when (process-get (mpc-proc) 'ready) - (with-demoted-errors "MPC: %s" - (with-local-quit (mpc-status-refresh)))) - (mpc--status-timer-start)) + (mpc--status-timer-start) + (mpc--status-timer-run)) (defun mpc--status-timers-refresh () "Start/stop the timers according to whether a song is playing." === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2014-02-10 01:34:22 +0000 +++ lisp/progmodes/perl-mode.el 2014-04-03 00:41:09 +0000 @@ -250,7 +250,11 @@ ;; Catch ${ so that ${var} doesn't screw up indentation. ;; This also catches $' to handle 'foo$', although it should really ;; check that it occurs inside a '..' string. - ("\\(\\$\\)[{']" (1 ". p")) + ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1))) + (save-excursion + (not (nth 3 (syntax-ppss + (match-beginning 0)))))) + (string-to-syntax ". p")))) ;; Handle funny names like $DB'stop. ("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_")) ;; format statements @@ -276,7 +280,7 @@ ;; perl-font-lock-special-syntactic-constructs. ((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" (regexp-opt '("split" "if" "unless" "until" "while" "split" - "grep" "map" "not" "or" "and")) + "grep" "map" "not" "or" "and" "for" "foreach")) "\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)") (2 (ignore (if (and (match-end 1) ; / at BOL. @@ -854,11 +858,12 @@ (and (= (char-syntax (following-char)) ?\)) (save-excursion (forward-char 1) - (forward-sexp -1) - (perl-indent-new-calculate - ;; Recalculate the parsing-start, since we may have jumped - ;; dangerously close (typically in the case of nested functions). - 'virtual nil (save-excursion (perl-beginning-of-function))))) + (when (condition-case nil (progn (forward-sexp -1) t) + (scan-error nil)) + (perl-indent-new-calculate + ;; Recalculate the parsing-start, since we may have jumped + ;; dangerously close (typically in the case of nested functions). + 'virtual nil (save-excursion (perl-beginning-of-function)))))) (and (and (= (following-char) ?{) (save-excursion (forward-char) (perl-hanging-paren-p))) (+ (or default (perl-calculate-indent parse-start)) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-03-15 17:37:58 +0000 +++ lisp/progmodes/python.el 2014-04-06 23:23:45 +0000 @@ -3651,8 +3651,9 @@ (let ((count 0)) (while (eq (char-before (- (point) count)) last-command-event) (cl-incf count)) - (= count 3))) - (save-excursion (insert (make-string 3 last-command-event))))) + (= count 3)) + (eq (char-after) last-command-event)) + (save-excursion (insert (make-string 2 last-command-event))))) (defvar electric-indent-inhibit) === modified file 'lisp/shell.el' --- lisp/shell.el 2014-02-10 01:34:22 +0000 +++ lisp/shell.el 2014-04-07 01:27:32 +0000 @@ -792,8 +792,11 @@ Environment variables are expanded, see function `substitute-in-file-name'." (if shell-dirtrackp ;; We fail gracefully if we think the command will fail in the shell. - (with-demoted-errors "Couldn't cd: %s" - (let ((start (progn (string-match +;;; (with-demoted-errors "Directory tracker failure: %s" + ;; This fails so often that it seems better to just ignore errors (?). + ;; Eg even: foo=/tmp; cd $foo is beyond us (bug#17159). + (ignore-errors + (let ((start (progn (string-match (concat "^" shell-command-separator-regexp) str) ; skip whitespace (match-end 0))) === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-03-03 04:57:26 +0000 +++ nt/ChangeLog 2014-04-03 19:10:35 +0000 @@ -1,3 +1,7 @@ +2014-04-03 Ken Brown + + * emacs.rc: Don't use manifest on Cygwin. (Bug#17176) + 2014-02-17 Juanma Barranquero * Makefile.in (install): Create destination directory before copying === modified file 'nt/emacs.rc' --- nt/emacs.rc 2014-03-21 10:12:53 +0000 +++ nt/emacs.rc 2014-04-07 20:54:16 +0000 @@ -1,10 +1,12 @@ Emacs ICON icons/emacs.ico 32649 CURSOR icons/hand.cur -#if defined (WIN64) || defined (__x86_64__) +#ifndef __CYGWIN__ +#ifdef WIN64 1 24 "emacs-x64.manifest" #else 1 24 "emacs-x86.manifest" #endif +#endif #ifndef VS_VERSION_INFO #define VS_VERSION_INFO 1 === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-07 17:52:38 +0000 +++ src/ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,37 @@ +2014-04-07 Stefan Monnier + + * lisp.h (struct Lisp_Symbol): New bitfield `pinned'. + + * alloc.c: Keep track of symbols referenced from pure space (bug#17168). + (symbol_block_pinned): New var. + (Fmake_symbol): Initialize `pinned'. + (purecopy): New function, extracted from Fpurecopy. Mark symbols as + pinned and signal an error for un-purifiable objects. + (pure_cons): Use it. + (Fpurecopy): Use it, except for objects that can't be purified. + (mark_pinned_symbols): New function. + (Fgarbage_collect): Use it. + (gc_sweep): Remove hack made unnecessary. + +2014-04-05 Glenn Morris + + * keyboard.c (Fopen_dribble_file): Doc tweak. + +2014-04-04 Jan Djärv + + Backport from trunk. + * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool + bar is zero height, just return (Bug#16976). + (initFrameFromEmacs:): Initialize wait_for_tool_bar. + * nsterm.h (EmacsView): Add wait_for_tool_bar. + * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar + is nil. If waiting for toolbar to complete, force a redraw. + (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976). + +2014-04-03 Ken Brown + + * Makefile.in (EMACS_MANIFEST): Update comment. (Bug#17176) + 2014-04-07 Paul Eggert * alloc.c: Simplify by removing use of HAVE_EXECINFO_H. @@ -4490,7 +4524,7 @@ * frame.c (delete_frame): Block/unblock input to overcome race condition (Bug#15475). -2013-09-29 Andreas Politz (tiny change) +2013-09-29 Andreas Politz * frame.c (delete_frame): Record selected frame only after calling Qdelete_frame_functions (Bug#15477). === modified file 'src/Makefile.in' --- src/Makefile.in 2014-01-12 17:27:17 +0000 +++ src/Makefile.in 2014-04-03 19:10:35 +0000 @@ -259,7 +259,7 @@ ## emacs.res if HAVE_W32 EMACSRES = @EMACSRES@ -## emacs-*.manifest if HAVE_W32 +## emacs-*.manifest if WINDOWSNT EMACS_MANIFEST = @EMACS_MANIFEST@ ## If HAVE_W32, compiler arguments for including ## the resource file in the binary. === modified file 'src/alloc.c' --- src/alloc.c 2014-04-07 17:52:38 +0000 +++ src/alloc.c 2014-04-07 20:54:16 +0000 @@ -3357,6 +3357,13 @@ static struct symbol_block *symbol_block; static int symbol_block_index = SYMBOL_BLOCK_SIZE; +/* Pointer to the first symbol_block that contains pinned symbols. + Tests for 24.4 showed that at dump-time, Emacs contains about 15K symbols, + 10K of which are pinned (and all but 250 of them are interned in obarray), + whereas a "typical session" has in the order of 30K symbols. + `symbol_block_pinned' lets mark_pinned_symbols scan only 15K symbols rather + than 30K to find the 10K symbols we need to mark. */ +static struct symbol_block *symbol_block_pinned; /* List of free symbols. */ @@ -3409,10 +3416,11 @@ SET_SYMBOL_VAL (p, Qunbound); set_symbol_function (val, Qnil); set_symbol_next (val, NULL); - p->gcmarkbit = 0; + p->gcmarkbit = false; p->interned = SYMBOL_UNINTERNED; p->constant = 0; - p->declared_special = 0; + p->declared_special = false; + p->pinned = false; consing_since_gc += sizeof (struct Lisp_Symbol); symbols_consed++; total_free_symbols--; @@ -5214,6 +5222,8 @@ return string; } +static Lisp_Object purecopy (Lisp_Object obj); + /* Return a cons allocated from pure space. Give it pure copies of CAR as car and CDR as cdr. */ @@ -5223,8 +5233,8 @@ Lisp_Object new; struct Lisp_Cons *p = pure_alloc (sizeof *p, Lisp_Cons); XSETCONS (new, p); - XSETCAR (new, Fpurecopy (car)); - XSETCDR (new, Fpurecopy (cdr)); + XSETCAR (new, purecopy (car)); + XSETCDR (new, purecopy (cdr)); return new; } @@ -5265,9 +5275,19 @@ { if (NILP (Vpurify_flag)) return obj; - - if (PURE_POINTER_P (XPNTR (obj))) + else if (MARKERP (obj) || OVERLAYP (obj) + || HASH_TABLE_P (obj) || SYMBOLP (obj)) + /* Can't purify those. */ return obj; + else + return purecopy (obj); +} + +static Lisp_Object +purecopy (Lisp_Object obj) +{ + if (PURE_POINTER_P (XPNTR (obj)) || INTEGERP (obj) || SUBRP (obj)) + return obj; /* Already pure. */ if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */ { @@ -5295,7 +5315,7 @@ size &= PSEUDOVECTOR_SIZE_MASK; vec = XVECTOR (make_pure_vector (size)); for (i = 0; i < size; i++) - vec->contents[i] = Fpurecopy (AREF (obj, i)); + vec->contents[i] = purecopy (AREF (obj, i)); if (COMPILEDP (obj)) { XSETPVECTYPE (vec, PVEC_COMPILED); @@ -5304,11 +5324,23 @@ else XSETVECTOR (obj, vec); } - else if (MARKERP (obj)) - error ("Attempt to copy a marker to pure storage"); + else if (SYMBOLP (obj)) + { + if (!XSYMBOL (obj)->pinned) + { /* We can't purify them, but they appear in many pure objects. + Mark them as `pinned' so we know to mark them at every GC cycle. */ + XSYMBOL (obj)->pinned = true; + symbol_block_pinned = symbol_block; + } + return obj; + } else - /* Not purified, don't hash-cons. */ - return obj; + { + Lisp_Object args[2]; + args[0] = build_pure_c_string ("Don't know how to purify: %S"); + args[1] = obj; + Fsignal (Qerror, (Fcons (Fformat (2, args), Qnil))); + } if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */ Fputhash (obj, obj, Vpurify_flag); @@ -5471,6 +5503,24 @@ return list; } +static void +mark_pinned_symbols (void) +{ + struct symbol_block *sblk; + int lim = (symbol_block_pinned == symbol_block + ? symbol_block_index : SYMBOL_BLOCK_SIZE); + + for (sblk = symbol_block_pinned; sblk; sblk = sblk->next) + { + union aligned_Lisp_Symbol *sym = sblk->symbols, *end = sym + lim; + for (; sym < end; ++sym) + if (sym->s.pinned) + mark_object (make_lisp_ptr (&sym->s, Lisp_Symbol)); + + lim = SYMBOL_BLOCK_SIZE; + } +} + DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", doc: /* Reclaim storage for Lisp objects no longer needed. Garbage collection happens automatically if you cons more than @@ -5573,6 +5623,7 @@ for (i = 0; i < staticidx; i++) mark_object (*staticvec[i]); + mark_pinned_symbols (); mark_specpdl (); mark_terminals (); mark_kboards (); @@ -6574,12 +6625,7 @@ for (; sym < end; ++sym) { - /* Check if the symbol was created during loadup. In such a case - it might be pointed to by pure bytecode which we don't trace, - so we conservatively assume that it is live. */ - bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); - - if (!sym->s.gcmarkbit && !pure_p) + if (!sym->s.gcmarkbit) { if (sym->s.redirect == SYMBOL_LOCALIZED) xfree (SYMBOL_BLV (&sym->s)); @@ -6593,8 +6639,6 @@ else { ++num_used; - if (!pure_p) - eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); sym->s.gcmarkbit = 0; } } === modified file 'src/bidi.c' --- src/bidi.c 2014-01-01 17:44:48 +0000 +++ src/bidi.c 2014-04-06 15:56:01 +0000 @@ -22,9 +22,16 @@ A sequential implementation of the Unicode Bidirectional algorithm, (UBA) as per UAX#9, a part of the Unicode Standard. - Unlike the reference and most other implementations, this one is - designed to be called once for every character in the buffer or - string. + Unlike the Reference Implementation and most other implementations, + this one is designed to be called once for every character in the + buffer or string. That way, we can leave intact the design of the + Emacs display engine, whereby an iterator object is used to + traverse buffer or string text character by character, and generate + the necessary data for displaying each character in 'struct glyph' + objects. (See xdisp.c for the details of that iteration.) The + functions on this file replace the original linear iteration in the + logical order of the text with a non-linear iteration in the visual + order, i.e. in the order characters should be shown on display. The main entry point is bidi_move_to_visually_next. Each time it is called, it finds the next character in the visual order, and @@ -52,7 +59,182 @@ A note about references to UAX#9 rules: if the reference says something like "X9/Retaining", it means that you need to refer to rule X9 and to its modifications described in the "Implementation - Notes" section of UAX#9, under "Retaining Format Codes". */ + Notes" section of UAX#9, under "Retaining Format Codes". + + Here's the overview of the design of the reordering engine + implemented by this file. + + Basic implementation structure + ------------------------------ + + The sequential processing steps described by UAX#9 are implemented + as recursive levels of processing, all of which examine the next + character in the logical order. This hierarchy of processing looks + as follows, from the innermost (deepest) to the outermost level, + omitting some subroutines used by each level: + + bidi_fetch_char -- fetch next character + bidi_resolve_explicit -- resolve explicit levels and directions + bidi_resolve_weak -- resolve weak types + bidi_resolve_neutral -- resolve neutral types + bidi_level_of_next_char -- resolve implicit levels + + Each level calls the level below it, and works on the result + returned by the lower level, including all of its sub-levels. + + Unlike all the levels below it, bidi_level_of_next_char can return + the information about either the next or previous character in the + logical order, depending on the current direction of scanning the + buffer or string. For the next character, it calls all the levels + below it; for the previous character, it uses the cache, described + below. + + Thus, the result of calling bidi_level_of_next_char is the resolved + level of the next or the previous character in the logical order. + Based on this information, the function bidi_move_to_visually_next + finds the next character in the visual order and updates the + direction in which the buffer is scanned, either forward or + backward, to find the next character to be displayed. (Text is + scanned backwards when it needs to be reversed for display, i.e. if + the visual order is the inverse of the logical order.) This + implements the last, reordering steps of the UBA, by successively + calling bidi_level_of_next_char until the character of the required + embedding level is found; the scan direction is dynamically updated + as a side effect. See the commentary before the 'while' loop in + bidi_move_to_visually_next, for the details. + + Fetching characters + ------------------- + + In a nutshell, fetching the next character boils down to calling + STRING_CHAR_AND_LENGTH, passing it the address of a buffer or + string position. See bidi_fetch_char. However, if the next + character is "covered" by a display property of some kind, + bidi_fetch_char returns the u+FFFC "object replacement character" + that represents the entire run of text covered by the display + property. (The ch_len and nchars members of 'struct bidi_it' + reflect the length in bytes and characters of that text.) This is + so we reorder text on both sides of the display property as + appropriate for an image or embedded string. Similarly, text + covered by a display spec of the form '(space ...)', is replaced + with the u+2029 paragraph separator character, so such display + specs produce the same effect as a TAB under UBA. Both these + special characters are not actually displayed -- the display + property is displayed instead -- but just used to compute the + embedding level of the surrounding text so as to produce the + required effect. + + Bidi iterator states + -------------------- + + The UBA is highly context dependent in some of its parts, + i.e. results of processing a character can generally depend on + characters very far away. The UAX#9 description of the UBA + prescribes a stateful processing of each character, whereby the + results of this processing depend on various state variables, such + as the current embedding level, level stack, and directional + override status. In addition, the UAX#9 description includes many + passages like this (from rule W2 in this case): + + Search backward from each instance of a European number until the + first strong type (R, L, AL, or sos) is found. If an AL is found, + change the type of the European number to Arabic number. + + To support this, we use a bidi iterator object, 'struct bidi_it', + which is a sub-structure of 'struct it' used by xdisp.c (see + dispextern.h for the definition of both of these structures). The + bidi iterator holds the entire state of the iteration required by + the UBA, and is updated as the text is traversed. In particular, + the embedding level of the current character being resolved is + recorded in the iterator state. To avoid costly searches backward + in support of rules like W2 above, the necessary character types + are also recorded in the iterator state as they are found during + the forward scan, and then used when such rules need to be applied. + (Forward scans cannot be avoided in this way; they need to be + performed at least once, and the results recorded in the iterator + state, to be reused until the forward scan oversteps the recorded + position.) + + In this manner, the iterator state acts as a mini-cache of + contextual information required for resolving the level of the + current character by various UBA rules. + + Caching of bidi iterator states + ------------------------------- + + As described above, the reordering engine uses the information + recorded in the bidi iterator state in order to resolve the + embedding level of the current character. When the reordering + engine needs to process the next character in the logical order, it + fetches it and applies to it all the UBA levels, updating the + iterator state as it goes. But when the buffer or string is + scanned backwards, i.e. in the reverse order of buffer/string + positions, the scanned characters were already processed during the + preceding forward scan (see bidi_find_other_level_edge). To avoid + costly re-processing of characters that were already processed + during the forward scan, the iterator states computed while + scanning forward are cached. + + The cache is just a linear array of 'struct bidi_it' objects, which + is dynamically allocated and reallocated as needed, since the size + of the cache depends on the text being processed. We only need the + cache while processing embedded levels higher than the base + paragraph embedding level, because these higher levels require + changes in scan direction. Therefore, as soon as we are back to + the base embedding level, we can free the cache; see the calls to + bidi_cache_reset and bidi_cache_shrink, for the conditions to do + this. + + The cache maintains the index of the next unused cache slot -- this + is where the next iterator state will be cached. The function + bidi_cache_iterator_state saves an instance of the state in the + cache and increments the unused slot index. The companion function + bidi_cache_find looks up a cached state that corresponds to a given + buffer/string position. All of the cached states must correspond + 1:1 to the buffer or string region whose processing they reflect; + bidi.c will abort if it finds cache slots that violate this 1:1 + correspondence. + + When the parent iterator 'struct it' is pushed (see push_it in + xdisp.c) to pause the current iteration and start iterating over a + different object (e.g., a 'display' string that covers some buffer + text), the bidi iterator cache needs to be "pushed" as well, so + that a new empty cache could be used while iterating over the new + object. Later, when the new object is exhausted, and xdisp.c calls + pop_it, we need to "pop" the bidi cache as well and return to the + original cache. See bidi_push_it and bidi_pop_it for how this is + done. + + Some functions of the display engine save copies of 'struct it' in + local variables, and restore them later. For examples, see + pos_visible_p and move_it_in_display_line_to in xdisp.c, and + window_scroll_pixel_based in window.c. When this happens, we need + to save and restore the bidi cache as well, because conceptually + the cache is part of the 'struct it' state, and needs to be in + perfect sync with the portion of the buffer/string that is being + processed. This saving and restoring of the cache state is handled + by bidi_shelve_cache and bidi_unshelve_cache, and the helper macros + SAVE_IT and RESTORE_IT defined on xdisp.c. + + Note that, because reordering is implemented below the level in + xdisp.c that breaks glyphs into screen lines, we are violating + paragraph 3.4 of UAX#9. which mandates that line breaking shall be + done before reordering each screen line separately. However, + following UAX#9 to the letter in this matter goes against the basic + design of the Emacs display engine, and so we choose here this + minor deviation from the UBA letter in preference to redesign of + the display engine. The effect of this is only seen in continued + lines that are broken into screen lines in the middle of a run + whose direction is opposite to the paragraph's base direction. + + Important design and implementation note: when the code needs to + scan far ahead, be sure to avoid such scans as much as possible + when the buffer/string doesn't contain any RTL characters. Users + of left-to-right scripts will never forgive you if you introduce + some slow-down due to bidi in situations that don't involve any + bidirectional text. See the large comment near the beginning of + bidi_resolve_neutral, for one situation where such shortcut was + necessary. */ #include #include === modified file 'src/buffer.h' --- src/buffer.h 2014-01-01 07:43:34 +0000 +++ src/buffer.h 2014-04-04 16:59:50 +0000 @@ -847,8 +847,8 @@ struct region_cache *width_run_cache; struct region_cache *bidi_paragraph_cache; - /* Non-zero means don't use redisplay optimizations for - displaying this buffer. */ + /* Non-zero means disable redisplay optimizations when rebuilding the glyph + matrices (but not when redrawing). */ bool_bf prevent_redisplay_optimizations_p : 1; /* Non-zero whenever the narrowing is changed in this buffer. */ === modified file 'src/frame.h' --- src/frame.h 2014-03-20 14:09:37 +0000 +++ src/frame.h 2014-04-04 16:59:50 +0000 @@ -375,7 +375,8 @@ set this directly, use SET_FRAME_ICONIFIED instead. */ bool_bf iconified : 1; - /* True if this frame should be redrawn. */ + /* True if this frame should be fully redisplayed. Disables all + optimizations while rebuilding matrices and redrawing. */ bool_bf garbaged : 1; /* False means, if this frame has just one window, === modified file 'src/keyboard.c' --- src/keyboard.c 2014-04-05 19:30:36 +0000 +++ src/keyboard.c 2014-04-07 20:54:16 +0000 @@ -1,7 +1,6 @@ /* Keyboard and mouse input; editor command loop. -Copyright (C) 1985-1989, 1993-1997, 1999-2014 Free Software Foundation, -Inc. +Copyright (C) 1985-1989, 1993-1997, 1999-2014 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2379,7 +2378,7 @@ -2 means do neither. 1 means do both. */ -/* The arguments MAP is for menu prompting. MAP is a keymap. +/* The argument MAP is a keymap for menu prompting. PREV_EVENT is the previous input event, or nil if we are reading the first event of a key sequence (or not reading a key sequence). @@ -10068,7 +10067,10 @@ "FOpen dribble file: ", doc: /* Start writing all keyboard characters to a dribble file called FILE. If FILE is nil, close any open dribble file. -The file will be closed when Emacs exits. */) +The file will be closed when Emacs exits. + +Be aware that this records ALL characters you type! +This may include sensitive information such as passwords. */) (Lisp_Object file) { if (dribble) === modified file 'src/lisp.h' --- src/lisp.h 2014-04-05 19:30:36 +0000 +++ src/lisp.h 2014-04-07 20:54:16 +0000 @@ -1572,6 +1572,9 @@ special (with `defvar' etc), and shouldn't be lexically bound. */ bool_bf declared_special : 1; + /* True if pointed to from purespace and hence can't be GC'd. */ + bool_bf pinned : 1; + /* The symbol's name, as a Lisp string. */ Lisp_Object name; === modified file 'test/ChangeLog' --- test/ChangeLog 2014-04-04 23:31:02 +0000 +++ test/ChangeLog 2014-04-07 20:54:16 +0000 @@ -1,3 +1,28 @@ +2014-04-07 João Távora + + * automated/electric-tests.el (define-electric-pair-test): Don't + overtest.. + (inhibit-in-mismatched-string-inside-ruby-comments): New test. + (inhibit-in-mismatched-string-inside-c-comments): New test. + +2014-04-07 João Távora + + * automated/electric-tests.el (inhibit-if-strings-mismatched): + New test, change from `inhibit-only-of-next-is-mismatched'. + +2014-04-06 João Távora + + * automated/python-tests.el (python-triple-quote-pairing): New test. + (python-syntax-after-python-backspace): New test. + +2014-04-06 João Távora + + * automated/electric-tests.el (electric-pair-define-test-form): + More readable test docstrings. + (whitespace-skipping-for-quotes-not-ouside) + (whitespace-skipping-for-quotes-only-inside) + (whitespace-skipping-for-quotes-in-text-mode): New tests. + 2014-04-04 João Távora * automated/electric-tests.el (define-electric-pair-test): Don't === modified file 'test/automated/electric-tests.el' --- test/automated/electric-tests.el 2014-04-04 23:31:02 +0000 +++ test/automated/electric-tests.el 2014-04-07 20:54:16 +0000 @@ -114,8 +114,8 @@ mode extra-desc)) () - ,(format "With \"%s\", try input %c at point %d. \ -Should %s \"%s\" and point at %d" + ,(format "With |%s|, try input %c at point %d. \ +Should %s |%s| and point at %d" fixture char (1+ pos) @@ -383,6 +383,31 @@ :test-in-code nil :test-in-comments t) +(define-electric-pair-test whitespace-skipping-for-quotes-not-ouside + " \" \"" "\"-----" :expected-string "\"\" \" \"" + :expected-point 2 + :bindings '((electric-pair-skip-whitespace . chomp)) + :test-in-strings nil + :test-in-code t + :test-in-comments nil) + +(define-electric-pair-test whitespace-skipping-for-quotes-only-inside + " \" \"" "---\"--" :expected-string " \"\"" + :expected-point 5 + :bindings '((electric-pair-skip-whitespace . chomp)) + :test-in-strings nil + :test-in-code t + :test-in-comments nil) + +(define-electric-pair-test whitespace-skipping-quotes-not-without-proper-syntax + " \" \"" "---\"--" :expected-string " \"\"\" \"" + :expected-point 5 + :modes '(text-mode) + :bindings '((electric-pair-skip-whitespace . chomp)) + :test-in-strings nil + :test-in-code t + :test-in-comments nil) + ;;; Pairing arbitrary characters ;;; === modified file 'test/automated/python-tests.el' --- test/automated/python-tests.el 2014-01-01 07:43:34 +0000 +++ test/automated/python-tests.el 2014-04-06 23:23:45 +0000 @@ -134,6 +134,16 @@ ;;; Font-lock and syntax +(ert-deftest python-syntax-after-python-backspace () + ;; `python-indent-dedent-line-backspace' garbles syntax + :expected-result :failed + (python-tests-with-temp-buffer + "\"\"\"" + (goto-char (point-max)) + (python-indent-dedent-line-backspace 1) + (should (string= (buffer-string) "\"\"")) + (should (null (nth 3 (syntax-ppss)))))) + ;;; Indentation @@ -2696,6 +2706,9 @@ (equal (symbol-value (car ccons)) (cdr ccons))))) (kill-buffer buffer))) + +;;; Electricity + (ert-deftest python-util-forward-comment-1 () (python-tests-with-temp-buffer (concat @@ -2708,6 +2721,32 @@ (python-util-forward-comment -1) (should (= (point) (point-min))))) +(ert-deftest python-triple-quote-pairing () + (python-tests-with-temp-buffer + "\"\"\n" + (goto-char (1- (point-max))) + (let ((last-command-event ?\")) + (call-interactively 'self-insert-command)) + (should (string= (buffer-string) + "\"\"\"\"\"\"\n")) + (should (= (point) 4))) + (python-tests-with-temp-buffer + "\n" + (let ((last-command-event ?\")) + (dotimes (i 3) + (call-interactively 'self-insert-command))) + (should (string= (buffer-string) + "\"\"\"\"\"\"\n")) + (should (= (point) 4))) + (python-tests-with-temp-buffer + "\"\n\"\"\n" + (goto-char (1- (point-max))) + (let ((last-command-event ?\")) + (call-interactively 'self-insert-command)) + (should (= (point) (1- (point-max)))) + (should (string= (buffer-string) + "\"\n\"\"\"\n")))) + (provide 'python-tests) === modified file 'test/indent/perl.perl' --- test/indent/perl.perl 2013-05-06 19:33:56 +0000 +++ test/indent/perl.perl 2014-04-03 00:41:09 +0000 @@ -16,5 +16,9 @@ bar EOF2 +print $'; # This should not start a string! + +print "hello" for /./; + $fileType_filesButNot # bug#12373? = join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} ); ------------------------------------------------------------ revno: 116949 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-04-07 10:52:38 -0700 message: * alloc.c: Simplify by removing use of HAVE_EXECINFO_H. We have a substitute execinfo.h on hosts that lack it. (suspicious_free_history): Make it EXTERNALLY_VISIBLE so it isn't optimized away. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-07 00:51:52 +0000 +++ src/ChangeLog 2014-04-07 17:52:38 +0000 @@ -1,3 +1,10 @@ +2014-04-07 Paul Eggert + + * alloc.c: Simplify by removing use of HAVE_EXECINFO_H. + We have a substitute execinfo.h on hosts that lack it. + (suspicious_free_history): Make it EXTERNALLY_VISIBLE so it + isn't optimized away. + 2014-04-05 Paul Eggert Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'. === modified file 'src/alloc.c' --- src/alloc.c 2014-04-05 19:30:36 +0000 +++ src/alloc.c 2014-04-07 17:52:38 +0000 @@ -47,10 +47,7 @@ #endif /* HAVE_WINDOW_SYSTEM */ #include - -#ifdef HAVE_EXECINFO_H -#include /* For backtrace */ -#endif +#include /* For backtrace. */ #if (defined ENABLE_CHECKING \ && defined HAVE_VALGRIND_VALGRIND_H \ @@ -207,23 +204,22 @@ #define SUSPICIOUS_OBJECT_CHECKING 1 #ifdef SUSPICIOUS_OBJECT_CHECKING -struct suspicious_free_record { +struct suspicious_free_record +{ void *suspicious_object; -#ifdef HAVE_EXECINFO_H void *backtrace[128]; -#endif }; static void *suspicious_objects[32]; static int suspicious_object_index; -struct suspicious_free_record suspicious_free_history[64]; +struct suspicious_free_record suspicious_free_history[64] EXTERNALLY_VISIBLE; static int suspicious_free_history_index; /* Find the first currently-monitored suspicious pointer in range [begin,end) or NULL if no such pointer exists. */ static void *find_suspicious_object_in_range (void *begin, void *end); static void detect_suspicious_free (void *ptr); #else -#define find_suspicious_object_in_range(begin, end) NULL -#define detect_suspicious_free(ptr) (void) +# define find_suspicious_object_in_range(begin, end) NULL +# define detect_suspicious_free(ptr) (void) #endif /* Maximum amount of C stack to save when a GC happens. */ @@ -6827,7 +6823,7 @@ #ifdef SUSPICIOUS_OBJECT_CHECKING -static void* +static void * find_suspicious_object_in_range (void *begin, void *end) { char *begin_a = begin; @@ -6848,14 +6844,14 @@ detect_suspicious_free (void *ptr) { int i; - struct suspicious_free_record* rec; eassert (ptr != NULL); for (i = 0; i < ARRAYELTS (suspicious_objects); ++i) if (suspicious_objects[i] == ptr) { - rec = &suspicious_free_history[suspicious_free_history_index++]; + struct suspicious_free_record *rec + = &suspicious_free_history[suspicious_free_history_index++]; if (suspicious_free_history_index == ARRAYELTS (suspicious_free_history)) { @@ -6864,9 +6860,7 @@ memset (rec, 0, sizeof (*rec)); rec->suspicious_object = ptr; -#ifdef HAVE_EXECINFO_H - backtrace (&rec->backtrace[0], ARRAYELTS (rec->backtrace)); -#endif + backtrace (rec->backtrace, ARRAYELTS (rec->backtrace)); suspicious_objects[i] = NULL; } } ------------------------------------------------------------ revno: 116948 committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-04-07 06:21:22 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2014-04-02 15:14:50 +0000 +++ lisp/dired.el 2014-04-07 10:21:22 +0000 @@ -3867,7 +3867,7 @@ ;;; Start of automatically extracted autoloads. -;;;### (autoloads nil "dired-aux" "dired-aux.el" "6969bb4414a8a31b91342ab922a94efb") +;;;### (autoloads nil "dired-aux" "dired-aux.el" "1448837b5f3e2b9ad63f723361f1e32e") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ ------------------------------------------------------------ revno: 116947 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2014-04-07 02:51:52 +0200 message: lisp/ChangeLog, src/ChangeLog: Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-06 18:15:09 +0000 +++ lisp/ChangeLog 2014-04-07 00:51:52 +0000 @@ -9,15 +9,14 @@ 2014-04-04 João Távora - * elec-pair.el: - (electric-pair--syntax-ppss): When inside comments parse from - comment beginning. + * elec-pair.el (electric-pair--syntax-ppss): When inside comments + parse from comment beginning. (electric-pair--balance-info): Fix typo in comment. (electric-pair--in-unterminated-string-p): Delete. (electric-pair--unbalanced-strings-p): New function. (electric-pair-string-bound-function): New var. (electric-pair-inhibit-if-helps-balance): Decide quote pairing - according to `electric-pair--in-unterminated-string-p' + according to `electric-pair--in-unterminated-string-p'. 2014-04-04 Stefan Monnier @@ -303,7 +302,7 @@ Reported by Victor Lau. Fix parsing 'var' in AUTOs, msg1294. Reported by Dominique Chen. (verilog-auto-inout-module): Fix AUTOINOUTMODULE not inserting - interface-only modules, bug721. Reported by Dean Hoyt. + interface-only modules, bug721. Reported by Dean Hoyt. 2014-03-26 Glenn Morris @@ -349,9 +348,9 @@ (subword-mode-map): Hollow out. (capitalized-words-mode): Define as obsolete alias for `subword-mode'. - (subword-mode,superword-mode): Tweak documentation to reflect new + (subword-mode, superword-mode): Tweak documentation to reflect new implementation; call `subword-setup-buffer'. - (subword-forward,subword-capitalize): Add underscore to indicate + (subword-forward, subword-capitalize): Add underscore to indicate unused variable. (subword-find-word-boundary-function-table): New constant. (subword-empty-char-table): New constant. @@ -5300,7 +5299,7 @@ * rect.el (rectangle-mark-mode): Rename from rectangle-mark. Make it into a proper minor mode. - (rectangle--region): (implicitly) rename to rectangle-mark-mode. + (rectangle--region): (Implicitly) rename to rectangle-mark-mode. (rectangle-mark-mode-map): New keymap. (rectangle--highlight-for-redisplay): Fix some corner cases (bug#15796). @@ -5543,8 +5542,7 @@ 2013-10-28 Daiki Ueno - * epa-file.el - (epa-file-cache-passphrase-for-symmetric-encryption): + * epa-file.el (epa-file-cache-passphrase-for-symmetric-encryption): Document that this option has no effect with GnuPG 2.0 (bug#15552). 2013-10-27 Xue Fuqiao @@ -12356,9 +12354,8 @@ * textmodes/reftex-vars.el (reftex-ref-style-alist): Add cleveref macros. - * textmodes/reftex-parse.el - (reftex-locate-bibliography-files): Accept options for - bibliography commands. + * textmodes/reftex-parse.el (reftex-locate-bibliography-files): + Accept options for bibliography commands. * textmodes/reftex-vars.el (reftex-bibliography-commands): Add addbibresource. Basic Biblatex support. @@ -13828,8 +13825,7 @@ 2013-04-19 Fabián Ezequiel Gallina New faster Imenu implementation (bug#14058). - * progmodes/python.el: - (python-imenu-prev-index-position): + * progmodes/python.el (python-imenu-prev-index-position) (python-imenu-format-item-label-function) (python-imenu-format-parent-item-label-function) (python-imenu-format-parent-item-jump-label-function): === modified file 'src/ChangeLog' --- src/ChangeLog 2014-04-05 19:30:36 +0000 +++ src/ChangeLog 2014-04-07 00:51:52 +0000 @@ -43,7 +43,7 @@ * dired.c (file_attributes): * chartab.c (uniprop_decoder_count, uniprop_encode_count): Change expressions of the form sizeof(arr) / sizeof(arr[0]) - to ARRAYELTS(arr). + to ARRAYELTS (arr). 2014-04-02 Daniel Colascione @@ -55,10 +55,10 @@ * alloc.c: Include execinfo.h if available. (SUSPICIOUS_OBJECT_CHECKING): New macro; define unconditionally. (suspicious_free_record): New structure. - (suspicious_objects,suspicious_object_index) - (suspicious_free_history, suspicious_free_history_index): New - variables. - (find_suspicious_object_in_range,detect_suspicious_free) + (suspicious_objects, suspicious_object_index) + (suspicious_free_history, suspicious_free_history_index): + New variables. + (find_suspicious_object_in_range, detect_suspicious_free) (Fsuspicious_object): New functions. (cleanup_vector): Call find_suspicious_object_in_range. @@ -281,10 +281,10 @@ Split gc_sweep into discrete functions for legibility and better stack traces. - * alloc.c (sweep_strings,sweep_vectors): Add NO_INLINE + * alloc.c (sweep_strings, sweep_vectors): Add NO_INLINE (sweep_vectors): Fix typo in comment. - (sweep_conses,sweep_floats,sweep_intervals) - (sweep_symbols,sweep_misc,sweep_buffers): New functions. + (sweep_conses, sweep_floats, sweep_intervals) + (sweep_symbols, sweep_misc, sweep_buffers): New functions. (gc_sweep): Call new functions, to which existing functionality is moved. * fns.c (sweep_weak_hash_tables): Add NO_INLINE. @@ -346,7 +346,7 @@ * alloc.c (lisp_align_malloc, allocate_string_data) (allocate_vectorlike): Allow mmap allocation of lisp objects. - (pointers_fit_in_lispobj_p,mmap_lisp_allowed_p): New functions. + (pointers_fit_in_lispobj_p, mmap_lisp_allowed_p): New functions. 2014-03-21 Eli Zaretskii ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.