1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-19 10:22:27 +00:00
Commit Graph

268 Commits

Author SHA1 Message Date
Ivan Shmakov
2776a6502b * lisp/desktop.el (desktop-create-buffer): Check that buffers are still live
before burying them.

Fixes: debbugs:18373
2014-09-09 20:47:20 -04:00
Glenn Morris
61dcf9bc85 * lisp/desktop.el (after-init-hook): Disable startup frame restoration
in non-graphical situations.

Fixes: debbugs:17693
2014-07-15 21:28:42 -07:00
Juri Linkov
8abe20426b * lisp/desktop.el (desktop-minor-mode-table): Add `defining-kbd-macro'
and `isearch-mode' associated with nil.

Fixes: debbugs:17849
2014-07-04 02:48:24 +03:00
Juri Linkov
cbb6a7aeff * lisp/desktop.el (desktop-save): Rename arg auto-save' to only-if-changed'.
Doc fix.

Fixes: debbugs:17873
2014-07-03 02:45:12 +03:00
Juri Linkov
a4d8b73e1c * lisp/desktop.el (desktop-auto-save-enable)
(desktop-auto-save-disable): New functions.
(desktop-save-mode, desktop-auto-save-timeout): Use them.
(desktop-read): Disable the autosave before loading the desktop,
and enable afterwards.

Fixes: debbugs:17351
2014-06-25 02:23:41 +03:00
Juri Linkov
7f11800984 * lisp/desktop.el: Activate auto-saving on window configuration changes.
(desktop-save-mode, desktop-auto-save-timeout): Add/remove
`desktop-auto-save-set-timer' to/from `window-configuration-change-hook'.
(desktop-auto-save-set-timer): Change REPEAT arg of
`run-with-idle-timer' from t to nil.
http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00147.html
2014-06-07 02:38:40 +03:00
Juri Linkov
8e554df009 * lisp/desktop.el (desktop-value-to-string): Let-bind print-length' and print-level' to nil.
Fixes: debbugs:17351
2014-04-27 11:22:11 +03:00
Glenn Morris
464560055f Some doc edits related to desktop-restore-frames
* doc/emacs/misc.texi (Saving Emacs Sessions):
Be briefer about desktop's handling of frames.
The manual does not need to mention every option, nor should
it just repeat the doc-strings.

* lisp/desktop.el (desktop-restore-frames)
(desktop-restore-in-current-display, desktop-restore-forces-onscreen)
(desktop-restore-reuses-frames): Doc tweaks.

* etc/NEWS: Related edits.
2014-03-12 00:14:30 -07:00
Juanma Barranquero
4538c058d0 lisp/frameset.el: Separate frame reusing from cleaning up.
* lisp/desktop.el (desktop-restore-forces-onscreen)
  (desktop-restore-reuses-frames): Use non-keyword values.
  (desktop-restore-frameset): Use CLEANUP-FRAMES arg of frameset-restore.

* lisp/frameset.el: Separate options for reusing frames and cleaning up.
  (frameset--reuse-list): Remove definition; declare.
  (frameset--action-map): Declare.
  (frameset--find-frame-if): Doc fix.
  (frameset--restore-frame): Cache frame action.
  (frameset-restore): New keyword arg CLEANUP-FRAMES, allows to select
  how to clean up the frame list after restoring.  Remove cleaning
  options from REUSE-FRAMES.  Change all keyword values to symbols.
  (frameset--jump-to-register): Simplify by using CLEANUP-FRAMES.
2014-03-11 01:46:07 +01:00
Stefan Monnier
ca70fe789c * lisp/desktop.el (desktop-create-buffer): Don't run activate-mark-hook.
Fixes: debbugs:14430
2014-03-09 22:18:29 -04:00
Juanma Barranquero
e59fa9adb3 lisp/desktop.el: Do not fail when desktop-files-not-to-save is nil. 2014-02-22 03:10:49 +01:00
Glenn Morris
c863b6ade6 Some desktop doc
* doc/emacs/misc.texi (Saving Emacs Sessions):
Mention desktop-auto-save-timeout.

* lisp/desktop.el (desktop-save-mode, desktop-auto-save-timeout): Doc fixes.

* etc/NEWS: Related edit.
2014-02-17 17:33:30 -08:00
Juri Linkov
c99cf5eec1 * lisp/desktop.el (desktop-read): Claim the lock when the owner is not the current process.
Fixes: debbugs:16157
2014-02-07 09:58:10 +02:00
Juri Linkov
7d7a68d860 * lisp/desktop.el (desktop-buffers-not-to-save): Change default from nil to "\\` ".
Fixes: debbugs:16651
2014-02-07 09:51:56 +02:00
Juri Linkov
2b777cd9a2 * lisp/desktop.el (desktop-save-mode): Call `desktop-auto-save-set-timer'
when enabling, and `desktop-auto-save-cancel-timer' when disabling.
(desktop-auto-save-cancel-timer): New function with some code from
`desktop-auto-save-set-timer'.
(after-init-hook): Don't call `desktop-auto-save-set-timer'.
Instead of setting `desktop-save-mode' to nil, call
`desktop-save-mode' with arg 0.

Fixes: debbugs:16630
2014-02-07 09:44:29 +02:00
Glenn Morris
15baaea8e7 Revert earlier desktop-auto-save doc changes
I don't understand this feature.
2014-02-02 23:35:44 -08:00
Glenn Morris
be445cf2ab Some doc for desktop-auto-save-timeout
* doc/emacs/misc.texi (Saving Emacs Sessions):
Mention desktop-auto-save-timeout.

* lisp/desktop.el (desktop-save-mode): Doc fix.

* etc/NEWS: Related edit.
2014-02-02 19:12:29 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Glenn Morris
9c61f806fb Misc small custom fixes
The value of defcustom's const should not be quoted!

* lisp/desktop.el (desktop-restore-in-current-display):
* lisp/newcomment.el (comment-empty-lines):
* lisp/progmodes/idlwave.el (idlwave-scan-all-buffers-for-routine-info)
(idlwave-pad-keyword):
* lisp/progmodes/tcl.el (tcl-tab-always-indent):
* lisp/textmodes/reftex-vars.el (reftex-index-default-tag):
* lisp/elec-pair.el (electric-pair-skip-whitespace):
* lisp/progmodes/cfengine.el (cfengine-cf-promises):
* lisp/cedet/ede/linux.el (project-linux-build-directory-default)
(project-linux-architecture-default):
* lisp/erc/erc-button.el (erc-button-alist):
* lisp/gnus/auth-source.el (auth-sources):
* lisp/gnus/nnmairix.el (nnmairix-propagate-marks-upon-close):
* lisp/url/url-history.el (url-history-track):
* lisp/url/url-vars.el (url-honor-refresh-requests):
Fix custom types.

* lisp/net/tls.el (tls-certtool-program): Fix default value.
2013-12-27 17:24:15 -08:00
Juri Linkov
6c8e0ae69b * lisp/desktop.el (desktop-auto-save-timeout): Change default to
`auto-save-timeout'.  Doc fix.
(desktop-save): Skip the timestamp in desktop-saved-frameset
when checking for auto-save changes.
(desktop-auto-save): Don't call desktop-auto-save-set-timer since
`desktop-auto-save' is called repeatedly by the idle timer.
(desktop-auto-save-set-timer): Replace `run-with-timer' with
`run-with-idle-timer' and a non-nil arg REPEAT.  Doc fix.

Fixes: debbugs:15331
2013-12-16 23:48:51 +02:00
Glenn Morris
8c106d177f Use accented form of some names
* doc/emacs/ack.texi (Acknowledgments):
* doc/emacs/emacs.texi (Acknowledgments):
* doc/lispref/intro.texi (Acknowledgments): Use accented form of some names.

* lisp/emacs-lisp/authors.el (authors-aliases, authors-ignored-files):
Add some entries.
(authors-fixed-entries): Use accented form of name.
2013-10-12 17:31:19 -07:00
Glenn Morris
9271e90e73 * lisp/desktop.el (desktop-save): Default to saving in .emacs.d,
since PWD is no longer in desktop-path by default.

