.emacs-my
changeset 1730 795b3f2ecfbb
parent 1729 237c8f98ac43
child 1731 fec5d1fffe8c
equal deleted inserted replaced
1729:237c8f98ac43 1730:795b3f2ecfbb
   524         ("America/Chicago" "Chicago/US Central")
   524         ("America/Chicago" "Chicago/US Central")
   525         ("America/Los_Angeles" "Los Angeles")
   525         ("America/Los_Angeles" "Los Angeles")
   526         ("America/New_York" "New York")
   526         ("America/New_York" "New York")
   527         ("Asia/Tokyo" "Tokyo")))
   527         ("Asia/Tokyo" "Tokyo")))
   528 
   528 
   529 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   529 
   530 (message "shell, bash, Cygwin, MSYS")
   530 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
   531 (message "term colors, ansi colors")
       
   532 
       
   533 (ansi-color-for-comint-mode-on)
       
   534 
       
   535 (defun my-ansi-color (&optional beg end)
       
   536   "Interpret ANSI color esacape sequence by colorifying cotent.
       
   537 Operate on selected region on whole buffer."
       
   538   (interactive
       
   539    (if (use-region-p)
       
   540        (list (region-beginning) (region-end))
       
   541      (list (point-min) (point-max))))
       
   542   (ansi-color-apply-on-region beg end))
       
   543 
       
   544 
       
   545 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
   546 (message "shell, bash")
   531 
   547 
   532 (cl-eval-when (compile) (require 'shell))
   548 (cl-eval-when (compile) (require 'shell))
   533 
   549 
   534 (defvar my-use-windows-shell nil
   550 (setq explicit-bash-args '("-i"))
   535   "If t 'cmdproxy.exe' will be used as shell.
   551 
   536 Affect on \\[shell] like commands. If nil, 'sh' will be used." )
   552 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
   553 (message "Cygwin, MSYS")
   537 
   554 
   538 (defun follow-cygwin-symlink ()
   555 (defun follow-cygwin-symlink ()
   539   "Follow new-style (and also UCS-16) Cygwin symlinks."
   556   "Follow new-style (and also UCS-16) Cygwin symlinks."
   540   (save-excursion
   557   (save-excursion
   541     (goto-char 0)
   558     (goto-char 0)
   612 (when (eq system-type 'windows-nt)
   629 (when (eq system-type 'windows-nt)
   613   (add-to-list 'exec-suffixes ".py")
   630   (add-to-list 'exec-suffixes ".py")
   614   (add-to-list 'exec-suffixes ".sh")
   631   (add-to-list 'exec-suffixes ".sh")
   615   (defun executable-find (command) (locate-file command exec-path exec-suffixes))
   632   (defun executable-find (command) (locate-file command exec-path exec-suffixes))
   616   )
   633   )
   617 
       
   618 (ansi-color-for-comint-mode-on)
       
   619 
       
   620 (defun my-ansi-color (&optional beg end)
       
   621   "Interpret ANSI color esacape sequence by colorifying cotent.
       
   622 Operate on selected region on whole buffer."
       
   623   (interactive
       
   624    (if (use-region-p)
       
   625        (list (region-beginning) (region-end))
       
   626      (list (point-min) (point-max))))
       
   627   (ansi-color-apply-on-region beg end))
       
   628 
       
   629 (setq explicit-bash-args '("-i"))
       
   630 
   634 
   631 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   635 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   632 (message "term")
   636 (message "term")
   633 
   637 
   634 (cl-eval-when (compile) (require 'term))
   638 (cl-eval-when (compile) (require 'term))
  1650       (goto-char end)
  1654       (goto-char end)
  1651       (save-excursion
  1655       (save-excursion
  1652         (insert result)))))
  1656         (insert result)))))
  1653 
  1657 
  1654 (defun my-calc-line (arg)
  1658 (defun my-calc-line (arg)
  1655   "Evaluate calc expression in current line and display the
  1659   "Evaluate calc expression in the current line and display the
  1656 result in the echo area by skipping everything after the final
  1660 result in the echo area by skipping everything after the final
  1657 '=' sign.
  1661 '=' sign.
  1658 
  1662 
  1659 With prefix ARG non-nil or repeating command interactively,
  1663 With prefix ARG non-nil or repeating command interactively,
  1660 insert the result at the end of line + add a space if necessary
  1664 insert the result at the end of line & add a space if necessary
  1661 for delimiting clearing everything after '=' sign if it is here."
  1665 for delimiting clearing everything after '=' sign if it is here."
  1662   (interactive "P")
  1666   (interactive "P")
  1663   (require 'calc)
  1667   (require 'calc)
  1664   (save-excursion
  1668   (save-excursion
  1665     (let (beg end expr result)
  1669     (let (beg end expr result)