Now on revision 110095. ------------------------------------------------------------ revno: 110095 fixes bug: http://debbugs.gnu.org/12469 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-09-19 14:51:33 +0800 message: * killing.texi (Yanking): Minor clarification. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-09-17 03:24:32 +0000 +++ doc/emacs/ChangeLog 2012-09-19 06:51:33 +0000 @@ -1,3 +1,7 @@ +2012-09-19 Chong Yidong + + * killing.texi (Yanking): Minor clarification (Bug#12469). + 2012-09-17 Chong Yidong * building.texi (GDB User Interface Layout): Remove reference to === modified file 'doc/emacs/killing.texi' --- doc/emacs/killing.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/killing.texi 2012-09-19 06:51:33 +0000 @@ -289,7 +289,7 @@ On graphical displays, @kbd{C-y} first checks if another application has placed any text in the system clipboard more recently than the -last Emacs kill. If so, it inserts the text in the clipboard instead. +last Emacs kill. If so, it inserts the clipboard's text instead. Thus, Emacs effectively treats ``cut'' or ``copy'' clipboard operations performed in other applications like Emacs kills, except that they are not recorded in the kill ring. @xref{Cut and Paste}, ------------------------------------------------------------ revno: 110094 fixes bug: http://debbugs.gnu.org/12368 committer: Jan Djärv branch nick: trunk timestamp: Wed 2012-09-19 08:47:01 +0200 message: * lisp/startup.el (command-line-ns-option-alist): Add -g and --geometry. * src/frame.c (read_integer, XParseGeometry): Moved from w32xfns.c. (Fx_parse_geometry): If there is a space in string, call Qns_parse_geometry, otherwise do as on other terms. * src/w32xfns.c (read_integer, XParseGeometry): Move to frame.c. * src/nsfns.m (XParseGeometry): Remove. (Fx_create_frame): Call x_set_offset to correctly interpret top_pos in geometry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 23:40:39 +0000 +++ lisp/ChangeLog 2012-09-19 06:47:01 +0000 @@ -1,3 +1,7 @@ +2012-09-19 Jan Djärv + + * startup.el (command-line-ns-option-alist): Add -g and --geometry. + 2012-09-18 Juri Linkov * dired-aux.el (dired-diff): Restore original functionality of === modified file 'lisp/startup.el' --- lisp/startup.el 2012-09-17 05:41:04 +0000 +++ lisp/startup.el 2012-09-19 06:47:01 +0000 @@ -216,8 +216,8 @@ ("-fn" 1 x-handle-switch font) ("-font" 1 x-handle-switch font) ("-ib" 1 x-handle-numeric-switch internal-border-width) - ;;("-g" . x-handle-geometry) - ;;("-geometry" . x-handle-geometry) + ("-g" 1 x-handle-geometry) + ("-geometry" 1 x-handle-geometry) ("-fg" 1 x-handle-switch foreground-color) ("-foreground" 1 x-handle-switch foreground-color) ("-bg" 1 x-handle-switch background-color) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-17 20:11:34 +0000 +++ src/ChangeLog 2012-09-19 06:47:01 +0000 @@ -1,3 +1,15 @@ +2012-09-19 Jan Djärv + + * w32xfns.c (read_integer, XParseGeometry): Move to frame.c. + + * nsfns.m (XParseGeometry): Remove. + (Fx_create_frame): Call x_set_offset to correctly interpret + top_pos in geometry. + + * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c. + (Fx_parse_geometry): If there is a space in string, call + Qns_parse_geometry, otherwise do as on other terms (Bug#12368). + 2012-09-17 Eli Zaretskii * search.c (scan_buffer): Use character positions in calls to === modified file 'src/frame.c' --- src/frame.c 2012-09-15 07:06:56 +0000 +++ src/frame.c 2012-09-19 06:47:01 +0000 @@ -3897,6 +3897,140 @@ } +#if !defined (HAVE_X_WINDOWS) && defined (NoValue) + +/* + * XParseGeometry parses strings of the form + * "=x{+-}{+-}", where + * width, height, xoffset, and yoffset are unsigned integers. + * Example: "=80x24+300-49" + * The equal sign is optional. + * It returns a bitmask that indicates which of the four values + * were actually found in the string. For each value found, + * the corresponding argument is updated; for each value + * not found, the corresponding argument is left unchanged. + */ + +static int +read_integer (register char *string, char **NextString) +{ + register int Result = 0; + int Sign = 1; + + if (*string == '+') + string++; + else if (*string == '-') + { + string++; + Sign = -1; + } + for (; (*string >= '0') && (*string <= '9'); string++) + { + Result = (Result * 10) + (*string - '0'); + } + *NextString = string; + if (Sign >= 0) + return (Result); + else + return (-Result); +} + +int +XParseGeometry (char *string, + int *x, int *y, + unsigned int *width, unsigned int *height) +{ + int mask = NoValue; + register char *strind; + unsigned int tempWidth, tempHeight; + int tempX, tempY; + char *nextCharacter; + + if ((string == NULL) || (*string == '\0')) return (mask); + if (*string == '=') + string++; /* ignore possible '=' at beg of geometry spec */ + + strind = (char *)string; + if (*strind != '+' && *strind != '-' && *strind != 'x') + { + tempWidth = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= WidthValue; + } + + if (*strind == 'x' || *strind == 'X') + { + strind++; + tempHeight = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= HeightValue; + } + + if ((*strind == '+') || (*strind == '-')) + { + if (*strind == '-') + { + strind++; + tempX = -read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= XNegative; + + } + else + { + strind++; + tempX = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + } + mask |= XValue; + if ((*strind == '+') || (*strind == '-')) + { + if (*strind == '-') + { + strind++; + tempY = -read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= YNegative; + } + else + { + strind++; + tempY = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + } + mask |= YValue; + } + } + + /* If strind isn't at the end of the string then it's an invalid + geometry specification. */ + + if (*strind != '\0') return (0); + + if (mask & XValue) + *x = tempX; + if (mask & YValue) + *y = tempY; + if (mask & WidthValue) + *width = tempWidth; + if (mask & HeightValue) + *height = tempHeight; + return (mask); +} + +#endif /* !defined (HAVE_X_WINDOWS) && defined (NoValue) */ /* NS used to define x-parse-geometry in ns-win.el, but that confused @@ -3917,15 +4051,16 @@ On Nextstep, this just calls `ns-parse-geometry'. */) (Lisp_Object string) { -#ifdef HAVE_NS - return call1 (Qns_parse_geometry, string); -#else int geometry, x, y; unsigned int width, height; Lisp_Object result; CHECK_STRING (string); +#ifdef HAVE_NS + if (strchr (SSDATA (string), ' ') != NULL) + return call1 (Qns_parse_geometry, string); +#endif geometry = XParseGeometry (SSDATA (string), &x, &y, &width, &height); result = Qnil; @@ -3961,7 +4096,6 @@ result = Fcons (Fcons (Qheight, make_number (height)), result); return result; -#endif /* HAVE_NS */ } === modified file 'src/nsfns.m' --- src/nsfns.m 2012-09-16 09:11:50 +0000 +++ src/nsfns.m 2012-09-19 06:47:01 +0000 @@ -870,16 +870,6 @@ } -/* Xism; we stub out (we do implement this in ns-win.el) */ -int -XParseGeometry (char *string, int *x, int *y, - unsigned int *width, unsigned int *height) -{ - message1 ("Warning: XParseGeometry not supported under NS.\n"); - return 0; -} - - /* TODO: move to nsterm? */ int ns_lisp_to_cursor_type (Lisp_Object arg) @@ -1399,6 +1389,9 @@ UNGCPRO; + if (window_prompting & USPosition) + x_set_offset (f, f->left_pos, f->top_pos, 1); + /* Make sure windows on this frame appear in calls to next-window and similar functions. */ Vwindow_list = Qnil; === modified file 'src/w32xfns.c' --- src/w32xfns.c 2012-09-15 08:03:11 +0000 +++ src/w32xfns.c 2012-09-19 06:47:01 +0000 @@ -303,138 +303,6 @@ } } - -/* - * XParseGeometry parses strings of the form - * "=x{+-}{+-}", where - * width, height, xoffset, and yoffset are unsigned integers. - * Example: "=80x24+300-49" - * The equal sign is optional. - * It returns a bitmask that indicates which of the four values - * were actually found in the string. For each value found, - * the corresponding argument is updated; for each value - * not found, the corresponding argument is left unchanged. - */ - -static int -read_integer (register char *string, char **NextString) -{ - register int Result = 0; - int Sign = 1; - - if (*string == '+') - string++; - else if (*string == '-') - { - string++; - Sign = -1; - } - for (; (*string >= '0') && (*string <= '9'); string++) - { - Result = (Result * 10) + (*string - '0'); - } - *NextString = string; - if (Sign >= 0) - return (Result); - else - return (-Result); -} - -int -XParseGeometry (char *string, - int *x, int *y, - unsigned int *width, unsigned int *height) -{ - int mask = NoValue; - register char *strind; - unsigned int tempWidth, tempHeight; - int tempX, tempY; - char *nextCharacter; - - if ((string == NULL) || (*string == '\0')) return (mask); - if (*string == '=') - string++; /* ignore possible '=' at beg of geometry spec */ - - strind = (char *)string; - if (*strind != '+' && *strind != '-' && *strind != 'x') - { - tempWidth = read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= WidthValue; - } - - if (*strind == 'x' || *strind == 'X') - { - strind++; - tempHeight = read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= HeightValue; - } - - if ((*strind == '+') || (*strind == '-')) - { - if (*strind == '-') - { - strind++; - tempX = -read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= XNegative; - - } - else - { - strind++; - tempX = read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - } - mask |= XValue; - if ((*strind == '+') || (*strind == '-')) - { - if (*strind == '-') - { - strind++; - tempY = -read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= YNegative; - } - else - { - strind++; - tempY = read_integer (strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - } - mask |= YValue; - } - } - - /* If strind isn't at the end of the string then it's an invalid - geometry specification. */ - - if (*strind != '\0') return (0); - - if (mask & XValue) - *x = tempX; - if (mask & YValue) - *y = tempY; - if (mask & WidthValue) - *width = tempWidth; - if (mask & HeightValue) - *height = tempHeight; - return (mask); -} - /* x_sync is a no-op on W32. */ void x_sync (struct frame *f) ------------------------------------------------------------ revno: 110093 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-09-19 02:40:39 +0300 message: * lisp/dired-aux.el (dired-diff): Restore original functionality of getting the default value, but keep new feature of using the latest existing backup file (`diff-latest-backup-file'). diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-18 23:18:06 +0000 +++ etc/NEWS 2012-09-18 23:40:39 +0000 @@ -468,8 +468,8 @@ mark/unmark/flag all files in the active region. *** The minibuffer default for `=' (`dired-diff) has changed. -It is now the backup file for the file at point, if one exists, rather -than the file at the mark. +It is now the backup file for the file at point, if one exists. +In Transient Mark mode the default is the file at the active mark. *** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. The global binding for `M-=', `count-words-region' is in effect. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 23:18:06 +0000 +++ lisp/ChangeLog 2012-09-18 23:40:39 +0000 @@ -1,5 +1,11 @@ 2012-09-18 Juri Linkov + * dired-aux.el (dired-diff): Restore original functionality of + getting the default value, but keep new feature of using the + latest existing backup file (`diff-latest-backup-file'). + +2012-09-18 Juri Linkov + * dired.el (dired-mark): If the region is active in Transient Mark mode, mark all files in the active region. Doc fix. (dired-unmark, dired-flag-file-deletion, dired-unmark-backward): === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-18 22:57:45 +0000 +++ lisp/dired-aux.el 2012-09-18 23:40:39 +0000 @@ -51,33 +51,57 @@ (defconst dired-star-subst-regexp "\\(^\\|[ \t]\\)\\*\\([ \t]\\|$\\)") (defconst dired-quark-subst-regexp "\\(^\\|[ \t]\\)\\?\\([ \t]\\|$\\)") +(declare-function diff-latest-backup-file "diff" (fn)) ; actually belongs into files.el + ;;;###autoload (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. -If called interactively, prompt for FILE; if the file at point -has a backup file, use that as the default. - -FILE is the first file given to `diff'. -With prefix arg, prompt for second argument SWITCHES, -which is the string of command switches for `diff'." +If called interactively, prompt for FILE. If the file at point +has a backup file, use that as the default. If the mark is active +in Transient Mark mode, use the file at the mark as the default. +\(That's the mark set by \\[set-mark-command], not by Dired's +\\[dired-mark] command.) + +FILE is the first file given to `diff'. The file at point +is the second file given to `diff'. + +With prefix arg, prompt for second argument SWITCHES, which is +the string of command switches for the third argument of `diff'." (interactive (let* ((current (dired-get-filename t)) - (oldf (file-newest-backup current)) - (dir (if oldf (file-name-directory oldf)))) - (list (read-file-name - (format "Diff %s with%s: " - (file-name-nondirectory current) - (if oldf - (concat " (default " - (file-name-nondirectory oldf) - ")") - "")) - dir oldf t) - (if current-prefix-arg - (read-string "Options for diff: " - (if (stringp diff-switches) - diff-switches - (mapconcat 'identity diff-switches " "))))))) + ;; Get the latest existing backup file. + (oldf (diff-latest-backup-file current)) + ;; Get the file at the mark. + (file-at-mark (if (and transient-mark-mode mark-active) + (save-excursion (goto-char (mark t)) + (dired-get-filename t t)))) + (default-file (or file-at-mark + (and oldf (file-name-nondirectory oldf)))) + ;; Use it as default if it's not the same as the current file, + ;; and the target dir is current or there is a default file. + (default (if (and (not (equal default-file current)) + (or (equal (dired-dwim-target-directory) + (dired-current-directory)) + default-file)) + default-file)) + (target-dir (if default + (dired-current-directory) + (dired-dwim-target-directory))) + (defaults (dired-dwim-target-defaults (list current) target-dir))) + (list + (minibuffer-with-setup-hook + (lambda () + (set (make-local-variable 'minibuffer-default-add-function) nil) + (setq minibuffer-default defaults)) + (read-file-name + (format "Diff %s with%s: " current + (if default (format " (default %s)" default) "")) + target-dir default t)) + (if current-prefix-arg + (read-string "Options for diff: " + (if (stringp diff-switches) + diff-switches + (mapconcat 'identity diff-switches " "))))))) (let ((current (dired-get-filename t))) (when (or (equal (expand-file-name file) (expand-file-name current)) === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-18 23:18:06 +0000 +++ lisp/dired.el 2012-09-18 23:40:39 +0000 @@ -3763,17 +3763,22 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3650b53533253c50b10e2aa8c9005ebf") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2a883f0d481a8d0292eb90c09ae36a8e") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ Compare file at point with file FILE using `diff'. -If called interactively, prompt for FILE; if the file at point -has a backup file, use that as the default. - -FILE is the first file given to `diff'. -With prefix arg, prompt for second argument SWITCHES, -which is the string of command switches for `diff'. +If called interactively, prompt for FILE. If the file at point +has a backup file, use that as the default. If the mark is active +in Transient Mark mode, use the file at the mark as the default. +\(That's the mark set by \\[set-mark-command], not by Dired's +\\[dired-mark] command.) + +FILE is the first file given to `diff'. The file at point +is the second file given to `diff'. + +With prefix arg, prompt for second argument SWITCHES, which is +the string of command switches for the third argument of `diff'. \(fn FILE &optional SWITCHES)" t nil) ------------------------------------------------------------ revno: 110092 fixes bug: http://debbugs.gnu.org/10624 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-09-19 02:18:06 +0300 message: * lisp/dired.el (dired-mark): If the region is active in Transient Mark mode, mark all files in the active region. Doc fix. (dired-unmark, dired-flag-file-deletion, dired-unmark-backward): Doc fix. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-18 22:57:45 +0000 +++ etc/NEWS 2012-09-18 23:18:06 +0000 @@ -463,6 +463,10 @@ `dired-do-chown', `dired-do-touch' pulls the file attributes of the file at point. +*** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'), +`DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion') +mark/unmark/flag all files in the active region. + *** The minibuffer default for `=' (`dired-diff) has changed. It is now the backup file for the file at point, if one exists, rather than the file at the mark. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 22:57:45 +0000 +++ lisp/ChangeLog 2012-09-18 23:18:06 +0000 @@ -1,5 +1,12 @@ 2012-09-18 Juri Linkov + * dired.el (dired-mark): If the region is active in Transient Mark + mode, mark all files in the active region. Doc fix. + (dired-unmark, dired-flag-file-deletion, dired-unmark-backward): + Doc fix. (Bug#10624) + +2012-09-18 Juri Linkov + * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file attributes for M-n are pulled from the file at point. (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix. === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-18 22:57:45 +0000 +++ lisp/dired.el 2012-09-18 23:18:06 +0000 @@ -3097,21 +3097,37 @@ (defun dired-mark (arg) "Mark the current (or next ARG) files. If on a subdir headerline, mark all its files except `.' and `..'. +If the region is active in Transient Mark mode, mark all files +in the active region. Use \\[dired-unmark-all-files] to remove all marks and \\[dired-unmark] on a subdir to remove the marks in this subdir." (interactive "P") - (if (dired-get-subdir) - (save-excursion (dired-mark-subdir-files)) + (cond + ;; Mark files in the active region. + ((and transient-mark-mode mark-active) + (save-excursion + (let ((beg (region-beginning)) + (end (region-end))) + (dired-mark-files-in-region + (progn (goto-char beg) (line-beginning-position)) + (progn (goto-char end) (line-beginning-position)))))) + ;; Mark subdir files from the subdir headerline. + ((dired-get-subdir) + (save-excursion (dired-mark-subdir-files))) + ;; Mark the current (or next ARG) files. + (t (let ((inhibit-read-only t)) (dired-repeat-over-lines (prefix-numeric-value arg) - (function (lambda () (delete-char 1) (insert dired-marker-char))))))) + (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) (defun dired-unmark (arg) "Unmark the current (or next ARG) files. -If looking at a subdir, unmark all its files except `.' and `..'." +If looking at a subdir, unmark all its files except `.' and `..'. +If the region is active in Transient Mark mode, unmark all files +in the active region." (interactive "P") (let ((dired-marker-char ?\040)) (dired-mark arg))) @@ -3119,8 +3135,9 @@ (defun dired-flag-file-deletion (arg) "In Dired, flag the current line's file for deletion. With prefix arg, repeat over several lines. - -If on a subdir headerline, mark all its files except `.' and `..'." +If on a subdir headerline, flag all its files except `.' and `..'. +If the region is active in Transient Mark mode, flag all files +in the active region." (interactive "P") (let ((dired-marker-char dired-del-marker)) (dired-mark arg))) @@ -3128,7 +3145,9 @@ (defun dired-unmark-backward (arg) "In Dired, move up lines and remove marks or deletion flags there. Optional prefix ARG says how many lines to unmark/unflag; default -is one line." +is one line. +If the region is active in Transient Mark mode, unmark all files +in the active region." (interactive "p") (dired-unmark (- arg))) ------------------------------------------------------------ revno: 110091 fixes bug: http://debbugs.gnu.org/10624 committer: Juri Linkov branch nick: trunk timestamp: Wed 2012-09-19 01:57:45 +0300 message: * lisp/dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file attributes for M-n are pulled from the file at point. (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix. Suggested by Drew Adams. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-16 04:52:38 +0000 +++ etc/NEWS 2012-09-18 22:57:45 +0000 @@ -459,6 +459,10 @@ if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. +*** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp', +`dired-do-chown', `dired-do-touch' pulls the file attributes of the +file at point. + *** The minibuffer default for `=' (`dired-diff) has changed. It is now the backup file for the file at point, if one exists, rather than the file at the mark. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 22:10:19 +0000 +++ lisp/ChangeLog 2012-09-18 22:57:45 +0000 @@ -1,3 +1,10 @@ +2012-09-18 Juri Linkov + + * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file + attributes for M-n are pulled from the file at point. + (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix. + Suggested by Drew Adams. (Bug#10624) + 2012-09-18 Dmitry Gutov * progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-14 22:58:43 +0000 +++ lisp/dired-aux.el 2012-09-18 22:57:45 +0000 @@ -223,10 +223,17 @@ ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up'). ;; ARG describes which files to use, as in `dired-get-marked-files'. (let* ((files (dired-get-marked-files t arg)) - (default (and (eq op-symbol 'touch) - (stringp (car files)) - (format-time-string "%Y%m%d%H%M.%S" - (nth 5 (file-attributes (car files)))))) + ;; The source of default file attributes is the file at point. + (default-file (dired-get-filename t)) + (default (when default-file + (cond ((eq op-symbol 'touch) + (format-time-string + "%Y%m%d%H%M.%S" + (nth 5 (file-attributes default-file)))) + ((eq op-symbol 'chown) + (nth 2 (file-attributes default-file 'string))) + ((eq op-symbol 'chgrp) + (nth 3 (file-attributes default-file 'string)))))) (prompt (concat "Change " attribute-name " of %s to" (if (eq op-symbol 'touch) " (default now): " @@ -263,11 +270,15 @@ ;;;###autoload (defun dired-do-chmod (&optional arg) "Change the mode of the marked (or next ARG) files. -Symbolic modes like `g+w' are allowed." +Symbolic modes like `g+w' are allowed. +Type M-n to pull the file attributes of the file at point +into the minibuffer." (interactive "P") (let* ((files (dired-get-marked-files t arg)) - (modestr (and (stringp (car files)) - (nth 8 (file-attributes (car files))))) + ;; The source of default file attributes is the file at point. + (default-file (dired-get-filename t)) + (modestr (when default-file + (nth 8 (file-attributes default-file)))) (default (and (stringp modestr) (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) @@ -300,7 +311,9 @@ ;;;###autoload (defun dired-do-chgrp (&optional arg) - "Change the group of the marked (or next ARG) files." + "Change the group of the marked (or next ARG) files. +Type M-n to pull the file attributes of the file at point +into the minibuffer." (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chgrp not supported on this system")) @@ -308,7 +321,9 @@ ;;;###autoload (defun dired-do-chown (&optional arg) - "Change the owner of the marked (or next ARG) files." + "Change the owner of the marked (or next ARG) files. +Type M-n to pull the file attributes of the file at point +into the minibuffer." (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chown not supported on this system")) @@ -317,7 +332,9 @@ ;;;###autoload (defun dired-do-touch (&optional arg) "Change the timestamp of the marked (or next ARG) files. -This calls touch." +This calls touch. +Type M-n to pull the file attributes of the file at point +into the minibuffer." (interactive "P") (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg)) === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-15 10:20:56 +0000 +++ lisp/dired.el 2012-09-18 22:57:45 +0000 @@ -3744,7 +3744,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3c768e470d5d053d0049e0286ce38da7") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3650b53533253c50b10e2aa8c9005ebf") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ @@ -3798,22 +3798,30 @@ (autoload 'dired-do-chmod "dired-aux" "\ Change the mode of the marked (or next ARG) files. Symbolic modes like `g+w' are allowed. +Type M-n to pull the file attributes of the file at point +into the minibuffer. \(fn &optional ARG)" t nil) (autoload 'dired-do-chgrp "dired-aux" "\ Change the group of the marked (or next ARG) files. +Type M-n to pull the file attributes of the file at point +into the minibuffer. \(fn &optional ARG)" t nil) (autoload 'dired-do-chown "dired-aux" "\ Change the owner of the marked (or next ARG) files. +Type M-n to pull the file attributes of the file at point +into the minibuffer. \(fn &optional ARG)" t nil) (autoload 'dired-do-touch "dired-aux" "\ Change the timestamp of the marked (or next ARG) files. This calls touch. +Type M-n to pull the file attributes of the file at point +into the minibuffer. \(fn &optional ARG)" t nil) ------------------------------------------------------------ revno: 110090 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2012-09-19 02:10:19 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra whitespace after "end". (ruby-do-end-to-brace): Collapse block to one line if it fits within fill-column. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 07:07:13 +0000 +++ lisp/ChangeLog 2012-09-18 22:10:19 +0000 @@ -1,3 +1,10 @@ +2012-09-18 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra + whitespace after "end". + (ruby-do-end-to-brace): Collapse block to one line if it fits + within fill-column. + 2012-09-18 Martin Rudalics * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-09-08 23:32:25 +0000 +++ lisp/progmodes/ruby-mode.el 2012-09-18 22:10:19 +0000 @@ -1112,8 +1112,9 @@ (goto-char end) (when (eq (char-before) ?\}) (delete-char -1) - (skip-chars-backward " \t") - (when (not (bolp)) + (when (save-excursion + (skip-chars-backward " \t") + (not (bolp))) (insert "\n")) (insert "end") (setq end-marker (point-marker)) @@ -1137,16 +1138,35 @@ t))) (defun ruby-do-end-to-brace (orig end) - (goto-char (- end 3)) - (when (looking-at ruby-block-end-re) - (delete-char 3) - (insert "}") - (goto-char orig) - (delete-char 2) - (insert "{") - (if (looking-at "\\s +|") - (delete-char (- (match-end 0) (match-beginning 0) 1))) - t)) + (let (beg-marker end-marker beg-pos end-pos) + (goto-char (- end 3)) + (when (looking-at ruby-block-end-re) + (delete-char 3) + (setq end-marker (point-marker)) + (insert "}") + (goto-char orig) + (delete-char 2) + (insert "{") + (setq beg-marker (point-marker)) + (when (looking-at "\\s +|") + (delete-char (- (match-end 0) (match-beginning 0) 1)) + (forward-char) + (re-search-forward "|" (line-end-position) t)) + (save-excursion + (skip-chars-forward " \t\n\r") + (setq beg-pos (point)) + (goto-char end-marker) + (skip-chars-backward " \t\n\r") + (setq end-pos (point))) + (when (or + (< end-pos beg-pos) + (and (= (line-number-at-pos beg-pos) (line-number-at-pos end-pos)) + (< (+ (current-column) (- end-pos beg-pos) 2) fill-column))) + (just-one-space -1) + (goto-char end-marker) + (just-one-space -1)) + (goto-char beg-marker) + t))) (defun ruby-toggle-block () "Toggle block type from do-end to braces or back. === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2012-09-08 23:32:25 +0000 +++ test/automated/ruby-mode-tests.el 2012-09-18 22:10:19 +0000 @@ -219,12 +219,16 @@ (should (string= "foo do |b|\nend" (buffer-string))))) (ert-deftest ruby-toggle-block-to-brace () - (with-temp-buffer - (insert "foo do |b|\nend") - (ruby-mode) - (beginning-of-line) - (ruby-toggle-block) - (should (string= "foo {|b|\n}" (buffer-string))))) + (let ((pairs '((16 . "foo {|b| b + 2 }") + (15 . "foo {|b|\n b + 2\n}")))) + (dolist (pair pairs) + (with-temp-buffer + (let ((fill-column (car pair))) + (insert "foo do |b|\n b + 2\nend") + (ruby-mode) + (beginning-of-line) + (ruby-toggle-block) + (should (string= (cdr pair) (buffer-string)))))))) (ert-deftest ruby-toggle-block-to-multiline () (with-temp-buffer ------------------------------------------------------------ revno: 110089 committer: Jan D. branch nick: trunk timestamp: Tue 2012-09-18 20:13:01 +0200 message: * configure.ac (HAVE_GTK): Mention if we use GTK2 or GTK3. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-17 22:43:12 +0000 +++ ChangeLog 2012-09-18 18:13:01 +0000 @@ -1,3 +1,7 @@ +2012-09-18 Jan Djärv + + * configure.ac (HAVE_GTK): Mention if we use GTK2 or GTK3. + 2012-09-17 Andreas Schwab * Makefile.in (bootstrap): Revert last change. Run config.status === modified file 'configure.ac' --- configure.ac 2012-09-17 01:02:11 +0000 +++ configure.ac 2012-09-18 18:13:01 +0000 @@ -1914,6 +1914,7 @@ AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) GTK_OBJ=emacsgtkfixed.o term_header=gtkutil.h + USE_GTK_TOOLKIT="GTK3" else check_gtk2=yes gtk3_pkg_errors="$GTK_PKG_ERRORS " @@ -1932,6 +1933,7 @@ then AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) fi + test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2" fi if test x"$pkg_check_gtk" = xyes; then @@ -4396,7 +4398,7 @@ #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - USE_X_TOOLKIT=GTK + USE_X_TOOLKIT="$USE_GTK_TOOLKIT" fi echo " ------------------------------------------------------------ revno: 110088 fixes bug: http://debbugs.gnu.org/12464 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-09-18 13:49:33 +0300 message: Fix bug #12464 with test for giflib 5.0.0 on MS-Windows. nt/configure.bat: Include stddef.h before gif_lib.h, to have size_t defined, as needed by giflib-5.0.0. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-17 13:22:45 +0000 +++ nt/ChangeLog 2012-09-18 10:49:33 +0000 @@ -1,3 +1,8 @@ +2012-09-18 Eli Zaretskii + + * configure.bat: Include stddef.h before gif_lib.h, to have size_t + defined, as needed by giflib-5.0.0. (Bug#12464) + 2012-09-17 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/configure.bat' --- nt/configure.bat 2012-09-08 11:20:32 +0000 +++ nt/configure.bat 2012-09-18 10:49:33 +0000 @@ -627,7 +627,10 @@ if (%gifsupport%) == (N) goto gifDone echo Checking for libgif... -echo #include "gif_lib.h" >junk.c +rem giflib-5.0.0 needs size_t defined before gif_lib.h is included +rem redirection characters need to be protected from the shell +echo #include ^ >junk.c +echo #include "gif_lib.h" >>junk.c echo main (){} >>junk.c rem -o option is ignored with cl, but allows result to be consistent. echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log ------------------------------------------------------------ revno: 110087 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-18 06:17:43 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2012-09-17 11:44:48 +0000 +++ lisp/mail/rmail.el 2012-09-18 10:17:43 +0000 @@ -4550,7 +4550,7 @@ ;;; Start of automatically extracted autoloads. ;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el" -;;;;;; "7d558f958574f6003fa474ce2f3c80a8") +;;;;;; "78b8b7d5c679935c118d595d473d7c5e") ;;; Generated autoloads from rmailedit.el (autoload 'rmail-edit-current-message "rmailedit" "\ ------------------------------------------------------------ revno: 110086 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-18 00:19:25 -0700 message: rmailedit comment diff: === modified file 'lisp/mail/rmailedit.el' --- lisp/mail/rmailedit.el 2012-01-19 07:21:25 +0000 +++ lisp/mail/rmailedit.el 2012-09-18 07:19:25 +0000 @@ -111,6 +111,8 @@ ;; Even if the message is in `raw' state, boundaries etc ;; are still missing. All we can do is insert the real ;; raw message. (Bug#9840) + ;; FIXME? Since the 2012-09-17 changes to rmail-mime, + ;; can we just use that function now? (when (and entity (not (equal "text/plain" (car (rmail-mime-entity-type entity))))) ------------------------------------------------------------ revno: 110085 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-09-18 09:07:13 +0200 message: Fix some recent changes in debug.el. * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization value. (debug): Don't remove debugger window when debugger is expected to be back. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 05:14:42 +0000 +++ lisp/ChangeLog 2012-09-18 07:07:13 +0000 @@ -1,3 +1,10 @@ +2012-09-18 Martin Rudalics + + * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization + value. + (debug): Don't remove debugger window when debugger is expected + to be back. + 2012-09-18 Chong Yidong * custom.el (defface): Doc fix. === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2012-09-12 19:16:36 +0000 +++ lisp/emacs-lisp/debug.el 2012-09-18 07:07:13 +0000 @@ -75,9 +75,9 @@ The value used here is passed to `quit-restore-window'." :type '(choice (const :tag "Keep alive" nil) - (const :tag "Append" 'append) - (const :tag "Bury" 'bury) - (const :tag "Kill" 'kill)) + (const :tag "Append" append) + (const :tag "Bury" bury) + (const :tag "Kill" kill)) :group 'debugger :version "24.2") @@ -265,7 +265,8 @@ ;; Make sure we unbind buffer-read-only in the right buffer. (save-excursion (recursive-edit)))) - (when (and (window-live-p debugger-window) + (when (and (not debugger-will-be-back) + (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) ;; Record height of debugger window. (setq debugger-previous-window-height ------------------------------------------------------------ revno: 110084 fixes bug: http://debbugs.gnu.org/11440 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-09-18 13:14:42 +0800 message: Doc fixes for defface and friends. * lisp/cus-edit.el (custom-unlispify-remove-prefixes): Add warning. * lisp/custom.el (defface): Doc fix. * doc/lispref/customize.texi (Customization): Define customization more carefully. (Common Keywords): Add xref to Constant Variables. * doc/lispref/display.texi (Faces): Discuss anonymous faces. (Face Attributes): Tweak intro. (Defining Faces): Move after the Face Attributes node. Copyedits. (Displaying Faces): Describe role of inheritance. * doc/lispref/variables.texi (Defining Variables): Link to defcustom's node instead of the higher-level Customization chapter. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-11 02:28:27 +0000 +++ doc/lispref/ChangeLog 2012-09-18 05:14:42 +0000 @@ -1,3 +1,17 @@ +2012-09-18 Chong Yidong + + * display.texi (Faces): Discuss anonymous faces. + (Face Attributes): Tweak intro. + (Defining Faces): Move after the Face Attributes node. Copyedits. + (Displaying Faces): Describe role of inheritance. + + * customize.texi (Customization): Define customization more + carefully (Bug#11440). + (Common Keywords): Add xref to Constant Variables. + + * variables.texi (Defining Variables): Link to defcustom's node + instead of the higher-level Customization chapter. + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). === modified file 'doc/lispref/customize.texi' --- doc/lispref/customize.texi 2012-06-17 05:13:40 +0000 +++ doc/lispref/customize.texi 2012-09-18 05:14:42 +0000 @@ -6,13 +6,30 @@ @chapter Customization Settings @cindex customization item - This chapter describes how to declare customizable variables and -customization groups for classifying them. We use the term -@dfn{customization item} to include customizable variables, -customization groups, as well as faces. + Users of Emacs can customize variables and faces without writing +Lisp code, by using the Customize interface. @xref{Easy +Customization,,, emacs, The GNU Emacs Manual}. This chapter describes +how to define @dfn{customization items} that users can interact with +through the Customize interface. - @xref{Defining Faces}, for the @code{defface} macro, which is used -for declaring customizable faces. + Customization items include customizable variables, which are +defined with the +@ifinfo +@code{defcustom} macro (@pxref{Variable Definitions}); +@end ifinfo +@ifnotinfo +@code{defcustom} macro; +@end ifnotinfo +customizable faces, which are defined with @code{defface} (described +separately in @ref{Defining Faces}); and @dfn{customization groups}, +defined with +@ifinfo +@code{defgroup} (@pxref{Group Definitions}), +@end ifinfo +@ifnotinfo +@code{defgroup}, +@end ifnotinfo +which act as containers for groups of related customization items. @menu * Common Keywords:: Common keyword arguments for all kinds of @@ -29,9 +46,10 @@ @cindex customization keywords The customization declarations that we will describe in the next few -sections (@code{defcustom}, @code{defgroup}, etc.) all accept keyword -arguments for specifying various information. This section describes -keywords that apply to all types of customization declarations. +sections---@code{defcustom}, @code{defgroup}, etc.---all accept +keyword arguments (@pxref{Constant Variables}) for specifying various +information. This section describes keywords that apply to all types +of customization declarations. All of these keywords, except @code{:tag}, can be used more than once in a given item. Each use of the keyword has an independent effect. @@ -188,14 +206,14 @@ @cindex define customization group @cindex customization groups, defining - Each Emacs Lisp package should have one main customization group which -contains all the options, faces and other groups in the package. If the -package has a small number of options and faces, use just one group and -put everything in it. When there are more than twelve or so options and -faces, then you should structure them into subgroups, and put the -subgroups under the package's main customization group. It is OK to -put some of the options and faces in the package's main group alongside -the subgroups. + Each Emacs Lisp package should have one main customization group +which contains all the options, faces and other groups in the package. +If the package has a small number of options and faces, use just one +group and put everything in it. When there are more than twenty or so +options and faces, then you should structure them into subgroups, and +put the subgroups under the package's main customization group. It is +OK to put some of the options and faces in the package's main group +alongside the subgroups. The package's main or only group should be a member of one or more of the standard customization groups. (To display the full list of them, @@ -251,7 +269,17 @@ @node Variable Definitions @section Defining Customization Variables @cindex define customization options -@cindex customization variables, how to define +@cindex customizable variables, how to define +@cindex user options, how to define + + @dfn{Customizable variables}, also called @dfn{user options}, are +global Lisp variables whose values can be set through the Customize +interface. Unlike other global variables, which are defined with +@code{defvar} (@pxref{Defining Variables}), customizable variables are +defined using the @code{defcustom} macro. In addition to calling +@code{defvar} as a subroutine, @code{defcustom} states how the +variable should be displayed in the Customize interface, the values it +is allowed to take, etc. @defmac defcustom option standard doc [keyword value]@dots{} This macro declares @var{option} as a user option (i.e.@: a @@ -291,13 +319,14 @@ standard value after Emacs starts up. @end defmac - @code{defcustom} accepts the following additional keywords: + In addition to the keywords listed in @ref{Common Keywords}, this +macro accepts the following keywords: @table @code @item :type @var{type} Use @var{type} as the data type for this option. It specifies which -values are legitimate, and how to display the value. -@xref{Customization Types}, for more information. +values are legitimate, and how to display the value +(@pxref{Customization Types}). @item :options @var{value-list} @kindex options@r{, @code{defcustom} keyword} === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2012-08-05 09:24:55 +0000 +++ doc/lispref/display.texi 2012-09-18 05:14:42 +0000 @@ -1863,20 +1863,36 @@ A @dfn{face} is a collection of graphical @dfn{attributes} for displaying text: font, foreground color, background color, optional -underlining, and so on. Faces control how Emacs displays text in -buffers, as well as other parts of the frame such as the mode line. -@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of -faces Emacs normally comes with. - -@cindex face id - For most purposes, you refer to a face in Lisp programs using its -@dfn{face name}, which is usually a Lisp symbol. For backward -compatibility, a face name can also be a string, which is equivalent -to a Lisp symbol of the same name. +underlining, etc. Faces control how Emacs displays text in buffers, +as well as other parts of the frame such as the mode line. + +@cindex anonymous face + One way to represent a face is as a property list of attributes, +like @code{(:foreground "red" :weight bold)}. For example, you can +assign such an @dfn{anonymous face} as the value of the @code{face} +text property; this causes Emacs to display the underlying text with +the specified attributes. @xref{Special Properties}. + +@cindex face name + More commonly, a face is referred to via a @dfn{face name}: a Lisp +symbol which is associated with a set of face attributes. Named faces +are defined using the @code{defface} macro (@pxref{Defining Faces}). +Emacs defines several standard named faces; @xref{Standard Faces,,, +emacs, The GNU Emacs Manual}. + + Many parts of Emacs require named faces, and do not accept anonymous +faces. These include the functions documented in @ref{Attribute +Functions}, and the variable @code{font-lock-keywords} +(@pxref{Search-based Fontification}). Unless otherwise stated, we +will use the term @dfn{face} to refer only to named faces. + + For backward compatibility, you can also use a string to specify a +face name; that is equivalent to a Lisp symbol with the same name. @defun facep object -This function returns a non-@code{nil} value if @var{object} is a Lisp -symbol or string that names a face. Otherwise, it returns @code{nil}. +This function returns a non-@code{nil} value if @var{object} is a +named face: a Lisp symbol or string which serves as a face name. +Otherwise, it returns @code{nil}. @end defun By default, each face name corresponds to the same set of attributes @@ -1884,8 +1900,8 @@ attributes in one frame (@pxref{Attribute Functions}). @menu +* Face Attributes:: What is in a face? * Defining Faces:: How to define a face. -* Face Attributes:: What is in a face? * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. * Face Remapping:: Remapping faces to alternative definitions. @@ -1900,161 +1916,21 @@ * Low-Level Font:: Lisp representation for character display fonts. @end menu -@node Defining Faces -@subsection Defining Faces - - The @code{defface} macro defines a face and specifies its default -appearance. The user can subsequently customize the face using the -Customize interface (@pxref{Customization}). - -@defmac defface face spec doc [keyword value]@dots{} -This macro declares @var{face} as a customizable face whose default -attributes are given by @var{spec}. You should not quote the symbol -@var{face}, and it should not end in @samp{-face} (that would be -redundant). The argument @var{doc} is a documentation string for the -face. The additional @var{keyword} arguments have the same meanings -as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). - -When @code{defface} executes, it defines the face according to -@var{spec}, then uses any customizations that were read from the -init file (@pxref{Init File}) to override that specification. - -When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs -Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} -overrides any customizations of the face. This way, the face reflects -exactly what the @code{defface} says. - -@cindex face specification -The @var{spec} argument is a @dfn{face specification}, which states -how the face should appear on different kinds of terminals. It should -be an alist whose elements each have the form - -@example -(@var{display} . @var{plist}) -@end example - -@noindent -@var{display} specifies a class of terminals (see below), while -@var{plist} is a property list of face attributes and their values, -specifying how the face appears on such terminals -@iftex -(see the next section for details about face attributes). -@end iftex -@ifnottex -(@pxref{Face Attributes}, for details about face attributes). -@end ifnottex - -The @var{display} part of an element of @var{spec} determines which -frames the element matches. If more than one element of @var{spec} -matches a given frame, the first element that matches is the one used -for that frame. There are three possibilities for @var{display}: - -@table @asis -@item @code{default} -This element of @var{spec} doesn't match any frames; instead, it -specifies defaults that apply to all frames. This element, if used, -must be the first element of @var{spec}. Each of the following -elements can override any or all of these defaults. - -@item @code{t} -This element of @var{spec} matches all frames. Therefore, any -subsequent elements of @var{spec} are never used. Normally -@code{t} is used in the last (or only) element of @var{spec}. - -@item a list -If @var{display} is a list, each element should have the form -@code{(@var{characteristic} @var{value}@dots{})}. Here -@var{characteristic} specifies a way of classifying frames, and the -@var{value}s are possible classifications which @var{display} should -apply to. Here are the possible values of @var{characteristic}: - -@table @code -@item type -The kind of window system the frame uses---either @code{graphic} (any -graphics-capable display), @code{x}, @code{pc} (for the MS-DOS console), -@code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} -(a non-graphics-capable display). -@xref{Window Systems, window-system}. - -@item class -What kinds of colors the frame supports---either @code{color}, -@code{grayscale}, or @code{mono}. - -@item background -The kind of background---either @code{light} or @code{dark}. - -@item min-colors -An integer that represents the minimum number of colors the frame -should support. This matches a frame if its -@code{display-color-cells} value is at least the specified integer. - -@item supports -Whether or not the frame can display the face attributes given in -@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face -Attribute Testing}, for more information on exactly how this testing -is done. -@end table - -If an element of @var{display} specifies more than one @var{value} for a -given @var{characteristic}, any of those values is acceptable. If -@var{display} has more than one element, each element should specify a -different @var{characteristic}; then @emph{each} characteristic of the -frame must match one of the @var{value}s specified for it in -@var{display}. -@end table -@end defmac - - Here's how the standard face @code{highlight} is defined: - -@example -(defface highlight - '((((class color) (min-colors 88) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 88) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 16) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 16) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 8)) - :background "green" :foreground "black") - (t :inverse-video t)) - "Basic face for highlighting." - :group 'basic-faces) -@end example - - Internally, Emacs stores the face's default specification in its -@code{face-defface-spec} symbol property (@pxref{Property Lists}). -The @code{saved-face} property stores the face specification saved by -the user, using the customization buffer; the @code{customized-face} -property stores the face specification customized for the current -session, but not saved; and the @code{theme-face} property stores an -alist associating the active customization settings and Custom themes -with their specifications for that face. The face's documentation -string is stored in the @code{face-documentation} property. But -normally you should not try to set any of these properties directly. -@xref{Applying Customizations}, for the @code{custom-set-faces} -function, which is used to apply customized face settings. - - People are sometimes tempted to create variables whose values -specify a face to use. In the vast majority of cases, this is not -necessary; it is preferable to simply use faces directly. - @node Face Attributes @subsection Face Attributes @cindex face attributes - The effect of using a face is determined by a fixed set of @dfn{face -attributes}. This table lists all the face attributes, their possible -values, and their effects. You can specify more than one face for a -given piece of text; Emacs merges the attributes of all the faces to -determine how to display the text. @xref{Displaying Faces}. + @dfn{Face attributes} determine the visual appearance of a face. +The following table lists all the face attributes, their possible +values, and their effects. - In addition to the values given below, each face attribute can also -have the value @code{unspecified}. This special value means the face -doesn't specify that attribute. In face merging, when the first face -fails to specify a particular attribute, the next face gets a chance. -However, the @code{default} face must specify all attributes. + Apart from the values given below, each face attribute can have the +value @code{unspecified}. This special value means that the face +doesn't specify that attribute directly. An @code{unspecified} +attribute tells Emacs to refer instead to a parent face (see the +description @code{:inherit} attribute below); or, failing that, to an +underlying face (@pxref{Displaying Faces}). The @code{default} face +must specify all attributes. Some of these attributes are meaningful only on certain kinds of displays. If your display cannot handle a certain attribute, the @@ -2063,7 +1939,7 @@ @table @code @item :family Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU -Emacs Manual}, for more information about font families; the function +Emacs Manual}, for more information about font families. The function @code{font-family-list} (see below) returns a list of available family names. @xref{Fontsets}, for information about fontsets. @@ -2083,9 +1959,8 @@ units of 1/10 point. The value can also be a floating point number or a function, which -specifies the height relative to an @dfn{underlying face} (i.e., a -face that has a lower priority in the list described in -@ref{Displaying Faces}). If the value is a floating point number, +specifies the height relative to an @dfn{underlying face} +(@pxref{Displaying Faces}). If the value is a floating point number, that specifies the amount by which to scale the height of the underlying face. If the value is a function, that function is called with one argument, the height of the underlying face, and returns the @@ -2261,11 +2136,147 @@ @code{nil} otherwise. @end defun +@node Defining Faces +@subsection Defining Faces + + The usual way to define a face is through the @code{defface} macro. +This macro defines a face name, and associates that name with a set of +face attributes. It also sets up the face so that the user can +customize it via the Customize interface (@pxref{Customization}). + +@defmac defface face spec doc [keyword value]@dots{} +This macro declares @var{face} as a customizable face whose default +attributes are given by @var{spec}. You should not quote the symbol +@var{face}, and it should not end in @samp{-face} (that would be +redundant). The argument @var{doc} is a documentation string for the +face. The additional @var{keyword} arguments have the same meanings +as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). + +When @code{defface} executes, it defines the face according to +@var{spec}, then uses any customizations that were read from the +init file (@pxref{Init File}) to override that specification. + +When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs +Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} +overrides any customizations of the face. This way, the face reflects +exactly what the @code{defface} says. + +@cindex face specification +The @var{spec} argument is a @dfn{face specification}, which states +how the face should appear on different kinds of terminals. It should +be an alist whose elements each have the form + +@example +(@var{display} . @var{plist}) +@end example + +@noindent +@var{display} specifies a class of terminals (see below). @var{plist} +is a property list of face attributes and their values, specifying how +the face appears on such terminals. For backward compatibility, you +can also write an element as @code{(@var{display} @var{plist})}. + +The @var{display} part of an element of @var{spec} determines which +terminals the element matches. If more than one element of @var{spec} +matches a given terminal, the first element that matches is the one +used for that terminal. There are three possibilities for +@var{display}: + +@table @asis +@item @code{default} +This element of @var{spec} doesn't match any terminal; instead, it +specifies defaults that apply to all terminals. This element, if +used, must be the first element of @var{spec}. Each of the following +elements can override any or all of these defaults. + +@item @code{t} +This element of @var{spec} matches all terminals. Therefore, any +subsequent elements of @var{spec} are never used. Normally @code{t} +is used in the last (or only) element of @var{spec}. + +@item a list +If @var{display} is a list, each element should have the form +@code{(@var{characteristic} @var{value}@dots{})}. Here +@var{characteristic} specifies a way of classifying terminals, and the +@var{value}s are possible classifications which @var{display} should +apply to. Here are the possible values of @var{characteristic}: + +@table @code +@item type +The kind of window system the terminal uses---either @code{graphic} +(any graphics-capable display), @code{x}, @code{pc} (for the MS-DOS +console), @code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} (a +non-graphics-capable display). @xref{Window Systems, window-system}. + +@item class +What kinds of colors the terminal supports---either @code{color}, +@code{grayscale}, or @code{mono}. + +@item background +The kind of background---either @code{light} or @code{dark}. + +@item min-colors +An integer that represents the minimum number of colors the terminal +should support. This matches a terminal if its +@code{display-color-cells} value is at least the specified integer. + +@item supports +Whether or not the terminal can display the face attributes given in +@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face +Attribute Testing}, for more information on exactly how this testing +is done. +@end table + +If an element of @var{display} specifies more than one @var{value} for +a given @var{characteristic}, any of those values is acceptable. If +@var{display} has more than one element, each element should specify a +different @var{characteristic}; then @emph{each} characteristic of the +terminal must match one of the @var{value}s specified for it in +@var{display}. +@end table +@end defmac + + Here's how the standard face @code{highlight} is defined: + +@example +(defface highlight + '((((class color) (min-colors 88) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 88) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 16) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 16) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 8)) + :background "green" :foreground "black") + (t :inverse-video t)) + "Basic face for highlighting." + :group 'basic-faces) +@end example + + Internally, Emacs stores the face's default specification in its +@code{face-defface-spec} symbol property (@pxref{Property Lists}). +The @code{saved-face} property stores the face specification saved by +the user, using the customization buffer; the @code{customized-face} +property stores the face specification customized for the current +session, but not saved; and the @code{theme-face} property stores an +alist associating the active customization settings and Custom themes +with their specifications for that face. The face's documentation +string is stored in the @code{face-documentation} property. But +normally you should not try to set any of these properties directly. +@xref{Applying Customizations}, for the @code{custom-set-faces} +function, which is used to apply customized face settings. + + People are sometimes tempted to create variables whose values +specify a face to use. In the vast majority of cases, this is not +necessary; it is preferable to simply use faces directly. + @node Attribute Functions @subsection Face Attribute Functions This section describes the functions for accessing and modifying the -attributes of an existing face. +attributes of an existing named face. @defun set-face-attribute face frame &rest arguments This function sets one or more attributes of @var{face} for @@ -2467,8 +2478,12 @@ @node Displaying Faces @subsection Displaying Faces - Here is how Emacs determines the face to use for displaying any -given piece of text: + When Emacs displays a given piece of text, the visual appearance of +the text may be determined by faces drawn from different sources. If +these various sources together specify more than one face for a +particular character, Emacs merges the attributes of the various +faces. Here is the order in which Emacs merges the faces, from +highest to lowest priority: @itemize @bullet @item @@ -2482,11 +2497,11 @@ @item If the text lies within an overlay with a non-@code{nil} @code{face} -property, Emacs applies the face or face attributes specified by that -property. If the overlay has a @code{mouse-face} property and the -mouse is ``near enough'' to the overlay, Emacs applies the face or -face attributes specified by the @code{mouse-face} property instead. -@xref{Overlay Properties}. +property, Emacs applies the face(s) specified by that property. If +the overlay has a @code{mouse-face} property and the mouse is ``near +enough'' to the overlay, Emacs applies the face or face attributes +specified by the @code{mouse-face} property instead. @xref{Overlay +Properties}. When multiple overlays cover one character, an overlay with higher priority overrides those with lower priority. @xref{Overlays}. @@ -2508,11 +2523,12 @@ steps, Emacs applies the attribute of the @code{default} face. @end itemize - If these various sources together specify more than one face for a -particular character, Emacs merges the attributes of the various faces -specified. For each attribute, Emacs tries using the above order -(i.e.@: first the face of any special glyph; then the face for region -highlighting, if appropriate; and so on). + At each stage, if a face has a valid @code{:inherit} attribute, +Emacs treats any attribute with an @code{unspecified} value as having +the corresponding value drawn from the parent face(s). @pxref{Face +Attributes}. Note that the parent face(s) may also leave the +attribute unspecified; in that case, the attribute remains unspecified +at the next level of face merging. @node Face Remapping @subsection Face Remapping === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2012-08-04 14:33:00 +0000 +++ doc/lispref/elisp.texi 2012-09-18 05:14:42 +0000 @@ -1366,8 +1366,8 @@ Faces +* Face Attributes:: What is in a face? * Defining Faces:: How to define a face. -* Face Attributes:: What is in a face? * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2012-08-04 14:33:00 +0000 +++ doc/lispref/text.texi 2012-09-18 05:14:42 +0000 @@ -2999,12 +2999,11 @@ A face name (a symbol or string). @item -A property list of face attributes. This has the -form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a -face attribute name and @var{value} is a meaningful value for that -attribute. With this feature, you do not need to create a face each -time you want to specify a particular attribute for certain text. -@xref{Face Attributes}. +A property list of face attributes. This has the form (@var{keyword} +@var{value} @dots{}), where each @var{keyword} is a face attribute +name and @var{value} is a meaningful value for that attribute. With +this feature, you do not need to create a face each time you want to +specify a particular attribute for certain text. @item A list of faces. This specifies a face which is an aggregate of the === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2012-09-07 14:15:59 +0000 +++ doc/lispref/variables.texi 2012-09-18 05:14:42 +0000 @@ -403,7 +403,8 @@ initializes it only if it is originally void. To define a customizable variable, you should use @code{defcustom} -(which calls @code{defvar} as a subroutine). @xref{Customization}. +(which calls @code{defvar} as a subroutine). @xref{Variable +Definitions}. @defspec defvar symbol [value [doc-string]] This special form defines @var{symbol} as a variable. Note that === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-18 04:18:36 +0000 +++ lisp/ChangeLog 2012-09-18 05:14:42 +0000 @@ -1,3 +1,9 @@ +2012-09-18 Chong Yidong + + * custom.el (defface): Doc fix. + + * cus-edit.el (custom-unlispify-remove-prefixes): Add warning. + 2012-09-18 Martin Blais (tiny change) * progmodes/compile.el (compilation-start): Use compilation-always-kill === modified file 'lisp/cus-edit.el' --- lisp/cus-edit.el 2012-08-15 16:29:11 +0000 +++ lisp/cus-edit.el 2012-09-18 05:14:42 +0000 @@ -526,7 +526,10 @@ :type 'boolean) (defcustom custom-unlispify-remove-prefixes nil - "Non-nil means remove group prefixes from option names in buffer." + "Non-nil means remove group prefixes from option names in buffer. +Discarding prefixes often leads to confusing names for options +and faces in Customize buffers, so do not set this to a non-nil +value unless you are sure you know what it does." :group 'custom-menu :group 'custom-buffer :type 'boolean) === modified file 'lisp/custom.el' --- lisp/custom.el 2012-09-17 05:41:04 +0000 +++ lisp/custom.el 2012-09-18 05:14:42 +0000 @@ -350,68 +350,62 @@ Third argument DOC is the face documentation. -If FACE has been set with `custom-set-faces', set the face attributes -as specified by that function, otherwise set the face attributes -according to SPEC. - -The remaining arguments should have the form - - [KEYWORD VALUE]... - +If FACE has been set with `custom-set-faces', set the face +attributes as specified by that function, otherwise set the face +attributes according to SPEC. + +The remaining arguments should have the form [KEYWORD VALUE]... For a list of valid keywords, see the common keywords listed in `defcustom'. -SPEC should be an alist of the form ((DISPLAY ATTS)...). - -In the first element, DISPLAY can be `default'. The ATTS in that -element then act as defaults for all the following elements. - -Aside from that, DISPLAY specifies conditions to match some or -all frames. For each frame, the first element of SPEC where the -DISPLAY conditions are satisfied is the one that applies to that -frame. The ATTRs in this element take effect, and the following -elements are ignored, on that frame. - -In the last element, DISPLAY can be t. That element applies to a -frame if none of the previous elements (except the `default' if -any) did. - -ATTS is a list of face attributes followed by their values: - (ATTR VALUE ATTR VALUE...) - -The possible attributes are `:family', `:width', `:height', `:weight', -`:slant', `:underline', `:overline', `:strike-through', `:box', -`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'. - -DISPLAY can be `default' (only in the first element), the symbol -t (only in the last element) to match all frames, or an alist of -conditions of the form \(REQ ITEM...). For such an alist to -match a frame, each of the conditions must be satisfied, meaning -that the REQ property of the frame must match one of the -corresponding ITEMs. These are the defined REQ values: - -`type' (the value of `window-system') - Under X, in addition to the values `window-system' can take, - `motif', `lucid', `gtk' and `x-toolkit' are allowed, and match when - the Motif toolkit, Lucid toolkit, GTK toolkit or any X toolkit is in use. - -`class' (the frame's color support) - Should be one of `color', `grayscale', or `mono'. - -`background' (what color is used for the background text) - Should be one of `light' or `dark'. - -`min-colors' (the minimum number of colors the frame should support) - Should be an integer, it is compared with the result of - `display-color-cells'. - -`supports' (only match frames that support the specified face attributes) - Should be a list of face attributes. See the documentation for - the function `display-supports-face-attributes-p' for more - information on exactly how testing is done. - -See Info node `(elisp) Customization' in the Emacs Lisp manual -for more information." +SPEC should be an alist of the form + + ((DISPLAY . ATTS)...) + +where DISPLAY is a form specifying conditions to match certain +terminals and ATTS is a property list (ATTR VALUE ATTR VALUE...) +specifying face attributes and values for frames on those +terminals. On each terminal, the first element with a matching +DISPLAY specification takes effect, and the remaining elements in +SPEC are disregarded. + +As a special exception, in the first element of SPEC, DISPLAY can +be the special value `default'. Then the ATTS in that element +act as defaults for all the following elements. + +For backward compatibility, elements of SPEC can be written +as (DISPLAY ATTS) instead of (DISPLAY . ATTS). + +Each DISPLAY can have the following values: + - `default' (only in the first element). + - The symbol t, which matches all terminals. + - An alist of conditions. Each alist element must have the form + (REQ ITEM...). A matching terminal must satisfy each + specified condition by matching one of its ITEMs. Each REQ + must be one of the following: + - `type' (the terminal type). + Each ITEM must be one of the values returned by + `window-system'. Under X, additional allowed values are + `motif', `lucid', `gtk' and `x-toolkit'. + - `class' (the terminal's color support). + Each ITEM should be one of `color', `grayscale', or `mono'. + - `background' (what color is used for the background text) + Each ITEM should be one of `light' or `dark'. + - `min-colors' (the minimum number of supported colors) + Each ITEM should be an integer, which is compared with the + result of `display-color-cells'. + - `supports' (match terminals supporting certain attributes). + Each ITEM should be a list of face attributes. See + `display-supports-face-attributes-p' for more information on + exactly how testing is done. + +In the ATTS property list, possible attributes are `:family', +`:width', `:height', `:weight', `:slant', `:underline', +`:overline', `:strike-through', `:box', `:foreground', +`:background', `:stipple', `:inverse-video', and `:inherit'. + +See Info node `(elisp) Faces' in the Emacs Lisp manual for more +information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem