;; ;;---------------------------------------------------------------------------- ;; Impostazione delle dimensioni iniziali del frame. ;; (setq default-frame-alist '( ;; (menu-bar-lines . 1) ;; (left-fringe) ;; (right-fringe) ;; (tool-bar-lines . 1) ;; (width . 220) ;; (height . 49))) ;;---------------------------------------------------------------------------- ;; Impostazione della variabile di localizzazione per ottenere la data in italiano con la funzione insert-time-it, definita nelle righe successive. (set-locale-environment "it_IT") ;; Permette di inserire la data e l'ora. ;; This allows to insert date and time. (defun insert-time-it () (interactive) (insert (format-time-string " %-e %B %Y %-k:%M"))) ;;-------------------------------------------------------------------------- ;; Insert time stamp ;;-------------------------------------------------------------------------- (defun insert-date () "Insert current date and time." (interactive "*") (insert (current-time-string))) (defun insert-modification-time () "Insert a string describing the modification time into the buffer." (interactive) (insert (format-time-string "This file was last edited on %B %d %Y."))) (defun insert-modification-time-it () "Insert a string describing the modification time in Italian into the buffer." (interactive) (insert (format-time-string "File modificato il %d %B %Y."))) ;;-------------------------------------------------------------------------- ;; Dati sulla posizione geografica per il calendario. ;; Geographical data about Palermo, Italy (for lunar phases and calendar mode). ;;-------------------------------------------------------------------------- (setq calendar-latitude +38.07) (setq calendar-longitude +13.22) (setq calendar-location-name "Palermo") ;;-------------------------------------------------------------------------- ;; Autofill a 72 colonne per il LaTeX mode. (add-hook 'LaTeX-mode-hook 'turn-on-auto-fill) (setq fill-column 72) ;;-------------------------------------------------------------------------- ;; Avvia il server per l'inverse search con Skim. (server-start) ;;-------------------------------------------------------------------------- ; Salva la configurazione del desktop dopo l'uscita. (desktop-save-mode 1) ; Imposta il colore di sfondo. ;(setq initial-frame-alist '(background-color . "LightSalmon")) ;;-------------------------------------------------------------------------- ;; yasnippet ;(add-to-list 'load-path ;"~/emacs.d/plugins/yasnippet") ;(require 'yasnippet) ;(yas-global-mode 1) ; Google Maps ;(require 'google-maps) ;;-------------------------------------------------------------------------- ;; XML pretty-printing ;;-------------------------------------------------------------------------- (defun cheeso-pretty-print-xml-region (begin end) "Pretty format XML markup in region. You need to have nxml-mode http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do this. The function inserts linebreaks to separate tags that have nothing but whitespace between them. It then indents the markup by using nxml's indentation rules." (interactive "r") (save-excursion (nxml-mode) ;; split or , but not (goto-char begin) (while (search-forward-regexp ">[ \t]*<[^/]" end t) (backward-char 2) (insert "\n") (incf end)) ;; split and (goto-char begin) (while (search-forward-regexp "<.*?/.*?>[ \t]*<" end t) (backward-char) (insert "\n") (incf end)) ;; put xml namespace decls on newline (goto-char begin) (while (search-forward-regexp "\\(<\\([a-zA-Z][-:A-Za-z0-9]*\\)\\|['\"]\\) \\(xmlns[=:]\\)" end t) (goto-char (match-end 0)) (backward-char 6) (insert "\n") (incf end)) (indent-region begin end nil) (normal-mode)) (message "All indented!"))