Now on revision 114240. ------------------------------------------------------------ revno: 114240 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:58:57 -0700 message: * vc/vc-dispatcher.el (vc-dir-refresh): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:55:15 +0000 +++ lisp/ChangeLog 2013-09-12 06:58:57 +0000 @@ -15,6 +15,8 @@ * progmodes/cperl-mode.el (Info-find-node): * vc/ediff.el (Info-goto-node): Update declarations. + * vc/vc-dispatcher.el (vc-dir-refresh): Declare. + * vc/vc-bzr.el (vc-compilation-mode): Declare. (vc-bzr-pull): Require vc-dispatcher. * vc/vc-git.el (vc-compilation-mode): Declare. === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2013-09-05 03:05:44 +0000 +++ lisp/vc/vc-dispatcher.el 2013-09-12 06:58:57 +0000 @@ -398,6 +398,8 @@ (set (make-local-variable 'compilation-error-regexp-alist) error-regexp-alist))) +(declare-function vc-dir-refresh "vc-dir" ()) + (defun vc-set-async-update (process-buffer) "Set a `vc-exec-after' action appropriate to the current buffer. This action will update the current buffer after the current ------------------------------------------------------------ revno: 114239 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:55:15 -0700 message: * vc/vc-svn.el (vc-svn-retrieve-tag): Mark unused argument. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:53:57 +0000 +++ lisp/ChangeLog 2013-09-12 06:55:15 +0000 @@ -1,7 +1,7 @@ 2013-09-12 Glenn Morris * vc/vc-svn.el (vc-svn-dir-status-files, vc-svn-dir-extra-headers) - (vc-svn-ignore): Mark unused arguments. + (vc-svn-ignore, vc-svn-retrieve-tag): Mark unused arguments. * subr.el (do-after-load-evaluation): Also give compiler warnings when obsolete files are used (except by obsolete files). === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2013-09-12 06:53:57 +0000 +++ lisp/vc/vc-svn.el 2013-09-12 06:55:15 +0000 @@ -593,7 +593,7 @@ (vc-svn-command nil 0 dir "copy" name) (when branchp (vc-svn-retrieve-tag dir name nil))) -(defun vc-svn-retrieve-tag (dir name update) +(defun vc-svn-retrieve-tag (dir name _update) "Retrieve a tag at and below DIR. NAME is the name of the tag; if it is empty, do a `svn update'. If UPDATE is non-nil, then update (resynch) any affected buffers. ------------------------------------------------------------ revno: 114238 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:53:57 -0700 message: * vc/vc-svn.el (vc-svn-dir-status-files, vc-svn-dir-extra-headers) (vc-svn-ignore): Mark unused arguments. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:50:18 +0000 +++ lisp/ChangeLog 2013-09-12 06:53:57 +0000 @@ -1,5 +1,8 @@ 2013-09-12 Glenn Morris + * vc/vc-svn.el (vc-svn-dir-status-files, vc-svn-dir-extra-headers) + (vc-svn-ignore): Mark unused arguments. + * subr.el (do-after-load-evaluation): Also give compiler warnings when obsolete files are used (except by obsolete files). === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2013-09-12 06:21:33 +0000 +++ lisp/vc/vc-svn.el 2013-09-12 06:53:57 +0000 @@ -234,12 +234,12 @@ (vc-run-delayed (vc-svn-after-dir-status callback remote)))) -(defun vc-svn-dir-status-files (dir files _default-state callback) +(defun vc-svn-dir-status-files (_dir files _default-state callback) (apply 'vc-svn-command (current-buffer) 'async nil "status" files) (vc-run-delayed (vc-svn-after-dir-status callback))) -(defun vc-svn-dir-extra-headers (dir) +(defun vc-svn-dir-extra-headers (_dir) "Generate extra status headers for a Subversion working copy." (let (process-file-side-effects) (vc-svn-command "*vc*" 0 nil "info")) @@ -352,7 +352,7 @@ (concat "-r" rev)) (vc-switches 'SVN 'checkout)))) -(defun vc-svn-ignore (file &optional directory remove) +(defun vc-svn-ignore (file &optional _directory _remove) "Ignore FILE under Subversion. FILE is a file wildcard, relative to the root directory of DIRECTORY." (vc-svn-command t 0 file "propedit" "svn:ignore")) ------------------------------------------------------------ revno: 114237 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:50:18 -0700 message: Revert part of previous vc-bzr change diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:37:02 +0000 +++ lisp/ChangeLog 2013-09-12 06:50:18 +0000 @@ -12,8 +12,7 @@ * progmodes/cperl-mode.el (Info-find-node): * vc/ediff.el (Info-goto-node): Update declarations. - * vc/vc-bzr.el (vc-exec-after): Remove unused declaration. - (vc-compilation-mode): Declare. + * vc/vc-bzr.el (vc-compilation-mode): Declare. (vc-bzr-pull): Require vc-dispatcher. * vc/vc-git.el (vc-compilation-mode): Declare. (vc-git-pull): Require vc-dispatcher. === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2013-09-12 05:45:42 +0000 +++ lisp/vc/vc-bzr.el 2013-09-12 06:50:18 +0000 @@ -321,6 +321,7 @@ "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. +(declare-function vc-exec-after "vc-dispatcher" (code)) (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) (declare-function vc-compilation-mode "vc-dispatcher" (backend)) ------------------------------------------------------------ revno: 114236 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:47:07 -0700 message: gnus-icalendar small fix * gnus/gnus-icalendar.el (gnus-icalendar-event--build-reply-event-body): Avoid using `find', which i) might not be defined at runtime; ii) does not work, since its default test is eql, not equal. (gnus-mime-action-alist): Declare. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-09-11 03:31:56 +0000 +++ lisp/gnus/ChangeLog 2013-09-12 06:47:07 +0000 @@ -1,3 +1,10 @@ +2013-09-12 Glenn Morris + + * gnus-icalendar.el (gnus-icalendar-event--build-reply-event-body): + Avoid using `find', which i) might not be defined at runtime; + ii) does not work, since its default test is eql, not equal. + (gnus-mime-action-alist): Declare. + 2013-09-11 Stefan Monnier * score-mode.el (gnus-score-mode-map): Move initialization === modified file 'lisp/gnus/gnus-icalendar.el' --- lisp/gnus/gnus-icalendar.el 2013-08-13 07:22:05 +0000 +++ lisp/gnus/gnus-icalendar.el 2013-09-12 06:47:07 +0000 @@ -257,9 +257,9 @@ ((string= key "ATTENDEE") (update-attendee-status line)) ((string= key "SUMMARY") (update-summary line)) ((string= key "DTSTAMP") (update-dtstamp)) - ((find key '("ORGANIZER" "DTSTART" "DTEND" - "LOCATION" "DURATION" "SEQUENCE" - "RECURRENCE-ID" "UID")) line) + ((member key '("ORGANIZER" "DTSTART" "DTEND" + "LOCATION" "DURATION" "SEQUENCE" + "RECURRENCE-ID" "UID")) line) (t nil)))) (when new-line (push new-line reply-event-lines)))))) @@ -816,6 +816,8 @@ (gnus-icalendar-show-org-agenda (with-current-buffer gnus-article-buffer gnus-icalendar-event))) +(defvar gnus-mime-action-alist) ; gnus-art + (defun gnus-icalendar-setup () (add-to-list 'mm-inlined-types "text/calendar") (add-to-list 'mm-automatic-display "text/calendar") ------------------------------------------------------------ revno: 114235 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:37:02 -0700 message: * subr.el (do-after-load-evaluation): Also give compiler warnings when obsolete files are used (except by obsolete files). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:21:33 +0000 +++ lisp/ChangeLog 2013-09-12 06:37:02 +0000 @@ -1,5 +1,8 @@ 2013-09-12 Glenn Morris + * subr.el (do-after-load-evaluation): Also give compiler warnings + when obsolete files are used (except by obsolete files). + * vc/vc-svn.el (vc-svn-parse-status): If there are multiple files in the status output, assume `filename' is the first. (Bug#15322) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-09-10 15:30:10 +0000 +++ lisp/subr.el 2013-09-12 06:37:02 +0000 @@ -3907,12 +3907,27 @@ (mapc #'funcall (cdr a-l-element)))) ;; Complain when the user uses obsolete files. (when (string-match-p "/obsolete/[^/]*\\'" abs-file) - (run-with-timer 0 nil - (lambda (file) - (message "Package %s is obsolete!" - (substring file 0 - (string-match "\\.elc?\\>" file)))) - (file-name-nondirectory abs-file))) + ;; Maybe we should just use display-warning? This seems yucky... + (let* ((file (file-name-nondirectory abs-file)) + (msg (format "Package %s is obsolete!" + (substring file 0 + (string-match "\\.elc?\\>" file))))) + ;; Cribbed from cl--compiling-file. + (if (and (boundp 'byte-compile--outbuffer) + (bufferp (symbol-value 'byte-compile--outbuffer)) + (equal (buffer-name (symbol-value 'byte-compile--outbuffer)) + " *Compiler Output*")) + ;; Don't warn about obsolete files using other obsolete files. + (unless (and (stringp byte-compile-current-file) + (string-match-p "/obsolete/[^/]*\\'" + (expand-file-name + byte-compile-current-file + byte-compile-root-dir))) + (byte-compile-log-warning msg)) + (run-with-timer 0 nil + (lambda (msg) + (message "%s" msg)) msg)))) + ;; Finally, run any other hook. (run-hook-with-args 'after-load-functions abs-file)) ------------------------------------------------------------ revno: 114234 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-09-12 10:29:13 +0400 message: * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip scroll bar values to prevent thumb from disappear and update comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 17:31:29 +0000 +++ src/ChangeLog 2013-09-12 06:29:13 +0000 @@ -1,3 +1,8 @@ +2013-09-12 Dmitry Antipov + + * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip + scroll bar values to prevent thumb from disappear and update comment. + 2013-09-11 Glenn Morris * emacs.c (usage_message): Possessive apostrophe tweak. === modified file 'src/xterm.c' --- src/xterm.c 2013-09-11 13:35:28 +0000 +++ src/xterm.c 2013-09-12 06:29:13 +0000 @@ -4798,12 +4798,21 @@ top = max (0, min (1, top)); else top = old_top; +#if ! defined (HAVE_XAW3D) + /* With Xaw, 'top' values too closer to 1.0 may + cause the thumb to disappear. Fix that. */ + top = min (top, 0.99f); +#endif /* Keep two pixels available for moving the thumb down. */ shown = max (0, min (1 - top - (2.0f / height), shown)); +#if ! defined (HAVE_XAW3D) + /* Likewise with too small 'shown'. */ + shown = max (shown, 0.01f); +#endif - /* If the call to XawScrollbarSetThumb below doesn't seem to work, - check that your system's configuration file contains a define - for `NARROWPROTO'. See s/freebsd.h for an example. */ + /* If the call to XawScrollbarSetThumb below doesn't seem to + work, check that 'NARROWPROTO' is defined in src/config.h. + If this is not so, most likely you need to fix configure. */ if (top != old_top || shown != old_shown) { if (bar->dragging == -1) ------------------------------------------------------------ revno: 114233 fixes bug: http://debbugs.gnu.org/15322 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:21:33 -0700 message: * vc/vc-svn.el (vc-svn-parse-status): If there are multiple files in the status output, assume `filename' is the first. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 06:10:12 +0000 +++ lisp/ChangeLog 2013-09-12 06:21:33 +0000 @@ -1,5 +1,8 @@ 2013-09-12 Glenn Morris + * vc/vc-svn.el (vc-svn-parse-status): If there are multiple files + in the status output, assume `filename' is the first. (Bug#15322) + * vc/vc.el (vc-deduce-fileset): Doc fix. * calc/calc-help.el (Info-goto-node): === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc-svn.el 2013-09-12 06:21:33 +0000 @@ -674,19 +674,23 @@ (defun vc-svn-parse-status (&optional filename) "Parse output of \"svn status\" command in the current buffer. -Set file properties accordingly. Unless FILENAME is non-nil, parse only -information about FILENAME and return its status." - (let (file status propstat) +Set file properties accordingly. If FILENAME is non-nil, return its status." + (let (multifile file status propstat) (goto-char (point-min)) (while (re-search-forward ;; Ignore the files with status X. "^\\(?:\\?\\|[ ACDGIMR!~][ MC][ L][ +][ S]..\\([ *]\\) +\\([-0-9]+\\) +\\([0-9?]+\\) +\\([^ ]+\\)\\) +" nil t) ;; If the username contains spaces, the output format is ambiguous, ;; so don't trust the output's filename unless we have to. - (setq file (or filename + (setq file (or (unless multifile filename) (expand-file-name - (buffer-substring (point) (line-end-position))))) - (setq status (char-after (line-beginning-position)) + (buffer-substring (point) (line-end-position)))) + ;; If we are parsing the result of running status on a directory, + ;; there could be multiple files in the output. + ;; We assume that filename, if supplied, applies to the first + ;; listed file (ie, the directory). Bug#15322. + multifile t + status (char-after (line-beginning-position)) ;; Status of the item's properties ([ MC]). propstat (char-after (1+ (line-beginning-position)))) (if (eq status ??) ------------------------------------------------------------ revno: 114232 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 23:10:12 -0700 message: * lisp/vc/vc.el (vc-deduce-fileset): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:48:22 +0000 +++ lisp/ChangeLog 2013-09-12 06:10:12 +0000 @@ -1,5 +1,7 @@ 2013-09-12 Glenn Morris + * vc/vc.el (vc-deduce-fileset): Doc fix. + * calc/calc-help.el (Info-goto-node): * progmodes/cperl-mode.el (Info-find-node): * vc/ediff.el (Info-goto-node): Update declarations. === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc.el 2013-09-12 06:10:12 +0000 @@ -965,7 +965,8 @@ "Deduce a set of files and a backend to which to apply an operation. Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). -If we're in VC-dir mode, FILESET is the list of marked files. +If we're in VC-dir mode, FILESET is the list of marked files, +or the directory if no files are marked. Otherwise, if in a buffer visiting a version-controlled file, FILESET is a single-file fileset containing that file. Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file ------------------------------------------------------------ revno: 114231 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:48:22 -0700 message: Update some function declarations * calc/calc-help.el (Info-goto-node): * progmodes/cperl-mode.el (Info-find-node): * vc/ediff.el (Info-goto-node): Update declarations. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:45:42 +0000 +++ lisp/ChangeLog 2013-09-12 05:48:22 +0000 @@ -1,5 +1,9 @@ 2013-09-12 Glenn Morris + * calc/calc-help.el (Info-goto-node): + * progmodes/cperl-mode.el (Info-find-node): + * vc/ediff.el (Info-goto-node): Update declarations. + * vc/vc-bzr.el (vc-exec-after): Remove unused declaration. (vc-compilation-mode): Declare. (vc-bzr-pull): Require vc-dispatcher. === modified file 'lisp/calc/calc-help.el' --- lisp/calc/calc-help.el 2013-02-01 03:51:08 +0000 +++ lisp/calc/calc-help.el 2013-09-12 05:48:22 +0000 @@ -30,7 +30,7 @@ (require 'calc-macs) ;; Declare functions which are defined elsewhere. -(declare-function Info-goto-node "info" (nodename &optional fork)) +(declare-function Info-goto-node "info" (nodename &optional fork strict-case)) (declare-function Info-last "info" ()) === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2013-09-11 06:33:28 +0000 +++ lisp/progmodes/cperl-mode.el 2013-09-12 05:48:22 +0000 @@ -6535,7 +6535,7 @@ (eval '(mode-compile)))) ; Avoid a warning (declare-function Info-find-node "info" - (filename nodename &optional no-going-back)) + (filename nodename &optional no-going-back strict-case)) (defun cperl-info-buffer (type) ;; Returns buffer with documentation. Creates if missing. === modified file 'lisp/vc/ediff.el' --- lisp/vc/ediff.el 2013-09-05 03:30:07 +0000 +++ lisp/vc/ediff.el 2013-09-12 05:48:22 +0000 @@ -1481,7 +1481,7 @@ (format "Ediff %s of %s" ediff-version ediff-date))) ;; info is run first, and will autoload info.el. -(declare-function Info-goto-node "info" (nodename &optional fork)) +(declare-function Info-goto-node "info" (nodename &optional fork strict-case)) ;;;###autoload (defun ediff-documentation (&optional node) ------------------------------------------------------------ revno: 114230 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:45:42 -0700 message: Silence some vc- compilation warnings * vc/vc-bzr.el (vc-exec-after): Remove unused declaration. (vc-compilation-mode): Declare. (vc-bzr-pull): Require vc-dispatcher. * vc/vc-git.el (vc-compilation-mode): Declare. (vc-git-pull): Require vc-dispatcher. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:43:55 +0000 +++ lisp/ChangeLog 2013-09-12 05:45:42 +0000 @@ -1,5 +1,11 @@ 2013-09-12 Glenn Morris + * vc/vc-bzr.el (vc-exec-after): Remove unused declaration. + (vc-compilation-mode): Declare. + (vc-bzr-pull): Require vc-dispatcher. + * vc/vc-git.el (vc-compilation-mode): Declare. + (vc-git-pull): Require vc-dispatcher. + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Declare. * progmodes/octave.el (help-button-action): Declare. === modified file 'lisp/vc/vc-bzr.el' --- lisp/vc/vc-bzr.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc-bzr.el 2013-09-12 05:45:42 +0000 @@ -320,11 +320,9 @@ ("^Using saved parent location: \\(.+\\)" 1 nil nil 0)) "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") -;; Follows vc-bzr-(async-)command, which uses vc-do-(async-)command -;; from vc-dispatcher. -(declare-function vc-exec-after "vc-dispatcher" (code)) -;; Follows vc-exec-after. +;; To be called via vc-pull from vc.el, which requires vc-dispatcher. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) +(declare-function vc-compilation-mode "vc-dispatcher" (backend)) (defun vc-bzr-pull (prompt) "Pull changes into the current Bzr branch. @@ -354,6 +352,7 @@ (setq vc-bzr-program (car args) command (cadr args) args (cddr args))) + (require 'vc-dispatcher) (let ((buf (apply 'vc-bzr-async-command command args))) (with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr))) (vc-set-async-update buf)))) === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc-git.el 2013-09-12 05:45:42 +0000 @@ -706,6 +706,9 @@ '(("^ \\(.+\\) |" 1 nil nil 0)) "Value of `compilation-error-regexp-alist' in *vc-git* buffers.") +;; To be called via vc-pull from vc.el, which requires vc-dispatcher. +(declare-function vc-compilation-mode "vc-dispatcher" (backend)) + (defun vc-git-pull (prompt) "Pull changes into the current Git branch. Normally, this runs \"git pull\". If PROMPT is non-nil, prompt @@ -725,6 +728,7 @@ (setq git-program (car args) command (cadr args) args (cddr args))) + (require 'vc-dispatcher) (apply 'vc-do-async-command buffer root git-program command args) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git))) (vc-set-async-update buffer))) ------------------------------------------------------------ revno: 114229 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:43:55 -0700 message: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:43:23 +0000 +++ lisp/ChangeLog 2013-09-12 05:43:55 +0000 @@ -1,5 +1,7 @@ 2013-09-12 Glenn Morris + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Declare. + * progmodes/octave.el (help-button-action): Declare. * shell.el (shell-directory-tracker): Output error as a message === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-09-11 06:44:35 +0000 +++ lisp/progmodes/ruby-mode.el 2013-09-12 05:43:55 +0000 @@ -1377,6 +1377,7 @@ ;; Unusual code layout confuses the byte-compiler. (declare-function ruby-syntax-propertize-expansion "ruby-mode" ()) (declare-function ruby-syntax-expansion-allowed-p "ruby-mode" (parse-state)) +(declare-function ruby-syntax-propertize-function "ruby-mode" (start end)) (if (eval-when-compile (fboundp #'syntax-propertize-rules)) ;; New code that works independently from font-lock. ------------------------------------------------------------ revno: 114228 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:43:23 -0700 message: * lisp/progmodes/octave.el (help-button-action): Declare. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:40:50 +0000 +++ lisp/ChangeLog 2013-09-12 05:43:23 +0000 @@ -1,5 +1,7 @@ 2013-09-12 Glenn Morris + * progmodes/octave.el (help-button-action): Declare. + * shell.el (shell-directory-tracker): Output error as a message rather than just returning it as a string. (shell-process-pushd): Remove useless use of message. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-06-21 06:45:37 +0000 +++ lisp/progmodes/octave.el 2013-09-12 05:43:23 +0000 @@ -1581,6 +1581,9 @@ :group 'octave :version "24.4") +;; Used in a mode derived from help-mode. +(declare-function help-button-action "help-mode" (button)) + (define-button-type 'octave-help-file 'follow-link t 'action #'help-button-action ------------------------------------------------------------ revno: 114227 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:40:50 -0700 message: Fix some minor shell.el oddness related to usage of error and message * lisp/shell.el (shell-directory-tracker): Output error as a message rather than just returning it as a string. (shell-process-pushd): Remove useless use of message. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:32:57 +0000 +++ lisp/ChangeLog 2013-09-12 05:40:50 +0000 @@ -1,5 +1,9 @@ 2013-09-12 Glenn Morris + * shell.el (shell-directory-tracker): Output error as a message + rather than just returning it as a string. + (shell-process-pushd): Remove useless use of message. + * dframe.el (dframe-timer-fn): * files.el (dir-locals-read-from-file): * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run) === modified file 'lisp/shell.el' --- lisp/shell.el 2013-09-12 05:32:57 +0000 +++ lisp/shell.el 2013-09-12 05:40:50 +0000 @@ -791,7 +791,7 @@ 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. - (condition-case nil + (with-demoted-errors "Couldn't cd: %s" (let ((start (progn (string-match (concat "^" shell-command-separator-regexp) str) ; skip whitespace @@ -824,8 +824,7 @@ (setq start (progn (string-match shell-command-separator-regexp str end) ;; skip again - (match-end 0))))) - (error "Couldn't cd")))) + (match-end 0)))))))) (defun shell-unquote-argument (string) "Remove all kinds of shell quoting from STRING." @@ -907,7 +906,7 @@ (cond ((> num (length shell-dirstack)) (message "Directory stack not that deep.")) ((= num 0) - (error (message "Couldn't cd"))) + (error "Couldn't cd")) (shell-pushd-dextract (let ((dir (nth (1- num) shell-dirstack))) (shell-process-popd arg) ------------------------------------------------------------ revno: 114226 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 22:32:57 -0700 message: Use with-demoted-errors now that it can format any error messages * dframe.el (dframe-timer-fn): * files.el (dir-locals-read-from-file): * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run, mpc-format): * reveal.el (reveal-post-command): * saveplace.el (load-save-place-alist-from-file): * shell.el (shell-resync-dirs): * w32-common-fns.el (x-get-selection-value): * emacs-lisp/copyright.el (copyright-find-copyright): * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): * emulation/tpu-edt.el (tpu-copy-keyfile): * play/bubbles.el (bubbles--mark-neighbourhood): * progmodes/executable.el (executable-make-buffer-file-executable-if-script-p): * term/pc-win.el (x-get-selection-value): Use with-demoted-errors. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 05:20:07 +0000 +++ lisp/ChangeLog 2013-09-12 05:32:57 +0000 @@ -1,3 +1,21 @@ +2013-09-12 Glenn Morris + + * dframe.el (dframe-timer-fn): + * files.el (dir-locals-read-from-file): + * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run) + (mpc-format): + * reveal.el (reveal-post-command): + * saveplace.el (load-save-place-alist-from-file): + * shell.el (shell-resync-dirs): + * w32-common-fns.el (x-get-selection-value): + * emacs-lisp/copyright.el (copyright-find-copyright): + * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): + * emulation/tpu-edt.el (tpu-copy-keyfile): + * play/bubbles.el (bubbles--mark-neighbourhood): + * progmodes/executable.el + (executable-make-buffer-file-executable-if-script-p): + * term/pc-win.el (x-get-selection-value): Use with-demoted-errors. + 2013-09-12 Stefan Monnier Cleanup Eshell to rely less on dynamic scoping. === modified file 'lisp/dframe.el' --- lisp/dframe.el 2013-08-29 19:55:58 +0000 +++ lisp/dframe.el 2013-09-12 05:32:57 +0000 @@ -758,9 +758,8 @@ Evaluates all cached timer functions in sequence." (let ((l dframe-client-functions)) (while (and l (sit-for 0)) - (condition-case er - (funcall (car l)) - (error (message "DFRAME TIMER ERROR: %S" er))) + (with-demoted-errors "DFRAME TIMER ERROR: %S" + (funcall (car l))) (setq l (cdr l))))) ;;; Menu hacking for mouse-3 === modified file 'lisp/emacs-lisp/copyright.el' --- lisp/emacs-lisp/copyright.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/copyright.el 2013-09-12 05:32:57 +0000 @@ -1,7 +1,6 @@ ;;; copyright.el --- update the copyright notice in current buffer -;; Copyright (C) 1991-1995, 1998, 2001-2013 Free Software Foundation, -;; Inc. +;; Copyright (C) 1991-1995, 1998, 2001-2013 Free Software Foundation, Inc. ;; Author: Daniel Pfeiffer ;; Keywords: maint, tools @@ -145,18 +144,17 @@ This function sets the match-data that `copyright-update-year' uses." (widen) (goto-char (copyright-start-point)) - (condition-case err - ;; (1) Need the extra \\( \\) around copyright-regexp because we - ;; goto (match-end 1) below. See note (2) below. - (copyright-re-search (concat "\\(" copyright-regexp - "\\)\\([ \t]*\n\\)?.*\\(?:" - copyright-names-regexp "\\)") - (copyright-limit) - t) - ;; In case the regexp is rejected. This is useful because - ;; copyright-update is typically called from before-save-hook where - ;; such an error is very inconvenient for the user. - (error (message "Can't update copyright: %s" err) nil))) + ;; In case the regexp is rejected. This is useful because + ;; copyright-update is typically called from before-save-hook where + ;; such an error is very inconvenient for the user. + (with-demoted-errors "Can't update copyright: %s" + ;; (1) Need the extra \\( \\) around copyright-regexp because we + ;; goto (match-end 1) below. See note (2) below. + (copyright-re-search (concat "\\(" copyright-regexp + "\\)\\([ \t]*\n\\)?.*\\(?:" + copyright-names-regexp "\\)") + (copyright-limit) + t))) (defun copyright-find-end () "Possibly adjust the search performed by `copyright-find-copyright'. === modified file 'lisp/emacs-lisp/eldoc.el' --- lisp/emacs-lisp/eldoc.el 2013-08-29 19:55:58 +0000 +++ lisp/emacs-lisp/eldoc.el 2013-09-12 05:32:57 +0000 @@ -309,27 +309,26 @@ Emacs Lisp mode) that support ElDoc.") (defun eldoc-print-current-symbol-info () - (condition-case err - (and (or (eldoc-display-message-p) eldoc-post-insert-mode) - (if eldoc-documentation-function - (eldoc-message (funcall eldoc-documentation-function)) - (let* ((current-symbol (eldoc-current-symbol)) - (current-fnsym (eldoc-fnsym-in-current-sexp)) - (doc (cond - ((null current-fnsym) - nil) - ((eq current-symbol (car current-fnsym)) - (or (apply 'eldoc-get-fnsym-args-string - current-fnsym) - (eldoc-get-var-docstring current-symbol))) - (t - (or (eldoc-get-var-docstring current-symbol) - (apply 'eldoc-get-fnsym-args-string - current-fnsym)))))) - (eldoc-message doc)))) - ;; This is run from post-command-hook or some idle timer thing, - ;; so we need to be careful that errors aren't ignored. - (error (message "eldoc error: %s" err)))) + ;; This is run from post-command-hook or some idle timer thing, + ;; so we need to be careful that errors aren't ignored. + (with-demoted-errors "eldoc error: %s" + (and (or (eldoc-display-message-p) eldoc-post-insert-mode) + (if eldoc-documentation-function + (eldoc-message (funcall eldoc-documentation-function)) + (let* ((current-symbol (eldoc-current-symbol)) + (current-fnsym (eldoc-fnsym-in-current-sexp)) + (doc (cond + ((null current-fnsym) + nil) + ((eq current-symbol (car current-fnsym)) + (or (apply 'eldoc-get-fnsym-args-string + current-fnsym) + (eldoc-get-var-docstring current-symbol))) + (t + (or (eldoc-get-var-docstring current-symbol) + (apply 'eldoc-get-fnsym-args-string + current-fnsym)))))) + (eldoc-message doc)))))) (defun eldoc-get-fnsym-args-string (sym &optional index) "Return a string containing the parameter list of the function SYM. === modified file 'lisp/emulation/tpu-edt.el' --- lisp/emulation/tpu-edt.el 2013-05-15 23:55:41 +0000 +++ lisp/emulation/tpu-edt.el 2013-09-12 05:32:57 +0000 @@ -2374,9 +2374,8 @@ (goto-char (point-min)) (beep) (and (tpu-y-or-n-p "Copy key definitions to the new file now? ") - (condition-case conditions - (copy-file oldname newname) - (error (message "Sorry, couldn't copy - %s." (cdr conditions))))) + (with-demoted-errors "Sorry, couldn't copy - %s." + (copy-file oldname newname))) (kill-buffer "*TPU-Notice*"))) (defvar tpu-edt-old-global-values nil) === modified file 'lisp/files.el' --- lisp/files.el 2013-09-11 12:36:59 +0000 +++ lisp/files.el 2013-09-12 05:32:57 +0000 @@ -3637,21 +3637,17 @@ The new class name is the same as the directory in which FILE is found. Returns the new class name." (with-temp-buffer - ;; This is with-demoted-errors, but we want to mention dir-locals - ;; in any error message. - (condition-case err - (progn - (insert-file-contents file) - (unless (zerop (buffer-size)) - (let* ((dir-name (file-name-directory file)) - (class-name (intern dir-name)) - (variables (let ((read-circle nil)) - (read (current-buffer))))) - (dir-locals-set-class-variables class-name variables) - (dir-locals-set-directory-class dir-name class-name - (nth 5 (file-attributes file))) - class-name))) - (error (message "Error reading dir-locals: %S" err) nil)))) + (with-demoted-errors "Error reading dir-locals: %S" + (insert-file-contents file) + (unless (zerop (buffer-size)) + (let* ((dir-name (file-name-directory file)) + (class-name (intern dir-name)) + (variables (let ((read-circle nil)) + (read (current-buffer))))) + (dir-locals-set-class-variables class-name variables) + (dir-locals-set-directory-class dir-name class-name + (nth 5 (file-attributes file))) + class-name))))) (defcustom enable-remote-dir-locals nil "Non-nil means dir-local variables will be applied to remote files." === modified file 'lisp/mpc.el' --- lisp/mpc.el 2013-08-09 21:22:44 +0000 +++ lisp/mpc.el 2013-09-12 05:32:57 +0000 @@ -491,10 +491,9 @@ (cancel-timer mpc--status-timer) (setq mpc--status-timer nil))) (defun mpc--status-timer-run () - (condition-case err - (when (process-get (mpc-proc) 'ready) - (with-local-quit (mpc-status-refresh))) - (error (message "MPC: %s" err)))) + (with-demoted-errors "MPC: %s" + (when (process-get (mpc-proc) 'ready) + (with-local-quit (mpc-status-refresh))))) (defvar mpc--status-idle-timer nil) (defun mpc--status-idle-timer-start () @@ -520,9 +519,8 @@ (run-with-idle-timer 10 t 'mpc--status-idle-timer-run)))) (defun mpc--status-idle-timer-run () (when (process-get (mpc-proc) 'ready) - (condition-case err - (with-local-quit (mpc-status-refresh)) - (error (message "MPC: %s" err)))) + (with-demoted-errors "MPC: %s" + (with-local-quit (mpc-status-refresh)))) (mpc--status-timer-start)) (defun mpc--status-timers-refresh () @@ -999,9 +997,8 @@ (`Cover (let* ((dir (file-name-directory (cdr (assq 'file info)))) (cover (concat dir "cover.jpg")) - (file (condition-case err - (mpc-file-local-copy cover) - (error (message "MPC: %s" err)))) + (file (with-demoted-errors "MPC: %s" + (mpc-file-local-copy cover))) image) ;; (debug) (push `(equal ',dir (file-name-directory (cdr (assq 'file info)))) pred) === modified file 'lisp/play/bubbles.el' --- lisp/play/bubbles.el 2013-03-05 17:13:01 +0000 +++ lisp/play/bubbles.el 2013-09-12 05:32:57 +0000 @@ -1108,25 +1108,24 @@ Use optional parameter POS instead of point if given." (when bubbles--playing (unless pos (setq pos (point))) - (condition-case err - (let ((char (char-after pos)) - (inhibit-read-only t) - (row (bubbles--row (point))) - (col (bubbles--col (point)))) - (add-text-properties (point-min) (point-max) - '(face default active nil)) - (let ((count 0)) - (when (and row col (not (eq char (bubbles--empty-char)))) - (setq count (bubbles--mark-direct-neighbours row col char)) - (unless (> count 1) - (add-text-properties (point-min) (point-max) - '(face default active nil)) - (setq count 0))) - (bubbles--update-neighbourhood-score count)) - (put-text-property (point-min) (point-max) 'pointer 'arrow) - (bubbles--update-faces-or-images) - (sit-for 0)) - (error (message "Bubbles: Internal error %s" err))))) + (with-demoted-errors "Bubbles: Internal error %s" + (let ((char (char-after pos)) + (inhibit-read-only t) + (row (bubbles--row (point))) + (col (bubbles--col (point)))) + (add-text-properties (point-min) (point-max) + '(face default active nil)) + (let ((count 0)) + (when (and row col (not (eq char (bubbles--empty-char)))) + (setq count (bubbles--mark-direct-neighbours row col char)) + (unless (> count 1) + (add-text-properties (point-min) (point-max) + '(face default active nil)) + (setq count 0))) + (bubbles--update-neighbourhood-score count)) + (put-text-property (point-min) (point-max) 'pointer 'arrow) + (bubbles--update-faces-or-images) + (sit-for 0))))) (defun bubbles--neighbourhood-available () "Return t if another valid neighborhood is available." === modified file 'lisp/progmodes/executable.el' --- lisp/progmodes/executable.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/executable.el 2013-09-12 05:32:57 +0000 @@ -269,16 +269,15 @@ (save-restriction (widen) (string= "#!" (buffer-substring (point-min) (+ 2 (point-min))))) - (condition-case nil - (let* ((current-mode (file-modes (buffer-file-name))) - (add-mode (logand ?\111 (default-file-modes)))) - (or (/= (logand ?\111 current-mode) 0) - (zerop add-mode) - (set-file-modes (buffer-file-name) - (logior current-mode add-mode)))) - ;; Eg file-modes can return nil (bug#9879). It should not, - ;; in this context, but we should handle it all the same. - (error (message "Unable to make file executable"))))) + ;; Eg file-modes can return nil (bug#9879). It should not, + ;; in this context, but we should handle it all the same. + (with-demoted-errors "Unable to make file executable: %s" + (let* ((current-mode (file-modes (buffer-file-name))) + (add-mode (logand ?\111 (default-file-modes)))) + (or (/= (logand ?\111 current-mode) 0) + (zerop add-mode) + (set-file-modes (buffer-file-name) + (logior current-mode add-mode))))))) (provide 'executable) === modified file 'lisp/reveal.el' --- lisp/reveal.el 2013-01-01 09:11:05 +0000 +++ lisp/reveal.el 2013-09-12 05:32:57 +0000 @@ -72,27 +72,26 @@ ;; - we only refresh spots in the current window. ;; FIXME: do we actually know that (current-buffer) = (window-buffer) ? (with-local-quit - (condition-case err - (let ((old-ols - (delq nil - (mapcar - (lambda (x) - ;; We refresh any spot in the current window as well - ;; as any spots associated with a dead window or - ;; a window which does not show this buffer any more. - (cond - ((eq (car x) (selected-window)) (cdr x)) - ((not (and (window-live-p (car x)) - (eq (window-buffer (car x)) (current-buffer)))) - ;; Adopt this since it's owned by a window that's - ;; either not live or at least not showing this - ;; buffer any more. - (setcar x (selected-window)) - (cdr x)))) - reveal-open-spots)))) - (setq old-ols (reveal-open-new-overlays old-ols)) - (reveal-close-old-overlays old-ols)) - (error (message "Reveal: %s" err))))) + (with-demoted-errors "Reveal: %s" + (let ((old-ols + (delq nil + (mapcar + (lambda (x) + ;; We refresh any spot in the current window as well + ;; as any spots associated with a dead window or + ;; a window which does not show this buffer any more. + (cond + ((eq (car x) (selected-window)) (cdr x)) + ((not (and (window-live-p (car x)) + (eq (window-buffer (car x)) (current-buffer)))) + ;; Adopt this since it's owned by a window that's + ;; either not live or at least not showing this + ;; buffer any more. + (setcar x (selected-window)) + (cdr x)))) + reveal-open-spots)))) + (setq old-ols (reveal-open-new-overlays old-ols)) + (reveal-close-old-overlays old-ols))))) (defun reveal-open-new-overlays (old-ols) (let ((repeat t)) === modified file 'lisp/saveplace.el' --- lisp/saveplace.el 2013-09-08 23:15:17 +0000 +++ lisp/saveplace.el 2013-09-12 05:32:57 +0000 @@ -255,13 +255,9 @@ (insert-file-contents file) (goto-char (point-min)) (setq save-place-alist - ;; This is with-demoted-errors, but we want to - ;; mention save-place in any error message. - (condition-case err + (with-demoted-errors "Error reading save-place-file: %S" (car (read-from-string - (buffer-substring (point-min) (point-max)))) - (error (message "Error reading save-place-file: %S" err) - nil))) + (buffer-substring (point-min) (point-max)))))) ;; If there is a limit, and we're over it, then we'll ;; have to truncate the end of the list: === modified file 'lisp/shell.el' --- lisp/shell.el 2013-08-05 14:26:57 +0000 +++ lisp/shell.el 2013-09-12 05:32:57 +0000 @@ -1,7 +1,6 @@ ;;; shell.el --- specialized comint.el for running the shell -*- lexical-binding: t -*- -;; Copyright (C) 1988, 1993-1997, 2000-2013 Free Software Foundation, -;; Inc. +;; Copyright (C) 1988, 1993-1997, 2000-2013 Free Software Foundation, Inc. ;; Author: Olin Shivers ;; Simon Marshall @@ -1015,12 +1014,11 @@ ds)) (setq i (match-end 0))) (let ((ds (nreverse ds))) - (condition-case nil - (progn (shell-cd (car ds)) - (setq shell-dirstack (cdr ds) - shell-last-dir (car shell-dirstack)) - (shell-dirstack-message)) - (error (message "Couldn't cd")))))) + (with-demoted-errors "Couldn't cd: %s" + (shell-cd (car ds)) + (setq shell-dirstack (cdr ds) + shell-last-dir (car shell-dirstack)) + (shell-dirstack-message))))) (if started-at-pmark (goto-char (marker-position pmark))))) ;; For your typing convenience: === modified file 'lisp/term/pc-win.el' --- lisp/term/pc-win.el 2013-08-08 23:59:14 +0000 +++ lisp/term/pc-win.el 2013-09-12 05:32:57 +0000 @@ -1,7 +1,7 @@ ;;; pc-win.el --- setup support for `PC windows' (whatever that is) -;; Copyright (C) 1994, 1996-1997, 1999, 2001-2013 Free Software -;; Foundation, Inc. +;; Copyright (C) 1994, 1996-1997, 1999, 2001-2013 +;; Free Software Foundation, Inc. ;; Author: Morten Welinder ;; Maintainer: FSF @@ -238,9 +238,8 @@ (if x-select-enable-clipboard (let (text) ;; Don't die if x-get-selection signals an error. - (condition-case c - (setq text (w16-get-clipboard-data)) - (error (message "w16-get-clipboard-data:%s" c))) + (with-demoted-errors "w16-get-clipboard-data:%s" + (setq text (w16-get-clipboard-data))) (if (string= text "") (setq text nil)) (cond ((not text) nil) === modified file 'lisp/w32-common-fns.el' --- lisp/w32-common-fns.el 2013-01-01 09:11:05 +0000 +++ lisp/w32-common-fns.el 2013-09-12 05:32:57 +0000 @@ -107,9 +107,8 @@ (if x-select-enable-clipboard (let (text) ;; Don't die if x-get-selection signals an error. - (condition-case c - (setq text (w32-get-clipboard-data)) - (error (message "w32-get-clipboard-data:%s" c))) + (with-demoted-errors "w32-get-clipboard-data:%s" + (setq text (w32-get-clipboard-data))) (if (string= text "") (setq text nil)) (cond ((not text) nil) ------------------------------------------------------------ revno: 114225 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-09-12 01:20:07 -0400 message: Cleanup Eshell to rely less on dynamic scoping. * lisp/eshell/esh-opt.el (eshell-eval-using-options): Don't bind usage-msg, last-value, and ext-command here. Bind `args' closer to `body'. (temp-args, last-value, usage-msg, ext-command, args): Don't defvar. (eshell--args): Declare new dynamic var. (eshell-do-opt): Add argument `args'. Bind our own usage-msg, last-value, and ext-command. Pass `args' to `body'. (eshell-process-args): Bind eshell--args. (eshell-set-option): Use eshell--args. * lisp/eshell/eshell.el (eshell): Use derived-mode-p. * lisp/eshell/esh-var.el (eshell-parse-variable): Use backquote. (eshell-parse-variable-ref): Remove unused vars `end' and `err'. (eshell-glob-function): Declare. * lisp/eshell/esh-util.el: Require cl-lib. (eshell-read-hosts-file): Avoid add-to-list. * lisp/eshell/esh-cmd.el (eshell-parse-lisp-argument): Remove unused var `err'. * lisp/eshell/em-unix.el (compilation-scroll-output, locate-history-list): Declare. (eshell/diff): Remove unused var `err'. * lisp/eshell/em-rebind.el (eshell-delete-backward-char): Remove unused arg `killflag'. * lisp/eshell/em-pred.el (eshell-parse-modifiers): Remove unused var `err'. * lisp/eshell/em-ls.el (eshell-ls-highlight-alist): Move defvars before first use. * lisp/eshell/em-glob.el (eshell-glob-matches, message-shown): Move declaration before first use. * lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use backquotes. * autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we rely on cl-return. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 04:56:51 +0000 +++ lisp/ChangeLog 2013-09-12 05:20:07 +0000 @@ -1,5 +1,33 @@ 2013-09-12 Stefan Monnier + Cleanup Eshell to rely less on dynamic scoping. + * eshell/esh-opt.el (eshell-eval-using-options): Don't bind usage-msg, + last-value, and ext-command here. Bind `args' closer to `body'. + (temp-args, last-value, usage-msg, ext-command, args): Don't defvar. + (eshell--args): Declare new dynamic var. + (eshell-do-opt): Add argument `args'. Bind our own usage-msg, + last-value, and ext-command. Pass `args' to `body'. + (eshell-process-args): Bind eshell--args. + (eshell-set-option): Use eshell--args. + * eshell/eshell.el (eshell): Use derived-mode-p. + * eshell/esh-var.el (eshell-parse-variable): Use backquote. + (eshell-parse-variable-ref): Remove unused vars `end' and `err'. + (eshell-glob-function): Declare. + * eshell/esh-util.el: Require cl-lib. + (eshell-read-hosts-file): Avoid add-to-list. + * eshell/esh-cmd.el (eshell-parse-lisp-argument): Remove unused var + `err'. + * eshell/em-unix.el (compilation-scroll-output, locate-history-list): + Declare. + (eshell/diff): Remove unused var `err'. + * eshell/em-rebind.el (eshell-delete-backward-char): Remove unused arg + `killflag'. + * eshell/em-pred.el (eshell-parse-modifiers): Remove unused var `err'. + * eshell/em-ls.el (eshell-ls-highlight-alist): Move defvars before + first use. + * eshell/em-glob.el (eshell-glob-matches, message-shown): + Move declaration before first use. + * eshell/em-alias.el (eshell-maybe-replace-by-alias): Use backquotes. * autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we rely on cl-return. === modified file 'lisp/eshell/em-alias.el' --- lisp/eshell/em-alias.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/em-alias.el 2013-09-12 05:20:07 +0000 @@ -221,18 +221,11 @@ (let ((alias (eshell-lookup-alias command))) (if alias (throw 'eshell-replace-command - (list - 'let - (list - (list 'eshell-command-name - (list 'quote eshell-last-command-name)) - (list 'eshell-command-arguments - (list 'quote eshell-last-arguments)) - (list 'eshell-prevent-alias-expansion - (list 'quote - (cons command - eshell-prevent-alias-expansion)))) - (eshell-parse-command (nth 1 alias)))))))) + `(let ((eshell-command-name ',eshell-last-command-name) + (eshell-command-arguments ',eshell-last-arguments) + (eshell-prevent-alias-expansion + ',(cons command eshell-prevent-alias-expansion))) + ,(eshell-parse-command (nth 1 alias)))))))) (defun eshell-alias-completions (name) "Find all possible completions for NAME. === modified file 'lisp/eshell/em-glob.el' --- lisp/eshell/em-glob.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/em-glob.el 2013-09-12 05:20:07 +0000 @@ -180,6 +180,8 @@ (goto-char (1+ end)))))))))) (defvar eshell-glob-chars-regexp nil) +(defvar eshell-glob-matches) +(defvar message-shown) (defun eshell-glob-regexp (pattern) "Convert glob-pattern PATTERN to a regular expression. @@ -262,9 +264,6 @@ (error "No matches found: %s" glob) glob)))) -(defvar eshell-glob-matches) -(defvar message-shown) - ;; FIXME does this really need to abuse eshell-glob-matches, message-shown? (defun eshell-glob-entries (path globs &optional recurse-p) "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." === modified file 'lisp/eshell/em-ls.el' --- lisp/eshell/em-ls.el 2013-05-23 07:55:52 +0000 +++ lisp/eshell/em-ls.el 2013-09-12 05:20:07 +0000 @@ -268,6 +268,25 @@ :type '(repeat (cons function face)) :group 'eshell-ls) +(defvar block-size) +(defvar dereference-links) +(defvar dir-literal) +(defvar error-func) +(defvar flush-func) +(defvar human-readable) +(defvar ignore-pattern) +(defvar insert-func) +(defvar listing-style) +(defvar numeric-uid-gid) +(defvar reverse-list) +(defvar show-all) +(defvar show-almost-all) +(defvar show-recursive) +(defvar show-size) +(defvar sort-method) +(defvar ange-cache) +(defvar dired-flag) + ;;; Functions: (defun eshell-ls-insert-directory @@ -315,25 +334,6 @@ (put 'eshell/ls 'eshell-no-numeric-conversions t) -(defvar block-size) -(defvar dereference-links) -(defvar dir-literal) -(defvar error-func) -(defvar flush-func) -(defvar human-readable) -(defvar ignore-pattern) -(defvar insert-func) -(defvar listing-style) -(defvar numeric-uid-gid) -(defvar reverse-list) -(defvar show-all) -(defvar show-almost-all) -(defvar show-recursive) -(defvar show-size) -(defvar sort-method) -(defvar ange-cache) -(defvar dired-flag) - (declare-function eshell-glob-regexp "em-glob" (pattern)) (defun eshell-do-ls (&rest args) === modified file 'lisp/eshell/em-pred.el' --- lisp/eshell/em-pred.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/em-pred.el 2013-09-12 05:20:07 +0000 @@ -307,7 +307,7 @@ succeeds; MOD-FUNCS take any string and preform a modification, returning the resultant string." (let (result negate follow preds mods) - (condition-case err + (condition-case nil (while (not (eobp)) (let ((char (char-after))) (cond === modified file 'lisp/eshell/em-rebind.el' --- lisp/eshell/em-rebind.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/em-rebind.el 2013-09-12 05:20:07 +0000 @@ -218,7 +218,7 @@ (cdar bindings)) (setq bindings (cdr bindings))))) -(defun eshell-delete-backward-char (n &optional killflag) +(defun eshell-delete-backward-char (n) "Delete the last character, unless it's part of the output." (interactive "P") (let ((count (prefix-numeric-value n))) === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2013-05-28 10:22:03 +0000 +++ lisp/eshell/em-unix.el 2013-09-12 05:20:07 +0000 @@ -714,6 +714,8 @@ (goto-char (point-min)) (resize-temp-buffer-window)))))) +(defvar compilation-scroll-output) + (defun eshell-grep (command args &optional maybe-use-occur) "Generic service function for the various grep aliases. It calls Emacs's grep utility if the command is not redirecting output, @@ -989,7 +991,7 @@ (setq args nil) (setcdr (last args 3) nil)) (with-current-buffer - (condition-case err + (condition-case nil (diff-no-select old new (nil-blank-string (eshell-flatten-and-stringify args))) @@ -1014,6 +1016,8 @@ (put 'eshell/diff 'eshell-no-numeric-conversions t) +(defvar locate-history-list) + (defun eshell/locate (&rest args) "Alias \"locate\" to call Emacs `locate' function." (if (or eshell-plain-locate-behavior === modified file 'lisp/eshell/esh-arg.el' --- lisp/eshell/esh-arg.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/esh-arg.el 2013-09-12 05:20:07 +0000 @@ -278,7 +278,7 @@ (eshell-resolve-current-argument) eshell-current-argument)) -(defsubst eshell-operator (&rest args) +(defsubst eshell-operator (&rest _args) "A stub function that generates an error if a floating operator is found." (error "Unhandled operator in input text")) === modified file 'lisp/eshell/esh-cmd.el' --- lisp/eshell/esh-cmd.el 2013-08-04 20:18:11 +0000 +++ lisp/eshell/esh-cmd.el 2013-09-12 05:20:07 +0000 @@ -650,7 +650,7 @@ (looking-at eshell-lisp-regexp)) (let* ((here (point)) (obj - (condition-case err + (condition-case nil (read (current-buffer)) (end-of-file (throw 'eshell-incomplete ?\())))) === modified file 'lisp/eshell/esh-opt.el' --- lisp/eshell/esh-opt.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/esh-opt.el 2013-09-12 05:20:07 +0000 @@ -28,11 +28,11 @@ (require 'esh-ext) ;; Unused. -;;; (defgroup eshell-opt nil -;;; "The options processing code handles command argument parsing for -;;; Eshell commands implemented in Lisp." -;;; :tag "Command options processing" -;;; :group 'eshell) +;; (defgroup eshell-opt nil +;; "The options processing code handles command argument parsing for +;; Eshell commands implemented in Lisp." +;; :tag "Command options processing" +;; :group 'eshell) ;;; User Functions: @@ -103,32 +103,25 @@ macro-args (list 'eshell-stringify-list (list 'eshell-flatten-list macro-args))))) - (let ,(append (delq nil (mapcar (lambda (opt) + (let ,(delq nil (mapcar (lambda (opt) (and (listp opt) (nth 3 opt))) (cadr options))) - '(usage-msg last-value ext-command args)) ;; FIXME: `options' ends up hiding some variable names under `quote', ;; which is incompatible with lexical scoping!! - (eshell-do-opt ,name ,options (lambda () ,@body-forms))))) + (eshell-do-opt ,name ,options (lambda (args) ,@body-forms) temp-args)))) ;;; Internal Functions: -(defvar temp-args) -(defvar last-value) -(defvar usage-msg) -(defvar ext-command) ;; Documented part of the interface; see eshell-eval-using-options. -(defvar args) +(defvar eshell--args) -(defun eshell-do-opt (name options body-fun) +(defun eshell-do-opt (name options body-fun args) "Helper function for `eshell-eval-using-options'. This code doesn't really need to be macro expanded everywhere." - (setq args temp-args) - (if (setq - ext-command + (let* (last-value + (ext-command (catch 'eshell-ext-command - (when (setq - usage-msg + (let ((usage-msg (catch 'eshell-usage (setq last-value nil) (if (and (= (length args) 0) @@ -136,12 +129,14 @@ (throw 'eshell-usage (eshell-show-usage name options))) (setq args (eshell-process-args name args options) - last-value (funcall body-fun)) - nil)) - (error "%s" usage-msg)))) + last-value (funcall body-fun args)) + nil))) + (when usage-msg + (error "%s" usage-msg)))))) + (if ext-command (throw 'eshell-external (eshell-external-command ext-command args)) - last-value)) + last-value))) (defun eshell-show-usage (name options) "Display the usage message for NAME, using OPTIONS." @@ -197,12 +192,13 @@ (if (not (nth 3 opt)) (eshell-show-usage name options) (if (eq (nth 2 opt) t) - (if (> ai (length args)) + (if (> ai (length eshell--args)) (error "%s: missing option argument" name) - (set (nth 3 opt) (nth ai args)) + (set (nth 3 opt) (nth ai eshell--args)) (if (> ai 0) - (setcdr (nthcdr (1- ai) args) (nthcdr (1+ ai) args)) - (setq args (cdr args)))) + (setcdr (nthcdr (1- ai) eshell--args) + (nthcdr (1+ ai) eshell--args)) + (setq eshell--args (cdr eshell--args)))) (set (nth 3 opt) (or (nth 2 opt) t))))) (defun eshell-process-option (name switch kind ai options) @@ -232,14 +228,15 @@ (setq extcmd (eshell-search-path (cadr extcmd))) (if extcmd (throw 'eshell-ext-command extcmd) - (if (characterp switch) - (error "%s: unrecognized option -%c" name switch) - (error "%s: unrecognized option --%s" name switch)))))))) + (error (if (characterp switch) "%s: unrecognized option -%c" + "%s: unrecognized option --%s") + name switch))))))) (defun eshell-process-args (name args options) "Process the given ARGS using OPTIONS. This assumes that symbols have been intern'd by `eshell-eval-using-options'." - (let ((ai 0) arg) + (let ((ai 0) arg + (eshell--args args)) (while (< ai (length args)) (setq arg (nth ai args)) (if (not (and (stringp arg) === modified file 'lisp/eshell/esh-util.el' --- lisp/eshell/esh-util.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/esh-util.el 2013-09-12 05:20:07 +0000 @@ -23,6 +23,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (defgroup eshell-util nil "This is general utility code, meant for use by Eshell itself." :tag "General utilities" @@ -484,12 +486,12 @@ (while (re-search-forward "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) (if (match-string 1) - (add-to-list 'hosts (match-string 1))) + (cl-pushnew (match-string 1) hosts :test #'equal)) (if (match-string 2) - (add-to-list 'hosts (match-string 2))) + (cl-pushnew (match-string 2) hosts :test #'equal)) (if (match-string 4) - (add-to-list 'hosts (match-string 4))))) - (sort hosts 'string-lessp))) + (cl-pushnew (match-string 4) hosts :test #'equal)))) + (sort hosts #'string-lessp))) (defun eshell-read-hosts (file result-var timestamp-var) "Read the contents of /etc/passwd for user names." === modified file 'lisp/eshell/esh-var.el' --- lisp/eshell/esh-var.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/esh-var.el 2013-09-12 05:20:07 +0000 @@ -395,12 +395,9 @@ indices (and (not (eobp)) (eq (char-after) ?\[) (eshell-parse-indices)) - value (list 'let - (list (list 'indices - (list 'quote indices))) - value)) + value `(let ((indices ',indices)) ,value)) (if get-len - (list 'length value) + `(length ,value) value))) (defun eshell-parse-variable-ref () @@ -414,67 +411,68 @@ disambiguates the length of the name {COMMAND} result of command is variable's value (LISP-FORM) result of Lisp form is variable's value" - (let (end) - (cond - ((eq (char-after) ?{) - (let ((end (eshell-find-delimiter ?\{ ?\}))) - (if (not end) - (throw 'eshell-incomplete ?\{) - (prog1 - (list 'eshell-convert - (list 'eshell-command-to-value - (list 'eshell-as-subcommand - (eshell-parse-command - (cons (1+ (point)) end))))) - (goto-char (1+ end)))))) - ((memq (char-after) '(?\' ?\")) - (let ((name (if (eq (char-after) ?\') - (eshell-parse-literal-quote) - (eshell-parse-double-quote)))) - (if name + (cond + ((eq (char-after) ?{) + (let ((end (eshell-find-delimiter ?\{ ?\}))) + (if (not end) + (throw 'eshell-incomplete ?\{) + (prog1 + (list 'eshell-convert + (list 'eshell-command-to-value + (list 'eshell-as-subcommand + (eshell-parse-command + (cons (1+ (point)) end))))) + (goto-char (1+ end)))))) + ((memq (char-after) '(?\' ?\")) + (let ((name (if (eq (char-after) ?\') + (eshell-parse-literal-quote) + (eshell-parse-double-quote)))) + (if name (list 'eshell-get-variable (eval name) 'indices)))) - ((eq (char-after) ?\<) - (let ((end (eshell-find-delimiter ?\< ?\>))) - (if (not end) - (throw 'eshell-incomplete ?\<) - (let* ((temp (make-temp-file temporary-file-directory)) - (cmd (concat (buffer-substring (1+ (point)) end) - " > " temp))) - (prog1 - (list - 'let (list (list 'eshell-current-handles - (list 'eshell-create-handles temp - (list 'quote 'overwrite)))) - (list - 'progn - (list 'eshell-as-subcommand - (eshell-parse-command cmd)) - (list 'ignore - (list 'nconc 'eshell-this-command-hook - (list 'list - (list 'function - (list 'lambda nil - (list 'delete-file temp)))))) - (list 'quote temp))) - (goto-char (1+ end))))))) - ((eq (char-after) ?\() - (condition-case err - (list 'eshell-command-to-value - (list 'eshell-lisp-command - (list 'quote (read (current-buffer))))) - (end-of-file - (throw 'eshell-incomplete ?\()))) - ((assoc (char-to-string (char-after)) - eshell-variable-aliases-list) - (forward-char) - (list 'eshell-get-variable - (char-to-string (char-before)) 'indices)) - ((looking-at eshell-variable-name-regexp) - (prog1 - (list 'eshell-get-variable (match-string 0) 'indices) - (goto-char (match-end 0)))) - (t - (error "Invalid variable reference"))))) + ((eq (char-after) ?\<) + (let ((end (eshell-find-delimiter ?\< ?\>))) + (if (not end) + (throw 'eshell-incomplete ?\<) + (let* ((temp (make-temp-file temporary-file-directory)) + (cmd (concat (buffer-substring (1+ (point)) end) + " > " temp))) + (prog1 + (list + 'let (list (list 'eshell-current-handles + (list 'eshell-create-handles temp + (list 'quote 'overwrite)))) + (list + 'progn + (list 'eshell-as-subcommand + (eshell-parse-command cmd)) + (list 'ignore + (list 'nconc 'eshell-this-command-hook + (list 'list + (list 'function + (list 'lambda nil + (list 'delete-file temp)))))) + (list 'quote temp))) + (goto-char (1+ end))))))) + ((eq (char-after) ?\() + (condition-case nil + (list 'eshell-command-to-value + (list 'eshell-lisp-command + (list 'quote (read (current-buffer))))) + (end-of-file + (throw 'eshell-incomplete ?\()))) + ((assoc (char-to-string (char-after)) + eshell-variable-aliases-list) + (forward-char) + (list 'eshell-get-variable + (char-to-string (char-before)) 'indices)) + ((looking-at eshell-variable-name-regexp) + (prog1 + (list 'eshell-get-variable (match-string 0) 'indices) + (goto-char (match-end 0)))) + (t + (error "Invalid variable reference")))) + +(defvar eshell-glob-function) (defun eshell-parse-indices () "Parse and return a list of list of indices." === modified file 'lisp/eshell/eshell.el' --- lisp/eshell/eshell.el 2013-05-23 04:57:27 +0000 +++ lisp/eshell/eshell.el 2013-09-12 05:20:07 +0000 @@ -300,7 +300,7 @@ (get-buffer-create eshell-buffer-name))))) (cl-assert (and buf (buffer-live-p buf))) (pop-to-buffer-same-window buf) - (unless (eq major-mode 'eshell-mode) + (unless (derived-mode-p 'eshell-mode) (eshell-mode)) buf)) ------------------------------------------------------------ revno: 114224 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-09-12 00:56:51 -0400 message: * lisp/autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we rely on cl-return. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-12 01:32:45 +0000 +++ lisp/ChangeLog 2013-09-12 04:56:51 +0000 @@ -1,3 +1,8 @@ +2013-09-12 Stefan Monnier + + * autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we + rely on cl-return. + 2013-09-12 Glenn Morris * term/ns-win.el (global-map): Remove binding for ispell-next, @@ -18,8 +23,8 @@ * eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization (bug#15338). - (eshell-self-insert-command, eshell-send-invisible): Remove - unused argument. + (eshell-self-insert-command, eshell-send-invisible): + Remove unused argument. (eshell-handle-control-codes): Remove unused var `orig'. Avoid delete-backward-char. === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-09-04 20:56:54 +0000 +++ lisp/autorevert.el 2013-09-12 04:56:51 +0000 @@ -548,7 +548,7 @@ (cl-assert (stringp file)) (when (eq action 'renamed) (cl-assert (stringp file1))) ;; Loop over all buffers, in order to find the intended one. - (dolist (buffer buffers) + (cl-dolist (buffer buffers) (when (buffer-live-p buffer) (with-current-buffer buffer (when (and (stringp buffer-file-name) ------------------------------------------------------------ revno: 114223 fixes bug: http://debbugs.gnu.org/15357 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 21:32:45 -0400 message: * lisp/term/ns-win.el (global-map): Remove binding for ispell-next, deleted 1999-05-29. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 18:33:58 +0000 +++ lisp/ChangeLog 2013-09-12 01:32:45 +0000 @@ -1,3 +1,8 @@ +2013-09-12 Glenn Morris + + * term/ns-win.el (global-map): Remove binding for ispell-next, + deleted 1999-05-29. (Bug#15357) + 2013-09-11 Glenn Morris * echistory.el (electric-command-history): Remove call to deleted func. === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2013-07-02 18:16:09 +0000 +++ lisp/term/ns-win.el 2013-09-12 01:32:45 +0000 @@ -104,7 +104,6 @@ (define-key global-map [?\s-~] 'ns-prev-frame) (define-key global-map [?\s--] 'center-line) (define-key global-map [?\s-:] 'ispell) -(define-key global-map [?\s-\;] 'ispell-next) (define-key global-map [?\s-?] 'info) (define-key global-map [?\s-^] 'kill-some-buffers) (define-key global-map [?\s-&] 'kill-this-buffer) ------------------------------------------------------------ revno: 114222 committer: Xue Fuqiao branch nick: trunk timestamp: Thu 2013-09-12 07:05:21 +0800 message: Character properties fix in lispref. * doc/lispref/nonascii.texi (Character Properties): Character properties fix for decimal-digit-value and digit-value. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-09-08 18:01:25 +0000 +++ doc/lispref/ChangeLog 2013-09-11 23:05:21 +0000 @@ -1,3 +1,8 @@ +2013-09-11 Xue Fuqiao + + * nonascii.texi (Character Properties): Character properties fix + for decimal-digit-value and digit-value. + 2013-09-08 Stefan Monnier * macros.texi (Defining Macros): Prefer "function" to "lambda === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2013-09-11 14:06:22 +0000 +++ doc/lispref/nonascii.texi 2013-09-11 23:05:21 +0000 @@ -478,14 +478,14 @@ @item decimal-digit-value Corresponds to the Unicode @code{Numeric_Value} property for +characters whose @code{Numeric_Type} is @samp{Decimal}. The value is +an integer number. For unassigned codepoints, the value is +@code{nil}, which means @acronym{NaN}, or ``not-a-number''. + +@item digit-value +Corresponds to the Unicode @code{Numeric_Value} property for characters whose @code{Numeric_Type} is @samp{Digit}. The value is an -integer number. For unassigned codepoints, the value is @code{nil}, -which means @acronym{NaN}, or ``not-a-number''. - -@item digit-value -Corresponds to the Unicode @code{Numeric_Value} property for -characters whose @code{Numeric_Type} is @samp{Decimal}. The value is -an integer number. Examples of such characters include compatibility +integer number. Examples of such characters include compatibility subscript and superscript digits, for which the value is the corresponding number. For unassigned codepoints, the value is @code{nil}, which means @acronym{NaN}. ------------------------------------------------------------ revno: 114221 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 14:40:06 -0400 message: Comment diff: === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2013-09-11 18:31:45 +0000 +++ lisp/vc/vc-cvs.el 2013-09-11 18:40:06 +0000 @@ -1230,6 +1230,7 @@ "Ignore FILE under CVS." (cvs-append-to-ignore (file-name-directory file) file)) +;; FIXME This should be in the vc-cvs- namespace if it is to live here. (defun cvs-append-to-ignore (dir str &optional old-dir) "In DIR, add STR to the .cvsignore file. If OLD-DIR is non-nil, then this is a directory that we don't want ------------------------------------------------------------ revno: 114220 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 14:36:51 -0400 message: * lisp/play/landmark.el: Yet more typo fixes. diff: === modified file 'lisp/play/landmark.el' --- lisp/play/landmark.el 2013-09-11 18:32:32 +0000 +++ lisp/play/landmark.el 2013-09-11 18:36:51 +0000 @@ -246,7 +246,7 @@ Entry to this mode calls the value of `landmark-mode-hook' if that value is non-nil. One interesting value is `turn-on-font-lock'." (landmark-display-statistics) - (setq-local font-lock-defaults '(lm-font-lock-keywords t)) + (setq-local font-lock-defaults '(landmark-font-lock-keywords t)) (setq buffer-read-only t)) ------------------------------------------------------------ revno: 114219 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 14:33:58 -0400 message: * lisp/echistory.el (electric-command-history): Remove call to deleted func. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 18:32:32 +0000 +++ lisp/ChangeLog 2013-09-11 18:33:58 +0000 @@ -1,5 +1,7 @@ 2013-09-11 Glenn Morris + * echistory.el (electric-command-history): Remove call to deleted func. + * play/landmark.el (landmark-mode): Fix typos. * vc/vc-cvs.el (cvs-append-to-ignore): Fix arg spec. @@ -61,6 +63,7 @@ * chistory.el (command-history-mode-map): Rename from command-history-map. (command-history-mode): Use define-derived-mode. + (Command-history-setup): Remove function. * calc/calc.el (calc-trail-mode-map): New var. (calc-trail-mode): Use define-derived-mode. (calc-trail-buffer): Set calc-main-buffer manually. === modified file 'lisp/echistory.el' --- lisp/echistory.el 2013-01-01 09:11:05 +0000 +++ lisp/echistory.el 2013-09-11 18:33:58 +0000 @@ -117,7 +117,6 @@ (save-window-excursion (list-command-history) (set-buffer "*Command History*") - (Command-history-setup) (setq major-mode 'electric-command-history) (setq mode-name "Electric History") (use-local-map electric-history-map)) ------------------------------------------------------------ revno: 114218 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 14:32:32 -0400 message: * lisp/play/landmark.el (landmark-mode): Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 18:31:45 +0000 +++ lisp/ChangeLog 2013-09-11 18:32:32 +0000 @@ -1,5 +1,7 @@ 2013-09-11 Glenn Morris + * play/landmark.el (landmark-mode): Fix typos. + * vc/vc-cvs.el (cvs-append-to-ignore): Fix arg spec. Check cvs-sort-ignore-file is bound. === modified file 'lisp/play/landmark.el' --- lisp/play/landmark.el 2013-09-11 03:31:56 +0000 +++ lisp/play/landmark.el 2013-09-11 18:32:32 +0000 @@ -233,7 +233,7 @@ (put 'landmark-mode 'intangible 1) ;; This one is for when they set view-read-only to t: Landmark cannot ;; allow View Mode to be activated in its buffer. -(define-derived-mode lm-mode special-mode "Lm" +(define-derived-mode landmark-mode special-mode "Lm" "Major mode for playing Lm against Emacs. You and Emacs play in turn by marking a free square. You mark it with X and Emacs marks it with O. The winner is the first to get five contiguous @@ -245,7 +245,7 @@ \\{landmark-mode-map} Entry to this mode calls the value of `landmark-mode-hook' if that value is non-nil. One interesting value is `turn-on-font-lock'." - (lm-display-statistics) + (landmark-display-statistics) (setq-local font-lock-defaults '(lm-font-lock-keywords t)) (setq buffer-read-only t)) ------------------------------------------------------------ revno: 114217 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 14:31:45 -0400 message: * lisp/vc/vc-cvs.el (cvs-append-to-ignore): Fix arg spec. Check cvs-sort-ignore-file is bound. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 17:27:22 +0000 +++ lisp/ChangeLog 2013-09-11 18:31:45 +0000 @@ -1,5 +1,8 @@ 2013-09-11 Glenn Morris + * vc/vc-cvs.el (cvs-append-to-ignore): Fix arg spec. + Check cvs-sort-ignore-file is bound. + * savehist.el: No need for cl when compiling on Emacs. 2013-09-11 Stefan Monnier === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2013-09-04 21:09:42 +0000 +++ lisp/vc/vc-cvs.el 2013-09-11 18:31:45 +0000 @@ -1226,7 +1226,7 @@ table (lambda () (vc-cvs-revision-table (car files)))))) table)) -(defun vc-cvs-ignore (file) +(defun vc-cvs-ignore (file &optional _directory _remove) "Ignore FILE under CVS." (cvs-append-to-ignore (file-name-directory file) file)) @@ -1245,7 +1245,9 @@ (goto-char (point-max)) (unless (bolp) (insert "\n")) (insert str (if old-dir "/\n" "\n")) - (if cvs-sort-ignore-file (sort-lines nil (point-min) (point-max))) + ;; FIXME this is a pcvs variable. + (if (bound-and-true-p cvs-sort-ignore-file) + (sort-lines nil (point-min) (point-max))) (save-buffer))) (provide 'vc-cvs) ------------------------------------------------------------ revno: 114216 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 13:31:29 -0400 message: * src/emacs.c (usage_message): Possessive apostrophe tweak. Likewise in some comments. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 16:03:42 +0000 +++ src/ChangeLog 2013-09-11 17:31:29 +0000 @@ -1,3 +1,7 @@ +2013-09-11 Glenn Morris + + * emacs.c (usage_message): Possessive apostrophe tweak. + 2013-09-11 Dmitry Antipov * nsterm.m (syms_of_nsterm): Use Qns. === modified file 'src/emacs.c' --- src/emacs.c 2013-08-15 16:37:15 +0000 +++ src/emacs.c 2013-09-11 17:31:29 +0000 @@ -1,7 +1,7 @@ /* Fully extensible Emacs, running on Unix, intended for GNU. -Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013 Free Software -Foundation, Inc. +Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -310,7 +310,7 @@ abbreviation for a --option.\n\ \n\ Various environment variables and window system resources also affect\n\ -Emacs' operation. See the main documentation.\n\ +the operation of Emacs. See the main documentation.\n\ \n\ Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\ section of the Emacs manual or the file BUGS.\n" === modified file 'src/w32proc.c' --- src/w32proc.c 2013-08-29 15:32:04 +0000 +++ src/w32proc.c 2013-09-11 17:31:29 +0000 @@ -1144,7 +1144,7 @@ return FALSE; } -/* create_child doesn't know what emacs' file handle will be for waiting +/* create_child doesn't know what emacs's file handle will be for waiting on output from the child, so we need to make this additional call to register the handle with the process This way the select emulator knows how to match file handles with === modified file 'src/xfns.c' --- src/xfns.c 2013-09-11 16:03:42 +0000 +++ src/xfns.c 2013-09-11 17:31:29 +0000 @@ -1031,7 +1031,7 @@ Note: this is done in two routines because of the way X10 works. Note: under X11, this is normally the province of the window manager, - and so emacs' border colors may be overridden. */ + and so emacs's border colors may be overridden. */ static void x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) ------------------------------------------------------------ revno: 114215 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 13:27:22 -0400 message: * lisp/savehist.el: No need for cl when compiling on Emacs. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 16:00:37 +0000 +++ lisp/ChangeLog 2013-09-11 17:27:22 +0000 @@ -1,3 +1,7 @@ +2013-09-11 Glenn Morris + + * savehist.el: No need for cl when compiling on Emacs. + 2013-09-11 Stefan Monnier * eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization === modified file 'lisp/savehist.el' --- lisp/savehist.el 2013-01-01 09:11:05 +0000 +++ lisp/savehist.el 2013-09-11 17:27:22 +0000 @@ -49,7 +49,7 @@ (require 'custom) (eval-when-compile - (require 'cl)) + (if (featurep 'xemacs) (require 'cl))) ;; User variables ------------------------------------------------------------ revno: 114214 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-09-11 20:03:42 +0400 message: * nsterm.m (syms_of_nsterm): Use Qns. * w32fns.c (Fx_open_connection): Remove old '#if 0' code. * w32term.c (w32_create_terminal, syms_of_w32term): Use Qw32. * xfns.c (x_display_info_for_name, Fx_open_connection): Remove old '#if 0' code. (syms_of_xfns): Use Qx. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 13:56:46 +0000 +++ src/ChangeLog 2013-09-11 16:03:42 +0000 @@ -1,5 +1,11 @@ 2013-09-11 Dmitry Antipov + * nsterm.m (syms_of_nsterm): Use Qns. + * w32fns.c (Fx_open_connection): Remove old '#if 0' code. + * w32term.c (w32_create_terminal, syms_of_w32term): Use Qw32. + * xfns.c (x_display_info_for_name, Fx_open_connection): + Remove old '#if 0' code. + (syms_of_xfns): Use Qx. * termhooks.h (fullscreen_hook): Remove the leftover. (struct terminal): Fix typo in comment. === modified file 'src/nsterm.m' --- src/nsterm.m 2013-09-09 12:15:45 +0000 +++ src/nsterm.m 2013-09-11 16:03:42 +0000 @@ -7433,6 +7433,6 @@ baseline level. The default value is nil. */); x_underline_at_descent_line = 0; - /* Tell emacs about this window system. */ - Fprovide (intern ("ns"), Qnil); + /* Tell Emacs about this window system. */ + Fprovide (Qns, Qnil); } === modified file 'src/w32fns.c' --- src/w32fns.c 2013-09-06 07:00:29 +0000 +++ src/w32fns.c 2013-09-11 16:03:42 +0000 @@ -5201,11 +5201,6 @@ if (! NILP (xrm_string)) CHECK_STRING (xrm_string); -#if 0 - if (! EQ (Vwindow_system, intern ("w32"))) - error ("Not using Microsoft Windows"); -#endif - /* Allow color mapping to be defined externally; first look in user's HOME directory, then in Emacs etc dir for a file called rgb.txt. */ { === modified file 'src/w32term.c' --- src/w32term.c 2013-09-09 12:15:45 +0000 +++ src/w32term.c 2013-09-11 16:03:42 +0000 @@ -6338,7 +6338,7 @@ terminal like X does. */ terminal->kboard = xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); - kset_window_system (terminal->kboard, intern ("w32")); + kset_window_system (terminal->kboard, Qw32); terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; /* Don't let the initial kboard remain current longer than necessary. @@ -6691,5 +6691,6 @@ staticpro (&last_mouse_motion_frame); last_mouse_motion_frame = Qnil; - Fprovide (intern_c_string ("w32"), Qnil); + /* Tell Emacs about this window system. */ + Fprovide (Qw32, Qnil); } === modified file 'src/xfns.c' --- src/xfns.c 2013-09-11 08:56:33 +0000 +++ src/xfns.c 2013-09-11 16:03:42 +0000 @@ -4434,11 +4434,6 @@ CHECK_STRING (name); -#if 0 - if (! EQ (Vinitial_window_system, intern ("x"))) - error ("Not using X Windows"); /* That doesn't stop us anymore. */ -#endif - for (dpyinfo = x_display_list, names = x_display_name_list; dpyinfo; dpyinfo = dpyinfo->next, names = XCDR (names)) @@ -4482,11 +4477,6 @@ if (! NILP (xrm_string)) CHECK_STRING (xrm_string); -#if 0 - if (! EQ (Vinitial_window_system, intern ("x"))) - error ("Not using X Windows"); /* That doesn't stop us anymore. */ -#endif - xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string); validate_x_resource_name (); @@ -6299,7 +6289,8 @@ When using Gtk+ tooltips, the tooltip face is not used. */); x_gtk_use_system_tooltips = 1; - Fprovide (intern_c_string ("x"), Qnil); + /* Tell Emacs about this window system. */ + Fprovide (Qx, Qnil); #ifdef USE_X_TOOLKIT Fprovide (intern_c_string ("x-toolkit"), Qnil); ------------------------------------------------------------ revno: 114213 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15338 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-11 12:00:37 -0400 message: * lisp/eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization. (eshell-self-insert-command, eshell-send-invisible): Remove unused argument. (eshell-handle-control-codes): Remove unused var `orig'. Avoid delete-backward-char. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 12:36:59 +0000 +++ lisp/ChangeLog 2013-09-11 16:00:37 +0000 @@ -1,5 +1,12 @@ 2013-09-11 Stefan Monnier + * eshell/esh-mode.el (eshell-mode-syntax-table): Fix up initialization + (bug#15338). + (eshell-self-insert-command, eshell-send-invisible): Remove + unused argument. + (eshell-handle-control-codes): Remove unused var `orig'. + Avoid delete-backward-char. + * files.el (set-auto-mode): Simplify a bit further. 2013-09-11 Glenn Morris @@ -74,7 +81,7 @@ 2013-09-10 Stefan Monnier * simple.el: Use set-temporary-overlay-map for universal-argument. - (universal-argument-map): Don't use default-bindings. + (universal-argument-map): Don't use default-bindings (bug#15317). Bind switch-frame explicitly. Replace universal-argument-minus with a conditional binding. (universal-argument-num-events, saved-overriding-map): Remove. === modified file 'lisp/eshell/esh-mode.el' --- lisp/eshell/esh-mode.el 2013-09-11 03:31:56 +0000 +++ lisp/eshell/esh-mode.el 2013-09-11 16:00:37 +0000 @@ -267,19 +267,20 @@ ;; All non-word multibyte characters should be `symbol'. (map-char-table (if (featurep 'xemacs) - (lambda (key val) + (lambda (key _val) (and (characterp key) (>= (char-int key) 256) (/= (char-syntax key) ?w) (modify-syntax-entry key "_ " st))) - (lambda (key val) + (lambda (key _val) (and (if (consp key) (and (>= (car key) 128) (/= (char-syntax (car key)) ?w)) (and (>= key 256) (/= (char-syntax key) ?w))) (modify-syntax-entry key "_ " st)))) - (standard-syntax-table)))) + (standard-syntax-table)) + st)) ;;; User Functions: @@ -451,8 +452,8 @@ (add-hook 'pre-command-hook 'eshell-intercept-commands t t) (message "Sending subprocess input directly"))) -(defun eshell-self-insert-command (N) - (interactive "i") +(defun eshell-self-insert-command () + (interactive) (process-send-string (eshell-interactive-process) (char-to-string (if (symbolp last-command-event) @@ -925,10 +926,10 @@ (custom-add-option 'eshell-output-filter-functions 'eshell-truncate-buffer) -(defun eshell-send-invisible (str) +(defun eshell-send-invisible () "Read a string without echoing. Then send it to the process running in the current buffer." - (interactive "P") ; Defeat snooping via C-x ESC ESC + (interactive) ; Don't pass str as argument, to avoid snooping via C-x ESC ESC (let ((str (read-passwd (format "%s Password: " (process-name (eshell-interactive-process)))))) @@ -950,7 +951,7 @@ (beginning-of-line) (if (re-search-forward eshell-password-prompt-regexp eshell-last-output-end t) - (eshell-send-invisible nil))))) + (eshell-send-invisible))))) (custom-add-option 'eshell-output-filter-functions 'eshell-watch-for-password-prompt) @@ -958,32 +959,30 @@ (defun eshell-handle-control-codes () "Act properly when certain control codes are seen." (save-excursion - (let ((orig (point))) - (goto-char eshell-last-output-block-begin) - (unless (eolp) - (beginning-of-line)) - (while (< (point) eshell-last-output-end) - (let ((char (char-after))) - (cond - ((eq char ?\r) - (if (< (1+ (point)) eshell-last-output-end) - (if (memq (char-after (1+ (point))) - '(?\n ?\r)) - (delete-char 1) - (let ((end (1+ (point)))) - (beginning-of-line) - (delete-region (point) end))) - (add-text-properties (point) (1+ (point)) - '(invisible t)) - (forward-char))) - ((eq char ?\a) - (delete-char 1) - (beep)) - ((eq char ?\C-h) - (delete-backward-char 1) - (delete-char 1)) - (t - (forward-char)))))))) + (goto-char eshell-last-output-block-begin) + (unless (eolp) + (beginning-of-line)) + (while (< (point) eshell-last-output-end) + (let ((char (char-after))) + (cond + ((eq char ?\r) + (if (< (1+ (point)) eshell-last-output-end) + (if (memq (char-after (1+ (point))) + '(?\n ?\r)) + (delete-char 1) + (let ((end (1+ (point)))) + (beginning-of-line) + (delete-region (point) end))) + (add-text-properties (point) (1+ (point)) + '(invisible t)) + (forward-char))) + ((eq char ?\a) + (delete-char 1) + (beep)) + ((eq char ?\C-h) + (delete-region (1- (point)) (1+ (point)))) + (t + (forward-char))))))) (custom-add-option 'eshell-output-filter-functions 'eshell-handle-control-codes) ------------------------------------------------------------ revno: 114212 committer: Xue Fuqiao branch nick: trunk timestamp: Wed 2013-09-11 22:06:22 +0800 message: Minor fixes for ido.texi. * doc/misc/ido.texi (Interactive Substring Matching): Use @key{RET} instead of @kbd{RET}. (Prefix Matching): Add an index. diff: === modified file 'doc/emacs/trouble.texi' --- doc/emacs/trouble.texi 2013-08-12 00:09:11 +0000 +++ doc/emacs/trouble.texi 2013-09-11 14:06:22 +0000 @@ -1140,6 +1140,7 @@ form that is clearly safe to install. @end itemize +@c FIXME: Include the node above? @node Contributing @section Contributing to Emacs Development @cindex contributing to Emacs === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2013-08-25 22:30:56 +0000 +++ doc/lispref/nonascii.texi 2013-09-11 14:06:22 +0000 @@ -549,6 +549,8 @@ @defun get-char-code-property char propname This function returns the value of @var{char}'s @var{propname} property. +@c FIXME: Use ā€˜?\s’ instead of ā€˜? ’ for the space character in the +@c first example? --xfq @example @group (get-char-code-property ? 'general-category) === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-09-08 23:31:14 +0000 +++ doc/misc/ChangeLog 2013-09-11 14:06:22 +0000 @@ -1,3 +1,9 @@ +2013-09-11 Xue Fuqiao + + * ido.texi (Interactive Substring Matching): Use @key{RET} instead + of @kbd{RET}. + (Prefix Matching): Add an index. + 2013-09-08 Glenn Morris * emacs-gnutls.texi: Tweak direntry. === modified file 'doc/misc/ido.texi' --- doc/misc/ido.texi 2013-08-10 04:58:31 +0000 +++ doc/misc/ido.texi 2013-09-11 14:06:22 +0000 @@ -258,7 +258,7 @@ At this point, you still have two matching buffers. If you want the first buffer in the list, you can simply press @key{RET}. If you want the second in the list, you can press @kbd{C-s} to move it to the top -of the list and then press @kbd{RET} to select it. +of the list and then press @key{RET} to select it. However, if you type @kbd{4}, you'll only have one match left: @@ -366,6 +366,7 @@ the only difference to the description of the substring matching above. +@cindex toggle prefix matching You can toggle prefix matching with @kbd{C-p} (@code{ido-toggle-prefix}). ------------------------------------------------------------ revno: 114211 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-09-11 17:56:46 +0400 message: * termhooks.h (fullscreen_hook): Remove the leftover. (struct terminal): Fix typo in comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 13:35:28 +0000 +++ src/ChangeLog 2013-09-11 13:56:46 +0000 @@ -1,5 +1,10 @@ 2013-09-11 Dmitry Antipov + * termhooks.h (fullscreen_hook): Remove the leftover. + (struct terminal): Fix typo in comment. + +2013-09-11 Dmitry Antipov + Cleaning up a few X scroll bar bits. * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member. * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]: === modified file 'src/termhooks.h' --- src/termhooks.h 2013-09-11 13:35:28 +0000 +++ src/termhooks.h 2013-09-11 13:56:46 +0000 @@ -43,11 +43,6 @@ scroll_bar_move_ratio }; -/* If the value of the frame parameter changed, whis hook is called. - For example, if going from fullscreen to not fullscreen this hook - may do something OS dependent, like extended window manager hints on X11. */ -extern void (*fullscreen_hook) (struct frame *f); - /* Output method of a terminal (and frames on this terminal, respectively). */ enum output_method @@ -499,7 +494,7 @@ windows. */ void (*frame_raise_lower_hook) (struct frame *f, int raise_flag); - /* If the value of the frame parameter changed, whis hook is called. + /* If the value of the frame parameter changed, this hook is called. For example, if going from fullscreen to not fullscreen this hook may do something OS dependent, like extended window manager hints on X11. */ void (*fullscreen_hook) (struct frame *f); ------------------------------------------------------------ revno: 114210 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-09-11 17:35:28 +0400 message: Cleaning up a few X scroll bar bits. * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member. * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]: New member last_seen_part, going to replace... * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part. (xt_action_hook) [USE_LUCID]: Adjust user. (xm_scroll_callback, xg_scroll_callback): Do not bloat with Lucid-specific scroll bar support. (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part to int and adjust to use last_seen_part member. (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user. (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]: Initialize last_seen_part. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 12:28:01 +0000 +++ src/ChangeLog 2013-09-11 13:35:28 +0000 @@ -1,3 +1,19 @@ +2013-09-11 Dmitry Antipov + + Cleaning up a few X scroll bar bits. + * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member. + * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]: + New member last_seen_part, going to replace... + * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part. + (xt_action_hook) [USE_LUCID]: Adjust user. + (xm_scroll_callback, xg_scroll_callback): Do not bloat with + Lucid-specific scroll bar support. + (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part + to int and adjust to use last_seen_part member. + (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user. + (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]: + Initialize last_seen_part. + 2013-09-11 Stefan Monnier * insdel.c (insert_from_buffer_1): Don't mark buffer as modified when === modified file 'src/termhooks.h' --- src/termhooks.h 2013-08-30 12:17:44 +0000 +++ src/termhooks.h 2013-09-11 13:35:28 +0000 @@ -31,6 +31,7 @@ #endif enum scroll_bar_part { + scroll_bar_nowhere = -1, scroll_bar_above_handle, scroll_bar_handle, scroll_bar_below_handle, === modified file 'src/xterm.c' --- src/xterm.c 2013-09-11 08:56:33 +0000 +++ src/xterm.c 2013-09-11 13:35:28 +0000 @@ -4081,10 +4081,6 @@ static Lisp_Object window_being_scrolled; -/* Last scroll bar part sent in xm_scroll_callback. */ - -static int last_scroll_bar_part; - /* Whether this is an Xaw with arrow-scrollbars. This should imply that movements of 1/20 of the screen size are mapped to up/down. */ @@ -4126,20 +4122,23 @@ && WINDOWP (window_being_scrolled)) { struct window *w; + struct scroll_bar *bar; x_send_scroll_bar_event (window_being_scrolled, scroll_bar_end_scroll, 0, 0); w = XWINDOW (window_being_scrolled); + bar = XSCROLL_BAR (w->vertical_scroll_bar); - if (XSCROLL_BAR (w->vertical_scroll_bar)->dragging != -1) + if (bar->dragging != -1) { - XSCROLL_BAR (w->vertical_scroll_bar)->dragging = -1; + bar->dragging = -1; /* The thumb size is incorrect while dragging: fix it. */ set_vertical_scroll_bar (w); } window_being_scrolled = Qnil; - last_scroll_bar_part = -1; - +#if defined (USE_LUCID) + bar->last_seen_part = scroll_bar_nowhere; +#endif /* Xt timeouts no longer needed. */ toolkit_scroll_bar_interaction = 0; } @@ -4323,7 +4322,6 @@ if (part >= 0) { window_being_scrolled = bar->window; - last_scroll_bar_part = part; x_send_scroll_bar_event (bar->window, part, portion, whole); } } @@ -4384,7 +4382,6 @@ if (part >= 0) { window_being_scrolled = bar->window; - last_scroll_bar_part = part; x_send_scroll_bar_event (bar->window, part, portion, whole); } @@ -4426,7 +4423,7 @@ float top = *top_addr; float shown; int whole, portion, height; - int part; + enum scroll_bar_part part; /* Get the size of the thumb, a value between 0 and 1. */ block_input (); @@ -4448,7 +4445,7 @@ window_being_scrolled = bar->window; bar->dragging = portion; - last_scroll_bar_part = part; + bar->last_seen_part = part; x_send_scroll_bar_event (bar->window, part, portion, whole); } @@ -4468,7 +4465,7 @@ /* The position really is stored cast to a pointer. */ int position = (intptr_t) call_data; Dimension height; - int part; + enum scroll_bar_part part; /* Get the height of the scroll bar. */ block_input (); @@ -4487,7 +4484,7 @@ window_being_scrolled = bar->window; bar->dragging = -1; - last_scroll_bar_part = part; + bar->last_seen_part = part; x_send_scroll_bar_event (bar->window, part, position, height); } @@ -4797,7 +4794,7 @@ NULL); /* Massage the top+shown values. */ - if (bar->dragging == -1 || last_scroll_bar_part == scroll_bar_down_arrow) + if (bar->dragging == -1 || bar->last_seen_part == scroll_bar_down_arrow) top = max (0, min (1, top)); else top = old_top; @@ -4902,6 +4899,9 @@ bar->end = 0; bar->dragging = -1; bar->fringe_extended_p = 0; +#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID) + bar->last_seen_part = scroll_bar_nowhere; +#endif /* Add bar to its frame's list of scroll bars. */ bar->next = FRAME_SCROLL_BARS (f); === modified file 'src/xterm.h' --- src/xterm.h 2013-09-04 04:02:56 +0000 +++ src/xterm.h 2013-09-11 13:35:28 +0000 @@ -801,6 +801,11 @@ being dragged, this is -1. */ int dragging; +#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID) + /* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback. */ + enum scroll_bar_part last_seen_part; +#endif + /* 1 if the background of the fringe that is adjacent to a scroll bar is extended to the gap between the fringe and the bar. */ unsigned fringe_extended_p : 1; ------------------------------------------------------------ revno: 114209 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-11 08:36:59 -0400 message: * lisp/files.el (set-auto-mode): Simplify a bit further. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 06:44:35 +0000 +++ lisp/ChangeLog 2013-09-11 12:36:59 +0000 @@ -1,3 +1,7 @@ +2013-09-11 Stefan Monnier + + * files.el (set-auto-mode): Simplify a bit further. + 2013-09-11 Glenn Morris * files.el (interpreter-mode-alist): Remove \\` \\' parts. === modified file 'lisp/files.el' --- lisp/files.el 2013-09-11 06:44:35 +0000 +++ lisp/files.el 2013-09-11 12:36:59 +0000 @@ -2679,11 +2679,9 @@ (setq done (assoc-default (file-name-nondirectory mode) (mapcar (lambda (e) - (if (string-match-p "\\`\\\\`" (car e)) - e - (cons - (format "\\`%s\\'" (car e)) - (cdr e)))) + (cons + (format "\\`%s\\'" (car e)) + (cdr e))) interpreter-mode-alist) #'string-match-p)) ;; If we found an interpreter mode to use, invoke it now. ------------------------------------------------------------ revno: 114208 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-09-11 08:28:01 -0400 message: * src/insdel.c (insert_from_buffer_1): Don't mark buffer as modified when insert-buffer-substring an empty string. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 10:24:48 +0000 +++ src/ChangeLog 2013-09-11 12:28:01 +0000 @@ -1,3 +1,8 @@ +2013-09-11 Stefan Monnier + + * insdel.c (insert_from_buffer_1): Don't mark buffer as modified when + insert-buffer-substring an empty string. + 2013-09-11 Paul Eggert * xdisp.c (Ftool_bar_lines_needed): Declare as 'const' if ifdeffed out, === modified file 'src/insdel.c' --- src/insdel.c 2013-08-06 06:53:09 +0000 +++ src/insdel.c 2013-09-11 12:28:01 +0000 @@ -1057,6 +1057,9 @@ ptrdiff_t outgoing_nbytes = incoming_nbytes; INTERVAL intervals; + if (nchars == 0) + return; + /* Make OUTGOING_NBYTES describe the text as it will be inserted in this buffer. */ ------------------------------------------------------------ revno: 114207 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-09-11 03:24:48 -0700 message: * xdisp.c (Ftool_bar_lines_needed): Declare as 'const' if ifdeffed out, avoiding a GCC warning. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 08:56:33 +0000 +++ src/ChangeLog 2013-09-11 10:24:48 +0000 @@ -1,3 +1,8 @@ +2013-09-11 Paul Eggert + + * xdisp.c (Ftool_bar_lines_needed): Declare as 'const' if ifdeffed out, + avoiding a GCC warning. + 2013-09-11 Dmitry Antipov Ifdef away frame tool bar code when it is not really used. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-09-11 08:56:33 +0000 +++ src/xdisp.c 2013-09-11 10:24:48 +0000 @@ -11903,6 +11903,10 @@ #endif /* !USE_GTK && !HAVE_NS */ +#if defined USE_GTK || defined HAVE_NS +EXFUN (Ftool_bar_lines_needed, 1) ATTRIBUTE_CONST; +#endif + DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 0, 1, 0, doc: /* Return the number of lines occupied by the tool bar of FRAME. ------------------------------------------------------------ revno: 114206 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-09-11 06:19:47 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2013-08-05 14:26:57 +0000 +++ lisp/mail/rmail.el 2013-09-11 10:19:47 +0000 @@ -4768,7 +4768,7 @@ ;;;*** -;;;### (autoloads nil "rmailsum" "rmailsum.el" "a9b3bbd9b82dd566524a1209b5cdb7dd") +;;;### (autoloads nil "rmailsum" "rmailsum.el" "9005bd5da3e21d1cc173e86fd9fec3c9") ;;; Generated autoloads from rmailsum.el (autoload 'rmail-summary "rmailsum" "\ ------------------------------------------------------------ revno: 114205 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-09-11 12:56:33 +0400 message: Ifdef away frame tool bar code when it is not really used. * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]: Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string and minimize_tool_bar_window_p under the above. (fset_current_tool_bar_string, fset_desired_tool_bar_string) (fset_tool_bar_window): Likewise. * dispnew.c (clear_current_matrices, clear_desired_matrices) (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame) (change_frame_size_1): * window.c (window_from_coordinates, Frecenter): Adjust users. * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar code is not really used. * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line) (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info) (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight) [!USE_GTK && !HAVE_NS]: Define as such. (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face) (note_mouse_highlight, expose_frame): * xfns.c (x_set_tool_bar_lines): * xterm.c (handle_one_xevent): Adjust users. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 08:24:05 +0000 +++ src/ChangeLog 2013-09-11 08:56:33 +0000 @@ -1,3 +1,26 @@ +2013-09-11 Dmitry Antipov + + Ifdef away frame tool bar code when it is not really used. + * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]: + Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string + and minimize_tool_bar_window_p under the above. + (fset_current_tool_bar_string, fset_desired_tool_bar_string) + (fset_tool_bar_window): Likewise. + * dispnew.c (clear_current_matrices, clear_desired_matrices) + (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame) + (change_frame_size_1): + * window.c (window_from_coordinates, Frecenter): Adjust users. + * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar + code is not really used. + * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line) + (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info) + (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight) + [!USE_GTK && !HAVE_NS]: Define as such. + (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face) + (note_mouse_highlight, expose_frame): + * xfns.c (x_set_tool_bar_lines): + * xterm.c (handle_one_xevent): Adjust users. + 2013-09-11 Paul Eggert Fix corruption with multiple emacsclient -t instances (Bug#15222). === modified file 'src/dispnew.c' --- src/dispnew.c 2013-09-09 16:47:43 +0000 +++ src/dispnew.c 2013-09-11 08:56:33 +0000 @@ -783,9 +783,11 @@ clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); #endif +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Clear the matrix of the tool-bar window, if any. */ if (WINDOWP (f->tool_bar_window)) clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); +#endif /* Clear current window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -806,8 +808,10 @@ clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); #endif +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) if (WINDOWP (f->tool_bar_window)) clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); +#endif /* Do it for window matrices. */ eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); @@ -2041,10 +2045,9 @@ /* Allocate/reallocate window matrices. */ allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f))); -#ifdef HAVE_X_WINDOWS +#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) /* Allocate/ reallocate matrices of the dummy window used to display the menu bar under X when no X toolkit support is available. */ -#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) { /* Allocate a dummy window if not already done. */ struct window *w; @@ -2068,10 +2071,9 @@ w->total_cols = FRAME_TOTAL_COLS (f); allocate_matrices_for_window_redisplay (w); } -#endif /* not USE_X_TOOLKIT && not USE_GTK */ -#endif /* HAVE_X_WINDOWS */ +#endif -#ifndef USE_GTK +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) { /* Allocate/ reallocate matrices of the tool bar window. If we don't have a tool bar window yet, make one. */ @@ -2145,6 +2147,7 @@ } #endif +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Free the tool bar window and its glyph matrices. */ if (!NILP (f->tool_bar_window)) { @@ -2154,6 +2157,7 @@ w->desired_matrix = w->current_matrix = NULL; fset_tool_bar_window (f, Qnil); } +#endif /* Release frame glyph matrices. Reset fields to zero in case we are called a second time. */ @@ -3036,6 +3040,7 @@ update_window (XWINDOW (f->menu_bar_window), 1); #endif +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Update the tool-bar window, if present. */ if (WINDOWP (f->tool_bar_window)) { @@ -3056,7 +3061,7 @@ fset_desired_tool_bar_string (f, tem); } } - +#endif /* Update windows. */ paused_p = update_window_tree (root_window, force_p); @@ -5488,8 +5493,10 @@ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) FrameCols (FRAME_TTY (f)) = newwidth; +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) if (WINDOWP (f->tool_bar_window)) XWINDOW (f->tool_bar_window)->total_cols = newwidth; +#endif } FRAME_LINES (f) = newheight; === modified file 'src/frame.h' --- src/frame.h 2013-09-09 16:47:43 +0000 +++ src/frame.h 2013-09-11 08:56:33 +0000 @@ -145,9 +145,15 @@ Lisp_Object menu_bar_window; #endif +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* A window used to display the tool-bar of a frame. */ Lisp_Object tool_bar_window; + /* Desired and current contents displayed in that window. */ + Lisp_Object desired_tool_bar_string; + Lisp_Object current_tool_bar_string; +#endif + /* Desired and current tool-bar items. */ Lisp_Object tool_bar_items; @@ -155,10 +161,6 @@ tool bar only supports top. */ Lisp_Object tool_bar_position; - /* Desired and current contents displayed in tool_bar_window. */ - Lisp_Object desired_tool_bar_string; - Lisp_Object current_tool_bar_string; - /* Beyond here, there should be no more Lisp_Object components. */ /* Cache of realized faces. */ @@ -197,9 +199,11 @@ /* Set to non-zero when current redisplay has updated frame. */ unsigned updated_p : 1; +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Set to non-zero to minimize tool-bar height even when auto-resize-tool-bar is set to grow-only. */ unsigned minimize_tool_bar_window_p : 1; +#endif #if defined (USE_GTK) || defined (HAVE_NS) /* Nonzero means using a tool bar that comes from the toolkit. */ @@ -455,16 +459,6 @@ f->condemned_scroll_bars = val; } FRAME_INLINE void -fset_current_tool_bar_string (struct frame *f, Lisp_Object val) -{ - f->current_tool_bar_string = val; -} -FRAME_INLINE void -fset_desired_tool_bar_string (struct frame *f, Lisp_Object val) -{ - f->desired_tool_bar_string = val; -} -FRAME_INLINE void fset_face_alist (struct frame *f, Lisp_Object val) { f->face_alist = val; @@ -536,11 +530,23 @@ { f->tool_bar_position = val; } +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) FRAME_INLINE void fset_tool_bar_window (struct frame *f, Lisp_Object val) { f->tool_bar_window = val; } +FRAME_INLINE void +fset_current_tool_bar_string (struct frame *f, Lisp_Object val) +{ + f->current_tool_bar_string = val; +} +FRAME_INLINE void +fset_desired_tool_bar_string (struct frame *f, Lisp_Object val) +{ + f->desired_tool_bar_string = val; +} +#endif /* HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS */ #define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1) === modified file 'src/window.c' --- src/window.c 2013-09-06 07:00:29 +0000 +++ src/window.c 2013-09-11 08:56:33 +0000 @@ -1379,6 +1379,7 @@ cw.window = &window, cw.x = x, cw.y = y; cw.part = part; foreach_window (f, check_window_containing, &cw); +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* If not found above, see if it's in the tool bar window, if a tool bar exists. */ if (NILP (window) @@ -1391,6 +1392,7 @@ *part = ON_TEXT; window = f->tool_bar_window; } +#endif return window; } @@ -5112,9 +5114,9 @@ /* Invalidate pixel data calculated for all compositions. */ for (i = 0; i < n_compositions; i++) composition_table[i]->font = NULL; - +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; - +#endif Fredraw_frame (WINDOW_FRAME (w)); SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); } === modified file 'src/window.h' --- src/window.h 2013-09-05 16:25:20 +0000 +++ src/window.h 2013-09-11 08:56:33 +0000 @@ -525,10 +525,13 @@ #endif /* 1 if W is a tool bar window. */ - +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) #define WINDOW_TOOL_BAR_P(W) \ (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \ && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window)) +#else +#define WINDOW_TOOL_BAR_P(W) (0) +#endif /* Return the frame y-position at which window W starts. This includes a header line, if any. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2013-09-09 16:47:43 +0000 +++ src/xdisp.c 2013-09-11 08:56:33 +0000 @@ -913,11 +913,8 @@ #ifdef HAVE_WINDOW_SYSTEM static void x_consider_frame_title (Lisp_Object); -static int tool_bar_lines_needed (struct frame *, int *); static void update_tool_bar (struct frame *, int); -static void build_desired_tool_bar_string (struct frame *f); static int redisplay_tool_bar (struct frame *); -static void display_tool_bar_line (struct it *, int); static void notice_overwritten_cursor (struct window *, enum glyph_row_area, int, int, int, int); @@ -11566,6 +11563,7 @@ } } +#if ! defined (USE_GTK) && ! defined (HAVE_NS) /* Set F->desired_tool_bar_string to a Lisp string representing frame F's desired tool-bar contents. F->tool_bar_items must have @@ -11903,6 +11901,7 @@ return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); } +#endif /* !USE_GTK && !HAVE_NS */ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 0, 1, 0, @@ -11910,9 +11909,10 @@ If FRAME is nil or omitted, use the selected frame. */) (Lisp_Object frame) { + int nlines = 0; +#if ! defined (USE_GTK) && ! defined (HAVE_NS) struct frame *f = decode_any_frame (frame); struct window *w; - int nlines = 0; if (WINDOWP (f->tool_bar_window) && (w = XWINDOW (f->tool_bar_window), @@ -11925,7 +11925,7 @@ nlines = tool_bar_lines_needed (f, NULL); } } - +#endif return make_number (nlines); } @@ -11936,15 +11936,17 @@ static int redisplay_tool_bar (struct frame *f) { - struct window *w; - struct it it; - struct glyph_row *row; +#if defined (USE_GTK) || defined (HAVE_NS) -#if defined (USE_GTK) || defined (HAVE_NS) if (FRAME_EXTERNAL_TOOL_BAR (f)) update_frame_tool_bar (f); return 0; -#endif + +#else /* !USE_GTK && !HAVE_NS */ + + struct window *w; + struct it it; + struct glyph_row *row; /* If frame hasn't a tool-bar window or if it is zero-height, don't do anything. This means you must start with tool-bar-lines @@ -12100,8 +12102,11 @@ f->minimize_tool_bar_window_p = 0; return 0; + +#endif /* USE_GTK || HAVE_NS */ } +#if ! defined (USE_GTK) && ! defined (HAVE_NS) /* Get information about the tool-bar item which is displayed in GLYPH on frame F. Return in *PROP_IDX the index where tool-bar item @@ -12345,6 +12350,8 @@ help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); } +#endif /* !USE_GTK && !HAVE_NS */ + #endif /* HAVE_WINDOW_SYSTEM */ @@ -26691,10 +26698,13 @@ /* Change the mouse cursor. */ if (FRAME_WINDOW_P (f)) { +#if ! defined (USE_GTK) && ! defined (HAVE_NS) if (draw == DRAW_NORMAL_TEXT && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); - else if (draw == DRAW_MOUSE_FACE) + else +#endif + if (draw == DRAW_MOUSE_FACE) FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); else FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); @@ -28032,7 +28042,7 @@ w = XWINDOW (window); frame_to_window_pixel_xy (w, &x, &y); -#ifdef HAVE_WINDOW_SYSTEM +#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS) /* Handle tool-bar window differently since it doesn't display a buffer. */ if (EQ (window, f->tool_bar_window)) @@ -28945,9 +28955,11 @@ TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r); +#if ! defined (USE_GTK) && ! defined (HAVE_NS) if (WINDOWP (f->tool_bar_window)) mouse_face_overwritten_p |= expose_window (XWINDOW (f->tool_bar_window), &r); +#endif #ifdef HAVE_X_WINDOWS #ifndef MSDOS === modified file 'src/xfns.c' --- src/xfns.c 2013-09-06 07:00:29 +0000 +++ src/xfns.c 2013-09-11 08:56:33 +0000 @@ -1215,8 +1215,11 @@ void x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) { - int delta, nlines, root_height; + int nlines; +#if ! defined (USE_GTK) + int delta, root_height; Lisp_Object root_window; +#endif /* Treat tool bars like menu bars. */ if (FRAME_MINIBUF_ONLY_P (f)) @@ -1229,6 +1232,7 @@ nlines = 0; #ifdef USE_GTK + FRAME_TOOL_BAR_LINES (f) = 0; if (nlines) { @@ -1245,8 +1249,7 @@ FRAME_EXTERNAL_TOOL_BAR (f) = 0; } - return; -#endif +#else /* !USE_GTK */ /* Make sure we redisplay all windows in this frame. */ ++windows_or_buffers_changed; @@ -1301,7 +1304,7 @@ } run_window_configuration_change_hook (f); - +#endif /* USE_GTK */ } === modified file 'src/xterm.c' --- src/xterm.c 2013-09-09 12:15:45 +0000 +++ src/xterm.c 2013-09-11 08:56:33 +0000 @@ -6225,6 +6225,7 @@ f = x_any_window_to_frame (dpyinfo, event.xkey.window); +#if ! defined (USE_GTK) /* If mouse-highlight is an integer, input clears out mouse highlighting. */ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) @@ -6234,6 +6235,7 @@ clear_mouse_face (hlinfo); hlinfo->mouse_face_hidden = 1; } +#endif #if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS if (f == 0) @@ -6773,6 +6775,7 @@ #endif if (f) { +#if ! defined (USE_GTK) /* Is this in the tool-bar? */ if (WINDOWP (f->tool_bar_window) && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) @@ -6785,13 +6788,11 @@ tool_bar_p = EQ (window, f->tool_bar_window); if (tool_bar_p && event.xbutton.button < 4) - { - handle_tool_bar_click (f, x, y, - event.xbutton.type == ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, - event.xbutton.state)); - } + handle_tool_bar_click + (f, x, y, event.xbutton.type == ButtonPress, + x_x_to_emacs_modifiers (dpyinfo, event.xbutton.state)); } +#endif /* !USE_GTK */ if (!tool_bar_p) #if defined (USE_X_TOOLKIT) || defined (USE_GTK) ------------------------------------------------------------ revno: 114204 fixes bug: http://debbugs.gnu.org/15222 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-09-11 01:24:05 -0700 message: Fix corruption with multiple emacsclient -t instances. This bug was introduced by my 2013-08-26 patch, which incorrectly assumed that the terminfo implementation doesn't use termcap buffers. * term.c (init_tty) [TERMINFO]: Remove optimization, as these buffers apparently are used after all. * termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too. (struct tty_display_info): Define members termcap_term_buffer and termcap_strings_buffer even if TERMINFO. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 07:20:20 +0000 +++ src/ChangeLog 2013-09-11 08:24:05 +0000 @@ -1,3 +1,14 @@ +2013-09-11 Paul Eggert + + Fix corruption with multiple emacsclient -t instances (Bug#15222). + This bug was introduced by my 2013-08-26 patch, which incorrectly + assumed that the terminfo implementation doesn't use termcap buffers. + * term.c (init_tty) [TERMINFO]: Remove optimization, as + these buffers apparently are used after all. + * termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too. + (struct tty_display_info): Define members termcap_term_buffer and + termcap_strings_buffer even if TERMINFO. + 2013-09-11 Dmitry Antipov Fix last change. === modified file 'src/term.c' --- src/term.c 2013-09-06 16:40:12 +0000 +++ src/term.c 2013-09-11 08:24:05 +0000 @@ -2917,12 +2917,8 @@ struct terminal * init_tty (const char *name, const char *terminal_type, bool must_succeed) { -#ifdef TERMINFO - char **address = 0; -#else char *area; char **address = &area; -#endif int status; struct tty_display_info *tty = NULL; struct terminal *terminal = NULL; @@ -3013,13 +3009,9 @@ /* On some systems, tgetent tries to access the controlling terminal. */ block_tty_out_signal (); -#ifdef TERMINFO - status = tgetent (0, terminal_type); -#else status = tgetent (tty->termcap_term_buffer, terminal_type); if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1]) emacs_abort (); -#endif unblock_tty_out_signal (); if (status < 0) @@ -3050,9 +3042,7 @@ terminal_type); } -#ifndef TERMINFO area = tty->termcap_strings_buffer; -#endif tty->TS_ins_line = tgetstr ("al", address); tty->TS_ins_multi_lines = tgetstr ("AL", address); tty->TS_bell = tgetstr ("bl", address); === modified file 'src/termchar.h' --- src/termchar.h 2013-08-27 03:52:21 +0000 +++ src/termchar.h 2013-09-11 08:24:05 +0000 @@ -30,9 +30,7 @@ /* There is nothing else here at the moment... */ }; -#ifndef TERMINFO enum { TERMCAP_BUFFER_SIZE = 4096 }; -#endif /* Parameters that are shared between frames on the same tty device. */ @@ -78,7 +76,6 @@ mouse-face. */ Mouse_HLInfo mouse_highlight; -#ifndef TERMINFO /* Buffer used internally by termcap (see tgetent in the Termcap manual). Only init_tty should use this. */ char termcap_term_buffer[TERMCAP_BUFFER_SIZE]; @@ -86,7 +83,6 @@ /* Buffer storing terminal description strings (see tgetstr in the Termcap manual). Only init_tty should use this. */ char termcap_strings_buffer[TERMCAP_BUFFER_SIZE]; -#endif /* Strings, numbers and flags taken from the termcap entry. */ ------------------------------------------------------------ revno: 114203 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-09-11 11:20:20 +0400 message: Fix last change. * data.c (Feqlsign, Flss, Fgtr, Fleq, Fgeq): Add convenient 'usage' docstring entry to pacify make-docfile. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-09-11 02:41:00 +0000 +++ src/ChangeLog 2013-09-11 07:20:20 +0000 @@ -1,3 +1,18 @@ +2013-09-11 Dmitry Antipov + + Fix last change. + * data.c (Feqlsign, Flss, Fgtr, Fleq, Fgeq): Add convenient + 'usage' docstring entry to pacify make-docfile. + +2013-09-11 Barry O'Reilly + + Change comparison functions =, <, >, <=, >= to take many arguments. + * data.c: Change comparison functions' interface and implementation. + * lisp.h: Make arithcompare available for efficient two arg + comparisons. + * bytecode.c: Use arithcompare. + * fileio.c: Use new interface. + 2013-09-11 Stefan Monnier * keyboard.c (read_char): Don't break immediate_echo (bug#15332). === modified file 'src/data.c' --- src/data.c 2013-09-11 05:03:23 +0000 +++ src/data.c 2013-09-11 07:20:20 +0000 @@ -2321,21 +2321,24 @@ } DEFUN ("=", Feqlsign, Seqlsign, 1, MANY, 0, - doc: /* Return t if args, all numbers or markers, are equal. */) + doc: /* Return t if args, all numbers or markers, are equal. +usage: (= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { return arithcompare_driver (nargs, args, ARITH_EQUAL); } DEFUN ("<", Flss, Slss, 1, MANY, 0, - doc: /* Return t if each arg is less than the next arg. All must be numbers or markers. */) + doc: /* Return t if each arg is less than the next arg. All must be numbers or markers. +usage: (< NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { return arithcompare_driver (nargs, args, ARITH_LESS); } DEFUN (">", Fgtr, Sgtr, 1, MANY, 0, - doc: /* Return t if each arg is greater than the next arg. All must be numbers or markers. */) + doc: /* Return t if each arg is greater than the next arg. All must be numbers or markers. +usage: (> NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { return arithcompare_driver (nargs, args, ARITH_GRTR); @@ -2343,7 +2346,8 @@ DEFUN ("<=", Fleq, Sleq, 1, MANY, 0, doc: /* Return t if each arg is less than or equal to the next arg. -All must be numbers or markers. */) +All must be numbers or markers. +usage: (<= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { return arithcompare_driver (nargs, args, ARITH_LESS_OR_EQUAL); @@ -2351,7 +2355,8 @@ DEFUN (">=", Fgeq, Sgeq, 1, MANY, 0, doc: /* Return t if each arg is greater than or equal to the next arg. -All must be numbers or markers. */) +All must be numbers or markers. +usage: (= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { return arithcompare_driver (nargs, args, ARITH_GRTR_OR_EQUAL); ------------------------------------------------------------ revno: 114202 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-09-10 23:44:35 -0700 message: Improve previous interpreter-mode-alist change * lisp/files.el (interpreter-mode-alist): Remove \\` \\' parts. (set-auto-mode): Don't regexp-quote elements. * lisp/progmodes/python.el (interpreter-mode-alist): Remove \\` \\'. * lisp/progmodes/cc-mode.el (interpreter-mode-alist): * lisp/progmodes/ruby-mode.el (interpreter-mode-alist): Revert previous change. * etc/NEWS: Update. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-09-11 05:03:23 +0000 +++ etc/NEWS 2013-09-11 06:44:35 +0000 @@ -616,11 +616,9 @@ in the presence of files with negative time stamps. ** The cars of the elements in `interpreter-mode-alist' are now treated -as regexps rather than literal strings. For the time being, any -element whose car does not start with "\\" is still treated as a -literal string, so this change should not cause any incompatibilities -if you have code that just adds elements to the list, only if you are -actually using interpreter-mode-alist for something. +as regexps rather than literal strings. Technically this is an +incompatible change, but unless you are using interpreter-mode-alist +for something (not just adding elements to it), it ought not to affect you. * Lisp Changes in Emacs 24.4 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-09-11 03:31:56 +0000 +++ lisp/ChangeLog 2013-09-11 06:44:35 +0000 @@ -1,3 +1,12 @@ +2013-09-11 Glenn Morris + + * files.el (interpreter-mode-alist): Remove \\` \\' parts. + (set-auto-mode): Don't regexp-quote elements. + * progmodes/python.el (interpreter-mode-alist): Remove \\` \\'. + * progmodes/cc-mode.el (interpreter-mode-alist): + * progmodes/ruby-mode.el (interpreter-mode-alist): + Revert previous change. + 2013-09-11 Stefan Monnier * play/snake.el (snake-mode): === modified file 'lisp/files.el' --- lisp/files.el 2013-09-10 20:38:52 +0000 +++ lisp/files.el 2013-09-11 06:44:35 +0000 @@ -2447,43 +2447,34 @@ (mapcar (lambda (l) (cons (purecopy (car l)) (cdr l))) - '(("\\`\\(mini\\)?perl5?\\'" . perl-mode) - ("\\`wishx?\\'" . tcl-mode) - ("\\`tcl\\(sh\\)?\\'" . tcl-mode) - ("\\`expect\\'" . tcl-mode) - ("\\`scm\\'" . scheme-mode) - ("\\`[acjkwz]sh\\'" . sh-mode) - ("\\`bash2?\\'" . sh-mode) - ("\\`dtksh\\'" . sh-mode) - ("\\`es\\'" . sh-mode) - ("\\`itcsh\\'" . sh-mode) - ("\\`oash\\'" . sh-mode) - ("\\`pdksh\\'" . sh-mode) - ("\\`rbash\\'" . sh-mode) - ("\\`rc\\'" . sh-mode) - ("\\`rpm\\'" . sh-mode) - ("\\`sh5?\\'" . sh-mode) - ("\\`tcsh\\'" . sh-mode) - ("\\`wksh\\'" . sh-mode) - ("\\`tail\\'" . text-mode) - ("\\`more\\'" . text-mode) - ("\\`less\\'" . text-mode) - ("\\`pg\\'" . text-mode) - ("\\`make\\'" . makefile-gmake-mode) ; Debian uses this - ("\\`guile\\'" . scheme-mode) - ("\\`clisp\\'" . lisp-mode) - ("\\`emacs\\'" . emacs-lisp-mode))) + '(("\\(mini\\)?perl5?" . perl-mode) + ("wishx?" . tcl-mode) + ("tcl\\(sh\\)?" . tcl-mode) + ("expect" . tcl-mode) + ("scm" . scheme-mode) + ("[acjkwz]sh" . sh-mode) + ("r?bash2?" . sh-mode) + ("\\(dt\\|pd\\|w\\)ksh" . sh-mode) + ("es" . sh-mode) + ("i?tcsh" . sh-mode) + ("oash" . sh-mode) + ("rc" . sh-mode) + ("rpm" . sh-mode) + ("sh5?" . sh-mode) + ("tail" . text-mode) + ("more" . text-mode) + ("less" . text-mode) + ("pg" . text-mode) + ("make" . makefile-gmake-mode) ; Debian uses this + ("guile" . scheme-mode) + ("clisp" . lisp-mode) + ("emacs" . emacs-lisp-mode))) "Alist mapping interpreter names to major modes. This is used for files whose first lines match `auto-mode-interpreter-regexp'. Each element looks like (REGEXP . MODE). -If REGEXP matches the name (minus any directory part) of the interpreter -specified in the first line of a script, enable major mode MODE. - -Emacs versions earlier than 24.4 treat the car of each element as a -literal string that must match the entire name, rather than a regexp. -For backwards compatibility, any REGEXP that does not begin with \"\\\\\" -continues to be treated in this way. This behavior may be removed in -future and should not be relied upon. +If \\\\`REGEXP\\\\' matches the name (minus any directory part) of +the interpreter specified in the first line of a script, enable +major mode MODE. See also `auto-mode-alist'.") @@ -2687,13 +2678,11 @@ ;; same time. (setq done (assoc-default (file-name-nondirectory mode) - ;; Backwards compat: if car of i-m-alist does not start - ;; with "\\", treat as literal string. (mapcar (lambda (e) - (if (string-match-p "\\`\\\\" (car e)) + (if (string-match-p "\\`\\\\`" (car e)) e (cons - (format "\\`%s\\'" (regexp-quote (car e))) + (format "\\`%s\\'" (car e)) (cdr e)))) interpreter-mode-alist) #'string-match-p)) === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2013-09-10 20:38:52 +0000 +++ lisp/progmodes/cc-mode.el 2013-09-11 06:44:35 +0000 @@ -1555,7 +1555,7 @@ (cons "Pike" (c-lang-const c-mode-menu pike))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode)) -;;;###autoload (add-to-list 'interpreter-mode-alist '("\\`pike\\'" . pike-mode)) +;;;###autoload (add-to-list 'interpreter-mode-alist '("pike" . pike-mode)) ;;;###autoload (define-derived-mode pike-mode prog-mode "Pike" @@ -1589,7 +1589,10 @@ ;; Support for AWK ;;;###autoload (add-to-list 'auto-mode-alist '("\\.awk\\'" . awk-mode)) -;;;###autoload (add-to-list 'interpreter-mode-alist '("\\`[gmn]?awk\\'" . awk-mode)) +;;;###autoload (add-to-list 'interpreter-mode-alist '("awk" . awk-mode)) +;;;###autoload (add-to-list 'interpreter-mode-alist '("mawk" . awk-mode)) +;;;###autoload (add-to-list 'interpreter-mode-alist '("nawk" . awk-mode)) +;;;###autoload (add-to-list 'interpreter-mode-alist '("gawk" . awk-mode)) (c-define-abbrev-table 'awk-mode-abbrev-table '(("else" "else" c-electric-continued-statement 0) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-09-10 20:46:25 +0000 +++ lisp/progmodes/python.el 2013-09-11 06:44:35 +0000 @@ -225,7 +225,7 @@ ;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode)) ;;;###autoload -(add-to-list 'interpreter-mode-alist (cons (purecopy "\\`python[0-9.]*\\'") 'python-mode)) +(add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) (defgroup python nil "Python Language's flying circus support for Emacs." === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-09-10 20:38:52 +0000 +++ lisp/progmodes/ruby-mode.el 2013-09-11 06:44:35 +0000 @@ -1968,7 +1968,8 @@ "\\)\\'")) 'ruby-mode)) ;;;###autoload -(add-to-list 'interpreter-mode-alist (cons (purecopy "\\`\\(rbx\\|j?ruby\\(1\\.[89]\\)?\\)\\'") 'ruby-mode)) +(dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) + (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode))) (provide 'ruby-mode)