Now on revision 109438. ------------------------------------------------------------ revno: 109438 fixes bug: http://debbugs.gnu.org/12013 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-08-04 22:24:50 -0700 message: * lisp/eshell/esh-ext.el (eshell/addpath): Also update eshell-path-env. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 04:19:21 +0000 +++ lisp/ChangeLog 2012-08-05 05:24:50 +0000 @@ -1,7 +1,11 @@ +2012-08-05 Glenn Morris + + * eshell/esh-ext.el (eshell/addpath): + Also update eshell-path-env. (Bug#12013) + 2012-08-05 Chong Yidong - * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc - fixes. + * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc fixes. * fringe.el (fringe-styles): Add docstring. (fringe--check-mode): New function. === modified file 'lisp/eshell/esh-ext.el' --- lisp/eshell/esh-ext.el 2012-07-11 23:13:41 +0000 +++ lisp/eshell/esh-ext.el 2012-08-05 05:24:50 +0000 @@ -235,7 +235,8 @@ (getenv "PATH")) (concat (getenv "PATH") path-separator (car args)))) - (setq args (cdr args)))) + (setq args (cdr args))) + (setq eshell-path-env (getenv "PATH"))) (let ((paths (parse-colon-path (getenv "PATH")))) (while paths (eshell-printn (car paths)) ------------------------------------------------------------ revno: 109437 fixes bug: http://debbugs.gnu.org/11979 author: Ulrich Müller committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-08-04 22:00:52 -0700 message: * configure.ac: Disable paxctl if binaries don't have a PT_PAX_FLAGS header. diff: === modified file 'ChangeLog' --- ChangeLog 2012-08-03 10:02:48 +0000 +++ ChangeLog 2012-08-05 05:00:52 +0000 @@ -1,3 +1,8 @@ +2012-08-05 Ulrich Müller + + * configure.ac: Disable paxctl if binaries don't have a + PT_PAX_FLAGS program header. (Bug#11979) + 2012-08-03 Eli Zaretskii * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/stat-time.$(O), === modified file 'configure.ac' --- configure.ac 2012-08-03 20:34:35 +0000 +++ configure.ac 2012-08-05 05:00:52 +0000 @@ -731,6 +731,12 @@ if test $opsys = gnu-linux; then AC_PATH_PROG(PAXCTL, paxctl,, [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) + if test "X$PAXCTL" != X; then + AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then AC_MSG_RESULT(yes) + else AC_MSG_RESULT(no); PAXCTL=""; fi]) + fi fi ## Need makeinfo >= 4.7 (?) to build the manuals. ------------------------------------------------------------ revno: 109436 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 12:19:21 +0800 message: * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc fixes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 03:52:02 +0000 +++ lisp/ChangeLog 2012-08-05 04:19:21 +0000 @@ -1,5 +1,8 @@ 2012-08-05 Chong Yidong + * wdired.el (wdired-mode, wdired-change-to-wdired-mode): Doc + fixes. + * fringe.el (fringe-styles): Add docstring. (fringe--check-mode): New function. (set-fringe-mode, set-fringe-style): Use it. === modified file 'lisp/wdired.el' --- lisp/wdired.el 2012-07-11 23:13:41 +0000 +++ lisp/wdired.el 2012-08-05 04:19:21 +0000 @@ -183,14 +183,21 @@ (defun wdired-mode () - "Writable Dired mode. + "Writable Dired (WDired) mode. \\ -Press \\[wdired-finish-edit] to make the changes to take effect -and exit. To abort the edit, use \\[wdired-abort-changes]. - -In this mode you can edit the names of the files, the target of -the links and the permission bits of the files. You can use -\\[customize-group] RET wdired to customize WDired behavior. +In WDired mode, you can edit the names of the files in the +buffer, the target of the links, and the permission bits of the +files. + +Type \\[wdired-finish-edit] to exit WDired mode, returning to +Dired mode, and make your edits \"take effect\" by modifying the +file and directory names, link targets, and/or file permissions +on disk. If you delete the filename of a file, it is flagged for +deletion in the Dired buffer. + +Type \\[wdired-abort-changes] to abort your edits and exit WDired mode. + +Type \\[customize-group] RET wdired to customize WDired behavior. The only editable texts in a WDired buffer are filenames, symbolic link targets, and filenames permission." @@ -201,16 +208,17 @@ ;;;###autoload (defun wdired-change-to-wdired-mode () - "Put a dired buffer in a mode in which filenames are editable. + "Put a Dired buffer in Writable Dired (WDired) mode. \\ -This mode allows the user to change the names of the files, and after -typing \\[wdired-finish-edit] Emacs renames the files and directories -in disk. +In WDired mode, you can edit the names of the files in the +buffer, the target of the links, and the permission bits of the +files. After typing \\[wdired-finish-edit], Emacs modifies the files and +directories to reflect your edits. See `wdired-mode'." (interactive) - (or (eq major-mode 'dired-mode) - (error "Not a Dired buffer")) + (unless (eq major-mode 'dired-mode) + (error "Not a Dired buffer")) (set (make-local-variable 'wdired-old-content) (buffer-substring (point-min) (point-max))) (set (make-local-variable 'wdired-old-point) (point)) ------------------------------------------------------------ revno: 109435 fixes bug: http://debbugs.gnu.org/6480 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 11:52:02 +0800 message: * fringe.el: Docstring and minor code improvements. (fringe-styles): Add docstring. (fringe--check-style): New function. (set-fringe-mode, set-fringe-style): Use it. (fringe-mode, set-fringe-style): Doc fixes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-05 03:03:31 +0000 +++ lisp/ChangeLog 2012-08-05 03:52:02 +0000 @@ -1,5 +1,10 @@ 2012-08-05 Chong Yidong + * fringe.el (fringe-styles): Add docstring. + (fringe--check-mode): New function. + (set-fringe-mode, set-fringe-style): Use it. + (fringe-mode, set-fringe-style): Doc fixes (Bug#6480). + * files.el (set-auto-mode): Fix invalid setq call. 2012-08-04 Stefan Monnier === modified file 'lisp/fringe.el' --- lisp/fringe.el 2012-07-14 11:44:39 +0000 +++ lisp/fringe.el 2012-08-05 03:52:02 +0000 @@ -105,8 +105,8 @@ (defun set-fringe-mode (value) "Set `fringe-mode' to VALUE and put the new value into effect. See `fringe-mode' for possible values and their effect." + (fringe--check-style value) (setq fringe-mode value) - (when fringe-mode-explicit (modify-all-frames-parameters (list (cons 'left-fringe (if (consp fringe-mode) @@ -116,6 +116,14 @@ (cdr fringe-mode) fringe-mode)))))) +(defun fringe--check-style (style) + (or (null style) + (integerp style) + (and (consp style) + (or (null (car style)) (integerp (car style))) + (or (null (cdr style)) (integerp (cdr style)))) + (error "Invalid fringe style `%s'" style))) + ;; For initialization of fringe-mode, take account of changes ;; made explicitly to default-frame-alist. (defun fringe-mode-initialize (symbol value) @@ -141,24 +149,40 @@ ("right-only" . (0 . nil)) ("left-only" . (nil . 0)) ("half-width" . (4 . 4)) - ("minimal" . (1 . 1)))) + ("minimal" . (1 . 1))) + "Alist mapping fringe mode names to fringe widths. +Each list element has the form (NAME . WIDTH), where NAME is a +mnemonic fringe mode name (a symbol) and WIDTH is one of the +following: +- nil, which means the default width (8 pixels). +- a cons cell (LEFT . RIGHT), where LEFT and RIGHT are + respectively the left and right fringe widths in pixels, or + nil (meaning to disable that fringe). +- a single integer, which specifies the pixel widths of both + fringes.") (defcustom fringe-mode nil - "Specify appearance of fringes on all frames. -This variable can be nil (the default) meaning the fringes should have -the default width (8 pixels), it can be an integer value specifying -the width of both left and right fringe (where 0 means no fringe), or -a cons cell where car indicates width of left fringe and cdr indicates -width of right fringe (where again 0 can be used to indicate no -fringe). -Note that the actual width may be rounded up to ensure that the sum of -the width of the left and right fringes is a multiple of the frame's -character width. However, a fringe width of 0 is never rounded. -To set this variable in a Lisp program, use `set-fringe-mode' to make -it take real effect. -Setting the variable with a customization buffer also takes effect. -If you only want to modify the appearance of the fringe in one frame, -you can use the interactive function `set-fringe-style'." + "Default appearance of fringes on all frames. +The Lisp value should be one of the following: +- nil, which means the default width (8 pixels). +- a cons cell (LEFT . RIGHT), where LEFT and RIGHT are + respectively the left and right fringe widths in pixels, or + nil (meaning to disable that fringe). +- a single integer, which specifies the pixel widths of both + fringes. +Note that the actual width may be rounded up to ensure that the +sum of the width of the left and right fringes is a multiple of +the frame's character width. However, a fringe width of 0 is +never rounded. + +When setting this variable from Customize, the user can choose +from the mnemonic fringe mode names defined in `fringe-styles'. + +When setting this variable in a Lisp program, call +`set-fringe-mode' afterward to make it take real effect. + +To modify the appearance of the fringe in a specific frame, use +the interactive function `set-fringe-style'." :type `(choice ,@ (mapcar (lambda (style) (let ((name @@ -195,30 +219,31 @@ ": ") fringe-styles nil t)) (style (assoc (downcase mode) fringe-styles))) - (if style (cdr style) - (if (eq 0 (cdr (assq 'left-fringe - (if all-frames - default-frame-alist - (frame-parameters (selected-frame)))))) - nil - 0)))) + (cond + (style + (cdr style)) + ((not (eq 0 (cdr (assq 'left-fringe + (if all-frames + default-frame-alist + (frame-parameters)))))) + 0)))) (defun fringe-mode (&optional mode) "Set the default appearance of fringes on all frames. - -When called interactively, query the user for MODE. Valid values -for MODE include `no-fringes', `default', `left-only', `right-only', -`minimal' and `half-width'. - -When used in a Lisp program, MODE can be a cons cell where the -integer in car specifies the left fringe width and the integer in -cdr specifies the right fringe width. MODE can also be a single -integer that specifies both the left and the right fringe width. -If a fringe width specification is nil, that means to use the -default width (8 pixels). This command may round up the left and -right width specifications to ensure that their sum is a multiple -of the character width of a frame. It never rounds up a fringe -width of 0. +When called interactively, query the user for MODE; valid values +are `no-fringes', `default', `left-only', `right-only', `minimal' +and `half-width'. See `fringe-styles'. + +When used in a Lisp program, MODE should be one of these: +- nil, which means the default width (8 pixels). +- a cons cell (LEFT . RIGHT), where LEFT and RIGHT are + respectively the left and right fringe widths in pixels, or + nil (meaning to disable that fringe). +- a single integer, which specifies the pixel widths of both + fringes. +This command may round up the left and right width specifications +to ensure that their sum is a multiple of the character width of +a frame. It never rounds up a fringe width of 0. Fringe widths set by `set-window-fringes' override the default fringe widths set by this command. This command applies to all @@ -230,26 +255,27 @@ (defun set-fringe-style (&optional mode) "Set the default appearance of fringes on the selected frame. - -When called interactively, query the user for MODE. Valid values -for MODE include `none', `default', `left-only', `right-only', -`minimal' and `half'. - -When used in a Lisp program, MODE can be a cons cell where the -integer in car specifies the left fringe width and the integer in -cdr specifies the right fringe width. MODE can also be a single -integer that specifies both the left and the right fringe width. -If a fringe width specification is nil, that means to use the -default width (8 pixels). This command may round up the left and -right width specifications to ensure that their sum is a multiple -of the character width of a frame. It never rounds up a fringe -width of 0. +When called interactively, query the user for MODE; valid values +are `no-fringes', `default', `left-only', `right-only', `minimal' +and `half-width'. See `fringe-styles'. + +When used in a Lisp program, MODE should be one of these: +- nil, which means the default width (8 pixels). +- a cons cell (LEFT . RIGHT), where LEFT and RIGHT are + respectively the left and right fringe widths in pixels, or + nil (meaning to disable that fringe). +- a single integer, which specifies the pixel widths of both + fringes. +This command may round up the left and right width specifications +to ensure that their sum is a multiple of the character width of +a frame. It never rounds up a fringe width of 0. Fringe widths set by `set-window-fringes' override the default fringe widths set by this command. If you want to set the default appearance of fringes on all frames, see the command `fringe-mode'." (interactive (list (fringe-query-style))) + (fringe--check-style mode) (modify-frame-parameters (selected-frame) (list (cons 'left-fringe (if (consp mode) (car mode) mode)) ------------------------------------------------------------ revno: 109434 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-05 11:03:31 +0800 message: * files.el (set-auto-mode): Fix invalid setq call. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-04 22:31:04 +0000 +++ lisp/ChangeLog 2012-08-05 03:03:31 +0000 @@ -1,3 +1,7 @@ +2012-08-05 Chong Yidong + + * files.el (set-auto-mode): Fix invalid setq call. + 2012-08-04 Stefan Monnier * isearch.el: Misc simplification; use defstruct. === modified file 'lisp/files.el' --- lisp/files.el 2012-08-03 10:23:30 +0000 +++ lisp/files.el 2012-08-05 03:03:31 +0000 @@ -2734,7 +2734,7 @@ (cadr mode)) (setq mode (car mode) name (substring name 0 (match-beginning 0))) - (setq name)) + (setq name nil)) (when mode (set-auto-mode-0 mode keep-mode-if-same) (setq done t)))))) ------------------------------------------------------------ revno: 109433 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2012-08-04 18:31:04 -0400 message: * lisp/isearch.el: Misc simplification; use defstruct. (isearch-mode-map): Dense maps now work like sparse ones. (isearch--state): New defstruct. (isearch-string-state, isearch-message-state, isearch-point-state) (isearch-success-state, isearch-forward-state) (isearch-other-end-state, isearch-word-state, isearch-error-state) (isearch-wrapped-state, isearch-barrier-state) (isearch-case-fold-search-state, isearch-pop-fun-state): Remove, replaced by defstruct's accessors. (isearch--set-state): Rename from isearch-top-state and change calling convention. (isearch-push-state): Use new isearch--get-state. (isearch-toggle-word): Disable regexp when enabling word. (isearch-message-prefix): Remove unused arg _c-q-hack. (isearch-message-suffix): Remove unused arg _ellipsis. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-04 08:09:24 +0000 +++ lisp/ChangeLog 2012-08-04 22:31:04 +0000 @@ -1,3 +1,21 @@ +2012-08-04 Stefan Monnier + + * isearch.el: Misc simplification; use defstruct. + (isearch-mode-map): Dense maps now work like sparse ones. + (isearch--state): New defstruct. + (isearch-string-state, isearch-message-state, isearch-point-state) + (isearch-success-state, isearch-forward-state) + (isearch-other-end-state, isearch-word-state, isearch-error-state) + (isearch-wrapped-state, isearch-barrier-state) + (isearch-case-fold-search-state, isearch-pop-fun-state): Remove, + replaced by defstruct's accessors. + (isearch--set-state): Rename from isearch-top-state and change + calling convention. + (isearch-push-state): Use new isearch--get-state. + (isearch-toggle-word): Disable regexp when enabling word. + (isearch-message-prefix): Remove unused arg _c-q-hack. + (isearch-message-suffix): Remove unused arg _ellipsis. + 2012-08-04 Andreas Schwab * simple.el (list-processes--refresh): For a server use :host or === modified file 'lisp/isearch.el' --- lisp/isearch.el 2012-07-18 09:27:23 +0000 +++ lisp/isearch.el 2012-08-04 22:31:04 +0000 @@ -57,6 +57,7 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) ;; Some additional options and constants. @@ -413,13 +414,6 @@ ;; Make function keys, etc, which aren't bound to a scrolling-function ;; exit the search. (define-key map [t] 'isearch-other-control-char) - ;; Control chars, by default, end isearch mode transparently. - ;; We need these explicit definitions because, in a dense keymap, - ;; the binding for t does not affect characters. - ;; We use a dense keymap to save space. - (while (< i ?\s) - (define-key map (make-string 1 i) 'isearch-other-control-char) - (setq i (1+ i))) ;; Single-byte printing chars extend the search string by default. (setq i ?\s) @@ -434,8 +428,8 @@ ;; default local key binding for any key not otherwise bound. (let ((meta-map (make-sparse-keymap))) (define-key map (char-to-string meta-prefix-char) meta-map) - (define-key map [escape] meta-map)) - (define-key map (vector meta-prefix-char t) 'isearch-other-meta-char) + (define-key map [escape] meta-map) + (define-key meta-map [t] 'isearch-other-meta-char)) ;; Several non-printing chars change the searching behavior. (define-key map "\C-s" 'isearch-repeat-forward) @@ -965,9 +959,10 @@ (before (if (bobp) nil (get-text-property (1- (point)) 'intangible)))) (when (and before after (eq before after)) - (if isearch-forward - (goto-char (next-single-property-change (point) 'intangible)) - (goto-char (previous-single-property-change (point) 'intangible))))) + (goto-char + (if isearch-forward + (next-single-property-change (point) 'intangible) + (previous-single-property-change (point) 'intangible))))) (if (and (> (length isearch-string) 0) (not nopush)) ;; Update the ring data. @@ -1007,73 +1002,58 @@ ;; The search status structure and stack. -(defsubst isearch-string-state (frame) - "Return the search string in FRAME." - (aref frame 0)) -(defsubst isearch-message-state (frame) - "Return the search string to display to the user in FRAME." - (aref frame 1)) -(defsubst isearch-point-state (frame) - "Return the point in FRAME." - (aref frame 2)) -(defsubst isearch-success-state (frame) - "Return the success flag in FRAME." - (aref frame 3)) -(defsubst isearch-forward-state (frame) - "Return the searching-forward flag in FRAME." - (aref frame 4)) -(defsubst isearch-other-end-state (frame) - "Return the other end of the match in FRAME." - (aref frame 5)) -(defsubst isearch-word-state (frame) - "Return the search-by-word flag in FRAME." - (aref frame 6)) -(defsubst isearch-error-state (frame) - "Return the regexp error message in FRAME, or nil if its regexp is valid." - (aref frame 7)) -(defsubst isearch-wrapped-state (frame) - "Return the search-wrapped flag in FRAME." - (aref frame 8)) -(defsubst isearch-barrier-state (frame) - "Return the barrier value in FRAME." - (aref frame 9)) -(defsubst isearch-case-fold-search-state (frame) - "Return the case-folding flag in FRAME." - (aref frame 10)) -(defsubst isearch-pop-fun-state (frame) - "Return the function restoring the mode-specific Isearch state in FRAME." - (aref frame 11)) +(cl-defstruct (isearch--state + (:constructor nil) + (:copier nil) + (:constructor isearch--get-state + (&aux + (string isearch-string) + (message isearch-message) + (point (point)) + (success isearch-success) + (forward isearch-forward) + (other-end isearch-other-end) + (word isearch-word) + (error isearch-error) + (wrapped isearch-wrapped) + (barrier isearch-barrier) + (case-fold-search isearch-case-fold-search) + (pop-fun (if isearch-push-state-function + (funcall isearch-push-state-function)))))) + (string :read-only t) + (message :read-only t) + (point :read-only t) + (success :read-only t) + (forward :read-only t) + (other-end :read-only t) + (word :read-only t) + (error :read-only t) + (wrapped :read-only t) + (barrier :read-only t) + (case-fold-search :read-only t) + (pop-fun :read-only t)) -(defun isearch-top-state () - (let ((cmd (car isearch-cmds))) - (setq isearch-string (isearch-string-state cmd) - isearch-message (isearch-message-state cmd) - isearch-success (isearch-success-state cmd) - isearch-forward (isearch-forward-state cmd) - isearch-other-end (isearch-other-end-state cmd) - isearch-word (isearch-word-state cmd) - isearch-error (isearch-error-state cmd) - isearch-wrapped (isearch-wrapped-state cmd) - isearch-barrier (isearch-barrier-state cmd) - isearch-case-fold-search (isearch-case-fold-search-state cmd)) - (if (functionp (isearch-pop-fun-state cmd)) - (funcall (isearch-pop-fun-state cmd) cmd)) - (goto-char (isearch-point-state cmd)))) +(defun isearch--set-state (cmd) + (setq isearch-string (isearch--state-string cmd) + isearch-message (isearch--state-message cmd) + isearch-success (isearch--state-success cmd) + isearch-forward (isearch--state-forward cmd) + isearch-other-end (isearch--state-other-end cmd) + isearch-word (isearch--state-word cmd) + isearch-error (isearch--state-error cmd) + isearch-wrapped (isearch--state-wrapped cmd) + isearch-barrier (isearch--state-barrier cmd) + isearch-case-fold-search (isearch--state-case-fold-search cmd)) + (if (functionp (isearch--state-pop-fun cmd)) + (funcall (isearch--state-pop-fun cmd) cmd)) + (goto-char (isearch--state-point cmd))) (defun isearch-pop-state () (setq isearch-cmds (cdr isearch-cmds)) - (isearch-top-state)) + (isearch--set-state (car isearch-cmds))) (defun isearch-push-state () - (setq isearch-cmds - (cons (vector isearch-string isearch-message (point) - isearch-success isearch-forward isearch-other-end - isearch-word - isearch-error isearch-wrapped isearch-barrier - isearch-case-fold-search - (if isearch-push-state-function - (funcall isearch-push-state-function))) - isearch-cmds))) + (push (isearch--get-state) isearch-cmds)) ;; Commands active while inside of the isearch minor mode. @@ -1100,11 +1080,11 @@ (curr-msg (if msg isearch-message isearch-string)) succ-msg) (when (or (not isearch-success) isearch-error) - (while (or (not (isearch-success-state (car cmds))) - (isearch-error-state (car cmds))) + (while (or (not (isearch--state-success (car cmds))) + (isearch--state-error (car cmds))) (pop cmds)) - (setq succ-msg (and cmds (if msg (isearch-message-state (car cmds)) - (isearch-string-state (car cmds))))) + (setq succ-msg (and cmds (if msg (isearch--state-message (car cmds)) + (isearch--state-string (car cmds))))) (if (and (stringp succ-msg) (< (length succ-msg) (length curr-msg)) (equal succ-msg @@ -1201,7 +1181,7 @@ (minibuffer-history-symbol)) (setq isearch-new-string (read-from-minibuffer - (isearch-message-prefix nil nil isearch-nonincremental) + (isearch-message-prefix nil isearch-nonincremental) (cons isearch-string (1+ (or (isearch-fail-pos) (length isearch-string)))) minibuffer-local-isearch-map nil @@ -1294,18 +1274,18 @@ ;; For defined push-state function, restore the first state. ;; This calls pop-state function and restores original point. (let ((isearch-cmds (last isearch-cmds))) - (isearch-top-state)) + (isearch--set-state (car isearch-cmds))) (goto-char isearch-opoint)) - (isearch-done t) ; exit isearch + (isearch-done t) ; Exit isearch.. (isearch-clean-overlays) - (signal 'quit nil)) ; and pass on quit signal + (signal 'quit nil)) ; ..and pass on quit signal. (defun isearch-abort () "Abort incremental search mode if searching is successful, signaling quit. Otherwise, revert to previous successful search and continue searching. Use `isearch-exit' to quit without signaling." (interactive) -;; (ding) signal instead below, if quitting + ;; (ding) signal instead below, if quitting (discard-input) (if (and isearch-success (not isearch-error)) ;; If search is successful and has no incomplete regexp, @@ -1328,9 +1308,7 @@ (if (null (if isearch-regexp regexp-search-ring search-ring)) (setq isearch-error "No previous search string") (setq isearch-string - (if isearch-regexp - (car regexp-search-ring) - (car search-ring)) + (car (if isearch-regexp regexp-search-ring search-ring)) isearch-message (mapconcat 'isearch-text-char-description isearch-string "") @@ -1391,8 +1369,10 @@ (defun isearch-toggle-word () "Toggle word searching on or off." + ;; The status stack is left unchanged. (interactive) (setq isearch-word (not isearch-word)) + (if isearch-word (setq isearch-regexp nil)) (setq isearch-success t isearch-adjusted t) (isearch-update)) @@ -1411,7 +1391,7 @@ (if isearch-case-fold-search nil 'yes)) (let ((message-log-max nil)) (message "%s%s [case %ssensitive]" - (isearch-message-prefix nil nil isearch-nonincremental) + (isearch-message-prefix nil isearch-nonincremental) isearch-message (if isearch-case-fold-search "in" ""))) (setq isearch-success t isearch-adjusted t) @@ -1857,7 +1837,7 @@ ;; We have to check 2 stack frames because the last might be ;; invalid just because of a backslash. (or (not isearch-error) - (not (isearch-error-state (cadr isearch-cmds))) + (not (isearch--state-error (cadr isearch-cmds))) allow-invalid)) (if to-barrier (progn (goto-char isearch-barrier) @@ -1872,8 +1852,8 @@ ;; Also skip over postfix operators -- though horrid, ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly valid. (while (and previous - (or (isearch-error-state frame) - (let* ((string (isearch-string-state frame)) + (or (isearch--state-error frame) + (let* ((string (isearch--state-string frame)) (lchar (aref string (1- (length string))))) ;; The operators aren't always operators; check ;; backslashes. This doesn't handle the case of @@ -1881,7 +1861,7 @@ ;; being special, but then we should fall back to ;; the barrier anyway because it's all optional. (if (isearch-backslash - (isearch-string-state (car previous))) + (isearch--state-string (car previous))) (eq lchar ?\}) (memq lchar '(?* ?? ?+)))))) (setq stack previous previous (cdr previous) frame (car stack))) @@ -1891,7 +1871,7 @@ ;; what matched before that. (let ((last-other-end (or (and (car previous) - (isearch-other-end-state (car previous))) + (isearch--state-other-end (car previous))) isearch-barrier))) (goto-char (if isearch-forward (max last-other-end isearch-barrier) @@ -2355,12 +2335,12 @@ (add-text-properties (match-beginning 0) (match-end 0) '(face trailing-whitespace) m))) (setq m (concat - (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) + (isearch-message-prefix ellipsis isearch-nonincremental) m - (isearch-message-suffix c-q-hack ellipsis))) + (isearch-message-suffix c-q-hack))) (if c-q-hack m (let ((message-log-max nil)) (message "%s" m))))) -(defun isearch-message-prefix (&optional _c-q-hack ellipsis nonincremental) +(defun isearch-message-prefix (&optional ellipsis nonincremental) ;; If about to search, and previous search regexp was invalid, ;; check that it still is. If it is valid now, ;; let the message we display while searching say that it is valid. @@ -2401,7 +2381,7 @@ (propertize (concat (upcase (substring m 0 1)) (substring m 1)) 'face 'minibuffer-prompt))) -(defun isearch-message-suffix (&optional c-q-hack _ellipsis) +(defun isearch-message-suffix (&optional c-q-hack) (concat (if c-q-hack "^Q" "") (if isearch-error (concat " [" isearch-error "]") @@ -2435,7 +2415,8 @@ ;; (or when using nonincremental word isearch) (let ((lax (not (or isearch-nonincremental (eq (length isearch-string) - (length (isearch-string-state (car isearch-cmds)))))))) + (length (isearch--state-string + (car isearch-cmds)))))))) (funcall (if isearch-forward #'re-search-forward #'re-search-backward) (if (functionp isearch-word) @@ -2501,6 +2482,7 @@ (isearch-no-upper-case-p isearch-string isearch-regexp))) (condition-case lossage (let ((inhibit-point-motion-hooks + ;; FIXME: equality comparisons on functions is asking for trouble. (and (eq isearch-filter-predicate 'isearch-filter-visible) search-invisible)) (inhibit-quit nil) @@ -2545,11 +2527,12 @@ (if isearch-success nil ;; Ding if failed this time after succeeding last time. - (and (isearch-success-state (car isearch-cmds)) + (and (isearch--state-success (car isearch-cmds)) (ding)) - (if (functionp (isearch-pop-fun-state (car isearch-cmds))) - (funcall (isearch-pop-fun-state (car isearch-cmds)) (car isearch-cmds))) - (goto-char (isearch-point-state (car isearch-cmds))))) + (if (functionp (isearch--state-pop-fun (car isearch-cmds))) + (funcall (isearch--state-pop-fun (car isearch-cmds)) + (car isearch-cmds))) + (goto-char (isearch--state-point (car isearch-cmds))))) ;; Called when opening an overlay, and we are still in isearch. ------------------------------------------------------------ revno: 109432 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-08-04 11:07:50 -0700 message: TODO trivia diff: === modified file 'etc/TODO' --- etc/TODO 2012-07-31 19:23:33 +0000 +++ etc/TODO 2012-08-04 18:07:50 +0000 @@ -18,7 +18,7 @@ "which form of concurrency" we'll want. ** Overhaul of customize: sounds wonderful. ** better support for dynamic embedded graphics: I like this idea (my - mpc.el code could use it for the volume widget), tho I wonder if the + mpc.el code could use it for the volume widget), though I wonder if the resulting efficiency will be sufficient. ** Spread Semantic. ** Improve the "code snippets" support: consolidate skeleton.el, tempo.el, ------------------------------------------------------------ revno: 109431 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-08-04 17:36:36 +0300 message: Fix compilation --with-x-toolkit=no. stc/xfns.c (x_set_menu_bar_lines): Fix compilation error in --with-x-toolkit=no builds by using FVAR. Reported by Carsten Mattner . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-04 14:33:00 +0000 +++ src/ChangeLog 2012-08-04 14:36:36 +0000 @@ -1,3 +1,9 @@ +2012-08-04 Eli Zaretskii + + * xfns.c (x_set_menu_bar_lines): Fix compilation error in + --with-x-toolkit=no builds. + Reported by Carsten Mattner . + 2012-08-04 Chong Yidong * syntax.c (Fmodify_syntax_entry): Doc fix. === modified file 'src/xfns.c' --- src/xfns.c 2012-08-03 23:36:11 +0000 +++ src/xfns.c 2012-08-04 14:36:36 +0000 @@ -1253,8 +1253,8 @@ UNBLOCK_INPUT; } - if (nlines == 0 && WINDOWP (f->menu_bar_window)) - clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); + if (nlines == 0 && WINDOWP (FVAR (f, menu_bar_window))) + clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix); } #endif /* not USE_X_TOOLKIT && not USE_GTK */ adjust_glyphs (f); ------------------------------------------------------------ revno: 109430 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-08-04 22:33:00 +0800 message: Doc fixes and improvements for syntax tables. * src/syntax.c (Fmodify_syntax_entry): Doc fix. * doc/lispref/syntax.texi (Syntax Basics): Rearrange the text for clarity. Fix description of syntax table inheritance. (Syntax Table Functions): Don't refer to internal contents of syntax table, since that is not explained yet. Copyedits. (Standard Syntax Tables): Node deleted. (Syntax Table Internals): Misc clarifications. Improve table formatting. * doc/lispref/keymaps.texi (Inheritance and Keymaps): * doc/lispref/text.texi (Sticky Properties): Tweak index entry. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-08-01 02:14:20 +0000 +++ doc/lispref/ChangeLog 2012-08-04 14:33:00 +0000 @@ -1,3 +1,16 @@ +2012-08-04 Chong Yidong + + * syntax.texi (Syntax Basics): Rearrange the text for clarity. + Fix description of syntax table inheritance. + (Syntax Table Functions): Don't refer to internal contents of + syntax table, since that is not explained yet. Copyedits. + (Standard Syntax Tables): Node deleted. + (Syntax Table Internals): Misc clarifications. Improve table + formatting. + + * keymaps.texi (Inheritance and Keymaps): + * text.texi (Sticky Properties): Tweak index entry. + 2012-07-28 Eli Zaretskii * nonascii.texi (Character Sets): Fix a typo. (Bug#12062) === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2012-07-25 05:48:19 +0000 +++ doc/lispref/elisp.texi 2012-08-04 14:33:00 +0000 @@ -1241,7 +1241,6 @@ * Motion and Syntax:: Moving over characters with certain syntaxes. * Parsing Expressions:: Parsing balanced expressions using the syntax table. -* Standard Syntax Tables:: Syntax tables used by various major modes. * Syntax Table Internals:: How syntax table information is stored. * Categories:: Another way of classifying character syntax. === modified file 'doc/lispref/keymaps.texi' --- doc/lispref/keymaps.texi 2012-07-21 14:48:17 +0000 +++ doc/lispref/keymaps.texi 2012-08-04 14:33:00 +0000 @@ -371,7 +371,7 @@ @node Inheritance and Keymaps @section Inheritance and Keymaps @cindex keymap inheritance -@cindex inheriting a keymap's bindings +@cindex inheritance, keymap A keymap can inherit the bindings of another keymap, which we call the @dfn{parent keymap}. Such a keymap looks like this: === modified file 'doc/lispref/syntax.texi' --- doc/lispref/syntax.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/syntax.texi 2012-08-04 14:33:00 +0000 @@ -23,7 +23,6 @@ * Motion and Syntax:: Moving over characters with certain syntaxes. * Parsing Expressions:: Parsing balanced expressions using the syntax table. -* Standard Syntax Tables:: Syntax tables used by various major modes. * Syntax Table Internals:: How syntax table information is stored. * Categories:: Another way of classifying character syntax. @end menu @@ -31,43 +30,65 @@ @node Syntax Basics @section Syntax Table Concepts - A syntax table is a char-table (@pxref{Char-Tables}). The element at -index @var{c} describes the character with code @var{c}. The element's -value should be a list that encodes the syntax of the character in -question. - - Syntax tables are used only for moving across text, not for the Emacs -Lisp reader. Emacs Lisp uses built-in syntactic rules when reading Lisp -expressions, and these rules cannot be changed. (Some Lisp systems -provide ways to redefine the read syntax, but we decided to leave this -feature out of Emacs Lisp for simplicity.) - - Each buffer has its own major mode, and each major mode has its own -idea of the syntactic class of various characters. For example, in -Lisp mode, the character @samp{;} begins a comment, but in C mode, it -terminates a statement. To support these variations, Emacs makes the -syntax table local to each buffer. Typically, each major mode has its -own syntax table and installs that table in each buffer that uses that -mode. Changing this table alters the syntax in all those buffers as -well as in any buffers subsequently put in that mode. Occasionally -several similar modes share one syntax table. @xref{Example Major -Modes}, for an example of how to set up a syntax table. - -A syntax table can inherit the data for some characters from the -standard syntax table, while specifying other characters itself. The -``inherit'' syntax class means ``inherit this character's syntax from -the standard syntax table''. Just changing the standard syntax for a -character affects all syntax tables that inherit from it. + A syntax table is a data structure which can be used to look up the +@dfn{syntax class} and other syntactic properties of each character. +Syntax tables are used by Lisp programs for scanning and moving across +text. + + Internally, a syntax table is a char-table (@pxref{Char-Tables}). +The element at index @var{c} describes the character with code +@var{c}; its value is a cons cell which specifies the syntax of the +character in question. @xref{Syntax Table Internals}, for details. +However, instead of using @code{aset} and @code{aref} to modify and +inspect syntax table contents, you should usually use the higher-level +functions @code{char-syntax} and @code{modify-syntax-entry}, which are +described in @ref{Syntax Table Functions}. @defun syntax-table-p object This function returns @code{t} if @var{object} is a syntax table. @end defun + Each buffer has its own major mode, and each major mode has its own +idea of the syntax class of various characters. For example, in Lisp +mode, the character @samp{;} begins a comment, but in C mode, it +terminates a statement. To support these variations, the syntax table +is local to each buffer. Typically, each major mode has its own +syntax table, which it installs in all buffers that use that mode. +For example, the variable @code{emacs-lisp-mode-syntax-table} holds +the syntax table used by Emacs Lisp mode, and +@code{c-mode-syntax-table} holds the syntax table used by C mode. +Changing a major mode's syntax table alters the syntax in all of that +mode's buffers, as well as in any buffers subsequently put in that +mode. Occasionally, several similar modes share one syntax table. +@xref{Example Major Modes}, for an example of how to set up a syntax +table. + +@cindex standard syntax table +@cindex inheritance, syntax table + A syntax table can @dfn{inherit} from another syntax table, which is +called its @dfn{parent syntax table}. A syntax table can leave the +syntax class of some characters unspecified, by giving them the +``inherit'' syntax class; such a character then acquires the syntax +class specified by the parent syntax table (@pxref{Syntax Class +Table}). Emacs defines a @dfn{standard syntax table}, which is the +default parent syntax table, and is also the syntax table used by +Fundamental mode. + +@defun standard-syntax-table +This function returns the standard syntax table, which is the syntax +table used in Fundamental mode. +@end defun + + Syntax tables are not used by the Emacs Lisp reader, which has its +own built-in syntactic rules which cannot be changed. (Some Lisp +systems provide ways to redefine the read syntax, but we decided to +leave this feature out of Emacs Lisp for simplicity.) + @node Syntax Descriptors @section Syntax Descriptors @cindex syntax class - The syntactic role of a character is called its @dfn{syntax class}. + The @dfn{syntax class} of a character describes its syntactic role. Each syntax table specifies the syntax class of each character. There is no necessary relationship between the class of a character in one syntax table and its class in any other table. @@ -81,21 +102,23 @@ syntax, regardless of whether the @samp{\} character actually has that syntax in the current syntax table. @ifnottex -@xref{Syntax Class Table}, for a list of syntax classes. +@xref{Syntax Class Table}, for a list of syntax classes and their +designator characters. @end ifnottex @cindex syntax descriptor A @dfn{syntax descriptor} is a Lisp string that describes the syntax -classes and other syntactic properties of a character. When you want -to modify the syntax of a character, that is done by calling the -function @code{modify-syntax-entry} and passing a syntax descriptor as -one of its arguments (@pxref{Syntax Table Functions}). +class and other syntactic properties of a character. When you want to +modify the syntax of a character, that is done by calling the function +@code{modify-syntax-entry} and passing a syntax descriptor as one of +its arguments (@pxref{Syntax Table Functions}). - The first character in a syntax descriptor designates the syntax -class. The second character specifies a matching character (e.g.@: in -Lisp, the matching character for @samp{(} is @samp{)}); if there is no -matching character, put a space there. Then come the characters for -any desired flags. + The first character in a syntax descriptor must be a syntax class +designator character. The second character, if present, specifies a +matching character (e.g.@: in Lisp, the matching character for +@samp{(} is @samp{)}); a space specifies that there is no matching +character. Then come characters specifying additional syntax +properties (@pxref{Syntax Flags}). If no matching character or flags are needed, only one character (specifying the syntax class) is sufficient. @@ -348,7 +371,6 @@ @end table @item -@c Emacs 19 feature @samp{p} identifies an additional ``prefix character'' for Lisp syntax. These characters are treated as whitespace when they appear between expressions. When they appear within an expression, they are handled @@ -366,21 +388,20 @@ altering syntax tables. @defun make-syntax-table &optional table -This function creates a new syntax table, with all values initialized -to @code{nil}. If @var{table} is non-@code{nil}, it becomes the -parent of the new syntax table, otherwise the standard syntax table is -the parent. Like all char-tables, a syntax table inherits from its -parent. Thus the original syntax of all characters in the returned -syntax table is determined by the parent. @xref{Char-Tables}. +This function creates a new syntax table. If @var{table} is +non-@code{nil}, the parent of the new syntax table is @var{table}; +otherwise, the parent is the standard syntax table. -Most major mode syntax tables are created in this way. +In the new syntax table, all characters are initially given the +``inherit'' (@samp{@@}) syntax class, i.e.@: their syntax is inherited +from the parent table (@pxref{Syntax Class Table}). @end defun @defun copy-syntax-table &optional table This function constructs a copy of @var{table} and returns it. If -@var{table} is not supplied (or is @code{nil}), it returns a copy of the -standard syntax table. Otherwise, an error is signaled if @var{table} is -not a syntax table. +@var{table} is omitted or @code{nil}, it returns a copy of the +standard syntax table. Otherwise, an error is signaled if @var{table} +is not a syntax table. @end defun @deffn Command modify-syntax-entry char syntax-descriptor &optional table @@ -393,11 +414,11 @@ The syntax is changed only for @var{table}, which defaults to the current buffer's syntax table, and not in any other syntax table. -The argument @var{syntax-descriptor} is a syntax descriptor for the -desired syntax (i.e.@: a string beginning with a class designator -character, and optionally containing a matching character and syntax -flags). An error is signaled if the first character is not one of the -seventeen syntax class designators. @xref{Syntax Descriptors}. +The argument @var{syntax-descriptor} is a syntax descriptor, i.e.@: a +string whose first character is a syntax class designator and whose +second and subsequent characters optionally specify a matching +character and syntax flags. @xref{Syntax Descriptors}. An error is +signaled if @var{syntax-descriptor} is not a valid syntax descriptor. This function always returns @code{nil}. The old syntax information in the table for this character is discarded. @@ -438,38 +459,37 @@ @defun char-syntax character This function returns the syntax class of @var{character}, represented -by its mnemonic designator character. This returns @emph{only} the -class, not any matching parenthesis or flags. - -An error is signaled if @var{char} is not a character. - -The following examples apply to C mode. The first example shows that -the syntax class of space is whitespace (represented by a space). The -second example shows that the syntax of @samp{/} is punctuation. This -does not show the fact that it is also part of comment-start and -end -sequences. The third example shows that open parenthesis is in the class -of open parentheses. This does not show the fact that it has a matching -character, @samp{)}. +by its designator character (@pxref{Syntax Class Table}). This +returns @emph{only} the class, not its matching character or syntax +flags. + +The following examples apply to C mode. (We use @code{string} to make +it easier to see the character returned by @code{char-syntax}.) @example @group +;; Space characters have whitespace syntax class. (string (char-syntax ?\s)) @result{} " " @end group @group +;; Forward slash characters have punctuation syntax. Note that this +;; @code{char-syntax} call does not reveal that it is also part of +;; comment-start and -end sequences. (string (char-syntax ?/)) @result{} "." @end group @group +;; Open parenthesis characters have open parenthesis syntax. Note +;; that this @code{char-syntax} call does not reveal that it has a +;; matching character, @samp{)}. (string (char-syntax ?\()) @result{} "(" @end group @end example -We use @code{string} to make it easier to see the character returned by -@code{char-syntax}. @end defun @defun set-syntax-table table @@ -905,135 +925,70 @@ You can use @code{forward-comment} to move forward or backward over one comment or several comments. -@node Standard Syntax Tables -@section Some Standard Syntax Tables - - Most of the major modes in Emacs have their own syntax tables. Here -are several of them: - -@defun standard-syntax-table -This function returns the standard syntax table, which is the syntax -table used in Fundamental mode. -@end defun - -@defvar text-mode-syntax-table -The value of this variable is the syntax table used in Text mode. -@end defvar - -@defvar c-mode-syntax-table -The value of this variable is the syntax table for C-mode buffers. -@end defvar - -@defvar emacs-lisp-mode-syntax-table -The value of this variable is the syntax table used in Emacs Lisp mode -by editing commands. (It has no effect on the Lisp @code{read} -function.) -@end defvar - @node Syntax Table Internals @section Syntax Table Internals @cindex syntax table internals - Lisp programs don't usually work with the elements directly; the -Lisp-level syntax table functions usually work with syntax descriptors -(@pxref{Syntax Descriptors}). Nonetheless, here we document the -internal format. This format is used mostly when manipulating -syntax properties. - - Each element of a syntax table is a cons cell of the form -@code{(@var{syntax-code} . @var{matching-char})}. The @sc{car}, -@var{syntax-code}, is an integer that encodes the syntax class, and any -flags. The @sc{cdr}, @var{matching-char}, is non-@code{nil} if -a character to match was specified. - - This table gives the value of @var{syntax-code} which corresponds -to each syntactic type. - -@multitable @columnfractions .05 .3 .3 .31 -@item -@tab -@i{Integer} @i{Class} -@tab -@i{Integer} @i{Class} -@tab -@i{Integer} @i{Class} -@item -@tab -0 @ @ whitespace -@tab -5 @ @ close parenthesis -@tab -10 @ @ character quote -@item -@tab -1 @ @ punctuation -@tab -6 @ @ expression prefix -@tab -11 @ @ comment-start -@item -@tab -2 @ @ word -@tab -7 @ @ string quote -@tab -12 @ @ comment-end -@item -@tab -3 @ @ symbol -@tab -8 @ @ paired delimiter -@tab -13 @ @ inherit -@item -@tab -4 @ @ open parenthesis -@tab -9 @ @ escape -@tab -14 @ @ generic comment -@item -@tab -15 @ generic string + Syntax tables are implemented as char-tables (@pxref{Char-Tables}), +but most Lisp programs don't work directly with their elements. +Syntax tables do not store syntax data as syntax descriptors +(@pxref{Syntax Descriptors}); they use an internal format, which is +documented in this section. This internal format can also be assigned +as syntax properties (@pxref{Syntax Properties}). + +@cindex syntax code + Each entry in a syntax table is a cons cell of the form +@code{(@var{syntax-code} . @var{matching-char})}. @var{syntax-code} +is an integer that encodes the syntax class and syntax flags, +according to the table below. @var{matching-char}, if non-@code{nil}, +specifies a matching character (similar to the second character in a +syntax descriptor). + +@multitable @columnfractions .2 .3 .2 .3 +@item +@i{Syntax code} @tab @i{Class} @tab @i{Syntax code} @tab @i{Class} +@item +0 @tab whitespace @tab 8 @tab paired delimiter +@item +1 @tab punctuation @tab 9 @tab escape +@item +2 @tab word @tab 10 @tab character quote +@item +3 @tab symbol @tab 11 @tab comment-start +@item +4 @tab open parenthesis @tab 12 @tab comment-end +@item +5 @tab close parenthesis @tab 13 @tab inherit +@item +6 @tab expression prefix @tab 14 @tab generic comment +@item +7 @tab string quote @tab 15 @tab generic string @end multitable - For example, the usual syntax value for @samp{(} is @code{(4 . 41)}. -(41 is the character code for @samp{)}.) +@noindent +For example, in the standard syntax table, the entry for @samp{(} is +@code{(4 . 41)}. (41 is the character code for @samp{)}.) - The flags are encoded in higher order bits, starting 16 bits from the -least significant bit. This table gives the power of two which + Syntax flags are encoded in higher order bits, starting 16 bits from +the least significant bit. This table gives the power of two which corresponds to each syntax flag. -@multitable @columnfractions .05 .3 .3 .3 -@item -@tab -@i{Prefix} @i{Flag} -@tab -@i{Prefix} @i{Flag} -@tab -@i{Prefix} @i{Flag} -@item -@tab -@samp{1} @ @ @code{(lsh 1 16)} -@tab -@samp{4} @ @ @code{(lsh 1 19)} -@tab -@samp{b} @ @ @code{(lsh 1 21)} -@item -@tab -@samp{2} @ @ @code{(lsh 1 17)} -@tab -@samp{p} @ @ @code{(lsh 1 20)} -@tab -@samp{n} @ @ @code{(lsh 1 22)} -@item -@tab -@samp{3} @ @ @code{(lsh 1 18)} +@multitable @columnfractions .15 .3 .15 .3 +@item +@i{Prefix} @tab @i{Flag} @tab @i{Prefix} @tab @i{Flag} +@item +@samp{1} @tab @code{(lsh 1 16)} @tab @samp{p} @tab @code{(lsh 1 20)} +@item +@samp{2} @tab @code{(lsh 1 17)} @tab @samp{b} @tab @code{(lsh 1 21)} +@item +@samp{3} @tab @code{(lsh 1 18)} @tab @samp{n} @tab @code{(lsh 1 22)} +@item +@samp{4} @tab @code{(lsh 1 19)} @end multitable @defun string-to-syntax @var{desc} -This function returns the internal form corresponding to the syntax -descriptor @var{desc}, a cons cell @code{(@var{syntax-code} +Given a syntax descriptor @var{desc}, this function returns the +corresponding internal form, a cons cell @code{(@var{syntax-code} . @var{matching-char})}. @end defun === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2012-07-17 07:43:01 +0000 +++ doc/lispref/text.texi 2012-08-04 14:33:00 +0000 @@ -3382,7 +3382,7 @@ @node Sticky Properties @subsection Stickiness of Text Properties @cindex sticky text properties -@cindex inheritance of text properties +@cindex inheritance, text property Self-inserting characters normally take on the same properties as the preceding character. This is called @dfn{inheritance} of properties. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-04 14:17:10 +0000 +++ src/ChangeLog 2012-08-04 14:33:00 +0000 @@ -1,3 +1,7 @@ +2012-08-04 Chong Yidong + + * syntax.c (Fmodify_syntax_entry): Doc fix. + 2012-08-04 Eli Zaretskii Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959) === modified file 'src/syntax.c' --- src/syntax.c 2012-07-30 18:56:42 +0000 +++ src/syntax.c 2012-08-04 14:33:00 +0000 @@ -1009,7 +1009,7 @@ " string quote. \\ escape. $ paired delimiter. ' expression quote or prefix operator. < comment starter. > comment ender. - / character-quote. @ inherit from `standard-syntax-table'. + / character-quote. @ inherit from parent table. | generic string fence. ! generic comment fence. Only single-character comment start and end sequences are represented thus. ------------------------------------------------------------ revno: 109429 fixes bug: http://debbugs.gnu.org/11959 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-08-04 17:17:10 +0300 message: Fix bug #11959 with startup warnings on MS-Windows about ../site-lisp. src/w32.c (init_environment): Change the default values of many environment variables in dflt_envvars[] to NULL, to avoid pushing them into environment when they were not already defined. Remove the code that deletes site-lisp subdirectories from the default value of EMACSLOADPATH, as it is no longer needed. (check_windows_init_file): Now external, not static. Use Vload_path as is, without adding anything, as this function is now called when Vload_path is already set up. src/w32.h (check_windows_init_file): Add prototype. src/emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build directory, ignore the /*/i386/ tail in Vinvocation_directory, for compatibility with Posix platforms. (main): Move the call to check_windows_init_file to here from w32.c. (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if any, in the DEFALT argument into the root of the Emacs build or installation tree, as appropriate. src/callproc.c (init_callproc_1): Call decode_env_path instead of doing its equivalent by hand. (init_callproc): Replace DOS_NT condition with MSDOS, thus letting the code that sets Vexec_path run on MS-Windows. src/lread.c (init_lread): Add comments to #ifdef's. nt/paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC) (PATH_DATA, PATH_DOC): Replace dummy directory names with directories relative to %emacs_dir%. (PATH_EXEC): Add lib-src/oo-spd/i386 and lib-src/oo/i386, to cater to the use case of running un-installed Emacs. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-08-03 12:16:40 +0000 +++ nt/ChangeLog 2012-08-04 14:17:10 +0000 @@ -1,3 +1,11 @@ +2012-08-04 Eli Zaretskii + + * paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC) + (PATH_DATA, PATH_DOC): Replace dummy directory names with + directories relative to %emacs_dir%. + (PATH_EXEC): Add lib-src/oo-spd/i386 and lib-src/oo/i386, to cater + to the use case of running un-installed Emacs. + 2012-08-03 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/paths.h' --- nt/paths.h 2012-06-30 21:10:50 +0000 +++ nt/paths.h 2012-08-04 14:17:10 +0000 @@ -18,14 +18,18 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +/* Relative file names in this file that begin with "%emacs_dir%/" are + treated specially by decode_env_path: they are expanded relative to + the value of the emacs_dir environment variable, which points to + the root of the Emacs tree. */ /* The default search path for Lisp function "load". Together with PATH_SITELOADSEARCH, this sets load-path. */ /* #define PATH_LOADSEARCH "/usr/local/lib/emacs/lisp" */ -#define PATH_LOADSEARCH "C:/emacs/lisp" +#define PATH_LOADSEARCH "%emacs_dir%/lisp;%emacs_dir%/leim" /* Like PATH_LOADSEARCH, but contains the non-standard pieces. */ -#define PATH_SITELOADSEARCH "C:/emacs/site-lisp" +#define PATH_SITELOADSEARCH "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp" /* Like PATH_LOADSEARCH, but used only when Emacs is dumping. This path is usually identical to PATH_LOADSEARCH except that the entry @@ -39,13 +43,13 @@ variable exec-directory. exec-directory is used for finding executables and other architecture-dependent files. */ /* #define PATH_EXEC "/usr/local/lib/emacs/etc" */ -#define PATH_EXEC "C:/emacs/bin" +#define PATH_EXEC "%emacs_dir%/bin;%emacs_dir%/lib-src/oo-spd/i386;%emacs_dir%/lib-src/oo/i386" /* Where Emacs should look for its architecture-independent data files, like the NEWS file. The lisp variable data-directory is set to this value. */ /* #define PATH_DATA "/usr/local/lib/emacs/data" */ -#define PATH_DATA "C:/emacs/data" +#define PATH_DATA "%emacs_dir%/etc" /* Where Emacs should look for X bitmap files. The lisp variable x-bitmap-file-path is set based on this value. */ @@ -53,11 +57,10 @@ /* Where Emacs should look for its docstring file. The lisp variable doc-directory is set to this value. */ -#define PATH_DOC "C:/emacs/etc" +#define PATH_DOC "%emacs_dir%/etc" /* Where the configuration process believes the info tree lives. The lisp variable configure-info-directory gets its value from this macro, and is then used to set the Info-default-directory-list. */ /* #define PATH_INFO "/usr/local/info" */ #define PATH_INFO "C:/emacs/info" - === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-04 08:58:33 +0000 +++ src/ChangeLog 2012-08-04 14:17:10 +0000 @@ -1,5 +1,33 @@ 2012-08-04 Eli Zaretskii + Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959) + * w32.c (init_environment): Change the default values of many + environment variables in dflt_envvars[] to NULL, to avoid pushing + them into environment when they were not already defined. Remove + the code that deletes site-lisp subdirectories from the default + value of EMACSLOADPATH, as it is no longer needed. + (check_windows_init_file): Now external, not static. Use + Vload_path as is, without adding anything, as this function is now + called when Vload_path is already set up. + + * w32.h (check_windows_init_file): Add prototype. + + * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build + directory, ignore the /*/i386/ tail in Vinvocation_directory, for + compatibility with Posix platforms. + (main): Move the call to check_windows_init_file to here from + w32.c. + (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if + any, in the DEFALT argument into the root of the Emacs build or + installation tree, as appropriate. + + * callproc.c (init_callproc_1): Call decode_env_path instead of + doing its equivalent by hand. + (init_callproc): Replace DOS_NT condition with MSDOS, thus letting + the code that sets Vexec_path run on MS-Windows. + + * lread.c (init_lread): Add comments to #ifdef's. + * msdos.c (dos_set_window_size, IT_update_begin) (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR instead of direct references. === modified file 'src/callproc.c' --- src/callproc.c 2012-08-03 23:36:11 +0000 +++ src/callproc.c 2012-08-04 14:17:10 +0000 @@ -1513,29 +1513,24 @@ void init_callproc_1 (void) { - char *data_dir = egetenv ("EMACSDATA"); - char *doc_dir = egetenv ("EMACSDOC"); #ifdef HAVE_NS const char *etc_dir = ns_etc_directory (); const char *path_exec = ns_exec_path (); #endif - Vdata_directory - = Ffile_name_as_directory (build_string (data_dir ? data_dir -#ifdef HAVE_NS - : (etc_dir ? etc_dir : PATH_DATA) -#else - : PATH_DATA -#endif - )); - Vdoc_directory - = Ffile_name_as_directory (build_string (doc_dir ? doc_dir -#ifdef HAVE_NS - : (etc_dir ? etc_dir : PATH_DOC) -#else - : PATH_DOC -#endif - )); + Vdata_directory = decode_env_path ("EMACSDATA", +#ifdef HAVE_NS + etc_dir ? etc_dir : +#endif + PATH_DATA); + Vdata_directory = Ffile_name_as_directory (Fcar (Vdata_directory)); + + Vdoc_directory = decode_env_path ("EMACSDOC", +#ifdef HAVE_NS + etc_dir ? etc_dir : +#endif + PATH_DOC); + Vdoc_directory = Ffile_name_as_directory (Fcar (Vdoc_directory)); /* Check the EMACSPATH environment variable, defaulting to the PATH_EXEC path from epaths.h. */ @@ -1576,7 +1571,7 @@ Lisp_Object tem; tem = Fexpand_file_name (build_string ("lib-src"), Vinstallation_directory); -#ifndef DOS_NT +#ifndef MSDOS /* MSDOS uses wrapped binaries, so don't do this. */ if (NILP (Fmember (tem, Vexec_path))) { @@ -1593,7 +1588,7 @@ } Vexec_directory = Ffile_name_as_directory (tem); -#endif /* not DOS_NT */ +#endif /* not MSDOS */ /* Maybe use ../etc as well as ../lib-src. */ if (data_dir == 0) === modified file 'src/emacs.c' --- src/emacs.c 2012-08-02 06:43:13 +0000 +++ src/emacs.c 2012-08-04 14:17:10 +0000 @@ -422,6 +422,16 @@ if (!NILP (Vinvocation_directory)) { dir = Vinvocation_directory; +#ifdef WINDOWSNT + /* If we are running from the build directory, set DIR to the + src subdirectory of the Emacs tree, like on Posix + platforms. */ + if (SBYTES (dir) > sizeof ("/i386/") - 1 + && 0 == strcmp (SSDATA (dir) + SBYTES (dir) - sizeof ("/i386/") + 1, + "/i386/")) + dir = Fexpand_file_name (build_string ("../.."), dir); +#else /* !WINDOWSNT */ +#endif name = Fexpand_file_name (Vinvocation_name, dir); while (1) { @@ -1434,6 +1444,10 @@ init_callproc (); /* Must follow init_cmdargs but not init_sys_modes. */ init_lread (); +#ifdef WINDOWSNT + /* Check to see if Emacs has been installed correctly. */ + check_windows_init_file (); +#endif /* Intern the names of all standard functions and variables; define standard keys. */ @@ -2228,6 +2242,12 @@ { const char *path, *p; Lisp_Object lpath, element, tem; + int defaulted = 0; +#ifdef WINDOWSNT + const char *emacs_dir = egetenv ("emacs_dir"); + static const char *emacs_dir_env = "%emacs_dir%/"; + const size_t emacs_dir_len = strlen (emacs_dir_env); +#endif /* It's okay to use getenv here, because this function is only used to initialize variables when Emacs starts up, and isn't called @@ -2237,7 +2257,10 @@ else path = 0; if (!path) - path = defalt; + { + path = defalt; + defaulted = 1; + } #ifdef DOS_NT /* Ensure values from the environment use the proper directory separator. */ if (path) @@ -2256,6 +2279,16 @@ p = path + strlen (path); element = (p - path ? make_string (path, p - path) : build_string (".")); +#ifdef WINDOWSNT + /* Relative file names in the default path are interpreted as + being relative to $emacs_dir. */ + if (emacs_dir && defaulted + && strncmp (path, emacs_dir_env, emacs_dir_len) == 0) + element = Fexpand_file_name (Fsubstring (element, + make_number (emacs_dir_len), + Qnil), + build_string (emacs_dir)); +#endif /* Add /: to the front of the name if it would otherwise be treated as magic. */ === modified file 'src/lread.c' --- src/lread.c 2012-08-03 23:36:11 +0000 +++ src/lread.c 2012-08-04 14:17:10 +0000 @@ -4131,7 +4131,7 @@ sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); } -#else +#else /* !CANNOT_DUMP */ if (NILP (Vpurify_flag)) { normal = PATH_LOADSEARCH; @@ -4293,7 +4293,7 @@ be missing unless something went extremely (and improbably) wrong, in which case the build will fail in obvious ways. */ } -#endif /* CANNOT_DUMP */ +#endif /* !CANNOT_DUMP */ Vvalues = Qnil; === modified file 'src/w32.c' --- src/w32.c 2012-08-03 10:23:30 +0000 +++ src/w32.c 2012-08-04 14:17:10 +0000 @@ -1709,17 +1709,19 @@ char * def_value; } dflt_envvars[] = { + /* If the default value is NULL, we will use the value from the + outside environment or the Registry, but will not push the + variable into the Emacs environment if it is defined neither + in the Registry nor in the outside environment. */ {"HOME", "C:/"}, {"PRELOAD_WINSOCK", NULL}, {"emacs_dir", "C:/emacs"}, - {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"}, + {"EMACSLOADPATH", NULL}, {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"}, - {"EMACSDATA", "%emacs_dir%/etc"}, - {"EMACSPATH", "%emacs_dir%/bin"}, - /* We no longer set INFOPATH because Info-default-directory-list - is then ignored. */ - /* {"INFOPATH", "%emacs_dir%/info"}, */ - {"EMACSDOC", "%emacs_dir%/etc"}, + {"EMACSDATA", NULL}, + {"EMACSPATH", NULL}, + {"INFOPATH", NULL}, + {"EMACSDOC", NULL}, {"TERM", "cmd"}, {"LANG", NULL}, }; @@ -1777,29 +1779,10 @@ } } - /* When Emacs is invoked with --no-site-lisp, we must remove the - site-lisp directories from the default value of EMACSLOADPATH. - This assumes that the site-lisp entries are at the front, and - that additional entries do exist. */ - if (no_site_lisp) - { - for (i = 0; i < N_ENV_VARS; i++) - { - if (strcmp (env_vars[i].name, "EMACSLOADPATH") == 0) - { - char *site; - while ((site = strstr (env_vars[i].def_value, "site-lisp"))) - env_vars[i].def_value = strchr (site, ';') + 1; - break; - } - } - } - #define SET_ENV_BUF_SIZE (4 * MAX_PATH) /* to cover EMACSLOADPATH */ /* Treat emacs_dir specially: set it unconditionally based on our - location, if it appears that we are running from the bin subdir - of a standard installation. */ + location. */ { char *p; char modname[MAX_PATH]; @@ -6618,7 +6601,7 @@ } -static void +void check_windows_init_file (void) { /* A common indication that Emacs is not installed properly is when @@ -6630,19 +6613,14 @@ loadup.el. */ && NILP (Vpurify_flag)) { - Lisp_Object objs[2]; - Lisp_Object full_load_path; Lisp_Object init_file; int fd; - objs[0] = Vload_path; - objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH"))); - full_load_path = Fappend (2, objs); init_file = build_string ("term/w32-win"); - fd = openp (full_load_path, init_file, Fget_load_suffixes (), NULL, Qnil); + fd = openp (Vload_path, init_file, Fget_load_suffixes (), NULL, Qnil); if (fd < 0) { - Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); + Lisp_Object load_path_print = Fprin1_to_string (Vload_path, Qnil); char *init_file_name = SDATA (init_file); char *load_path = SDATA (load_path_print); char *buffer = alloca (1024 @@ -6781,9 +6759,6 @@ /* Reset the volume info cache. */ volume_cache = NULL; } - - /* Check to see if Emacs has been installed correctly. */ - check_windows_init_file (); } /* === modified file 'src/w32.h' --- src/w32.h 2012-01-19 07:21:25 +0000 +++ src/w32.h 2012-08-04 14:17:10 +0000 @@ -140,6 +140,7 @@ extern void globals_of_w32menu (void); extern void syms_of_fontset (void); extern void syms_of_w32font (void); +extern void check_windows_init_file (void); extern int _sys_read_ahead (int fd); extern int _sys_wait_accept (int fd); ------------------------------------------------------------ revno: 109428 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-08-04 06:17:29 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-08-02 10:17:32 +0000 +++ autogen/configure 2012-08-04 10:17:29 +0000 @@ -14821,35 +14821,35 @@ case $opsys in aix4-2 ) - $as_echo "#define PTY_ITERATION int c; for (c = 0; !c ; c++) " >>confdefs.h - - $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptc\"); " >>confdefs.h - - $as_echo "#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); " >>confdefs.h + $as_echo "#define PTY_ITERATION int c; for (c = 0; !c ; c++)" >>confdefs.h + + $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptc\");" >>confdefs.h + + $as_echo "#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));" >>confdefs.h ;; cygwin ) - $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++) " >>confdefs.h - - $as_echo "#define PTY_OPEN do { int dummy; SIGMASKTYPE mask; mask = sigblock (sigmask (SIGCHLD)); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; sigsetmask (mask); if (fd >= 0) emacs_close (dummy); } while (0) " >>confdefs.h - - $as_echo "#define PTY_NAME_SPRINTF " >>confdefs.h - - $as_echo "#define PTY_TTY_NAME_SPRINTF " >>confdefs.h + $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h + + $as_echo "#define PTY_OPEN do { int dummy; SIGMASKTYPE mask; mask = sigblock (sigmask (SIGCHLD)); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; sigsetmask (mask); if (fd >= 0) emacs_close (dummy); } while (0)" >>confdefs.h + + $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h + + $as_echo "#define PTY_TTY_NAME_SPRINTF /**/" >>confdefs.h ;; darwin ) - $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++) " >>confdefs.h + $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h - $as_echo "#define PTY_OPEN do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (0) " >>confdefs.h - - $as_echo "#define PTY_NAME_SPRINTF " >>confdefs.h - - $as_echo "#define PTY_TTY_NAME_SPRINTF " >>confdefs.h + $as_echo "#define PTY_OPEN do { int slave; if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) fd = -1; else emacs_close (slave); } while (0)" >>confdefs.h + + $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h + + $as_echo "#define PTY_TTY_NAME_SPRINTF /**/" >>confdefs.h ;; @@ -14863,17 +14863,17 @@ $as_echo "#define UNIX98_PTYS 1" >>confdefs.h - $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++) " >>confdefs.h + $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); } " >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); }" >>confdefs.h if test "x$ac_cv_func_getpt" = xyes; then $as_echo "#define PTY_OPEN fd = getpt ()" >>confdefs.h - $as_echo "#define PTY_NAME_SPRINTF " >>confdefs.h + $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h else - $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptmx\"); " >>confdefs.h + $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptmx\");" >>confdefs.h fi else @@ -14885,9 +14885,9 @@ hpux*) $as_echo "#define FIRST_PTY_LETTER 'p'" >>confdefs.h - $as_echo "#define PTY_NAME_SPRINTF sprintf (pty_name, \"/dev/ptym/pty%c%x\", c, i); " >>confdefs.h + $as_echo "#define PTY_NAME_SPRINTF sprintf (pty_name, \"/dev/ptym/pty%c%x\", c, i);" >>confdefs.h - $as_echo "#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, \"/dev/pty/tty%c%x\", c, i); " >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, \"/dev/pty/tty%c%x\", c, i);" >>confdefs.h ;; @@ -14896,21 +14896,21 @@ $as_echo "#define FIRST_PTY_LETTER 'q'" >>confdefs.h - $as_echo "#define PTY_OPEN { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); } " >>confdefs.h - - $as_echo "#define PTY_NAME_SPRINTF " >>confdefs.h - - $as_echo "#define PTY_TTY_NAME_SPRINTF " >>confdefs.h + $as_echo "#define PTY_OPEN { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }" >>confdefs.h + + $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h + + $as_echo "#define PTY_TTY_NAME_SPRINTF /**/" >>confdefs.h ;; sol2* ) - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock (sigmask (SIGCLD)); if (grantpt (fd) == -1) { emacs_close (fd); return -1; } sigunblock (sigmask (SIGCLD)); if (unlockpt (fd) == -1) { emacs_close (fd); return -1; } if (!(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); } " >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock (sigmask (SIGCLD)); if (grantpt (fd) == -1) { emacs_close (fd); return -1; } sigunblock (sigmask (SIGCLD)); if (unlockpt (fd) == -1) { emacs_close (fd); return -1; } if (!(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h ;; unixware ) - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock(sigmask(SIGCLD)); if (grantpt(fd) == -1) fatal(\"could not grant slave pty\"); sigunblock(sigmask(SIGCLD)); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); } " >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock(sigmask(SIGCLD)); if (grantpt(fd) == -1) fatal(\"could not grant slave pty\"); sigunblock(sigmask(SIGCLD)); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h ;; esac @@ -14920,7 +14920,7 @@ sol2* | unixware ) $as_echo "#define FIRST_PTY_LETTER 'z'" >>confdefs.h - $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptmx\"); " >>confdefs.h + $as_echo "#define PTY_NAME_SPRINTF strcpy (pty_name, \"/dev/ptmx\");" >>confdefs.h $as_echo "#define SETUP_SLAVE_PTY if (ioctl (xforkin, I_PUSH, \"ptem\") == -1) fatal (\"ioctl I_PUSH ptem\"); if (ioctl (xforkin, I_PUSH, \"ldterm\") == -1) fatal (\"ioctl I_PUSH ldterm\"); if (ioctl (xforkin, I_PUSH, \"ttcompat\") == -1) fatal (\"ioctl I_PUSH ttcompat\");" >>confdefs.h ------------------------------------------------------------ revno: 109427 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-08-04 12:04:22 +0300 message: Fix the MSDOS build as fallout of latest changes. msdos/sedlibmk.inp (allocator.$(OBJEXT), careadlinkat.$(OBJEXT)): Fix editing out. msdos/sed2v2.inp (IS_DEVICE_SEP): Edit to match ':'. (IS_DIRECTORY_SEP, INTERNAL_TERMINAL): Fix Sed command syntax. (MSDOS): Define only if undefined, as MSDOS is a built-in macro, unless some std= switch to GCC is used. src/msdos.c (dos_set_window_size, IT_update_begin) (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR instead of direct references. diff: === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2012-08-01 15:43:36 +0000 +++ msdos/ChangeLog 2012-08-04 08:58:33 +0000 @@ -1,3 +1,13 @@ +2012-08-04 Eli Zaretskii + + * sedlibmk.inp (allocator.$(OBJEXT), careadlinkat.$(OBJEXT)): Fix + editing out. + + * sed2v2.inp (IS_DEVICE_SEP): Edit to match ':'. + (IS_DIRECTORY_SEP, INTERNAL_TERMINAL): Fix Sed command syntax. + (MSDOS): Define only if undefined, as MSDOS is a built-in macro, + unless some std= switch to GCC is used. + 2012-08-01 Glenn Morris * sed2v2.inp (HAVE_WCHAR_H): Fix typo. === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2012-08-01 15:20:59 +0000 +++ msdos/sed2v2.inp 2012-08-04 08:58:33 +0000 @@ -26,7 +26,10 @@ #define NSIG 320\ #endif -/^#undef MSDOS *$/s/^.*$/#define MSDOS/ +/^#undef MSDOS *$/c\ +#ifndef MSDOS\ +#define MSDOS\ +#endif /^#undef DOS_NT *$/s/^.*$/#define DOS_NT/ /^#undef FLOAT_CHECK_DOMAIN *$/s/^.*$/#define FLOAT_CHECK_DOMAIN/ /^#undef HAVE_ALLOCA *$/s/^.*$/#define HAVE_ALLOCA 1/ @@ -85,11 +88,12 @@ /^#undef HAVE_UNSIGNED_LONG_LONG_INT *$/s/^.*$/#define HAVE_UNSIGNED_LONG_LONG_INT 1/ /^#undef HAVE_WCHAR_H *$/s/^.*$/#define HAVE_WCHAR_H 1/ /^#undef DEVICE_SEP *$/s/^.*$/#define DEVICE_SEP ':'/ -/^#undef IS_DIRECTORY_SEP *$/s/^.*$/#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\\\')/ +/^#undef IS_DIRECTORY_SEP *$/s,^.*$,#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\\\'), +/^#undef IS_DEVICE_SEP *$/s/^.*$/#define IS_DEVICE_SEP(_c_) ((_c_) == ':')/ /^#undef IS_ANY_SEP *$/s/^.*$/#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))/ -/^#undef INTERNAL_TERMINAL *$/s/^.*$/#define INTERNAL_TERMINAL "pc|bios|IBM PC with color display::co#80:li#25:Co#16:pa#256:km:ms:cm=:cl=:ce=::se=:so=:us=
    :ue=
