branch: externals/ergoemacs-mode commit b3df015fa95ee6c2c3e62cf162c03c13dac034b1 Author: Fidler <matthew.fid...@gmail.com> Commit: Fidler <matthew.fid...@gmail.com>
Make sure changing local variables doesn't affect save state --- ergoemacs-command-loop.el | 6 ++++-- ergoemacs-component.el | 11 +++++++---- ergoemacs-functions.el | 17 +++++++++++------ ergoemacs-map.el | 3 ++- ergoemacs-mode.el | 11 ++++++++++- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/ergoemacs-command-loop.el b/ergoemacs-command-loop.el index d64b9ba..85e485c 100644 --- a/ergoemacs-command-loop.el +++ b/ergoemacs-command-loop.el @@ -1142,7 +1142,8 @@ appropriate value based on the COMMAND." (not ergoemacs-command-loop--minibuffer-unsupported-p)) (when (or (and command (symbolp command) (string-match-p "^\\(calc\\|math\\)" (symbol-name command))) (and (stringp command) (string-match-p "^[^:]*:\\(calc\\|math\\)" command))) - (set (make-local-variable 'ergoemacs-command-loop--minibuffer-unsupported-p) t)) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-command-loop--minibuffer-unsupported-p) t))) (ergoemacs-command-loop--minibuffer-supported-p))) (defun ergoemacs-command-loop-full-p (&optional type) @@ -1225,7 +1226,8 @@ The properties `point-entered' and `point-left' are handled by C internals." (setq last-point cur-point cur-point (point))))) (setq disable-point-adjustment nil) - (set (make-local-variable 'ergoemacs-command-loop--point-motion-last-point) (point))) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-command-loop--point-motion-last-point) (point)))) (defun ergoemacs-command-loop--sync-point () "Sometimes the window buffer and selected buffer are out of sync. diff --git a/ergoemacs-component.el b/ergoemacs-component.el index 32bf32d..0a1ad4b 100644 --- a/ergoemacs-component.el +++ b/ergoemacs-component.el @@ -948,13 +948,16 @@ OBJ is the current object being modified, passed to (dolist (elt (ergoemacs-component-struct--lookup-hash (or obj (ergoemacs-theme-components)))) (let ((plist (gethash hook (ergoemacs-component-struct-hook-plists elt)))) (when (and plist (plist-get plist :command-loop-unsupported-p)) - (set (make-local-variable 'ergoemacs-command-loop--minibuffer-unsupported-p) t) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-command-loop--minibuffer-unsupported-p) t)) (throw 'unsupported-p t)))))) (if ergoemacs-component-struct--composed-hook-minibuffer (push elt ergoemacs-component-struct--composed-hook-minibuffer) - (set (make-local-variable 'ergoemacs-component-struct--composed-hook-minibuffer) - (list elt)))) - (set (make-local-variable (car elt)) (make-composed-keymap (cdr elt) (symbol-value (car elt))))))) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-component-struct--composed-hook-minibuffer) + (list elt))))) + (ergoemacs-save-buffer-state + (set (make-local-variable (car elt)) (make-composed-keymap (cdr elt) (symbol-value (car elt)))))))) (defvar ergoemacs-component-struct--create-hooks nil) (defun ergoemacs-component-struct--create-hooks (&optional obj) diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el index 1011215..4516828 100644 --- a/ergoemacs-functions.el +++ b/ergoemacs-functions.el @@ -249,7 +249,8 @@ When TERMINAL is non-nil, run in a terminal instead of GUI." (kill-buffer buf))) (switch-to-buffer-other-window (get-buffer-create "*ergoemacs-clean*")) (let ((inhibit-read-only t)) - (set (make-local-variable 'ergoemacs-terminal) terminal) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-terminal) terminal)) (setq default-directory (expand-file-name (file-name-directory (locate-library "ergoemacs-mode")))) (delete-region (point-min) (point-max)) (when (or (equal current-prefix-arg '(4)) @@ -296,8 +297,9 @@ The PROCESS is the process where the clean environment is run." emacs-exe (expand-file-name (file-name-directory (locate-library "ergoemacs-mode"))) ergoemacs-load)) - (set (make-local-variable 'ergoemacs-batch-file) - (make-temp-file "ergoemacs-clean" nil ".bat")) + (ergoemacs-save-buffer-state + (set (make-local-variable 'ergoemacs-batch-file) + (make-temp-file "ergoemacs-clean" nil ".bat"))) (with-temp-file ergoemacs-batch-file (insert cmd)) (setq default-directory (file-name-directory ergoemacs-batch-file))) @@ -2444,15 +2446,18 @@ Sends shell prompt string to process, then turns on (require 'dirtrack) (cond ((string-match "cmd\\(proxy\\)?.exe" shell) - (set (make-local-variable 'dirtrack-list) (list "^\\([a-zA-Z]:.*\\)>" 1)) + (ergoemacs-save-buffer-state + (set (make-local-variable 'dirtrack-list) (list "^\\([a-zA-Z]:.*\\)>" 1))) (shell-dirtrack-mode -1) (dirtrack-mode 1)) ((string-match "powershell.exe" shell) - (set (make-local-variable 'dirtrack-list) (list "^PS \\([a-zA-Z]:.*\\)>" 1)) + (ergoemacs-save-buffer-state + (set (make-local-variable 'dirtrack-list) (list "^PS \\([a-zA-Z]:.*\\)>" 1))) (shell-dirtrack-mode -1) (dirtrack-mode 1)) (t ;; Assume basic abc@host:dir structure - (set (make-local-variable 'dirtrack-list) (list "^\\(?:.*?@\\)?\\(?:.*?:\\)?\\(?:[^ ]* \\)? *\\(.*\\) *\\([$#]\\|\\]\\)" 1)) + (ergoemacs-save-buffer-state + (set (make-local-variable 'dirtrack-list) (list "^\\(?:.*?@\\)?\\(?:.*?:\\)?\\(?:[^ ]* \\)? *\\(.*\\) *\\([$#]\\|\\]\\)" 1))) (shell-dirtrack-mode -1) (dirtrack-mode 1)))))) diff --git a/ergoemacs-map.el b/ergoemacs-map.el index 1c02a02..4c8cc2a 100644 --- a/ergoemacs-map.el +++ b/ergoemacs-map.el @@ -1029,7 +1029,8 @@ When INI is non-nil, add conditional maps to `minor-mode-map-alist'." (when (equal (ergoemacs (symbol-value elt) :map-key) (ergoemacs ergoemacs-read-from-minibuffer-map :map-key)) (use-local-map (make-composed-keymap (cdr elt) (current-local-map)))) - (set (make-local-variable (car elt)) (make-composed-keymap (cdr elt) (symbol-value (car elt))))) + (ergoemacs-save-buffer-state + (set (make-local-variable (car elt)) (make-composed-keymap (cdr elt) (symbol-value (car elt)))))) (setq ergoemacs-component-struct--composed-hook-minibuffer nil))) (setq ergoemacs-map--modify-active-last-overriding-terminal-local-map overriding-terminal-local-map ergoemacs-map--modify-active-last-overriding-local-map overriding-local-map diff --git a/ergoemacs-mode.el b/ergoemacs-mode.el index 4a42086..546d70d 100644 --- a/ergoemacs-mode.el +++ b/ergoemacs-mode.el @@ -596,7 +596,16 @@ When STORE-P is non-nil, save the tables." (ergoemacs-timing (intern (format "load-%s" pkg)) (load (symbol-name pkg))))) -(defcustom ergoemacs-use-unicode-symbols nil +(require 'unicode-fonts nil t) +(when (featurep 'unicode-fonts) + (require 'persistent-soft nil t) + (when (featurep 'persistent-soft) + (unicode-fonts-setup))) + + +(defcustom ergoemacs-use-unicode-symbols + (and (featurep 'persistent-soft) + (featurep 'unicode-fonts)) "Use unicode symbols in display." :type 'boolean :group 'ergoemacs-mode)