📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

6. Dirty Tricks

6.1 Inserting a header automatically

Emacs allows you to hook some actions to any event (opening of a file, saving, running a new mode, etc). .:: www.templepurohit.com ::. .:: writeablog.net ::. .:: telegra.ph ::. .:: addons.mozilla.org ::.

The autoinsert library uses this feature: when you open a new file under Emacs, this library inserts, according to the type of the file, a .:: land-book.com ::. .:: scam.vn ::. .:: addons.mozilla.org ::. standard header.

In our case, this standard header could well be the part declaring the document type (LinuxDoc), the title, the author, and the date. .:: management.ju.edu.jo ::. .:: www.awwwards.com ::. .:: squareblogs.net ::. .:: amazingradio.com ::. .:: okestream.bcz.com ::. .:: us.pinterest.com ::. [Ubuntu Community] .:: www.mobafire.com ::. .:: telegra.ph ::. .:: caf.vass.gov.vn ::.

I will describe here two ways to insert such a header. You could insert a template file containing the information to insert, or you could run an .:: md.darmstadt.ccc.de ::. .:: partners.skanska.com ::. .:: opendata.ternopilcity.gov.ua ::. .:: podcasts.apple.com ::. .:: chromewebstore.google.com ::. .:: hk.enrollbusiness.com ::. .:: squareblogs.net ::. elisp routine.

by inserting a file

You must first tell Emacs to run the auto-insert when opening a file, then to read the autoinsert library which declares the auto-insert-alist list which we need to change. This list defines the header to insert for each file type. By default, the file to insert must be in the .:: podcasts.apple.com ::. .:: www.popdaily.com.tw ::. .:: vuf.minagricultura.gov.co ::. .:: telegra.ph ::. .:: forum.446.s1.nabble.com ::. ~/insert/ directory, but it is possible to redefine the auto-insert-directory variable if you want to put it somewhere else.

Add the following lines to your .emacs file to insert the ~/emacs/sgml-insert.sgml file each time you open a new SGML file:

      (add-hook 'find-file-hooks 'auto-insert)
      (load-library "autoinsert")
      (setq auto-insert-directory "~/emacs/")
      (setq auto-insert-alist
            (append '((sgml-mode .  "sgml-insert.sgml"))
                    auto-insert-alist))
      

You can then write in the ~/emacs/sgml-insert.sgml file your customised header, then re-run Emacs and open some .:: blogfreely.net ::. .:: wiki.0-24.jp ::. .:: mindef.gov.bn ::. .:: blogfreely.net ::. .:: morguefile.com ::. foobar.sgml file. Emacs should ask you to confirm the automatic insertion, and if you answer yes, insert your header. .:: telegra.ph ::. .:: mindef.gov.bn ::. .:: telegra.ph ::. .:: hiqueyzhk582.wixsite.com ::.

by running a routine

This works like before, but instead of setting the auto-insert-alist to a file to insert, you need to set it to a function to execute. This is how to proceed, taking for granted you want to write this function in a file named .:: sp.ucn.edu.co ::. .:: chromewebstore.google.com ::. .:: openwhyd.org ::. .:: ml007.k12.sd.us ::. .:: blogfreely.net ::. .:: podcasts.apple.com ::. .:: telegra.ph ::. [Code: PowerShell] ~/emacs/sgml-header.el. (there's no need to burden your .emacs file with such a function, as it may turn out to be quite long): .:: www.battlakw.com ::. .:: computer.ju.edu.jo ::. .:: co.pinterest.com ::. .:: podcasts.apple.com ::.

      (add-hook 'find-file-hooks 'auto-insert)
      (load-library "autoinsert")
      (add-to-list 'load-path "~/emacs")
      (load-library "sgml-header")
      (setq auto-insert-alist
            (append '(((sgml-mode .  "SGML Mode") . insert-sgml-header))
                    auto-insert-alist))
      

You will find in appendix an example of insert-sgml-header function.


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this