Fixes: debbugs:15319
2013-10-09 21:03:11 -04:00
Paul Eggert
526e5233cc Spelling fixes. 2013-08-15 22:15:51 -07:00
Juanma Barranquero
a912c0163d lisp/frameset.el: Convert `frameset' to vector and add new slots.
(frameset): Use type vector, not list (incompatible change).
Do not declare a new constructor, use the default one.
Upgrade suggested properties `app', `name' and `desc' to slots `app',
`name' and `description', respectively, and add read-only slot `timestamp'.
Doc fixes.
(frameset-copy, frameset-persistent-filter-alist)
(frameset-filter-alist, frameset-switch-to-gui-p)
(frameset-switch-to-tty-p, frameset-filter-tty-to-GUI)
(frameset-filter-sanitize-color, frameset-filter-minibuffer)
(frameset-filter-iconified, frameset-keep-original-display-p):
Doc fixes.
(frameset-filter-shelve-param, frameset-filter-unshelve-param):
Rename from frameset-filter-(save|restore)-param.  All callers changed.
Doc fix.
(frameset-p): Adapt to change to vector and be more thorough.
Change arg name to OBJECT.  Doc fix.
(frameset-prop): Rename arg PROP to PROPERTY.  Doc fix.
(frameset-session-filter-alist): Rename from frameset-live-filter-alist.
All callers changed.
(frameset-frame-with-id): Rename from frameset-locate-frame-id.
All callers changed.
(frameset--record-minibuffer-relationships): Rename from
frameset--process-minibuffer-frames.  All callers changed.
(frameset-save): Add new keyword arguments APP, NAME and DESCRIPTION.
Use new default constructor (again).  Doc fix.
(frameset--find-frame-if): Rename from `frameset--find-frame.
All callers changed.
(frameset--reuse-frame): Rename arg FRAME-CFG to PARAMETERS.
(frameset--initial-params): Rename arg FRAME-CFG to PARAMETERS.
Doc fix.
(frameset--restore-frame): Rename args FRAME-CFG and WINDOW-CFG to
PARAMETERS and WINDOW-STATE, respectively.
(frameset-restore): Add new keyword argument PREDICATE.
Reset frameset--target-display to nil.  Doc fix.

lisp/desktop.el (desktop-save-frameset): Use new frameset-save args.
Use lexical-binding.
2013-08-08 00:54:08 +02:00
Juanma Barranquero
063233c357 * lisp/frameset.el: Miscellaneous cleanups.
(frameset): Add docstring.  Move :version property to its
  own `version' slot.
  (frameset-copy): Rename from copy-frameset.
  (frameset-p): Check more thoroughly.
  (frameset-prop): Do not check for :version, which is no longer a prop.
  (frameset-live-filter-alist, frameset-persistent-filter-alist):
  Use new :never value instead of t.
  (frameset-filter-alist): Expand and clarify docstring.
  (frameset-filter-tty-to-GUI, frameset-filter-sanitize-color)
  (frameset-filter-minibuffer, frameset-filter-save-param)
  (frameset-filter-restore-param, frameset-filter-iconified):
  Add pointer to docstring of frameset-filter-alist.
  (frameset-filter-params): Rename filter values to be more meaningful:
  :never instead of t, and reverse the meanings of :save and :restore.
  (frameset--process-minibuffer-frames): Clarify error message.
  (frameset-save): Avoid unnecessary and confusing call to framep.
  Use new BOA constructor for framesets.
  (frameset--reuse-list): Doc fix.
  (frameset--restore-frame): Rename from frameset--get-frame.  Doc fix.
  (frameset--minibufferless-last-p): Rename from frameset--sort-states.
  (frameset-minibufferless-first-p): Doc fix.
  Rename from frameset-sort-frames-for-deletion.
  (frameset-restore): Doc fixes.  Use new function names.
  Most changes suggested by Drew Adams <drew.adams@oracle.com>.

