/ergoemacs/init_functions.el

https://github.com/mbudde/ergoemacs · Emacs Lisp · 107 lines · 96 code · 10 blank · 1 comment · 6 complexity · 2517ad88ad5a5fadfd7cfac60b674de4 MD5 · raw file

  1. ;-*- coding: utf-8 -*-
  2. (defun text-scale-normal-size ()
  3. "Set the height of the default face in the current buffer to its default value."
  4. (interactive)
  5. (text-scale-increase 0))
  6. (defun toggle-line-move-visual ()
  7. "Toggle behavior of up/down arrow key, by visual line vs logical line."
  8. (interactive)
  9. (if line-move-visual
  10. (setq line-move-visual nil)
  11. (setq line-move-visual t))
  12. )
  13. (defun cmd-shell (&optional arg)
  14. "Run cmd.exe (WinNT) or command.com shell. A numeric prefix
  15. arg switches to the specified session, creating it if necessary."
  16. (interactive "P")
  17. (let ((buf-name (cond ((numberp arg)
  18. (format "*cmd<%s>*" arg))
  19. (arg
  20. (generate-new-buffer-name "*cmd*"))
  21. (t
  22. "*cmd*")))
  23. (explicit-shell-file-name (or (and (w32-using-nt) "cmd.exe")
  24. "command.com")))
  25. (shell buf-name)))
  26. (defun msys-shell (&optional arg)
  27. "Run MSYS shell (sh.exe). It's like a Unix Shell in Windows.
  28. A numeric prefix arg switches to the specified session, creating
  29. it if necessary."
  30. (interactive "P")
  31. (let ((buf-name (cond ((numberp arg)
  32. (format "*msys<%d>*" arg))
  33. (arg
  34. (generate-new-buffer-name "*msys*"))
  35. (t
  36. "*msys*")))
  37. (explicit-shell-file-name "sh.exe"))
  38. (shell buf-name)))
  39. (defun soft-wrap-lines ()
  40. "Make lines wrap at window edge and on word boundary,
  41. in current buffer."
  42. (interactive)
  43. (setq truncate-lines nil)
  44. (setq word-wrap t)
  45. )
  46. (defun close-frame ()
  47. "Closes the current frame or kill emacs if there are just one
  48. frame. It simulates the same functionality of the Close button in
  49. the frame title bar."
  50. (interactive)
  51. (if multiple-frames
  52. (delete-frame)
  53. (save-buffers-kill-terminal)))
  54. (defun list-text-editing-modes ()
  55. "Display a list of all text editing related major modes.
  56. The list includes all major modes for editing programing language
  57. files or such things as BBCode, but does not include major modes
  58. for dired, irc, mail, shell, etc."
  59. (interactive)
  60. (with-output-to-temp-buffer "*Major Modes for Text Editing*"
  61. (princ
  62. "###############################################
  63. # This is a list of text-editing related major modes that comes with ErgoEmacs.
  64. # The lines are formatted this way:
  65. # purpose/language name command name
  66. # The list is not complete.
  67. # please help by adding modes you use at
  68. # http://code.google.com/p/ergoemacs/issues/detail?id=64
  69. AutoHotKey xahk-mode
  70. BBCode xbbcode-mode
  71. Bash sh-mode
  72. C c-mode
  73. C++ c++-mode
  74. CSS css-mode
  75. Emacs Lisp emacs-lisp-mode
  76. HTML html-mode
  77. Haskell haskell-mode
  78. Java java-mode
  79. Javascript js-mode
  80. Javascript js2-mode
  81. LaTeX latex-mode
  82. Linden Scripting Language xlsl-mode
  83. Lua lua-mode
  84. OCaml tuareg-mode
  85. PHP php-mode
  86. Perl cperl-mode
  87. PowerShell powershell-mode
  88. Python python-mode
  89. Ruby ruby-mode
  90. TCL tcl-mode
  91. Visual Basic visual-basic-mode
  92. XML nxml-mode
  93. XML xml-mode
  94. cmd.exe dos-mode"
  95. )
  96. )
  97. )