Mercurial > emacs
changeset 95563:6d9c4248a579
Rename functions in lisp/face-remap.el
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1208
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 05 Jun 2008 02:42:55 +0000 |
parents | 5ffb937b95e9 |
children | 823072be49ad |
files | doc/emacs/ChangeLog doc/emacs/display.texi doc/lispref/ChangeLog doc/lispref/display.texi lisp/ChangeLog lisp/face-remap.el |
diffstat | 6 files changed, 85 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/emacs/ChangeLog Thu Jun 05 02:41:03 2008 +0000 +++ b/doc/emacs/ChangeLog Thu Jun 05 02:42:55 2008 +0000 @@ -1,3 +1,8 @@ +2008-06-05 Miles Bader <miles@gnu.org> + + * display.texi (Temporary Face Changes): Update to reflect function + renamings in face-remap.el. + 2008-06-04 Miles Bader <miles@gnu.org> * display.texi (Temporary Face Changes): Add
--- a/doc/emacs/display.texi Thu Jun 05 02:41:03 2008 +0000 +++ b/doc/emacs/display.texi Thu Jun 05 02:42:55 2008 +0000 @@ -1179,7 +1179,7 @@ display text in a buffer. @cindex adjust buffer face height -@findex adjust-buffer-face-height +@findex text-scale-adjust @kindex C-x C-+ @kindex C-x C-- @kindex C-x C-= @@ -1188,7 +1188,7 @@ step, type @kbd{C-x C-+} or @kbd{C-x C-=}. To decrease it one step, type @kbd{C-x C--}. To restore the default (global) face height, type @kbd{C-x C-0}. These keys are all bound to the same command, -@code{adjust-buffer-face-height}, which looks at the last key typed to +@code{text-scale-adjust}, which looks at the last key typed to determine the adjustment to make. The final key of these commands may be repeated without the leading @@ -1201,23 +1201,22 @@ argument of 0 will remove any scaling currently active. This command is a special-purpose wrapper around the -@code{increase-buffer-face-height} command which makes repetition -convenient even when it is bound in a non-top-level keymap. For -binding in a top-level keymap, @code{increase-buffer-face-height} or -@code{decrease-default-face-height} may be more appropriate." +@code{text-scale-increase} command which makes repetition convenient +even when it is bound in a non-top-level keymap. For binding in a +top-level keymap, @code{text-scale-increase} or +@code{text-scale-decrease} may be more appropriate." @cindex increase buffer face height -@findex increase-buffer-face-height +@findex text-scale-increase @cindex decrease buffer face height -@findex decrease-buffer-face-height -The @code{increase-buffer-face-height} and -@code{decrease-buffer-face-height} commands increase or decrease the -height of the default face in the current buffer by one step. With a -numeric prefix argument, the size will be increased/decreased by that -many steps; each step scales the font height by the value of the -variable @code{text-scale-mode-step}. If repeated, this command has a -cumulative effect. As a special case, a prefix argument of 0 will -remove any scaling currently active. +@findex text-scale-decrease +The @code{text-scale-increase} and @code{text-scale-decrease} commands +increase or decrease the height of the default face in the current +buffer by one step. With a numeric prefix argument, the size will be +increased/decreased by that many steps; each step scales the font +height by the value of the variable @code{text-scale-mode-step}. If +repeated, this command has a cumulative effect. As a special case, a +prefix argument of 0 will remove any scaling currently active. @findex text-scale-mode These commands automatically enable or disable the
--- a/doc/lispref/ChangeLog Thu Jun 05 02:41:03 2008 +0000 +++ b/doc/lispref/ChangeLog Thu Jun 05 02:42:55 2008 +0000 @@ -1,3 +1,8 @@ +2008-06-05 Miles Bader <miles@gnu.org> + + * display.texi (Displaying Faces): Update to reflect function + renamings in face-remap.el. + 2008-06-05 Juanma Barranquero <lekktu@gmail.com> * display.texi (Fontsets): Fix typos.
--- a/doc/lispref/display.texi Thu Jun 05 02:41:03 2008 +0000 +++ b/doc/lispref/display.texi Thu Jun 05 02:42:55 2008 +0000 @@ -2439,8 +2439,8 @@ together, with earlier values taking precedence. The @var{relative_specs_}n values are ``relative specs'', and are -added by @code{add-relative-face-remapping} (and removed by -@code{remove-relative-face-remapping}. These are intended for face +added by @code{face-remap-add-relative} (and removed by +@code{face-remap-remove-relative}. These are intended for face modifications (such as increasing the size). Typical users of these relative specs would be minor modes. @@ -2448,37 +2448,37 @@ face name, which causes the global definition of that face to be used. A non-default value of @var{base_specs} may also be set using -@code{set-base-face-remapping}. Because this @emph{overwrites} the +@code{face-remap-set-base}. Because this @emph{overwrites} the default base-spec value (which inherits the global face definition), -it is up to the caller of @code{set-base-face-remapping} to add such +it is up to the caller of @code{face-remap-set-base} to add such inheritance if it is desired. A typical use of -@code{set-base-face-remapping} would be a major mode adding a face +@code{face-remap-set-base} would be a major mode adding a face remappings, e.g., of the default face. -@defun add-relative-face-remapping face &rest specs +@defun face-remap-add-relative face &rest specs This functions adds a face remapping entry of @var{face} to @var{specs} in the current buffer. It returns a ``cookie'' which can be used to later delete the remapping with -@code{remove-relative-face-remapping}. +@code{face-remap-remove-relative}. @var{specs} can be any value suitable for the @code{face} text property, including a face name, a list of face names, or a face-attribute property list. The attributes given by @var{specs} will be merged with any other currently active face remappings of @var{face}, and with the global definition of @var{face} (by default; -this may be changed using @code{set-base-face-remapping}), -with the most recently added relative remapping taking precedence. +this may be changed using @code{face-remap-set-base}), with the most +recently added relative remapping taking precedence. @end defun -@defun remove-relative-face-remapping cookie +@defun face-remap-remove-relative cookie This function removes a face remapping previously added by -@code{add-relative-face-remapping}. @var{cookie} should be a return -value from that function. +@code{face-remap-add-relative}. @var{cookie} should be a return value +from that function. @end defun -@defun set-base-face-remapping face &rest specs +@defun face-remap-set-base face &rest specs This function sets the ``base remapping'' of @var{face} in the current buffer to @var{specs}. If @var{specs} is empty, the default base remapping is restored, which inherits from the global definition of @@ -2487,7 +2487,7 @@ definition of @var{face} is ignored). @end defun -@defun set-default-base-face-remapping face +@defun face-remap-reset-base face This function sets the ``base remapping'' of @var{face} to its default value, which inherits from @var{face}'s global definition. @end defun
--- a/lisp/ChangeLog Thu Jun 05 02:41:03 2008 +0000 +++ b/lisp/ChangeLog Thu Jun 05 02:42:55 2008 +0000 @@ -36,6 +36,17 @@ 2008-06-05 Miles Bader <miles@gnu.org> + * face-remap.el + (face-remap-add-relative): Renamed from `add-relative-face-remapping'. + (face-remap-remove-relative): Renamed from + `remove-relative-face-remapping'. + (face-remap-reset-base): Renamed from + `set-default-base-face-remapping'. + (face-remap-set-base): Renamed from `set-base-face-remapping'. + (text-scale-increase): Renamed from `increase-buffer-face-height'. + (text-scale-decrease): Renamed from `decrease-buffer-face-height'. + (text-scale-adjust): Renamed from `adjust-buffer-face-height'. + * face-remap.el (variable-pitch-mode): Autoload. 2008-06-04 Sam Steingold <sds@gnu.org>
--- a/lisp/face-remap.el Thu Jun 05 02:41:03 2008 +0000 +++ b/lisp/face-remap.el Thu Jun 05 02:42:55 2008 +0000 @@ -36,8 +36,8 @@ ;; The "specs" values are a lists of face names or face attribute-value ;; pairs, and are merged together, with earlier values taking precedence. ;; -;; The RELATIVE_SPECS_* values are added by `add-relative-face-remapping' -;; (and removed by `remove-relative-face-remapping', and are intended for +;; The RELATIVE_SPECS_* values are added by `face-remap-add-relative' +;; (and removed by `face-remap-remove-relative', and are intended for ;; face "modifications" (such as increasing the size). Typical users of ;; relative specs would be minor modes. ;; @@ -45,10 +45,10 @@ ;; face name, which causes the global definition of that face to be used. ;; ;; A non-default value of BASE_SPECS may also be set using -;; `set-base-face-remapping'. Because this _overwrites_ the default +;; `face-remap-set-base'. Because this _overwrites_ the default ;; value inheriting from the global face definition, it is up to the -;; caller of set-base-face-remapping to add such inheritance if it is -;; desired. A typical use of set-base-face-remapping would be a major +;; caller of face-remap-set-base to add such inheritance if it is +;; desired. A typical use of face-remap-set-base would be a major ;; mode setting face remappings, e.g., of the default face. ;; ;; All modifications cause face-remapping-alist to be made buffer-local. @@ -62,11 +62,11 @@ ;; Utility functions ;;;### autoload -(defun add-relative-face-remapping (face &rest specs) +(defun face-remap-add-relative (face &rest specs) "Add a face remapping entry of FACE to SPECS in the current buffer. Return a cookie which can be used to delete the remapping with -`remove-relative-face-remapping'. +`face-remap-remove-relative'. SPECS can be any value suitable for the `face' text property, including a face name, a list of face names, or a face-attribute @@ -77,7 +77,7 @@ The base (lowest priority) remapping may be set to a specific value, instead of the default of the global face definition, -using `set-base-face-remapping'." +using `face-remap-set-base'." (make-local-variable 'face-remapping-alist) (let ((entry (assq face face-remapping-alist))) (when (null entry) @@ -86,8 +86,8 @@ (setcdr entry (cons specs (cdr entry))) (cons face specs))) -(defun remove-relative-face-remapping (cookie) - "Remove a face remapping previously added by `add-relative-face-remapping'. +(defun face-remap-remove-relative (cookie) + "Remove a face remapping previously added by `face-remap-add-relative'. COOKIE should be the return value from that function." (let ((remapping (assq (car cookie) face-remapping-alist))) (when remapping @@ -102,7 +102,7 @@ (cdr cookie)))))) ;;;### autoload -(defun set-default-base-face-remapping (face) +(defun face-remap-reset-base (face) "Set the base remapping of FACE to inherit from FACE's global definition." (let ((entry (assq face face-remapping-alist))) (when entry @@ -116,7 +116,7 @@ (setcar (last entry) face))))) ; otherwise, just inherit global def ;;;### autoload -(defun set-base-face-remapping (face &rest specs) +(defun face-remap-set-base (face &rest specs) "Set the base remapping of FACE in the current buffer to SPECS. If SPECS is empty, the default base remapping is restored, which inherits from the global definition of FACE; note that this is @@ -125,7 +125,7 @@ (if (or (null specs) (and (eq (car specs) face) (null (cdr specs)))) ; default ;; Set entry back to default - (set-default-base-face-remapping face) + (face-remap-reset-base face) ;; Set the base remapping (make-local-variable 'face-remapping-alist) (let ((entry (assq face face-remapping-alist))) @@ -163,26 +163,26 @@ face size by the value of the variable `text-scale-mode-step' \(a negative amount shrinks the text). -The `increase-buffer-face-height' and `decrease-buffer-face-height' -functions may be used to interactively modify the variable -`text-scale-mode-amount' (they also enable or disable `text-scale-mode' -as necessary)." +The `text-scale-increase' and `text-scale-decrease' functions may +be used to interactively modify the variable +`text-scale-mode-amount' (they also enable or disable +`text-scale-mode' as necessary)." :lighter (" " text-scale-mode-lighter) (when text-scale-mode-remapping - (remove-relative-face-remapping text-scale-mode-remapping)) + (face-remap-remove-relative text-scale-mode-remapping)) (setq text-scale-mode-lighter (format (if (>= text-scale-mode-amount 0) "+%d" "%d") text-scale-mode-amount)) (setq text-scale-mode-remapping (and text-scale-mode - (add-relative-face-remapping 'default + (face-remap-add-relative 'default :height (expt text-scale-mode-step text-scale-mode-amount)))) (force-window-update (current-buffer))) ;;;###autoload -(defun increase-buffer-face-height (&optional inc) +(defun text-scale-increase (&optional inc) "Increase the height of the default face in the current buffer by INC steps. If the new height is other than the default, `text-scale-mode' is enabled. @@ -195,18 +195,18 @@ (text-scale-mode (if (zerop text-scale-mode-amount) -1 1))) ;;;###autoload -(defun decrease-buffer-face-height (&optional dec) +(defun text-scale-decrease (&optional dec) "Decrease the height of the default face in the current buffer by DEC steps. -See `increase-buffer-face-height' for more details." +See `text-scale-increase' for more details." (interactive "p") - (increase-buffer-face-height (- dec))) + (text-scale-increase (- dec))) -;;;###autoload (define-key ctl-x-map [(control ?+)] 'adjust-buffer-face-height) -;;;###autoload (define-key ctl-x-map [(control ?-)] 'adjust-buffer-face-height) -;;;###autoload (define-key ctl-x-map [(control ?=)] 'adjust-buffer-face-height) -;;;###autoload (define-key ctl-x-map [(control ?0)] 'adjust-buffer-face-height) +;;;###autoload (define-key ctl-x-map [(control ?+)] 'text-scale-adjust) +;;;###autoload (define-key ctl-x-map [(control ?-)] 'text-scale-adjust) +;;;###autoload (define-key ctl-x-map [(control ?=)] 'text-scale-adjust) +;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust) ;;;###autoload -(defun adjust-buffer-face-height (&optional inc) +(defun text-scale-adjust (&optional inc) "Increase or decrease the height of the default face in the current buffer. The actual adjustment made depends on the final component of the @@ -226,10 +226,10 @@ will remove any scaling currently active. This command is a special-purpose wrapper around the -`increase-buffer-face-height' command which makes repetition -convenient even when it is bound in a non-top-level keymap. -For binding in a top-level keymap, `increase-buffer-face-height' -or `decrease-default-face-height' may be more appropriate." +`text-scale-increase' command which makes repetition convenient +even when it is bound in a non-top-level keymap. For binding in +a top-level keymap, `text-scale-increase' or +`text-scale-decrease' may be more appropriate." (interactive "p") (let ((first t) (step t) @@ -247,7 +247,7 @@ (t (setq step nil)))) (when step - (increase-buffer-face-height step) + (text-scale-increase step) (setq inc 1 first nil) (setq ev (read-event)))) (push ev unread-command-events))) @@ -269,10 +269,10 @@ the `variable-pitch' face." :lighter " VarPitch" (when variable-pitch-mode-remapping - (remove-relative-face-remapping variable-pitch-mode-remapping)) + (face-remap-remove-relative variable-pitch-mode-remapping)) (setq variable-pitch-mode-remapping (and variable-pitch-mode - (add-relative-face-remapping 'default 'variable-pitch))) + (face-remap-add-relative 'default 'variable-pitch))) (force-window-update (current-buffer)))