* lisp/desktop.el (desktop-clear): Use new name of sort predicate.
2013-08-05 06:45:17 +02:00
Juanma Barranquero
d5671a82b8 * lisp/frameset.el: Add new predicate values for frameset-restore args.
(frameset-live-filter-alist, frameset-persistent-filter-alist):
  New variables.
  (frameset-filter-alist): Use them.  Add autoload cookie.
  (frameset-filter-tty-to-GUI): Move from desktop.el and rename.
  (frameset--set-id, frameset--reuse-frame): Rename `frame-id' to
  `frameset--id' (it's supposed to be internal to frameset.el).
  (frameset--process-minibuffer-frames): Ditto.  Doc fix.
  (frameset--initial-params): New function.
  (frameset--get-frame): Use it.  Doc fix.
  (frameset--move-onscreen): Accept new PRED value for FORCE-ONSCREEN.
  Accept :all, not 'all.
  (frameset-restore): Add new predicate values for FORCE-ONSCREEN and
  FORCE-DISPLAY.  Use :keywords for constant arguments to avoid collision
  with fbound symbols.  Fix frame id matching, and remove matching ids if
  the frame being restored is deleted.  Obey :delete.

* lisp/desktop.el (desktop-restore-forces-onscreen)
  (desktop-restore-reuses-frames): Document :keyword constant values.
  (desktop-filter-parameters-alist): Remove, now identical to
  frameset-filter-alist.
  (desktop--filter-tty*): Remove, moved to frameset.el.
  (desktop-save-frameset, desktop-restore-frameset):
  Do not pass :filters argument.
