Built-in files auto-update: Thu Mar 18 14:37:56 UTC 2021
This commit is contained in:
parent
4a4557c3c8
commit
b86c619cb6
|
@ -736,7 +736,9 @@ in `package-build-archive-dir'."
|
|||
(or (package-build--desc-from-package
|
||||
name version commit files)
|
||||
(package-build--desc-from-library
|
||||
name version commit files 'tar)))))
|
||||
name version commit files 'tar)
|
||||
(error "%s[-pkg].el matching package name is missing"
|
||||
name)))))
|
||||
(package-build--copy-package-files files source-dir target)
|
||||
(package-build--write-pkg-file desc target)
|
||||
(package-build--generate-info-files files source-dir target)
|
||||
|
|
|
@ -1933,8 +1933,8 @@ to install.
|
|||
|
||||
When `quelpa' is called interactively with a prefix argument (e.g
|
||||
\\[universal-argument] \\[quelpa]) it will try to upgrade the
|
||||
given package even if the global var `quelpa-upgrade-p' is set to
|
||||
nil."
|
||||
given package and remove any old versions of it even if the
|
||||
`quelpa-upgrade-p' and `quelpa-autoremove-p' are set to nil."
|
||||
(interactive (list nil))
|
||||
(run-hooks 'quelpa-before-hook)
|
||||
(when (quelpa-setup-p) ;if init fails we do nothing
|
||||
|
@ -1944,7 +1944,7 @@ nil."
|
|||
(quelpa-interactive-candidate))))
|
||||
(quelpa-upgrade-p (if current-prefix-arg t quelpa-upgrade-p)) ;shadow `quelpa-upgrade-p'
|
||||
(quelpa-stable-p quelpa-stable-p) ;shadow `quelpa-stable-p'
|
||||
(quelpa-autoremove-p (if current-prefix-arg quelpa-autoremove-p nil))
|
||||
(quelpa-autoremove-p (if current-prefix-arg t quelpa-autoremove-p))
|
||||
(cache-item (quelpa-arg-rcp arg)))
|
||||
(quelpa-parse-plist plist)
|
||||
(quelpa-parse-stable cache-item)
|
||||
|
|
|
@ -4,23 +4,24 @@
|
|||
;; Description: Frame and window commands (interactive functions).
|
||||
;; Author: Drew Adams
|
||||
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
|
||||
;; Copyright (C) 1996-2015, Drew Adams, all rights reserved.
|
||||
;; Copyright (C) 1996-2019, Drew Adams, all rights reserved.
|
||||
;; Created: Tue Mar 5 16:30:45 1996
|
||||
;; Version: 0
|
||||
;; Package-Requires: ((frame-fns "0"))
|
||||
;; Last-Updated: Thu Jan 1 10:44:52 2015 (-0800)
|
||||
;; Last-Updated: Sun Sep 13 14:15:03 2020 (-0700)
|
||||
;; By: dradams
|
||||
;; Update #: 3036
|
||||
;; URL: http://www.emacswiki.org/frame-cmds.el
|
||||
;; Doc URL: http://emacswiki.org/FrameModes
|
||||
;; Doc URL: http://www.emacswiki.org/OneOnOneEmacs
|
||||
;; Doc URL: http://www.emacswiki.org/Frame_Tiling_Commands
|
||||
;; Update #: 3182
|
||||
;; URL: https://www.emacswiki.org/emacs/download/frame-cmds.el
|
||||
;; Doc URL: https://emacswiki.org/emacs/FrameModes
|
||||
;; Doc URL: https://www.emacswiki.org/emacs/OneOnOneEmacs
|
||||
;; Doc URL: https://www.emacswiki.org/emacs/Frame_Tiling_Commands
|
||||
;; Keywords: internal, extensions, mouse, frames, windows, convenience
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x, 26.x
|
||||
;;
|
||||
;; Features that might be required by this library:
|
||||
;;
|
||||
;; `avoid', `frame-fns', `misc-fns', `strings', `thingatpt',
|
||||
;; `avoid', `backquote', `bytecomp', `cconv', `cl-lib',
|
||||
;; `frame-fns', `macroexp', `misc-fns', `strings', `thingatpt',
|
||||
;; `thingatpt+'.
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -35,8 +36,11 @@
|
|||
;; Load this library from your init file (~/.emacs or _emacs).
|
||||
;; Add the suggested key bindings (below) to your init file.
|
||||
;; Use `M-up|down|left|right' to move frames around incrementally.
|
||||
;; Use `C-S-v', `M-S-v', `C-S-next', `C-S-prior' to move frames to screen edges.
|
||||
;; Use `C-S-v', `M-S-v', `C-S-next', `C-S-prior' to move frames to
|
||||
;; screen edges.
|
||||
;; Use `C-M-up|down|left|right' to resize frames incrementally.
|
||||
;; Use `C-x {', `C-x }', `C-x ^', and `C-u C-x ^' to resize windows
|
||||
;; incrementally.
|
||||
;; Use `C-M-z' or `C-x C-z' to iconify/hide all frames.
|
||||
;; Use `C-M-z' in a lone frame to restore all frames.
|
||||
;; Use `C-mouse-1' in the minibuffer to restore all frames.
|
||||
|
@ -68,7 +72,7 @@
|
|||
;; kinds of frames. These include: `default-frame-alist',
|
||||
;; `initial-frame-alist', and `special-display-frame-alist'. The
|
||||
;; complete list of such frame alist variables is available using
|
||||
;; function `frame-alist-var-names', defined here.
|
||||
;; function `frcmds-frame-alist-var-names', defined here.
|
||||
;;
|
||||
;; Example: Suppose you change the background color of a frame and
|
||||
;; want to make that the default background color for new frames in
|
||||
|
@ -91,21 +95,25 @@
|
|||
;;
|
||||
;; User options defined here:
|
||||
;;
|
||||
;; `available-screen-pixel-bounds', `enlarge-font-tries',
|
||||
;; `frame-config-register', `frame-parameters-to-exclude',
|
||||
;; `available-screen-pixel-bounds', `clone-frame-parameters',
|
||||
;; `enlarge-font-tries', `frame-config-register',
|
||||
;; `frame-parameters-to-exclude',
|
||||
;; `move-frame-wrap-within-display-flag'
|
||||
;; `rename-frame-when-iconify-flag', `show-hide-show-function',
|
||||
;; `window-mgr-title-bar-pixel-height'.
|
||||
;;
|
||||
;; Commands defined here:
|
||||
;;
|
||||
;; `create-frame-tiled-horizontally',
|
||||
;; `create-frame-tiled-vertically', `delete-1-window-frames-on',
|
||||
;; `clone-frame', `create-frame-tiled-horizontally',
|
||||
;; `create-frame-tiled-vertically', `decrease-frame-transparency'
|
||||
;; (Emacs 23+), `delete-1-window-frames-on',
|
||||
;; `delete/iconify-window', `delete/iconify-windows-on',
|
||||
;; `delete-other-frames', `delete-windows-for', `enlarge-font',
|
||||
;; `enlarge-frame', `enlarge-frame-horizontally',
|
||||
;; `hide-everything', `hide-frame', `iconify-everything',
|
||||
;; `iconify/map-frame', `iconify/show-frame',
|
||||
;; `enlarge/shrink-window', `enlarge/shrink-window-repeat',
|
||||
;; `enlarge-window-repeat', `hide-everything', `hide-frame',
|
||||
;; `iconify-everything', `iconify/map-frame', `iconify/show-frame',
|
||||
;; `increase-frame-transparency' (Emacs 23+),
|
||||
;; `jump-to-frame-config-register', `maximize-frame',
|
||||
;; `maximize-frame-horizontally', `maximize-frame-vertically',
|
||||
;; `mouse-iconify/map-frame', `mouse-iconify/show-frame',
|
||||
|
@ -124,11 +132,12 @@
|
|||
;; `show-a-frame-on', `show-buffer-menu', `show-frame',
|
||||
;; `show-hide', `shrink-frame', `shrink-frame-horizontally',
|
||||
;; `split-frame-horizontally', `split-frame-vertically',
|
||||
;; `shrink-window-horizontally-repeat', `shrink-window-repeat',
|
||||
;; `tell-customize-var-has-changed', `tile-frames',
|
||||
;; `tile-frames-horizontally', `tile-frames-side-by-side',
|
||||
;; `tile-frames-top-to-bottom', `tile-frames-vertically',
|
||||
;; `toggle-max-frame', `toggle-max-frame-horizontally',
|
||||
;; `toggle-max-frame-vertically'.
|
||||
;; `toggle-max-frame-vertically', `toggle-menu-bar-for-frame'.
|
||||
;;
|
||||
;; Non-interactive functions defined here:
|
||||
;;
|
||||
|
@ -143,15 +152,15 @@
|
|||
;; `frcmds-frame-number', `frcmds-new-frame-position',
|
||||
;; `frcmds-read-args-for-tiling',
|
||||
;; `frcmds-read-buffer-for-delete-windows',
|
||||
;; `frcmds-set-difference', `frcmds-smart-tool-bar-pixel-height',
|
||||
;; `frcmds-split-frame-1', `frcmds-tile-frames', `nbutlast' (Emacs
|
||||
;; 20).
|
||||
;; `frcmds-repeat-command', `frcmds-set-difference',
|
||||
;; `frcmds-smart-tool-bar-pixel-height', `frcmds-split-frame-1',
|
||||
;; `frcmds-tile-frames', `nbutlast' (Emacs 20).
|
||||
;;
|
||||
;; Error symbols defined here:
|
||||
;;
|
||||
;; `font-too-small', `font-size'.
|
||||
;;
|
||||
;;
|
||||
;;
|
||||
;; ***** NOTE: The following EMACS PRIMITIVE has been ADVISED HERE:
|
||||
;;
|
||||
;; `delete-window' - If only one window in frame, `delete-frame'.
|
||||
|
@ -181,6 +190,11 @@
|
|||
;; (global-set-key [(control meta right)] 'enlarge-frame-horizontally)
|
||||
;; (global-set-key [(control meta up)] 'shrink-frame)
|
||||
;; (global-set-key [(control meta left)] 'shrink-frame-horizontally)
|
||||
;; (global-set-key [remap enlarge-window-horizontally] 'enlarge-window-horizontally-repeat)
|
||||
;; (global-set-key [remap shrink-window-horizontally] 'shrink-window-horizontally-repeat)
|
||||
;; (global-set-key [remap enlarge-window] 'enlarge/shrink-window-repeat)
|
||||
;; (global-set-key (kbd "C-M-S-<down>") 'increase-frame-transparency)
|
||||
;; (global-set-key (kbd "C-M-S-<up>") 'decrease-frame-transparency)
|
||||
;; (global-set-key [(control ?x) (control ?z)] 'iconify-everything)
|
||||
;; (global-set-key [vertical-line S-down-mouse-1] 'iconify-everything)
|
||||
;; (global-set-key [(control ?z)] 'iconify/show-frame)
|
||||
|
@ -189,6 +203,7 @@
|
|||
;; (global-set-key [(control meta ?z)] 'show-hide)
|
||||
;; (global-set-key [vertical-line C-down-mouse-1] 'show-hide)
|
||||
;; (global-set-key [C-down-mouse-1] 'mouse-show-hide-mark-unmark)
|
||||
;; (substitute-key-definition 'make-frame-command 'clone-frame global-map)
|
||||
;; (substitute-key-definition 'delete-window 'remove-window global-map)
|
||||
;; (define-key ctl-x-map "o" 'other-window-or-frame)
|
||||
;; (define-key ctl-x-4-map "1" 'delete-other-frames)
|
||||
|
@ -253,7 +268,7 @@
|
|||
;; (defvar menu-bar-doremi-menu (make-sparse-keymap "Do Re Mi"))
|
||||
;; (define-key global-map [menu-bar doremi]
|
||||
;; (cons "Do Re Mi" menu-bar-doremi-menu))
|
||||
;; (define-key menu-bar-doremi-menu [doremi-font+]
|
||||
;; (define-key menu-bar-doremi-menu [doremi-push-current-frame-config]
|
||||
;; '("Save Frame Configuration" . save-frame-config))
|
||||
;;
|
||||
;; See also these files for other frame commands:
|
||||
|
@ -277,6 +292,46 @@
|
|||
;;
|
||||
;;; Change Log:
|
||||
;;
|
||||
;; 2020/09/13 dadams
|
||||
;; Added: toggle-menu-bar-for-frame.
|
||||
;; 2019/12/13 dadams
|
||||
;; Added: frcmds-repeat-command, (enlarge|shrink)-window(-horizontally)-repeat,
|
||||
;; enlarge/shrink-window(-repeat).
|
||||
;; 2019/03/18 dadams
|
||||
;; clone-frame: Use frame-geom-value-numeric.
|
||||
;; 2019/03/03 dadams
|
||||
;; Added: clone-frame-parameters.
|
||||
;; clone-frame: Always select new frame. Augment current params with clone-frame-parameters.
|
||||
;; 2019/03/02 dadama
|
||||
;; clone-frame: Bind fit-frame-inhibit-fitting-flag to preserve current frame dimensions.
|
||||
;; Return the new frame.
|
||||
;; 2018/09/22 dadams
|
||||
;; Moved to mouse+.el: tear-off-window(-if-not-alone).
|
||||
;; 2018/09/21 dadams
|
||||
;; tear-off-window: Use pop-to-buffer-same-window, not switch-to-buffer.
|
||||
;; 2018/09/14 dadams
|
||||
;; Added: clone-frame.
|
||||
;; 2018/01/05 dadams
|
||||
;; frcmds-available-screen-pixel-bounds:
|
||||
;; Use display-monitor-attributes-list to compute, if option is nil.
|
||||
;; frcmds-new-frame-position: Correct for use with multiple monitors.
|
||||
;; 2018/01/02 dadams
|
||||
;; available-screen-pixel-bounds: Change :type to allow nil.
|
||||
;; 2017/10/22 dadams
|
||||
;; remove-windows-on: Added optional arg ALL-FRAMES.
|
||||
;; Just repeat get-buffer-window with ALL-FRAMES until no window.
|
||||
;; delete/iconify-windows-on: Removed second arg to frames-on.
|
||||
;; 2017/08/19 dadams
|
||||
;; delete-window: Use with-selected-window for Emacs 22+.
|
||||
;; Updated Emacs-Wiki URLs.
|
||||
;; 2017/05/06 dadams
|
||||
;; maximize-frame: Sidestep nil frame parameters.
|
||||
;; 2017/02/07 dadams
|
||||
;; Added decrease-frame-transparency, increase-frame-transparency. Suggest bind to C-M-up|down.
|
||||
;; 2016/01/24 dadams
|
||||
;; Added: tear-off-window, tear-off-window-if-not-alone.
|
||||
;; 2015/08/14 dadams
|
||||
;; tell-customize-var-has-changed: Use symbol-value, not eval.
|
||||
;; 2014/12/09 dadams
|
||||
;; Added: frcmds-frame-pixel-height.
|
||||
;; frcmds-split-frame-1: Use frame-pixel-width and frcmds-frame-pixel-height, instead of working
|
||||
|
@ -317,7 +372,7 @@
|
|||
;; tile-frames to frcmds-tile-frames.
|
||||
;; rename-non-minibuffer-frame: Pass OLD-NAME and NEW-NAME to rename-frame.
|
||||
;; Group Frame-Commands: Added :prefix frcmds-.
|
||||
;;
|
||||
;;
|
||||
;; 2014/02/24 dadams
|
||||
;; rename-frame, rename-non-minibuffer-frame: Fixed default buffer name for non-interactive.
|
||||
;; 2013/09/21 dadams
|
||||
|
@ -549,7 +604,7 @@
|
|||
;;
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'cl-lib)) ;; case, incf (plus, for Emacs 20: dolist, dotimes)
|
||||
(eval-when-compile (require 'cl)) ;; case, incf (plus, for Emacs 20: dolist, dotimes)
|
||||
(require 'frame-fns) ;; frame-geom-value-cons, frame-geom-value-numeric, frames-on, get-frame-name,
|
||||
;; get-a-frame, read-frame
|
||||
(require 'strings nil t) ;; (no error if not found) read-buffer
|
||||
|
@ -565,6 +620,7 @@
|
|||
|
||||
;; Quiet byte-compiler.
|
||||
(defvar 1on1-minibuffer-frame) ; In `oneonone.el'
|
||||
(defvar frame-alpha-lower-limit) ; Emacs 23+
|
||||
(defvar mac-tool-bar-display-mode)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -584,23 +640,39 @@ frame-cmds.el bug: \
|
|||
&body=Describe bug here, starting with `emacs -q'. \
|
||||
Don't forget to mention your Emacs and library versions."))
|
||||
:link '(url-link :tag "Other Libraries by Drew"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/DrewsElispLibraries")
|
||||
"https://www.emacswiki.org/emacs/DrewsElispLibraries")
|
||||
:link '(url-link :tag "Download"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/frame-cmds.el")
|
||||
"https://www.emacswiki.org/emacs/download/frame-cmds.el")
|
||||
:link '(url-link :tag "Description - `delete-window'"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/FrameModes")
|
||||
"https://www.emacswiki.org/emacs/FrameModes")
|
||||
:link '(url-link :tag "Description - Frame Renaming"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/FrameTitle")
|
||||
"https://www.emacswiki.org/emacs/FrameTitle")
|
||||
:link '(url-link :tag "Description - Frame Resizing"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/Shrink-Wrapping_Frames")
|
||||
"https://www.emacswiki.org/emacs/Shrink-Wrapping_Frames")
|
||||
:link '(url-link :tag "Description - Frame Customization"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/CustomizingAndSaving")
|
||||
"https://www.emacswiki.org/emacs/CustomizingAndSaving")
|
||||
:link '(url-link :tag "Description - Frame Tiling"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/Frame_Tiling_Commands")
|
||||
"https://www.emacswiki.org/emacs/Frame_Tiling_Commands")
|
||||
:link '(url-link :tag "Description - General"
|
||||
"http://www.emacswiki.org/cgi-bin/wiki/FrameModes")
|
||||
"https://www.emacswiki.org/emacs/FrameModes")
|
||||
:link '(emacs-commentary-link :tag "Commentary" "frame-cmds"))
|
||||
|
||||
(defcustom clone-frame-parameters (cons 30 30)
|
||||
"Frame parameter settings that override those of the frame to clone.
|
||||
The value can be an alist of frame parameters or a cons of two
|
||||
integers, (LEFT-OFFSET . TOP-OFFSET).
|
||||
|
||||
The latter case sets parameters `left' and `top' of the new frame to
|
||||
the `left' and `top' of the selected frame, offset by adding
|
||||
LEFT-OFFSET and TOP-OFFSET to them, respectively."
|
||||
:type '(choice
|
||||
(cons :tag "Offset from current frame location"
|
||||
(integer :tag "Left")
|
||||
(integer :tag "Top"))
|
||||
(alist :tag "Parameters to augment/replace those of current frame"
|
||||
:key-type (symbol :tag "Parameter")))
|
||||
:group 'Frame-Commands)
|
||||
|
||||
(defcustom rename-frame-when-iconify-flag t
|
||||
"*Non-nil means frames are renamed when iconified.
|
||||
The new name is the name of the current buffer."
|
||||
|
@ -619,9 +691,9 @@ Candidates include `jump-to-frame-config-register' and `show-buffer-menu'."
|
|||
|
||||
;; Use `cond', not `case', for Emacs 20 byte-compiler.
|
||||
(defcustom window-mgr-title-bar-pixel-height (cond ((eq window-system 'mac) 22)
|
||||
;; For older versions of macOS, 40 might be better.
|
||||
((eq window-system 'ns) 50)
|
||||
(t 27))
|
||||
;; For older versions of OS X, 40 might be better.
|
||||
((eq window-system 'ns) 50)
|
||||
(t 27))
|
||||
"*Height of frame title bar provided by the window manager, in pixels.
|
||||
You might alternatively call this constant the title-bar \"width\" or
|
||||
\"thickness\". There is no way for Emacs to determine this, so you
|
||||
|
@ -657,11 +729,13 @@ measured from the screen absolute origin, (0, 0), at the upper left.
|
|||
|
||||
If this is nil, then the available space is calculated. That should
|
||||
give good results in most cases."
|
||||
:type '(list
|
||||
(integer :tag "X0 (upper left) - pixels from screen left")
|
||||
(integer :tag "Y0 (upper left) - pixels from screen top")
|
||||
(integer :tag "X1 (lower right) - pixels from screen left" )
|
||||
(integer :tag "Y1 (lower right) - pixels from screen top"))
|
||||
:type '(choice
|
||||
(const :tag "Calculate automatically" nil)
|
||||
(list :tag "List of (x0 y0 x1 y1)"
|
||||
(integer :tag "X0 (upper left) - pixels from screen left")
|
||||
(integer :tag "Y0 (upper left) - pixels from screen top")
|
||||
(integer :tag "X1 (lower right) - pixels from screen left" )
|
||||
(integer :tag "Y1 (lower right) - pixels from screen top")))
|
||||
:group 'Frame-Commands)
|
||||
|
||||
|
||||
|
@ -787,6 +861,15 @@ A negative prefix arg deiconifies all iconified frames."
|
|||
(when rename-frame-when-iconify-flag (rename-non-minibuffer-frame))
|
||||
(iconify-or-deiconify-frame))
|
||||
|
||||
;;;###autoload
|
||||
(defun toggle-menu-bar-for-frame (&optional frame)
|
||||
"Toggle showing the menu-bar for selected frame.
|
||||
When called from Lisp, optional arg FRAME is used instead of the
|
||||
selected frame."
|
||||
(interactive)
|
||||
(let ((now (or (frame-parameter frame 'menu-bar-lines) 0)))
|
||||
(set-frame-parameter frame 'menu-bar-lines (if (zerop now) 1 0))))
|
||||
|
||||
|
||||
|
||||
;; ADVISE ORIGINAL (built-in):
|
||||
|
@ -794,9 +877,13 @@ A negative prefix arg deiconifies all iconified frames."
|
|||
;; If WINDOW is the only one in its frame, `delete-frame'.
|
||||
(defadvice delete-window (around delete-frame-if-one-win activate)
|
||||
"If WINDOW is the only one in its frame, then `delete-frame' too."
|
||||
(save-current-buffer
|
||||
(select-window (or (ad-get-arg 0) (selected-window)))
|
||||
(if (one-window-p t) (delete-frame) ad-do-it)))
|
||||
(if (fboundp 'with-selected-window) ; Emacs 22+
|
||||
(with-selected-window
|
||||
(or (ad-get-arg 0) (selected-window))
|
||||
(if (one-window-p t) (delete-frame) ad-do-it))
|
||||
(save-current-buffer
|
||||
(select-window (or (ad-get-arg 0) (selected-window)))
|
||||
(if (one-window-p t) (delete-frame) ad-do-it))))
|
||||
|
||||
;;;###autoload
|
||||
(defun delete-windows-for (&optional buffer)
|
||||
|
@ -809,7 +896,7 @@ With a prefix arg, prompt for a buffer and delete all windows, on any
|
|||
|
||||
|
||||
|
||||
;; REPLACES ORIGINAL (built-in):
|
||||
;; REPLACES ORIGINAL in `window.el' (built-in prior to Emacs 24.5):
|
||||
;;
|
||||
;; 1) Use `read-buffer' in interactive spec.
|
||||
;; 2) Do not raise an error if BUFFER is a string that does not name a buffer.
|
||||
|
@ -890,15 +977,18 @@ Only displayed buffers are completion candidates."
|
|||
(defalias 'remove-window 'delete-window)
|
||||
|
||||
;;;###autoload
|
||||
(defun remove-windows-on (buffer)
|
||||
"Remove all windows showing BUFFER. This calls `remove-window'
|
||||
on each window showing BUFFER."
|
||||
(defun remove-windows-on (buffer &optional all-frames)
|
||||
"Remove all windows showing BUFFER.
|
||||
This calls `remove-window' on each window showing BUFFER.
|
||||
|
||||
When called from Lisp, optional arg ALL-FRAMES controls which frames
|
||||
are considered. See `get-buffer-window' for its interpretation."
|
||||
(interactive
|
||||
(list (read-buffer "Remove all windows showing buffer: " (current-buffer) 'existing)))
|
||||
(setq buffer (get-buffer buffer)) ; Convert to buffer.
|
||||
(list (read-buffer "Remove all windows showing buffer: " (current-buffer) 'existing)
|
||||
t))
|
||||
(setq buffer (get-buffer buffer)) ; Convert to buffer.
|
||||
(when buffer ; Do nothing if null BUFFER.
|
||||
(dolist (fr (frames-on buffer t))
|
||||
(remove-window (get-buffer-window buffer t)))))
|
||||
(let (win) (while (setq win (get-buffer-window buffer all-frames)) (remove-window win)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun mouse-remove-window (event)
|
||||
|
@ -981,12 +1071,40 @@ Interactively, FRAME is nil, and FRAME-P depends on the prefix arg:
|
|||
'window-dedicated-p)))
|
||||
(setq buffer (get-buffer buffer)) ; Convert to buffer.
|
||||
(when buffer ; Do nothing if null BUFFER.
|
||||
;; `get-buffer-window' interprets FRAME oppositely for t and nil,
|
||||
;; so switch.
|
||||
;; `get-buffer-window' interprets FRAME oppositely for t and nil, so switch.
|
||||
(setq frame (if (eq t frame) nil (if (eq nil frame) t frame)))
|
||||
(dolist (fr (frames-on buffer frame))
|
||||
(dolist (fr (frames-on buffer))
|
||||
(delete/iconify-window (get-buffer-window buffer frame) frame-p))))
|
||||
|
||||
;;;###autoload
|
||||
(defun clone-frame (&optional frame no-clone)
|
||||
"Make and select a new frame with the same parameters as FRAME.
|
||||
With a prefix arg, don't clone - just call `make-frame-command'.
|
||||
Return the new frame.
|
||||
|
||||
FRAME defaults to the selected frame. The frame is created on the
|
||||
same terminal as FRAME. If the terminal is a text-only terminal then
|
||||
also select the new frame."
|
||||
(interactive "i\nP")
|
||||
(if no-clone
|
||||
(make-frame-command)
|
||||
(let* ((fit-frame-inhibit-fitting-flag t)
|
||||
(clone-frame-parameters (if (and clone-frame-parameters
|
||||
(not (consp (car clone-frame-parameters))))
|
||||
`((left . ,(+ (car clone-frame-parameters)
|
||||
(or (frame-geom-value-numeric
|
||||
'left (frame-parameter frame 'left))
|
||||
0)))
|
||||
(top . ,(+ (cdr clone-frame-parameters)
|
||||
(or (frame-geom-value-numeric
|
||||
'top (frame-parameter frame 'top))
|
||||
0))))
|
||||
clone-frame-parameters))
|
||||
(default-frame-alist (append clone-frame-parameters (frame-parameters frame)))
|
||||
(new-fr (make-frame)))
|
||||
(select-frame new-fr)
|
||||
new-fr)))
|
||||
|
||||
;;;###autoload
|
||||
(defun rename-frame (&optional old-name new-name all-named)
|
||||
"Rename a frame named OLD-NAME to NEW-NAME.
|
||||
|
@ -1120,7 +1238,7 @@ BUFFER may be a buffer or its name (a string)."
|
|||
(setq buffer (get-buffer buffer))
|
||||
(save-excursion
|
||||
(when (buffer-live-p buffer) ; Do nothing if dead buffer.
|
||||
(dolist (fr (frames-on buffer)) ; Is it better to search through
|
||||
(dolist (fr (frames-on buffer)) ; Is it better to search through
|
||||
(save-window-excursion ; `frames-on' or `get-buffer-window-list'?
|
||||
(select-frame fr)
|
||||
(when (one-window-p t fr) (delete-frame)))))))
|
||||
|
@ -1172,11 +1290,12 @@ In Lisp code:
|
|||
(fr-origin (if (eq direction 'horizontal)
|
||||
(car (frcmds-effective-screen-pixel-bounds))
|
||||
(cadr (frcmds-effective-screen-pixel-bounds))))
|
||||
(orig-left (frame-parameter frame 'left))
|
||||
(orig-top (frame-parameter frame 'top))
|
||||
(orig-width (frame-parameter frame 'width))
|
||||
(orig-height (frame-parameter frame 'height)))
|
||||
(let* ((borders (* 2 (cdr (assq 'border-width (frame-parameters frame)))))
|
||||
(orig-left (or (frame-parameter frame 'left) 0))
|
||||
(orig-top (or (frame-parameter frame 'top) 0))
|
||||
(orig-width (or (frame-parameter frame 'width) 0))
|
||||
(orig-height (or (frame-parameter frame 'height) 0)))
|
||||
(let* ((bord-width (cdr (assq 'border-width (frame-parameters frame))))
|
||||
(borders (if bord-width (* 2 bord-width) 0))
|
||||
(new-left (if (memq direction '(horizontal both)) 0 orig-left))
|
||||
(new-top (if (memq direction '(vertical both)) 0 orig-top))
|
||||
;; Subtract borders, scroll bars, & title bar, then convert pixel sizes to char sizes.
|
||||
|
@ -1202,20 +1321,24 @@ In Lisp code:
|
|||
(top . ,new-top)
|
||||
(height . ,new-height)
|
||||
;; If we actually changed a parameter, record the old one for restoration.
|
||||
,(and new-left (/= (frame-geom-value-numeric 'left orig-left)
|
||||
(frame-geom-value-numeric 'left new-left))
|
||||
,(and new-left
|
||||
(/= (frame-geom-value-numeric 'left orig-left)
|
||||
(frame-geom-value-numeric 'left new-left))
|
||||
(cons 'restore-left orig-left))
|
||||
,(and new-top (/= (frame-geom-value-numeric 'top orig-top)
|
||||
(frame-geom-value-numeric 'top new-top))
|
||||
,(and new-top
|
||||
(/= (frame-geom-value-numeric 'top orig-top)
|
||||
(frame-geom-value-numeric 'top new-top))
|
||||
(cons 'restore-top orig-top))
|
||||
,(and new-width (/= (frame-geom-value-numeric 'width orig-width)
|
||||
(frame-geom-value-numeric 'width new-width))
|
||||
,(and new-width
|
||||
(/= (frame-geom-value-numeric 'width orig-width)
|
||||
(frame-geom-value-numeric 'width new-width))
|
||||
(cons 'restore-width orig-width))
|
||||
,(and new-height (/= (frame-geom-value-numeric 'height orig-height)
|
||||
(frame-geom-value-numeric 'height new-height))
|
||||
,(and new-height
|
||||
(/= (frame-geom-value-numeric 'height orig-height)
|
||||
(frame-geom-value-numeric 'height new-height))
|
||||
(cons 'restore-height orig-height)))))
|
||||
(show-frame frame)
|
||||
(cl-incf fr-origin (if (eq direction 'horizontal) fr-pixel-width fr-pixel-height))))
|
||||
(incf fr-origin (if (eq direction 'horizontal) fr-pixel-width fr-pixel-height))))
|
||||
|
||||
;;;###autoload
|
||||
(unless (fboundp 'restore-frame-horizontally)
|
||||
|
@ -1281,7 +1404,7 @@ In Lisp code:
|
|||
(orig-height (frame-parameter frame 'height))
|
||||
(horiz (memq direction '(horizontal both)))
|
||||
(vert (memq direction '(vertical both))))
|
||||
(cl-case direction
|
||||
(case direction
|
||||
(both (unless (and restore-left restore-width restore-top restore-height)
|
||||
(maximize-frame 'both frame)))
|
||||
(vertical (unless (and restore-top restore-height) (maximize-frame-vertically frame)))
|
||||
|
@ -1351,7 +1474,7 @@ With a prefix arg, create that many new frames.
|
|||
The same character size is used for the new frames."
|
||||
(interactive "p")
|
||||
(frcmds-split-frame-1 'horizontal num))
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun split-frame-vertically (num)
|
||||
"Vertically split the selected frame.
|
||||
|
@ -1420,7 +1543,7 @@ the pixel width and height of the rectangle."
|
|||
(fr-origin (if (eq direction 'horizontal)
|
||||
(or x-min-pix (car (frcmds-effective-screen-pixel-bounds)))
|
||||
(or y-min-pix (cadr (frcmds-effective-screen-pixel-bounds))))))
|
||||
(cl-case direction ; Size of frame in pixels.
|
||||
(case direction ; Size of frame in pixels.
|
||||
(horizontal (setq fr-pixel-width (/ fr-pixel-width (length visible-frames))))
|
||||
(vertical (setq fr-pixel-height (/ fr-pixel-height (length visible-frames))))
|
||||
(otherwise (error "`frcmds-tile-frames': DIRECTION must be `horizontal' or `vertical'")))
|
||||
|
@ -1458,7 +1581,7 @@ the pixel width and height of the rectangle."
|
|||
(if (eq direction 'horizontal) (or y-min-pix 0) fr-origin))
|
||||
(show-frame fr)
|
||||
;; Move over the width or height of one frame, and add one border width.
|
||||
(cl-incf fr-origin (+ (or (cdr (assq 'border-width (frame-parameters fr))) 0)
|
||||
(incf fr-origin (+ (or (cdr (assq 'border-width (frame-parameters fr))) 0)
|
||||
(if (eq direction 'horizontal) fr-pixel-width fr-pixel-height))))))
|
||||
|
||||
(defun frcmds-extra-pixels-width (frame)
|
||||
|
@ -1470,13 +1593,14 @@ the pixel width and height of the rectangle."
|
|||
(- (frame-pixel-height frame) (* (frame-char-height frame) (frame-height frame))))
|
||||
|
||||
(defun frcmds-smart-tool-bar-pixel-height (&optional frame)
|
||||
"Pixel height of macOS smart tool bar."
|
||||
"Pixel height of Mac smart tool bar."
|
||||
(if (and (boundp 'mac-tool-bar-display-mode) (> (frame-parameter frame 'tool-bar-lines) 0))
|
||||
(if (eq mac-tool-bar-display-mode 'icons) 40 56)
|
||||
0))
|
||||
|
||||
(defun frcmds-read-args-for-tiling ()
|
||||
"Read arguments for `frcmds-tile-frames'."
|
||||
"Read two frame names and return a list of their frames.
|
||||
Return value can be used as second argument for `frcmds-tile-frames'."
|
||||
(list
|
||||
(list
|
||||
;; Note: `read-frame' puts selected-frame name at front of `frame-name-history'.
|
||||
|
@ -1512,9 +1636,25 @@ the pixel width and height of the rectangle."
|
|||
"Returns a value of the same form as option `available-screen-pixel-bounds'.
|
||||
This represents the currently available screen area."
|
||||
(or available-screen-pixel-bounds ; Use the option value, if available.
|
||||
(if (fboundp 'mac-display-available-pixel-bounds) ; macOS-specific.
|
||||
(if (fboundp 'mac-display-available-pixel-bounds) ; Mac-OS-specific.
|
||||
(mac-display-available-pixel-bounds)
|
||||
(list 0 0 (x-display-pixel-width) (x-display-pixel-height)))))
|
||||
(if (fboundp 'display-monitor-attributes-list) ; Emacs 24.4+
|
||||
(let ((attss (display-monitor-attributes-list))
|
||||
(x0 most-positive-fixnum)
|
||||
(y0 most-positive-fixnum)
|
||||
(x1 0)
|
||||
(y1 0)
|
||||
geom)
|
||||
(dolist (atts attss)
|
||||
(setq geom (cdr (assq 'geometry atts))
|
||||
x0 (min x0 (nth 0 geom))
|
||||
y0 (min y0 (nth 1 geom))
|
||||
x1 (max x1 (nth 2 geom))
|
||||
;; Use `max' for the height too, but it does not account for taskbar etc.
|
||||
y1 (max y1 (nth 3 geom))))
|
||||
(list x0 y0 x1 y1))
|
||||
;; Punt. Assume only one monitor.
|
||||
(list 0 0 (x-display-pixel-width) (x-display-pixel-height))))))
|
||||
|
||||
; Emacs 20 doesn't have `butlast'. Define it to avoid requiring `cl.el' at runtime. From `subr.el'.
|
||||
(unless (fboundp 'butlast)
|
||||
|
@ -1557,6 +1697,64 @@ space occupied by a standalone minibuffer, if any."
|
|||
(frcmds-effective-screen-pixel-bounds))))
|
||||
(- (cadddr bounds) (cadr bounds)))) ; Y1 - Y0
|
||||
|
||||
;; Same as `zz-repeat-command' in `zones.el'.
|
||||
;;
|
||||
(defun frcmds-repeat-command (command) ; Emacs 22+
|
||||
"Repeat COMMAND."
|
||||
(require 'repeat) ; Define its vars before we let-bind them.
|
||||
(let ((repeat-previous-repeated-command command)
|
||||
(repeat-message-function #'ignore)
|
||||
(last-repeatable-command 'repeat))
|
||||
(repeat nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun enlarge-window-horizontally-repeat () ; Emacs 22+
|
||||
"Enlarge selected window horizontally by one column.
|
||||
You can repeat this by hitting the last key again..."
|
||||
(interactive)
|
||||
(require 'repeat)
|
||||
(frcmds-repeat-command 'enlarge-window-horizontally))
|
||||
|
||||
;;;###autoload
|
||||
(defun shrink-window-horizontally-repeat () ; Emacs 22+
|
||||
"Srhink selected window horizontally by one column.
|
||||
You can repeat this by hitting the last key again..."
|
||||
(interactive)
|
||||
(require 'repeat)
|
||||
(frcmds-repeat-command 'shrink-window-horizontally))
|
||||
|
||||
;;;###autoload
|
||||
(defun enlarge-window-repeat () ; Emacs 22+
|
||||
"Enlarge selected window vertically by one line.
|
||||
You can repeat this by hitting the last key again..."
|
||||
(interactive)
|
||||
(require 'repeat)
|
||||
(frcmds-repeat-command 'enlarge-window))
|
||||
|
||||
;;;###autoload
|
||||
(defun shrink-window-repeat () ; Emacs 22+
|
||||
"Shrink selected window vertically by one line.
|
||||
You can repeat this by hitting the last key again..."
|
||||
(interactive)
|
||||
(require 'repeat)
|
||||
(frcmds-repeat-command 'shrink-window))
|
||||
|
||||
;;;###autoload
|
||||
(defun enlarge/shrink-window (arg) ; Emacs 22+
|
||||
"Enlarge selected window vertically by one line.
|
||||
With a prefix arg, shrink it."
|
||||
(interactive "P")
|
||||
(if arg (shrink-window 1) (enlarge-window 1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun enlarge/shrink-window-repeat () ; Emacs 22+
|
||||
"Enlarge selected window vertically by one line.
|
||||
With a prefix arg, shrink it.
|
||||
You can repeat this by hitting the last key again..."
|
||||
(interactive)
|
||||
(require 'repeat)
|
||||
(frcmds-repeat-command 'enlarge/shrink-window))
|
||||
|
||||
;; Inspired by `sk-grow-frame' from Sarir Khamsi [sarir.khamsi@raytheon.com]
|
||||
;;;###autoload
|
||||
(defun enlarge-frame (&optional increment frame) ; Suggested binding: `C-M-down'.
|
||||
|
@ -1631,17 +1829,19 @@ Same as `move-frame-right', except movement is to the left."
|
|||
"Return the new TYPE position of FRAME, incremented by INCR.
|
||||
TYPE is `left' or `top'.
|
||||
INCR is the increment to use when changing the position."
|
||||
(let ((new-pos (+ incr (cadr (frame-geom-value-cons
|
||||
type (cdr (assq type (frame-parameters frame)))))))
|
||||
(display-dimension (if (eq 'left type)
|
||||
(frcmds-available-screen-pixel-width t)
|
||||
(frcmds-available-screen-pixel-height t)))
|
||||
(frame-dimension (if (eq 'left type) (frame-pixel-width frame) (frame-pixel-height frame))))
|
||||
(let* ((f-dim (if (eq 'left type) (frame-pixel-width frame) (frame-pixel-height frame)))
|
||||
(f-min (cadr (frame-geom-value-cons type (cdr (assq type (frame-parameters frame))))))
|
||||
(f-max (+ f-min f-dim))
|
||||
(new-f-min (+ incr f-min))
|
||||
(new-f-max (+ incr f-max))
|
||||
(d-bnds (frcmds-available-screen-pixel-bounds))
|
||||
(d-min (if (eq 'left type) (nth 0 d-bnds) (nth 1 d-bnds)))
|
||||
(d-max (if (eq 'left type) (nth 2 d-bnds) (nth 3 d-bnds))))
|
||||
(if (not move-frame-wrap-within-display-flag)
|
||||
new-pos
|
||||
(when (< new-pos (- frame-dimension)) (setq new-pos display-dimension))
|
||||
(when (> new-pos display-dimension) (setq new-pos (- frame-dimension)))
|
||||
new-pos)))
|
||||
new-f-min
|
||||
(when (< new-f-max d-min) (setq new-f-min d-max))
|
||||
(when (> new-f-min d-max) (setq new-f-min (- d-min (- f-max f-min))))
|
||||
new-f-min)))
|
||||
|
||||
;;;###autoload
|
||||
(defun move-frame-to-screen-top (arg &optional frame) ; Suggested binding: `M-S-v'.
|
||||
|
@ -1709,6 +1909,29 @@ visible) frame back onto the screen."
|
|||
(modify-frame-parameters frame '((top . ,arg) (left . ,arg))))
|
||||
|
||||
|
||||
(when (> emacs-major-version 22) ; Emacs 23+
|
||||
|
||||
(defun decrease-frame-transparency (&optional n frame) ; Suggested binding: `C-M-S-up'.
|
||||
"Decrease the transparency of the selected frame.
|
||||
Decrease it by N percent, where N is the prefix arg.
|
||||
In Lisp code, FRAME is the frame to move."
|
||||
(interactive "p")
|
||||
(unless n (setq n 1))
|
||||
(let* ((now (or (frame-parameter frame 'alpha) 100))
|
||||
(new (+ now n)))
|
||||
(when (> new 100) (setq new frame-alpha-lower-limit))
|
||||
(when (< new frame-alpha-lower-limit) (setq new 100))
|
||||
(set-frame-parameter frame 'alpha new)))
|
||||
|
||||
(defun increase-frame-transparency (&optional n frame) ; Suggested binding: `C-M-S-down'.
|
||||
"Increase the transparency of the selected frame.
|
||||
Same as `decrease-frame-transparency', except increase."
|
||||
(interactive "p")
|
||||
(unless n (setq n 1))
|
||||
(decrease-frame-transparency (- n) frame))
|
||||
)
|
||||
|
||||
|
||||
;; This does not work 100% well. For instance, set frame font to
|
||||
;; "-raster-Terminal-normal-r-normal-normal-12-90-96-96-c-50-ms-oemlatin", then decrease font size.
|
||||
;; The next smaller existing font on my machine is
|
||||
|
@ -1870,9 +2093,9 @@ The CAR of each list item is a string variable name.
|
|||
The CDR is nil."
|
||||
(let ((vars ()))
|
||||
(mapatoms (lambda (sym) (and (boundp sym)
|
||||
(setq sym (symbol-name sym))
|
||||
(string-match "frame-alist$" sym)
|
||||
(push (list sym) vars))))
|
||||
(setq sym (symbol-name sym))
|
||||
(string-match "frame-alist$" sym)
|
||||
(push (list sym) vars))))
|
||||
vars))
|
||||
|
||||
(defun frcmds-frame-parameter-names ()
|
||||
|
@ -1945,7 +2168,7 @@ The CDR is nil."
|
|||
"Tell Customize to recognize that VARIABLE has been set (changed).
|
||||
VARIABLE is a symbol that names a user option."
|
||||
(interactive "vVariable: ")
|
||||
(put variable 'customized-value (list (custom-quote (eval variable)))))
|
||||
(put variable 'customized-value (list (custom-quote (symbol-value variable)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun other-window-or-frame (arg)
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
;; Description: Non-interactive frame and window functions.
|
||||
;; Author: Drew Adams
|
||||
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
|
||||
;; Copyright (C) 1996-2015, Drew Adams, all rights reserved.
|
||||
;; Copyright (C) 1996-2018, Drew Adams, all rights reserved.
|
||||
;; Created: Tue Mar 5 16:15:50 1996
|
||||
;; Version: 0
|
||||
;; Package-Requires: ()
|
||||
;; Last-Updated: Thu Jan 1 10:45:03 2015 (-0800)
|
||||
;; Last-Updated: Mon Jan 1 11:45:14 2018 (-0800)
|
||||
;; By: dradams
|
||||
;; Update #: 227
|
||||
;; URL: http://www.emacswiki.org/frame-fns.el
|
||||
;; Doc URL: http://emacswiki.org/FrameModes
|
||||
;; Update #: 236
|
||||
;; URL: https://www.emacswiki.org/emacs/download/frame-fns.el
|
||||
;; Doc URL: https://emacswiki.org/emacs/FrameModes
|
||||
;; Keywords: internal, extensions, local, frames
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x, 26.x
|
||||
;;
|
||||
;; Features that might be required by this library:
|
||||
;;
|
||||
|
@ -38,6 +38,8 @@
|
|||
;;
|
||||
;;; Change Log:
|
||||
;;
|
||||
;; 2017/10/22 dadams
|
||||
;; frames-on: Removed (unused) second arg.
|
||||
;; 2011/01/04 dadams
|
||||
;; Removed autoload cookies from non-interactive functions.
|
||||
;; 2010/01/12 dadams
|
||||
|
@ -265,10 +267,9 @@ existing frames."
|
|||
;; `frame-name-history' is defined in `frame.el'.
|
||||
nil existing nil '(frame-name-history . 2) default))
|
||||
|
||||
(defun frames-on (buffer &optional frame)
|
||||
"List of all live frames showing BUFFER (a buffer or its name).
|
||||
The optional FRAME argument is as for function `get-buffer-window'."
|
||||
(filtered-frame-list (function (lambda (fr) (get-buffer-window buffer fr)))))
|
||||
(defun frames-on (buffer)
|
||||
"List of all live frames showing BUFFER (a buffer or its name)."
|
||||
(filtered-frame-list (lambda (fr) (get-buffer-window buffer fr))))
|
||||
|
||||
(defun 1-window-frames-on (buffer)
|
||||
"List of all visible 1-window frames showing BUFFER."
|
||||
|
@ -277,7 +278,6 @@ The optional FRAME argument is as for function `get-buffer-window'."
|
|||
(let ((frs ()))
|
||||
(with-current-buffer buffer
|
||||
(when (buffer-live-p buffer) ; Do nothing if dead buffer.
|
||||
;; $$$$$$ Is it better to search through frames-on or windows-on?
|
||||
(dolist (fr (frames-on buffer))
|
||||
(save-window-excursion (select-frame fr)
|
||||
(when (one-window-p t fr) (push fr frs))))))
|
||||
|
@ -290,7 +290,6 @@ The optional FRAME argument is as for function `get-buffer-window'."
|
|||
(let ((frs ()))
|
||||
(with-current-buffer buffer
|
||||
(when (buffer-live-p buffer) ; Do nothing if dead buffer.
|
||||
;; $$$$$$ Is it better to search through frames-on or windows-on?
|
||||
(dolist (fr (frames-on buffer))
|
||||
(save-window-excursion (select-frame fr)
|
||||
(unless (one-window-p t fr)
|
||||
|
|
|
@ -4,21 +4,22 @@
|
|||
;; Description: Commands to zoom frame font size.
|
||||
;; Author: Drew Adams
|
||||
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
|
||||
;; Copyright (C) 2005-2015, Drew Adams, all rights reserved.
|
||||
;; Copyright (C) 2005-2019, Drew Adams, all rights reserved.
|
||||
;; Created: Fri Jan 07 10:24:35 2005
|
||||
;; Version: 0
|
||||
;; Package-Requires: ((frame-fns "0") (frame-cmds "0"))
|
||||
;; Last-Updated: Thu Jan 1 11:24:13 2015 (-0800)
|
||||
;; Last-Updated: Tue Nov 19 13:15:54 2019 (-0800)
|
||||
;; By: dradams
|
||||
;; Update #: 322
|
||||
;; URL: http://www.emacswiki.org/zoom-frm.el
|
||||
;; Doc URL: http://emacswiki.org/SetFonts
|
||||
;; Update #: 359
|
||||
;; URL: https://www.emacswiki.org/emacs/download/zoom-frm.el
|
||||
;; Doc URL: https://emacswiki.org/emacs/SetFonts
|
||||
;; Keywords: frames, extensions, convenience
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x
|
||||
;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x, 26.x
|
||||
;;
|
||||
;; Features that might be required by this library:
|
||||
;;
|
||||
;; `avoid', `frame-cmds', `frame-fns', `misc-fns', `strings',
|
||||
;; `avoid', `backquote', `bytecomp', `cconv', `cl-lib',
|
||||
;; `frame-cmds', `frame-fns', `macroexp', `misc-fns', `strings',
|
||||
;; `thingatpt', `thingatpt+'.
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -61,7 +62,7 @@
|
|||
;;
|
||||
;; Frame parameter changes, such as font size, can be saved for
|
||||
;; future use by all frames or all frames of a certain kind. For
|
||||
;; that, you must change the frame parameters of the corresponding
|
||||
;; that, you must change the frame parameters of the correponding
|
||||
;; frame-alist variable.
|
||||
;;
|
||||
;; There is no single variable for saving changes to parameters of
|
||||
|
@ -117,15 +118,35 @@
|
|||
;; mouse-wheel-down-event))
|
||||
;; [C-mouse-wheel]) ; Emacs 20, 21
|
||||
;; 'zoom-in)
|
||||
;; (global-set-key (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
|
||||
;; (vector (list 'control 'meta
|
||||
;; mouse-wheel-down-event))
|
||||
;; [C-M-mouse-wheel]) ; Emacs 20, 21
|
||||
;; 'zoom-all-frames-in)
|
||||
;; (when (boundp 'mouse-wheel-up-event) ; Emacs 22+
|
||||
;; (global-set-key (vector (list 'control mouse-wheel-up-event))
|
||||
;; (global-set-key (vector (list 'control
|
||||
;; mouse-wheel-up-event))
|
||||
;; 'zoom-out))
|
||||
;; (global-set-key (vector (list 'control 'meta
|
||||
;; mouse-wheel-up-event))
|
||||
;; 'zoom-all-frames-out))
|
||||
;;
|
||||
;; (global-set-key [S-mouse-1] 'zoom-in)
|
||||
;; (global-set-key [C-S-mouse-1] 'zoom-out)
|
||||
;; ;; Get rid of `mouse-set-font' or `mouse-appearance-menu':
|
||||
;; (global-set-key [S-down-mouse-1] nil)
|
||||
;;
|
||||
;;
|
||||
;; Some of the commands are not autoloaded by default, because this
|
||||
;; library works with old as well as recent Emacs releases. The
|
||||
;; commands that are not autoloaded are not usable in older releases.
|
||||
;; You can autoload such commands yourself. For example, if you use
|
||||
;; Emacs 23 or later, you can add this to your init file, to autoload
|
||||
;; `zoom-in/out':
|
||||
;;
|
||||
;; (autoload 'zoom-in/out "zoom-frm"
|
||||
;; "Zoom current frame or buffer in or out" t)
|
||||
;;
|
||||
;; The first two of the mouse bindings mean that in Emacs 22 or later
|
||||
;; you can hold the Control key and rotate the mouse wheel to zoom in
|
||||
;; and out, just as you might do in a Web browser.
|
||||
|
@ -157,6 +178,14 @@
|
|||
;;
|
||||
;;; Change Log:
|
||||
;;
|
||||
;; 2019/11/19 dadams
|
||||
;; zoom-all-frames-(in|out):
|
||||
;; Use zoom-frm-(in|out): zoom each relative to its current font. Visible only. Autoload.
|
||||
;; 2015/11/01 dadams
|
||||
;; Require cl.el at compile time, for macro case.
|
||||
;; 2015/01/10 dadams
|
||||
;; zoom-in, zoom-out: Added message about new zoom type.
|
||||
;; zoom-in/out: Corrected msg: C- modifier was missing. Reminder at end of doc string.
|
||||
;; 2013/12/31 dadams
|
||||
;; zoom-in/out: Use set-transient-map, if defined.
|
||||
;; 2013/09//29 dadams
|
||||
|
@ -201,6 +230,8 @@
|
|||
;;
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'cl)) ;; case
|
||||
|
||||
(require 'frame-cmds) ;; enlarge-font
|
||||
|
||||
|
||||
|
@ -221,11 +252,11 @@ zoom-frm.el bug: \
|
|||
&body=Describe bug here, starting with `emacs -q'. \
|
||||
Don't forget to mention your Emacs and library versions."))
|
||||
:link '(url-link :tag "Other Libraries by Drew"
|
||||
"http://www.emacswiki.org/DrewsElispLibraries")
|
||||
"https://www.emacswiki.org/emacs/DrewsElispLibraries")
|
||||
:link '(url-link :tag "Download"
|
||||
"http://www.emacswiki.org/emacs-en/download/zoom-frm.el")
|
||||
"https://www.emacswiki.org/emacs/download/zoom-frm.el")
|
||||
:link '(url-link :tag "Description"
|
||||
"http://www.emacswiki.org/SetFonts#ChangingFontSize")
|
||||
"https://www.emacswiki.org/emacs/SetFonts#ChangingFontSize")
|
||||
:link '(emacs-commentary-link :tag "Commentary" "zoom-frm"))
|
||||
|
||||
;;;###autoload
|
||||
|
@ -258,11 +289,11 @@ With prefix argument FLIP, reverse the direction:
|
|||
if `frame-zoom-font-difference' is positive, then make text smaller.
|
||||
This is equal but opposite to `zoom-frm-out'."
|
||||
(interactive (list (selected-frame) current-prefix-arg))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((zoom-factor (frame-parameter frame 'zoomed))
|
||||
(increment (if flip (- frame-zoom-font-difference) frame-zoom-font-difference)))
|
||||
(unless zoom-factor (setq zoom-factor 0))
|
||||
(setq zoom-factor (+ zoom-factor increment))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((zoom-factor (frame-parameter frame 'zoomed))
|
||||
(increment (if flip (- frame-zoom-font-difference) frame-zoom-font-difference)))
|
||||
(unless zoom-factor (setq zoom-factor 0))
|
||||
(setq zoom-factor (+ zoom-factor increment))
|
||||
(enlarge-font increment frame)
|
||||
(modify-frame-parameters frame (list (cons 'zoomed zoom-factor)))))
|
||||
|
||||
|
@ -275,16 +306,16 @@ With prefix argument FLIP, reverse the direction:
|
|||
if `frame-zoom-font-difference' is positive, then make text larger.
|
||||
This is equal but opposite to `zoom-frm-in'."
|
||||
(interactive (list (selected-frame) current-prefix-arg))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((frame-zoom-font-difference (- frame-zoom-font-difference)))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((frame-zoom-font-difference (- frame-zoom-font-difference)))
|
||||
(zoom-frm-in frame flip)))
|
||||
|
||||
;;;###autoload
|
||||
(defun zoom-frm-unzoom (&optional frame)
|
||||
"Cancel zoom of FRAME."
|
||||
(interactive)
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((zoom-factor (frame-parameter frame 'zoomed)))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(let ((zoom-factor (frame-parameter frame 'zoomed)))
|
||||
(if (not zoom-factor)
|
||||
(error "Frame is not zoomed")
|
||||
(enlarge-font (- zoom-factor) frame)
|
||||
|
@ -294,10 +325,8 @@ This is equal but opposite to `zoom-frm-in'."
|
|||
(defun toggle-zoom-frame (&optional frame)
|
||||
"Alternately zoom/unzoom FRAME by `frame-zoom-font-difference'."
|
||||
(interactive)
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(if (frame-parameter frame 'zoomed)
|
||||
(zoom-frm-unzoom frame)
|
||||
(zoom-frm-in frame)))
|
||||
(setq frame (or frame (selected-frame)))
|
||||
(if (frame-parameter frame 'zoomed) (zoom-frm-unzoom frame) (zoom-frm-in frame)))
|
||||
|
||||
(when (> emacs-major-version 22)
|
||||
(defun zoom-in (arg)
|
||||
|
@ -307,7 +336,9 @@ Frame zooming uses command `zoom-frm-in'.
|
|||
Buffer zooming uses command `text-scale-increase'."
|
||||
(interactive "P")
|
||||
(when arg
|
||||
(setq zoom-frame/buffer (if (eq zoom-frame/buffer 'frame) 'buffer 'frame)))
|
||||
(setq zoom-frame/buffer (if (eq zoom-frame/buffer 'frame) 'buffer 'frame))
|
||||
(message "%s zooming from now on" (upcase (symbol-name zoom-frame/buffer)))
|
||||
(sit-for 1))
|
||||
(if (eq zoom-frame/buffer 'frame)
|
||||
(zoom-frm-in)
|
||||
(with-current-buffer
|
||||
|
@ -324,7 +355,9 @@ Frame zooming uses command `zoom-frm-out'.
|
|||
Buffer zooming uses command `text-scale-decrease'."
|
||||
(interactive "P")
|
||||
(when arg
|
||||
(setq zoom-frame/buffer (if (eq zoom-frame/buffer 'frame) 'buffer 'frame)))
|
||||
(setq zoom-frame/buffer (if (eq zoom-frame/buffer 'frame) 'buffer 'frame))
|
||||
(message "%s zooming from now on" (upcase (symbol-name zoom-frame/buffer)))
|
||||
(sit-for 1))
|
||||
(if (eq zoom-frame/buffer 'frame)
|
||||
(zoom-frm-out)
|
||||
(with-current-buffer
|
||||
|
@ -336,7 +369,7 @@ Buffer zooming uses command `text-scale-decrease'."
|
|||
|
||||
(when (or (fboundp 'set-transient-map) ; Emacs 24.4+
|
||||
(fboundp 'set-temporary-overlay-map)) ; Emacs 24.3
|
||||
|
||||
|
||||
(defun zoom-in/out (arg)
|
||||
"Zoom current frame or buffer in or out.
|
||||
A prefix arg determines the behavior, as follows:
|
||||
|
@ -360,13 +393,15 @@ Buffer zooming uses command `text-scale-increase'.
|
|||
|
||||
User option `zoom-frame/buffer' determines the default zoom type:
|
||||
frame or buffer. If the option value is `buffer' and you never use
|
||||
plain `C-u' with this command then it acts like `text-scale-adjust'."
|
||||
plain `C-u' with this command then it acts like `text-scale-adjust'.
|
||||
|
||||
Remember that you can also use `C-u' when you are done zooming."
|
||||
(interactive "P")
|
||||
(when (or (equal arg '(4)) (eq ?\025 last-command-event)) ; `C-u'
|
||||
(setq zoom-frame/buffer (if (eq zoom-frame/buffer 'frame) 'buffer 'frame)
|
||||
arg 1)
|
||||
(message "Zooming %sS from now on" (upcase (symbol-name zoom-frame/buffer)))
|
||||
(sit-for 1))
|
||||
(message "%s zooming from now on" (upcase (symbol-name zoom-frame/buffer)))
|
||||
(sit-for 1))
|
||||
(let* ((ev last-command-event)
|
||||
(echo-keystrokes nil)
|
||||
(base (event-basic-type ev))
|
||||
|
@ -379,8 +414,8 @@ plain `C-u' with this command then it acts like `text-scale-adjust'."
|
|||
(?0 0)
|
||||
(t arg)))))
|
||||
(message (if (eq step 0)
|
||||
"Reset to default size. Use +/- to zoom in/out"
|
||||
"Use +/- to zoom in/out, 0 to reset (unzoom)"))
|
||||
"Reset to default size. Use C-x C-+/C-- to zoom in/out"
|
||||
"Use C-x C-+/C-- to zoom in/out, C-0 to reset (unzoom)"))
|
||||
(unless (eq step 'C-U-WAS-USED)
|
||||
(if (eq zoom-frame/buffer 'frame)
|
||||
(if (eq step 0)
|
||||
|
@ -403,33 +438,31 @@ plain `C-u' with this command then it acts like `text-scale-adjust'."
|
|||
(define-key map "\C-u" `(lambda () (interactive) (zoom-in/out ',arg)))
|
||||
map)))))))
|
||||
|
||||
;; These are not so useful, but some people might like them.
|
||||
(when (fboundp 'set-face-attribute) ; Emacs 22+
|
||||
(defun zoom-all-frames-in (&optional flip)
|
||||
"Zoom all frames in by `frame-zoom-font-difference', making text larger.
|
||||
;;;###autoload
|
||||
(defun zoom-all-frames-in (&optional flip)
|
||||
"Zoom all visible frames in, making text larger.
|
||||
Zoom by `frame-zoom-font-difference' points.
|
||||
|
||||
If `frame-zoom-font-difference' is negative, make text smaller.
|
||||
With prefix argument FLIP, reverse the direction:
|
||||
if `frame-zoom-font-difference' is positive, then make text smaller.
|
||||
This is equal but opposite to `zoom-all-frames-out'.
|
||||
Note: This zooming is unaffected by `zoom-frm-unzoom'."
|
||||
(interactive "P")
|
||||
(let ((increment (if flip (- frame-zoom-font-difference) frame-zoom-font-difference)))
|
||||
(set-face-attribute 'default nil
|
||||
:height (+ (* 10 increment)
|
||||
(face-attribute 'default :height nil 'default)))))
|
||||
if `frame-zoom-font-difference' is positive, make text smaller.
|
||||
This is equal but opposite to `zoom-all-frames-out'."
|
||||
(interactive "P")
|
||||
(dolist (fr (visible-frame-list))
|
||||
(zoom-frm-in fr flip)))
|
||||
|
||||
;;;###autoload
|
||||
(defun zoom-all-frames-out (&optional flip)
|
||||
"Zoom all frames out, making text smaller.
|
||||
Zoom by `frame-zoom-font-difference' points.
|
||||
|
||||
(defun zoom-all-frames-out (&optional flip)
|
||||
"Zoom all frames out by `frame-zoom-font-difference', making text smaller.
|
||||
If `frame-zoom-font-difference' is negative, make text larger.
|
||||
With prefix argument FLIP, reverse the direction:
|
||||
if `frame-zoom-font-difference' is positive, then make text larger.
|
||||
This is equal but opposite to `zoom-frm-in'.
|
||||
Note: This zooming is unaffected by `zoom-frm-unzoom'."
|
||||
(interactive "P")
|
||||
(let ((increment (if flip frame-zoom-font-difference (- frame-zoom-font-difference))))
|
||||
(set-face-attribute 'default nil
|
||||
:height (+ (* 10 increment)
|
||||
(face-attribute 'default :height nil 'default))))))
|
||||
if `frame-zoom-font-difference' is positive, make text larger.
|
||||
This is equal but opposite to `zoom-all-frames-in'."
|
||||
(interactive "P")
|
||||
(dolist (fr (visible-frame-list))
|
||||
(zoom-frm-out fr flip)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
|
Loading…
Reference in New Issue