Permalink
Browse files

Misc improvements:

* Add `fake-initial-key' to allow skipping the logo question with a
  predefined key.

* Parse and deal with a "--fast" argument at the toplevel, not inside
  `emacs-startup-hook', since it looks like it doesn't have an effect
  there.  (The hook is probably called in a context that protects it
  from changes.)

* Make the windows key behave as `super' on Windows, since it looks like
  a more common assignment for it on linux.

* Add some more fraction unicode abbreviations for special chars.

* Improve dealing with mail attachments.

* Fix code that overrides auto-revert behavior.

* Catchup with some changes to calculator in the Emacs tree.
  • Loading branch information...
1 parent 19b6a51 commit 3493a9c6b108e0571b3c37efd2468191279e3ab7 @elibarzilay committed Mar 27, 2012
View
@@ -5,7 +5,7 @@
;; /*****************************************************************\ ;;
;; *** *** ;;
;; *** Eli's Emacs initialization file! *** ;;
- "[2012-02-09]"
+ "[2012-03-27]"
;; *** Written by Eli Barzilay: Maze is Life! <eli@barzilay.org> *** ;;
;; *** *** ;;
;; \*****************************************************************/ ;;
View
Binary file not shown.
View
@@ -730,8 +730,7 @@ See the documentation for `calculator-mode' for more information."
(progn
(cond
((not (get-buffer-window calculator-buffer))
- (let ((split-window-keep-point nil)
- (window-min-height 2))
+ (let ((window-min-height 2))
;; maybe leave two lines for our window because of the normal
;; `raised' modeline in Emacs 21
(select-window
View
Binary file not shown.
View
@@ -160,12 +160,17 @@
("sub=" #x208C)
("sub(" #x208D)
("sub)" #x208E)
+ ("0/3" #x2189)
+ ("1/" #x215F)
("1/2" #x00BD)
("1/3" #x2153)
("1/4" #x00BC)
("1/5" #x2155)
("1/6" #x2159)
+ ("1/7" #x2150)
("1/8" #x215B)
+ ("1/9" #x2151)
+ ("1/10" #x2152)
("2/3" #x2154)
("2/5" #x2156)
("3/4" #x00BE)
View
Binary file not shown.
View
@@ -52,7 +52,7 @@
;; ?? vm-mime-ignore-composite-type-opaque-transfer-encoding t
;; ?? vm-mime-ignore-missing-multipart-boundary t
vm-send-using-mime t
- vm-honor-mime-content-disposition t ; and see below: no images
+ vm-honor-mime-content-disposition 'internal-only ; and see below: no images
vm-auto-decode-mime-messages t
vm-mime-decode-for-preview nil ; no preview lines anyway
vm-auto-displayed-mime-content-types
@@ -62,9 +62,9 @@
'("text" "multipart" "message/rfc822") ; no images
vm-mime-auto-displayed-content-types-exceptions '("image")
vm-mime-internal-content-types t
- vm-mime-internal-content-type-exceptions '("text/calendar")
+ vm-mime-internal-content-type-exceptions '("text/calendar" "application/pdf")
vm-mime-external-content-types-alist
- '(("text/html" "firefox") ("image" "qiv") ("video" "mplayer"))
+ '(("image" "qiv") ("video" "mplayer") ("application/pdf" "xpdf"))
vm-mime-external-content-type-exceptions '()
vm-mime-delete-viewer-processes t
vm-mime-type-converter-alist
@@ -100,7 +100,7 @@
;; needed?-- vm-mime-8bit-composition-charset "utf-8" ; avoid 2022-jp encoding
vm-mime-composition-armor-from-lines t ; nice to not have `>From's
;; vm-mime-encode-headers-type 'Q
- vm-mime-max-message-size (* 19 1000 1000) ; split bigger messages
+ vm-mime-max-message-size (* 20 1024 1024) ; split bigger messages
vm-mime-attachment-save-directory ; saved attachments to some temp
(expand-file-name
(findif
View
Binary file not shown.
View
@@ -39,21 +39,29 @@
"\\)\\)"))
(desktop-save-mode 1))
+;; Decide whether to load the previous desktop or not
+;; (Do that now, not in the startup hook, since there it cannot change
+;; `command-line-args')
+(defconst is-fast-p
+ (and (member "--fast" command-line-args)
+ (progn (setq command-line-args (delete "--fast" command-line-args)) t)))
+(defvar fake-initial-key nil
+ "If this is set, it's used as the initial keypress result (and no
+logo-question will appear).")
(add-hook 'emacs-startup-hook
(lambda ()
- ;; Decide whether to load the previous desktop or not
- (if (member "--fast" command-line-args)
- ;; not using desktop at all
- (setq command-line-args (delete "--fast" command-line-args))
+ (unless is-fast-p ; fast => don't use the desktop
;; otherwise, the question is whether we load buffers or not (so desktop
;; is always used here)
(let (;; ask about restoring desktop only if there are no command-line
;; arguments left (ignore the first -- it is the executable)
(load-buffers (null (cdr command-line-args))))
(when load-buffers
- (let* ((key (eli-logo
+ (let* ((key
+ (or fake-initial-key
+ (eli-logo
(concat "Hit any key to continue, escape/right-click:"
- " don't load previous desktop.")))
+ " don't load previous desktop."))))
(key (if (integerp key) key (event-basic-type key))))
(when (memq key '(27 escape mouse-3))
(setq load-buffers nil))))
View
@@ -173,7 +173,6 @@ THIS IS A MODIFIED VERSION THAT AUTOMATICALLY RELOADS THE FILE."
;;-----------------------------------------------------------------------------
;; Override from "files.el": don't ask about reverting a buffer, just say it
-
(when eli-auto-revert-on-change
;; do it after loading, so the new definition isn't replaced by the original
@@ -256,8 +255,11 @@ the various files."
(message "Reverting file %s...done" filename)))
;;ELI:
(t
- (message "File %s changed on disk!"
- (file-name-nondirectory filename))
+ (message "File %s changed on disk!%s"
+ (file-name-nondirectory filename)
+ (if (buffer-modified-p buf)
+ " (note: local modifications)"
+ " (touch to revert)"))
(ding t))
((yes-or-no-p
(if (string= (file-name-nondirectory filename)
@@ -360,6 +362,19 @@ Do you want to revisit the file normally now? ")
(find-file-noselect-1 buf filename nowarn
rawfile truename number))))))
+;;ELI: this is unchanged, but copied since before 23.2 it had only two
+;; inputs, so copy it here and make it optional
+(defun abort-if-file-too-large (size op-type &optional filename)
+ "If file SIZE larger than `large-file-warning-threshold', allow user to abort.
+OP-TYPE specifies the file operation being performed (for message to user)."
+ (when (and large-file-warning-threshold size
+ (> size large-file-warning-threshold)
+ (not (y-or-n-p
+ (format "File %s is large (%dMB), really %s? "
+ (file-name-nondirectory filename)
+ (/ size 1048576) op-type))))
+ (error "Aborted")))
+
)))
;;-----------------------------------------------------------------------------
View
@@ -469,12 +469,12 @@
(setq-default
;;
w32-alt-is-meta t
- w32-apps-modifier 'hyper
- w32-lwindow-modifier 'hyper
- w32-rwindow-modifier 'hyper
+ w32-apps-modifier 'super
+ w32-lwindow-modifier 'super
+ w32-rwindow-modifier 'super
w32-pass-alt-to-system nil
w32-pass-lwindow-to-system t ; they still work fine
- w32-pass-rwindow-to-system t ; as a hyper modifier
+ w32-pass-rwindow-to-system t ; as a super modifier
w32-capslock-is-shiftlock nil
w32-enable-caps-lock t
w32-enable-num-lock t

0 comments on commit 3493a9c

Please sign in to comment.