2013-08-05 00:12:18 +02:00
Juanma Barranquero
5414a28349 lisp/desktop.el (desktop-clear): Be more careful about deleting frames.
Do it only when called interactively and desktop-restore-frames is non-nil.
Doc fix.
(desktop-read): Set desktop-saved-frameset to nil.
2013-08-04 02:31:33 +02:00
Juanma Barranquero
9421876de5 lisp/desktop.el: Move code related to saving frames to frameset.el.
Require frameset.
(desktop-restore-frames): Doc fix.
(desktop-restore-reuses-frames): Rename from
desktop-restoring-reuses-frames.
(desktop-saved-frameset): Rename from desktop-saved-frame-states.
(desktop-clear): Clear frames too.
(desktop-filter-parameters-alist): Set from frameset-filter-alist.
(desktop--filter-tty*, desktop-save, desktop-read):
Use frameset functions.
(desktop-before-saving-frames-functions, desktop--filter-*-color)
(desktop--filter-minibuffer, desktop--filter-restore-desktop-parm)
(desktop--filter-save-desktop-parm, desktop--filter-iconified-position)
(desktop-restore-in-original-display-p, desktop--filter-frame-parms)
(desktop--process-minibuffer-frames, desktop-save-frames)
(desktop--reuse-list, desktop--compute-pos, desktop--move-onscreen)
(desktop--find-frame, desktop--select-frame, desktop--make-frame)
(desktop--sort-states, desktop-restoring-frames-p)
(desktop-restore-frames): Remove.  Most code moved to frameset.el.
(desktop-restoring-frameset-p, desktop-restore-frameset)
(desktop--check-dont-save, desktop-save-frameset): New functions.
(desktop--app-id): New constant.
(desktop-first-buffer, desktop-buffer-ok-count)
(desktop-buffer-fail-count): Move before first use.
lisp/frameset.el: New file.
2013-08-02 06:33:58 +02:00
Juanma Barranquero
9503c19086 lisp/desktop.el: Fix problem creating minibuffer(less,only) frames.
(desktop--make-frame): Include `minibuffer' in the minimal set of parameters
passed when creating a frame, because the minibuffer status of a frame cannot
be changed later.
2013-07-29 00:43:01 +02:00
Juanma Barranquero
ddeffb1731 lisp/desktop.el: Optionally force offscreen frames back onscreen.
(desktop-restoring-reuses-frames): New option.
(desktop--compute-pos, desktop--move-onscreen): New functions.
(desktop--make-frame): Use desktop--move-onscreen.
2013-07-28 05:03:45 +02:00
Juanma Barranquero
d85c4d5081 lisp/desktop.el: Restore frames at their positions, even if offscreen.
(desktop--make-frame): Apply most frame parameters after creating the frame
to force (partially or totally) offscreen frames to be restored as such.
2013-07-27 03:02:00 +02:00
Juanma Barranquero
d58d31fbe7 lisp/desktop.el (desktop--select-frame): Try harder to reuse the initial frame. 2013-07-26 19:49:52 +02:00
Juanma Barranquero
045f7a53f9 lisp/desktop.el (desktop-restore-frames): Call `sit-for'.
We want to be sure that new frames are visible before deleting
any remaining ones.
2013-07-26 16:01:19 +02:00
Juanma Barranquero
f63ebeb54e lisp/desktop.el: Use pcase-let, pcase-let* in a few places.
(desktop--select-frame, desktop--sort-states, desktop-restore-frames):
Deobfuscate access to desktop--mini values.
2013-07-25 11:24:26 +02:00
Juanma Barranquero
025309873b lisp/desktop.el: Rename internal "desktop-X" frame params to "desktop--X".
(desktop-filter-parameters-alist, desktop--filter-restore-desktop-parm)
(desktop--filter-save-desktop-parm, desktop--process-minibuffer-frames)
(desktop--select-frame, desktop--sort-states, desktop-restore-frames):
Change accordingly.
2013-07-25 10:35:04 +02:00
Juanma Barranquero
cb3a56d238 lisp/desktop.el: Add workaround for bug#14949.
(desktop--make-frame): Do not pass the `fullscreen' parameter to
modify-frame-parameters if the value has not changed.
(desktop--make-frame): On cl-delete-if call, check parameter name,
not full parameter.
2013-07-25 02:37:56 +02:00
Juanma Barranquero
889acc5ce7 lisp/desktop.el (desktop-restoring-frames-p): Return a true boolean.
(desktop-restore-frames): Warn when deleting an existing frame failed.
2013-07-24 18:21:44 +02:00
Juanma Barranquero
da77a2e2eb lisp/desktop.el (desktop-clear): Fix previous change. 2013-07-24 01:10:58 +02:00
Juanma Barranquero
74d7f75a6b lisp/desktop.el (desktop-list*): Fix previous change. 2013-07-23 13:29:30 +02:00
Juanma Barranquero
b61d71e44f lisp/desktop.el: Simplify.
(desktop-clear): Simplify; remove useless checks against invalid buffer names.
(desktop-list*): Use cl-list*.
(desktop-buffer-info, desktop-create-buffer): Simplify.
2013-07-23 03:10:54 +02:00
Juanma Barranquero
a1c80d9d45 lisp/desktop.el: Require 'cl-lib.
(desktop-before-saving-frames-functions): New hook.
(desktop--process-minibuffer-frames): Set desktop-mini parameter only
for frames being saved.  Rename from desktop--save-minibuffer-frames.
(desktop-save-frames): Run hook desktop-before-saving-frames-functions.
Do not save frames with non-nil `desktop-dont-save' parameter.  Filter
out deleted frames.
(desktop--find-frame): Use cl-find-if.
(desktop--select-frame): Use cl-(first|second|third) to access values
of desktop-mini.
(desktop--make-frame): Use cl-delete-if.
(desktop--sort-states): Fix sorting of minibuffer-owning frames.
(desktop-restore-frames): Use cl-(first|second|third) to access values
of desktop-mini.  Look for visible frame at the end, not while
restoring frames.
2013-07-22 03:25:47 +02:00
Juanma Barranquero
56bc453c4a lisp/desktop.el: Make some frame-restoring functions public.
(desktop-saved-frame-states): Rename from desktop--saved-states;
all users changed.
(desktop-save-frames): Rename from desktop--save-frames.
Do not save state to desktop file.
(desktop-save): Save desktop-saved-frame-states to desktop file
and reset to nil.
(desktop-restoring-frames-p): New function.
(desktop-restore-frames): Use it.  Rename from desktop--restore-frames.
(desktop-read): Use desktop-restoring-frames-p.  Do not try to fix
buffer-lists when restoring frames.  Suggested by Martin Rudalics.
2013-07-21 19:45:12 +02:00
Paul Eggert
02c66599e3 Spelling fixes. 2013-07-20 21:22:33 -07:00
Juanma Barranquero
728dc3cc60 lisp/desktop.el: Correctly restore iconified frames.
(desktop--filter-iconified-position): New function.
(desktop-filter-parameters-alist): Add entries for `top' and `left'.
2013-07-21 04:42:11 +02:00
Juanma Barranquero
b958c0ad58 lisp/desktop.el (desktop-restore-frames): Change default to t.
(desktop-restore-in-current-display): Now offer more options.
(desktop-restoring-reuses-frames): New customization option.
(desktop--saved-states): Doc fix.
(desktop-filter-parameters-alist): New variable, renamed and expanded from
desktop--excluded-frame-parameters.
(desktop--target-display): New variable.
(desktop-switch-to-gui-p, desktop-switch-to-tty-p, desktop--filter-tty*)
(desktop--filter-*-color, desktop--filter-minibuffer)
(desktop--filter-restore-desktop-parm, desktop--filter-save-desktop-parm)
(desktop-restore-in-original-display-p): New functions.
(desktop--filter-frame-parms): Use new desktop-filter-parameters-alist.
(desktop--save-minibuffer-frames): New function, inspired by a similar
function from Martin Rudalics.
(desktop--save-frames): Call it; play nice with desktop-globals-to-save.
(desktop--restore-in-this-display-p): Remove.
(desktop--find-frame): Rename from desktop--find-frame-in-display and add
predicate argument.
(desktop--make-full-frame): Remove, integrated into desktop--make-frame.
(desktop--reuse-list): New variable.
(desktop--select-frame, desktop--make-frame, desktop--sort-states):
New functions.
(desktop--restore-frames): Add support for "minibuffer-special" frames.
2013-07-15 02:07:51 +02:00
Juanma Barranquero
acfcc8c53b lisp/desktop.el: Minor fixes.
(desktop--v2s): Remove unused local variable.
(desktop-save-buffer): Make defvar-local; adjust docstring.
(desktop-auto-save-timeout, desktop-owner): Use ignore-errors.
(desktop-clear, desktop-save-buffer-p): Use string-match-p.
2013-07-12 13:21:01 +02:00
Juanma Barranquero
2addf9226a lisp/desktop.el: More fixes to frame restoration.
(desktop-restore-frames): Rename from desktop-save-windows.
(desktop-restore-in-current-display): New customization option.
(desktop--excluded-frame-parameters): Add `font'.
(desktop--save-frames): Rename from desktop--save-windows.
(desktop--restore-in-this-display-p): New function.
(desktop--make-full-frame): Remove unwanted width/height from
full(width|height) frames.
(desktop--restore-frames): Rename from desktop--restore-windows.
Obey desktop-restore-current-display.  Do not delete old frames or
select a new frame unless we were able to restore at least one frame.
2013-07-01 05:29:46 +02:00
Juanma Barranquero
a47cbd64fa Some fixes and improvements for desktop frame restoration.
It is still experimental and disabled by default.

* lisp/desktop.el (desktop--save-windows): Put the selected frame at
  the head of the list.
  (desktop--make-full-frame): New function.
  (desktop--restore-windows): Try to re-select the frame that was
  selected upon saving.  Do not abort if some frames fail to restore,
  just show an error message and contnue.  Set up maximized frames so
  they have default non-maximized dimensions.
2013-06-30 07:08:23 +02:00
Juanma Barranquero
39c0e36f24 New experimental feature to save&restore window and frame setup.
* etc/NEWS: Document new Desktop option `desktop-save-windows'.

* lisp/desktop.el (desktop-save-windows): New defcustom.
  (desktop--saved-states): New var.
  (desktop--excluded-frame-parameters): New defconst.
  (desktop--filter-frame-parms, desktop--find-frame-in-display)
  (desktop--restore-windows, desktop--save-windows): New functions.
  (desktop-save): Call `desktop--save-windows'.
  (desktop-read): Call `desktop--restore-windows'.
2013-06-27 11:08:14 +02:00
Glenn Morris
f12ad6ecd9 * lisp/vc/vc-dir.el (vc-dir-mode): Don't autoload it for everyone.
* lisp/desktop.el (vc-dir-mode): Just autoload it here.
2013-05-02 13:47:39 -04:00