:md=:mh=:mb=:mr=:me=::AB=:AF=:op=:"/ +/^#undef INTERNAL_TERMINAL *$/s,^.*$,#define INTERNAL_TERMINAL "pc|bios|IBM PC with color display::co#80:li#25:Co#16:pa#256:km:ms:cm=:cl=:ce=::se=
:so=:us=
    :ue=
:md=:mh=:mb=:mr=:me=::AB=:AF=:op=:", /^#undef NULL_DEVICE *$/s/^.*$/#define NULL_DEVICE "nul"/ -/^#undef SEPCHAR *$/s/^.*$/#define SEPCHAR ';'/ +/^#undef SEPCHAR *$/s/^.*$/#define SEPCHAR '\;'/ /^#undef USER_FULL_NAME *$/s/^.*$/#define USER_FULL_NAME (getenv ("NAME"))/ /^#undef _setjmp/s/^.*$/#define _setjmp setjmp/ /^#undef _longjmp/s/^.*$/#define _longjmp longjmp/ === modified file 'msdos/sedlibmk.inp' --- msdos/sedlibmk.inp 2012-07-28 23:05:32 +0000 +++ msdos/sedlibmk.inp 2012-08-04 08:58:33 +0000 @@ -605,10 +605,10 @@ s| *sys/select\.h|| s| *sys/time\.h|| } -/^am_libgnu_a_OBJECTS *=/,/^[ ]/{ +/^am_libgnu_a_OBJECTS *=/,/^[^ ]/{ + s/allocator\.\$(OBJEXT) // s/careadlinkat\.\$(OBJEXT) // } -/^am_libgnu_a_OBJECTS *=/s/allocator\.\$(OBJEXT)// /^srcdir *=/s/@[^@\n]*@/./ /^top_srcdir *=/s/@[^@\n]*@/../ /^top_builddir *=/s/@[^@\n]*@/../ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-04 00:52:10 +0000 +++ src/ChangeLog 2012-08-04 08:58:33 +0000 @@ -1,3 +1,9 @@ +2012-08-04 Eli Zaretskii + + * msdos.c (dos_set_window_size, IT_update_begin) + (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR + instead of direct references. + 2012-08-04 Paul Eggert Export DEFAULT_REHASH_* to GDB. === modified file 'src/msdos.c' --- src/msdos.c 2012-07-11 07:19:44 +0000 +++ src/msdos.c 2012-08-04 08:58:33 +0000 @@ -594,7 +594,7 @@ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); Lisp_Object window = hlinfo->mouse_face_window; - if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) + if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f) { hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; @@ -1255,7 +1255,7 @@ /* If the mouse highlight is in the window that was deleted (e.g., if it was popped by completion), clear highlight unconditionally. */ - if (NILP (w->buffer)) + if (NILP (WVAR (w, buffer))) hlinfo->mouse_face_window = Qnil; else { @@ -1265,7 +1265,7 @@ break; } - if (NILP (w->buffer) || i < w->desired_matrix->nrows) + if (NILP (WVAR (w, buffer)) || i < w->desired_matrix->nrows) clear_mouse_face (hlinfo); } } @@ -1318,8 +1318,8 @@ frame parameters. For the selected window, we use either its buffer-local value or the value from the frame parameters if the buffer doesn't define its local value for the cursor type. */ - sw = XWINDOW (f->selected_window); - frame_desired_cursor = Fcdr (Fassq (Qcursor_type, f->param_alist)); + sw = XWINDOW (FVAR (f, selected_window)); + frame_desired_cursor = Fcdr (Fassq (Qcursor_type, FVAR (f, param_alist))); if (cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window) @@ -1327,7 +1327,7 @@ new_cursor = frame_desired_cursor; else { - struct buffer *b = XBUFFER (sw->buffer); + struct buffer *b = XBUFFER (WVAR (sw, buffer)); if (EQ (BVAR (b,cursor_type), Qt)) new_cursor = frame_desired_cursor; @@ -1598,7 +1598,7 @@ Lisp_Object *values = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); /* Do we have to reverse the foreground and background colors? */ - int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt); + int reverse = EQ (Fcdr (Fassq (Qreverse, FVAR (f, param_alist))), Qt); int redraw = 0, fg_set = 0, bg_set = 0; unsigned long orig_fg, orig_bg; struct tty_display_info *tty = FRAME_TTY (f); ------------------------------------------------------------ revno: 109426 committer: Andreas Schwab branch nick: emacs timestamp: Sat 2012-08-04 10:09:24 +0200 message: * simple.el (list-processes): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-04 08:08:11 +0000 +++ lisp/ChangeLog 2012-08-04 08:09:24 +0000 @@ -2,6 +2,7 @@ * simple.el (list-processes--refresh): For a server use :host or :local as the address. + (list-processes): Doc fix. 2012-08-04 Michal Nazarewicz (tiny change) === modified file 'lisp/simple.el' --- lisp/simple.el 2012-08-04 08:08:11 +0000 +++ lisp/simple.el 2012-08-04 08:09:24 +0000 @@ -2906,7 +2906,7 @@ Any process listed as exited or signaled is actually eliminated after the listing is made. Optional argument BUFFER specifies a buffer to use, instead of -\"*Process List\". +\"*Process List*\". The return value is always nil." (interactive) (or (fboundp 'process-list) ------------------------------------------------------------ revno: 109425 committer: Andreas Schwab branch nick: emacs timestamp: Sat 2012-08-04 10:08:11 +0200 message: * simple.el (list-processes--refresh): For a server use :host or :local as the address. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-04 07:37:27 +0000 +++ lisp/ChangeLog 2012-08-04 08:08:11 +0000 @@ -1,3 +1,8 @@ +2012-08-04 Andreas Schwab + + * simple.el (list-processes--refresh): For a server use :host or + :local as the address. + 2012-08-04 Michal Nazarewicz (tiny change) * lisp/mpc.el: Support password in host argument. === modified file 'lisp/simple.el' --- lisp/simple.el 2012-07-29 18:11:42 +0000 +++ lisp/simple.el 2012-08-04 08:08:11 +0000 @@ -2881,7 +2881,9 @@ "network") (if (plist-get contact :server) (format "server on %s" - (plist-get contact :server)) + (or + (plist-get contact :host) + (plist-get contact :local))) (format "connection to %s" (plist-get contact :host)))) (format "(serial port %s%s)" ------------------------------------------------------------ revno: 109424 author: Michal Nazarewicz committer: Stefan Monnier branch nick: trunk timestamp: Sat 2012-08-04 03:37:27 -0400 message: * lisp/mpc.el: Support password in host argument. (mpc--proc-connect): Parse and use new password element. Set mpc-proc variable instead of returning process. (mpc-proc): Adjust accordingly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-03 11:51:11 +0000 +++ lisp/ChangeLog 2012-08-04 07:37:27 +0000 @@ -1,3 +1,10 @@ +2012-08-04 Michal Nazarewicz (tiny change) + + * lisp/mpc.el: Support password in host argument. + (mpc--proc-connect): Parse and use new password element. + Set mpc-proc variable instead of returning process. + (mpc-proc): Adjust accordingly. + 2012-08-03 Eli Zaretskii * whitespace.el (whitespace-display-mappings): Use Unicode === modified file 'lisp/mpc.el' --- lisp/mpc.el 2012-07-10 11:51:54 +0000 +++ lisp/mpc.el 2012-08-04 07:37:27 +0000 @@ -199,9 +199,10 @@ (defcustom mpc-host (concat (or (getenv "MPD_HOST") "localhost") (if (getenv "MPD_PORT") (concat ":" (getenv "MPD_PORT")))) - "Host (and port) where the Music Player Daemon is running. -The format is \"HOST\" or \"HOST:PORT\" where PORT defaults to 6600 -and HOST defaults to localhost." + "Host (and port) where the Music Player Daemon is running. The +format is \"HOST\", \"HOST:PORT\", \"PASSWORD@HOST\" or +\"PASSWORD@HOST:PORT\" where PASSWORD defaults to no password, PORT +defaults to 6600 and HOST defaults to localhost." :type 'string) (defvar mpc-proc nil) @@ -252,20 +253,30 @@ (funcall callback))))))))) (defun mpc--proc-connect (host) - (mpc--debug "Connecting to %s..." host) - (with-current-buffer (get-buffer-create (format " *mpc-%s*" host)) - ;; (pop-to-buffer (current-buffer)) - (let (proc) - (while (and (setq proc (get-buffer-process (current-buffer))) - (progn ;; (debug) - (delete-process proc))))) - (erase-buffer) - (let ((port 6600)) - (when (string-match ":[^.]+\\'" host) - (setq port (substring host (1+ (match-beginning 0)))) - (setq host (substring host 0 (match-beginning 0))) - (unless (string-match "[^[:digit:]]" port) - (setq port (string-to-number port)))) + (let ((port 6600) + pass) + + (when (string-match "\\`\\(?:\\(.*\\)@\\)?\\(.*?\\)\\(?::\\(.*\\)\\)?\\'" + host) + (let ((v (match-string 1 host))) + (when (and (stringp v) (not (string= "" v))) + (setq pass v))) + (let ((v (match-string 3 host))) + (setq host (match-string 2 host)) + (when (and (stringp v) (not (string= "" v))) + (setq port + (if (string-match "[^[:digit:]]" v) + (string-to-number v) + v))))) + + (mpc--debug "Connecting to %s:%s..." host port) + (with-current-buffer (get-buffer-create (format " *mpc-%s:%s*" host port)) + ;; (pop-to-buffer (current-buffer)) + (let (proc) + (while (and (setq proc (get-buffer-process (current-buffer))) + (progn ;; (debug) + (delete-process proc))))) + (erase-buffer) (let* ((coding-system-for-read 'utf-8-unix) (coding-system-for-write 'utf-8-unix) (proc (open-network-stream "MPC" (current-buffer) host port))) @@ -282,7 +293,9 @@ (set-process-query-on-exit-flag proc nil) ;; This may be called within a process filter ;-( (with-local-quit (mpc-proc-sync proc)) - proc)))) + (setq mpc-proc proc) + (when pass + (mpc-proc-cmd (list "password" pass) nil)))))) (defun mpc--proc-quote-string (s) (if (numberp s) (number-to-string s) @@ -306,11 +319,11 @@ (nreverse alists))) (defun mpc-proc () - (or (and mpc-proc - (buffer-live-p (process-buffer mpc-proc)) - (not (memq (process-status mpc-proc) '(closed))) - mpc-proc) - (setq mpc-proc (mpc--proc-connect mpc-host)))) + (unless (and mpc-proc + (buffer-live-p (process-buffer mpc-proc)) + (not (memq (process-status mpc-proc) '(closed)))) + (mpc--proc-connect mpc-host)) + mpc-proc) (defun mpc-proc-check (proc) (let ((error-text (process-get proc 'mpc-proc-error))) ------------------------------------------------------------ revno: 109423 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-08-03 17:52:10 -0700 message: Export DEFAULT_REHASH_* to GDB. * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE): Now constants, not macros. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-03 23:36:11 +0000 +++ src/ChangeLog 2012-08-04 00:52:10 +0000 @@ -1,3 +1,9 @@ +2012-08-04 Paul Eggert + + Export DEFAULT_REHASH_* to GDB. + * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE): + Now constants, not macros. + 2012-08-03 Paul Eggert Remove unnecessary casts involving pointers. === modified file 'src/lisp.h' --- src/lisp.h 2012-08-03 23:40:20 +0000 +++ src/lisp.h 2012-08-04 00:52:10 +0000 @@ -1271,11 +1271,11 @@ value gives the ratio of current entries in the hash table and the size of the hash table. */ -#define DEFAULT_REHASH_THRESHOLD 0.8 +static double const DEFAULT_REHASH_THRESHOLD = 0.8; /* Default factor by which to increase the size of a hash table. */ -#define DEFAULT_REHASH_SIZE 1.5 +static double const DEFAULT_REHASH_SIZE = 1.5; /* Most code should use this macro to access Lisp fields in a different misc objects. */ ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.