;; ;; .emacs ;; ;; Modified and Composed from several sources ;; by Chema Celorio ;; March 2000 ;; ;; Sources by : ;; ;; Miguel de Icaza ;; Mattias Nyrell 199911 ;; Ripat ;; Steve Dodd, March 1998 ;; William M. Perry ;; sdodd@udnergrad.math.uwaterloo.c ( .com ?? ) ;; < maw@nitro.fsck.org > ;; Marius Sundbakken ;; ;; Jan Borsodi ;; ;; Jason Leach April, 2000 ;; 1998 Michael Zucchi ;; This .emacs file provides : ;; ;; Change all the yes/no prompts to y/n ;; Do not ask for save confirmation before compiling ;; The compliation windows is 8 rows height ;; scroll while compiling ;; Added gtk+ and gnome syntax highligthning with some libraries names gnome-print specially ;; Added a function to comments C functions the GNOME way use it with C-x4h ;; Added wheel mouse support ;; Special colors ;; Added a nice key of F# shortcuts ;; Auto revert is turned on ;; Basic offset and tab size = 8 ( GNOME ) ;; Shift+move type highlightning ;; Page up and page down movement ;; Home and End goes to beggining and end of line (defun kill-buffer-fast () "Kills the current buffer" ( interactive ) ( kill-buffer nil)) (defun miguel-swap-window () "Cambia las ventanas" (interactive) (if (not (one-window-p)) (let ((first-buffer 0) (second-buffer 0)) (progn (setq first-buffer (window-buffer)) (other-window 1) (setq second-buffer (window-buffer)) (switch-to-buffer first-buffer) (other-window 1) (switch-to-buffer second-buffer) (other-window 1) ) ) ) ) ;; =========== Set the short-cut keys ========================== ;( define-key global-map [f1] ') ( define-key global-map [f2] 'find-file) ;; F2 - OPEN ( define-key global-map [f3] 'kill-buffer-fast) ;; F3 - CLOSE ( define-key global-map [f4] 'goto-line) ;; F4 - GOTO LINE ( define-key global-map [f5] 'other-window) ( define-key global-map [f6] 'call-last-kbd-macro) ;; F6 - Play macro ( define-key global-map [f7] 'replace-string) ;; F7 - REPLACE ;( define-key global-map [f8] ') ( define-key global-map [f9] 'undo) ;; F9 - UNDO ( define-key global-map [f10] 'compile) ;; F10 - COMPILE ( define-key global-map [f11] 'next-error) ;; F11 - NEXT ERROR ( define-key global-map [f12] 'add-change-log-entry-other-window) ;; F12 - CHANGE LOG ( global-set-key "\M-p" 'next-error) ;; Set Meta + P to next error ( global-set-key "\C-cp" 'ps-print-buffer) ;; Set C-c P to Print buffer ( global-set-key "\C-cP" 'ps-print-buffer) ;; Set C-c p to Print buffer ( global-set-key "\C-cr" 'ps-print-region) ;; Set C-c P to Print region ( global-set-key "\C-cR" 'ps-print-region) ;; Set C-c p to Print region ( global-set-key [home] 'beginning-of-line) ( global-set-key [end] 'end-of-line) ;; Make control+pageup/down scroll the other buffer (global-set-key [C-next] 'scroll-other-window) (global-set-key [C-prior] 'scroll-other-window-down) ; Dont show the GNU splash screen (setq inhibit-startup-message t) ; Make all "yes or no" prompts show "y or n" instead (fset 'yes-or-no-p 'y-or-n-p) ;; I have no idea what this does, but "if aint broken, dont fix it" ;; =========================== START: no idea ======================= ;; Byt plats på RET och LF. Detta gör att RET kommer att indentera ;; automagiskt (setq foo (global-key-binding "\C-m")) (global-set-key "\C-m" (global-key-binding "\C-j")) (global-set-key "\C-j" foo) ;; Bestämmer hut mycket emacs scrollar när man går utanför fönstret. (setq scroll-step 1) ;; När man programmerar kan det ibland vara väldigt trevligt om Emacs ;; blinkar matchande parenteser även om de står långt ifrån varandra. ;; Det kan göra Emacs lite långsammare någon gång ibland, men det är ;; det värt. (setq blink-matching-paren-distance nil) ;; ========================== END : no idea ======================= ;; Open unidentified files in text mode (setq default-major-mode 'text-mode) ;; Windows-like selection ;; Doesn't work in xemacs (pc-selection-mode) ;; Display clock ;;(setq display-time-24hr-format t) (display-time) ;; Compile command line to use : (setq compile-command "make -k") ;; over the filesystem. (defun make-backup-file-name (file-name) "Create the non-numeric backup file name for `file-name'." (require 'dired) (if (file-exists-p "~/.backups") (concat (expand-file-name "~/.backups/") (dired-replace-in-string "/" "|" file-name)) (concat file-name "~"))) ;; ==================== MOUSE SIMPLE(?) SET UP ================================== ;; Paste at point NOT at cursor (setq mouse-yank-at-point 't) ;; Scroll Bar gets dragged by mouse butn 1 (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; INTELLIMOUSE SETUP ;; . Wheel forward/backwards scrolls by 10 lines ;; . Shift + wheel forward/backwards scrolls by 1 line ;; (change mwheel-scroll-amount to change these defaults). ;; . Bind control + wheel scroll to undo ;; . Set wheel action focus to follow mouse pointer NOT cursor. (Change ;; mwheel-follow-mouse to "nil" to get wheel to only act on the window ;; containing the text cursor. ;; ;; * Please see the copyright notice below for original copyright stuff. ;; I have made a few small changes to the code, such as the undo binding to ;; the wheel, contact me at sdodd@udnergrad.math.uwaterloo.ca for the ;; original code, or the maintainer below. ;; EVEN FURTHER CHANGES BY chema@celorio.com ;; ;; changed : Scroll 3 lines and with shit + scroll scroll 10 lines ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mwheel.el --- Mouse support for MS intelli-mouse type mice ;; Copyright (C) 1998, Free Software Foundation, Inc. ;; Maintainer: William M. Perry ;; Keywords: mouse ;; This file is part of XEmacs. ;; XEmacs is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; XEmacs is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; Synched up with: Not synched. ;; Commentary: ;; Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'custom) (require 'cl) (defconst mwheel-running-xemacs (string-match "XEmacs" (emacs-version))) (defcustom mwheel-scroll-amount '(15 . 10) "Amount to scroll windows by when spinning the mouse wheel. This is actually a cons cell, where the first item is the amount to scroll on a normal wheel event, and the second is the amount to scroll when the wheel is moved with the shift key depressed. This should be the number of lines to scroll, or `nil' for near full screen. A near full screen is `next-screen-context-lines' less than a full screen." :group 'mouse :type '(cons (choice :tag "Normal" (const :tag "Full screen" :value nil) (integer :tag "Specific # of lines")) (choice :tag "Shifted" (const :tag "Full screen" :value nil) (integer :tag "Specific # of lines")))) ;; Change to nil to only scroll the window the cursor is in (not the pointer) (defcustom mwheel-follow-mouse 1 "Whether the mouse wheel should scroll the window that the mouse is over. This can be slightly disconcerting, but some people may prefer it." :group 'mouse :type 'boolean) (if (not (fboundp 'event-button)) (defun mwheel-event-button (event) (let ((x (symbol-name (event-basic-type event)))) (if (not (string-match "^mouse-\\([0-9]+\\)" x)) (error "Not a button event: %S" event)) (string-to-int (substring x (match-beginning 1) (match-end 1))))) (fset 'mwheel-event-button 'event-button)) (if (not (fboundp 'event-window)) (defun mwheel-event-window (event) (posn-window (event-start event))) (fset 'mwheel-event-window 'event-window)) (defun mwheel-scroll (event) (interactive "e") (let ((curwin (if mwheel-follow-mouse (prog1 (selected-window) (select-window (mwheel-event-window event))))) (amt (if (memq 'shift (event-modifiers event)) (cdr mwheel-scroll-amount) (car mwheel-scroll-amount)))) (case (mwheel-event-button event) (4 (scroll-down amt)) (5 (scroll-up amt)) (otherwise (error "Bad binding in mwheel-scroll"))) (if curwin (select-window curwin)))) (defun mwheel-undo (event) (interactive "e") (let ((curwin (if mwheel-follow-mouse (prog1 (selected-window) (select-window (mwheel-event-window event))))) ) (case (mwheel-event-button event) (4 (undo)) (5 (undo)) (otherwise (error "Bad binding in mwheel-scroll"))) (if curwin (select-window curwin)))) (define-key global-map (if mwheel-running-xemacs 'button4 [mouse-4]) 'mwheel-scroll) (define-key global-map (if mwheel-running-xemacs 'button5 [mouse-5]) 'mwheel-scroll) (define-key global-map (if mwheel-running-xemacs [(shift button4)] [S-mouse-4]) 'mwheel-scroll) (define-key global-map (if mwheel-running-xemacs [(shift button5)] [S-mouse-5]) 'mwheel-scroll) (define-key global-map (if mwheel-running-xemacs [(control button4)] [C-mouse-4]) 'mwheel-undo) (define-key global-map (if mwheel-running-xemacs [(control button5)] [C-mouse-5]) 'mwheel-undo) (provide 'mwheel) ;; ======================= END MOUSE SETUP !!!!!! ================== ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Nice colors and some other stuff! ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; All these settings was set using ;; "customize" on the help menu in ;; emacs (add-to-list 'auto-mode-alist '("\\.pxr$" . sgml-mode)) (add-to-list 'auto-mode-alist '("\\.printer$" . sgml-mode)) (add-to-list 'auto-mode-alist '("\\.model$" . sgml-mode)) (custom-set-variables '(global-auto-revert-mode-text " GRev") '(compilation-window-height 6 t) '(c-default-style "K&R") '(line-number-mode t) '(font-lock-maximum-decoration t) '(c-progress-interval 8) '(auto-revert-stop-on-user-input nil) '(compilation-scroll-output t) '(tab-width 5) '(compilation-ask-about-save nil t) '(c-basic-offset 8) '(c-font-lock-extra-types (quote ("GnomePrintOrient" "FILE" "\\sw+_t" "gint" "gfloat" "gchar" "gint8" "gint16" "gint32" "guint" "guint8" "guint16" "guint32" "guchar" "glong" "gboolean" "gshort" "gushort" "gulong" "gdouble" "gldouble" "gpointer" "Gtk\\w+" "Gdk\\w+" "GList" "GSList" "Document" "View" "GnomePrintDialog" "GnomeDialog" "GnomePrintRGBPClass" "GnomePrintContextClass" "GnomePaper" "GnomePrintPCLR" "GnomePrintESCR" "GladeXML" "GString" "GnomeFont" "GnomePrintMaster" "GnomePrintContext" "GnomePrinter" "PrintJobInfo" "GnomePrintMasterPreview" "GeditUndoInfo" "GnomeMDIChildClass" "GnomeMDI" "GnomeMDIMode" "poptContext" "GnomeApp" "GnomeMDIChild" "GnomeUIInfo" "GnomeDockItem" "GnomeUIPixmapType" "gconstpointer" "GnomeUIInfoType" "GeditToolbar" "SPDocument" "ArtPixBuf" "art_u8" "ArtDRect" "SPItem" "SPObject" "SPSelection" "GnomeAppBar" "SPDesktop" "SPMDIChild" "SPEventContext" "GnomeCanvas" "GnomeCanvasItem" "GnomeCanvasGroup" "GnomePrintFRGBA" "PluginData" "GModule" "SPDTStateType" "SPGuideLine" "GnomeSpellInfo" "GnomeSpell" "GnomeDockItemBehavior" "GnomeHelpMenuEntry" "GIOChannel" "GnomeMessageBox" "GnomeCrashFunction" "GnomePrintRGBP" "GnomePrintPCLRPrivate" "GnomePrintPCLVPrivate" "GnomePrintRGBP" "GnomePrintPCLV" "GnomePrintPCLVClass" "GnomeDock" "GnomeDockLayout" "GnomeDockPlacement" "GnomeClient" "GnomeClientFlags" "GnumericDashedCanvasLine" "GnumericDashedCanvasLineClass" "StyleBorderType" "GnomeCanvasLine" "GnomeCanvasLineClass" "WorkBook" "CellPos" "ColRowCollection" "SheetStyleData" "SheetModeType" "SheetModeType" "PrintInformation" "SheetPrivate" "DependencyData" "SolverParameters" "WorkbookCallback" "Sheet" "Range" "MStyle" "Workbook" "GHashTable" "xmlDocPtr" "xmlDoc" "xmlNsPtr" "XmlSheetObjectReadFn" "XmlSheetObjectWriteFn" "XmlParseContext" "xmlNodePtr" "CommandContext" "ColRowInfo" "PrintUnit" "StyleRegion" "SheetSelection" "NamedExpression" "Value" "Cell" "ExprArray" "StyleFormat" "RenderedValue" "CellComment" "CellFlags" "SolverConstraint" "String" "GeditPrintOrientation" "PrintScaling" "PrintMargins" "CellList" "SolverProblemType" "SolverOptions" "CellRef" "ValueRange" "PrintRange" "HFRenderInfo" "HFRenderType" "HFside" "PrintRepeatRange" "PrintCountInfo" "SPPath" "SPShape" "SPPathComp" "ArtBpath" "PageCountInfo" "GnomeTextFontHandle" "GnomePrintPsClass" "GnomePrintPdfClass" "GnomePrintPdf" "GnomePrintPs" "va_list" "GnomePrintPdfPage" "GnomePrintPdfPageContents" "GnomePrintPdfContents" "GnomePrintPdfPageContents" "GnomePrintPdfObject" "GPPath" "ArtVpath" "ArtSVP" "GPGC" "ArtVpathDash" "ArtPathStrokeJoinType" "ArtPathStrokeCapType" "GPCtx" "GnomePrintPreview" "GnomePrintPdfGraphicState" "GnomePrintDash" "ArtPathcode" "ArtPoint" "Gt1LoadedFont" "GraphicContext" "GnomePrintPreviewPrivate" "GnomePrintPdfFont" "GnomePrintPdfGsave" "GnomePrintPdfImage" "GnomePrintPs2Page" "GnomePrintPs2Font" "GnomePrintPs2Gsave" "GnomePrintPs2GraphicState" "GnomePrintPs2" "GnomePrintPs2Class" "GnomePrintCoies" "GnomePritnCopies" "GnomePrinterWidget" "GnomePrintDialogClass" "GnomePrintMeta" "ArtWindRule" "GnomeDialogClass" "GnomePrinterProfile" "GnomeDisplayFont" "GnomeFontWeight" "GnomeDisplayFont" "GnomeFontFace" "GnomeFontPrivate" "GnomeFontClass" "GnomeFontClassPrivate" "GnomeFontSelection" "GnomeFontSelectionClass" "GnomeFontSelectionDialog" "GnomeFontSelectionDialogClass" "GnomeFontType1EncTab" "Font_Info" "GnomeFontMap" "GnomeFontLigList" "GnomeFontKernPair" "GnomeFontWeightTab" "GnomeFontUnsized" "GnomeTextGlyphAttrEl" "GnomeTextLine" "GnomeTextAttrEl" "GnomeTextLayout" "GnomeGlyphList" "GnomeCanvasItemClass" "GnomePrintPreviewClass" "GnomeCanvasBuf" "ArtUta" "ArtIRect" "GnomePaperSelectior" "GnomeUnit" "Gt1GlyphOutline" "GnomeFontFacePrivate" "ps_internal_font" "GnomeFileEntry" "GnomeIconEntry" "ppd_struct" "GladeWidgetInfo" "GpaModel" "GpaModelInfo" "GpaClass" "GpaPrinter" "GpaPrinterClass" "GnomePrinterStatus" "GpaPaperInfo" "GpaPaperSize" "GpaPaperMedia" "GpaPaperSource" "GpaQuality" "GpaQualityInfo" "GpaResolution" "GpaResolutionSubtype" "GpaOptionsUnknown" "GpaOption" "GpaOptions" "GpaPaperMediaType" "GpaPaperMediaTypes" "GpaOptionTypes" "GpaOptionsGroup" "GnomePrintResolutionParameters" "GHashFunc" "GCompareFunc" "GHashNode" "GMemChunk" "GpaProfileList" "DIR" "GpaVendor" "GpaOptionsType" "GpaConstraint" "GpaConstraintType" "GpaContent" "GpaRequiredOptionValues" "GpaEncoding" "GpaKnownOptionType" "GpaCodeFragment" "GpaKnownPrinterValues" "GpaBackend" "GpaSettings" "T1Glyph" "GnomePrintPdfSubFont" "GnomeSegvInfo" "PpdVendorDictionary" "PpdSearchTag" "GpaPpdInfo" "GpaPpdPaper" "GpaKnownNodes" "GpaKnownPpdOptions" "GpaPpdDiv" "GpaPpdDivItem" "GpaPpdSimpleDiv" "GpaPpdSimpleDivItem" "GpaVendorDictType" "MailDialogSourcePage" "MailDialogServicePage" "MailService" "MailDialogServicePageItem" "MailDialogNewsPage" "Evolution_Shell" "GnomeDruidPageStart" "GnomeDruidPageFinish" "GnomeDruidPageStandard" "MailDruidDialog" "MailDialogTransportPage" "MailDialogIdentityPage" "MailDialogIdentity" "MailConfigService" "ServicePageCallback" "CamelProviderType" "CamelProvider" "CamelService" "CamelFolder" "CamelFolderInfo" "CamelException" "CamelStore" "CamelMboxStoreClass" "CamelStoreClass" "CamelServiceClass" "CamelURL" "CamelMboxStore" "CambelMboxSummary" "CamelFolderSearch" "CamelFolderClass" "CamelMboxFolder" "CamelSession" "EStorage" "EFolderTree" "Folder" "CamelMessageInfo" "GPtrArray" "CamelObject" "CamelMimeMessage" "CamelMboxFolderClass" "CamelMimeMessage" "CamelStream" "CamlMimeParser" "CamelMboxMessageInfo" "CamelTransport" "CamelMimeParser" "CamelFolderSummary" "CamelMboxSummary" "CamelException" "CamelFolder" "CamelFolderSummary" "CammelInternetAddress" "CamelMedium" "CamelMimeFilter" "CamelMimeFilterBasic" "CamelMimeFilterCharset" "CamelStreammem" "CamelStreamFs" "CamelStreamBuffer" "CamelObjectClass" "CamelDataWrapper" "CamelDataWrapperClass" "CamelMimePart" "IdentityPageCallback" "MailConfigIdentity" "CamelAddress" "CamelInternetAddress" "CameMimeFilterSave" "CamelMimeFilterLinewrap" "CamelMimeFilterCRLF" "CamelMultipart" "CamelNewsAddress" "CamelSeekableSubstream" "CamelSeekableStream" "CamelSimpleDataWrapper" "CamelStreamDataWrapper" "CamelStreamFilter" "CamelStreamMem" "GnomeDruidPage" "GnomeDruid" "GeditReplaceDialog" "GeditUndoActions" "GeditUndoState" "GeditUndoAction" "GeditView" "GeditDocument" "GeditViewClass" "GeditSearchStates" "UT_Bool" "UT_RGBColor" "UI_uint32" "Gr_Image" "Gr_Font" "XAP_App" "XAP_UnixFontManagement" "UT_sin32" "UT_UCSChar" "SampleDocument" "NameGuruState" "WorkbookControlGUI" "ParsePos" "ExprTree" "NameGuruScope" "GpaWindowInfo" "GnomePrinterDialog" "GpaConfigDialogInfo" "GpaAddDialogInfo" "PdfCompressionType" "GpaSliderInfo" "MtmTheme" "MtmExt" "MtmEnv" "MtmExtHandler" "MtmHandler" "HandlerManager" "MtmPlugin" "PluginManager" "MtmStateful" "MtmStatefullClass" "MtmPluginPrivate" "MtmUrlHandlerClass" "MtmUrlHandlerPrivate" "MtmResult" "CappletWidget" "MtmController" "MtmSelector" "MtmControlList" "MtmViewPreview" "MtmViewExtensions" "MtmInfoUpdateHtml" "MtmExtSelector" "GladeWidget" "GladeProperty" "GladePropertyType" "GladeParameter" "GladeChoice" "GladePalette" "GladeProjectWindow" "GladeWidgetClass" "GladeProject" "GladePaletteClass" "GladeProjectView" "GladeProjectViewClass" "GladeEditor" "GladeSetting" "GladeCatalog" "GladeCursor" "GladeCursorType" "GladePropertyView" "GladePropertyClass" "Archive" "Location" "LocationList" "SheetObject" "SheetObjectPrintInfo" "SheetControlGUI" "GnumericSheet" "SheetObjectCreationData" "SheetObjectAnchor" "ExprRelocateInfo" "GnomeCanvasPoints" "SheetObjectDirection" "SheetObjectGraphic" "SheetControlGUISlideHandler" "SheetObjectClass" "SheetObjectFilled" "CheckboxConfigState" "SheetWidgetCheckbox" "EvalPos" "SheetObjectWidgetClass" "Dependent" "SheetObjectWidget" "GnomeCanvasWidget" "WorkbookControl" "GnumericCommand" "GnumericCommandClass" "CmdSetText" "xmlNode" "XstTool" "XstTimeTool" "XstDialog" "XstSpinButton" "XstSpinButtonClass" "GladeEditorTable" "GladeEditorProperty" "GladeProjectViewList" "GladePropertyQuery" "GladePropertyQueryResult" "GladePlaceholder" "GladeProjectViewTree" "GParamSpec" "GType" "GEnumValue" "GladeFindInContainerData" "GladeParamSpec" "GladeSignalEditor" "GladeWidgetSignal" "GValue" "GladeWidgetFunction" "GladeXmlNode" "GladeXmlContext" "GladeSignal" "GObject" "GPANode" "GladePackingProperties" "XstDhcpdTool" "XstIp" "XstIpType" "XstIpRange" "XstDhcpdRange" "XstDhcpdSubnet" "XstDhcpdHost" "XstDhcpdHostsEditor" "XstDhcpdNetwork" "xmlChar" "GPAReference" "GnomePrintTransport" "GnomePrintJob" "GPFontEntry" ""))) '(c-tab-always-indent (quote other)) '(font-lock-support-mode (quote lazy-lock-mode)) '(delete-old-versions t) '(standard-indent 8) '(auto-revert-interval 2) '(column-number-mode t) '(indent-tabs-mode t) '(user-mail-address "chema@celorio.com") '(next-line-add-newlines nil) '(global-font-lock-mode t nil (font-lock)) '(global-auto-revert-mode t nil (autorevert)) '(font-lock-global-modes t)) (custom-set-faces '(default ((t (:size "14pt")))) '(font-lock-comment-face ((((class color) (background light)) (:foreground "#e00000")))) '(font-lock-string-face ((((class color) (background light)) (:foreground "#008000")))) '(font-lock-keyword-face ((((class color) (background light)) (:bold t :foreground "Black")))) '(font-lock-constant-face ((((class color) (background light)) (:foreground "#6446ad")))) '(font-lock-preprocessor-face ((((class color) (background light)) (:foreground "#800080")))) '(font-lock-type-face ((((class color) (background light)) (:bold t :foreground "#6446ad")))) '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "Black")))) '(font-lock-doc-string-face ((((class color) (background light)) (:foreground "#008000")))) '(font-lock-function-name-face ((((class color) (background light)) (:bold t :foreground "Black")))) '(font-lock-builtin-face ((((class color) (background light)) (:foreground "#800080"))))) ;; ;; (c) 1998 Michael Zucchi, All Rights Reserved ;; ;; 'gnome-doc' helper function for gnome comments. ;; ;; Load into emacs and use with C-x4h, to insert a new header for ;; the current function. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 of ;; the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public ;; License along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; ;; This is my first attempt at anything remotely lisp-like, you'll just ;; have to live with it :) ;; ;; It works ok with emacs-20, AFAIK it should work on other versions too. ;; insert header at current location (defun gnome-doc-insert-header (function) (insert "/**\n * " function ":\n")) ;; insert a single variable, at current location (defun gnome-doc-insert-var (var) (insert " * @" var ": \n")) ;; insert a 'blank' comment line (defun gnome-doc-insert-blank () (insert " * \n")) ;; insert a section comment line (defun gnome-doc-insert-section (section) (insert " * " section ": \n")) ;; insert the end of the header (defun gnome-doc-insert-footer () (insert " **/\n")) (defun gnome-doc-insert () "Add a gnome documentation header to the current function. Only C function types are properly supported at the moment." (interactive) (let (c-insert-here (point)) (save-excursion (beginning-of-defun) (let (c-arglist c-funcname (c-point (point)) c-comment-point c-isvoid c-doinsert) (search-backward "(") (forward-line -2) (while (or (looking-at "^$") (looking-at "^ \\*") (looking-at "^#")) (forward-line 1)) (if (or (looking-at ".*void.*(") (looking-at ".*void[ \t]*$")) (setq c-isvoid 1)) (save-excursion (if (re-search-forward "\\([A-Za-z_0-9]+\\)[ \t\n]*\\(([^)]*)\\)" c-point nil) (let ((c-argstart (match-beginning 2)) (c-argend (match-end 2))) (setq c-funcname (buffer-substring (match-beginning 1) (match-end 1))) (goto-char c-argstart) (while (re-search-forward "\\([A-Za-z_0-9]*\\)[,)]" c-argend t) (setq c-arglist (append c-arglist (list (buffer-substring (match-beginning 1) (match-end 1))))))))) ;; see if we already have a header here ... (save-excursion (forward-line -1) (while (looking-at "^ \\*") (forward-line -1)) (if (looking-at "^/\\*\\*") (error "Header already exists") (setq c-doinsert t))) ;; insert header (if c-doinsert (progn (gnome-doc-insert-header c-funcname) ;; all arguments (while c-arglist (gnome-doc-insert-var (car c-arglist)) (setq c-arglist (cdr c-arglist))) ;; finish it off (gnome-doc-insert-blank) (gnome-doc-insert-blank) ;; record the point of insertion (setq c-insert-here (- (point) 1)) ;; only insert a returnvalue if we have one ... (if (not c-isvoid) (progn (gnome-doc-insert-blank) (gnome-doc-insert-section "Return Value"))) (gnome-doc-insert-footer))))) ;; goto the start of the description saved above (goto-char c-insert-here))) ;; set global binding for this key (follows the format for ;; creating a changelog entry ...) (global-set-key "\C-x4h" 'gnome-doc-insert) ;; END gnome-doc (message ".emacs loaded.") ;; ;; BEGIN TRASH LINES, usefull for ideas when no sleeping is desired. ;; ;;;;;;;;;;;;;;;;;;;;;;; ;; Some key bindings ;; ;;;;;;;;;;;;;;;;;;;;;;; ;(global-set-key "\C-cF" 'font-lock-mode) ; Slå av/på font-lock ;(global-set-key "\C-cc" 'compile) ;(global-set-key [delete] `backward-delete-char) ;( define-key global-map [f12] 'undo) ;;; -*-Emacs-Lisp-*- ;; Mainly because i didn't like the colors in font-lock-mode ;; I use black text on white background, and a color scheme ;; based on the one in KDevelop. ;;;;;;;;;; ;; Misc ;; ;;;;;;;;;; ;; Misc settings that I found here and there... ;;(delete-selection-mode nil) ;; Set extensions ;; (setq tex-dvi-view-command "xdvi") ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; HTML/WWW related stuff ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Gör så att vi editerar HTML-filer med html-helper-mode. (autoload 'html-helper-mode "html-helper-mode" "HTML editing mode" t) (or (assoc "\\.pxr$" auto-mode-alist) (setq auto-mode-alist (cons '("\\.pxr$" . html-helper-mode) auto-mode-alist))) ;; Fyll i nya HTML-dokument med ett skelett. ;;(setq html-helper-build-new-buffer t) ;; Ladda lite extra HTML-prylar och slå på auto-fill och aao-mode när ;; man editerar HTML-filer ;;(add-hook 'html-helper-load-hook ;; '(lambda () ;; (load "hhm-netscape") ;; (load "html-font") ;; (turn-on-auto-fill) ;; (turn-on-aao-mode))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Saker som låg i min .emacs på IDA ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;(set-input-mode t nil 'gazonk 7) ;;(setq standard-display-european t) ;;(defun delete-to-beginning-of-line () ;; (interactive) ;; (let ((p (point))) ;; (beginning-of-line) ;; (kill-region (point) p))) ;;(defun delete-whole-line () ;; (interactive) ;; (beginning-of-line) ;; (kill-line)) ;; ;;(defun save-eval-changebuffer () ;; (interactive) ;; (save-buffer) ;; (eval-buffer) ;; (switch-to-buffer *common-lisp*)) ; ;;(global-set-key "\C-l" 'save-eval-changebuffer)