⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dirhistory.txt

📁 操作系统文件管理
💻 TXT
字号:
							1999-06-08							Emil Brink			Directory History1. INTRODUCTIONThis little document talks about the "directory history" mechanismsin gentoo. These mechanisms are responsible for keeping track ofwhich rows were selected in a certain directory the last time youvisited it in a given pane, the vertical position last used, andsuch.	This document was written during development of gentoo0.11.8, since that version (hopefully) includes a reworked directoryhistory system.2. PROBLEMS WITH PRE-0.11.8's HISTORY HANDLINGThe history code included in releases prior to 0.11.8 has severalproblems. Perhaps the most severe is that it always keeps the listof paths you have visited sorted in reverse chronological order,leaving the most recent path on top. This is fine for simple inter-action, but makes it difficult to step backwards through thehistory (since each step causes it to re-sort).	As of version 0.11.7, symbolic links are fairly well supp-orted by gentoo, and it becomes necessary to have some way offollowing links "backwards". The old directory history systemdoesn't do this very well, so a new one is needed.3. THE NEW HISTORYThe new directory history is modeled after the URL history inprograms such as Netscape Navigator. It will not be exactly likea browser's history, however. There are certain differences betweenfile system directories and web pages (yes, really, no matter whatMicros~1 says!).	The main idea of the dirhistory system is to keep the datathat describes a directory around until the next time you enterthat directory. A secondary goal is to arrange the data in a waythat preserves the order you visited the directories in, thus makingit easy to provide back- and forward movement through the history.3.1 The Current DirectoryThere is always a history data entry for the current directory.It is not on any of the lists (mentioned below); it's stored in aspecial single-entry "slot" designed for the purpose. This makesit easy to always find the current directory's history entry.3.2 The Backward, Forward and Cache ListsIn addition to the current directory slot, there are three liststhat also hold history entries: the backward list; the forwardlist; and the cache.	The backward list holds entries that you have alreadyvisited once during a session. The last entry on the backwardlist is normally the directory that was current previous to theone that is currently current (!), and so on. If it sounds comp-licated, that's entierly my fault. :)	The forward list holds entries for directories thatyou entered after the current directory. The forward list isonly used by the DirBackward and DirForward commands; it isleft blank by normal (absolute) navigation.	The cache holds entries for directories that have beenvisited, but are no longer part of the sequence available bymoving backward and forward. See the command descriptions belowfor more details.3.3 History CommandsThe following commands operate on the history state:DirEnter	Changes the current directory by simply replacing it with	a new path.		Appends the current dir to the back list first, and	then clears the forward list. Detailed steps:	1. Find current dir entry, and update the history state in	   it.	2. Find entry for target directory. If found on the back	   list, move all entries _after_ it to the cache list.	3. Enter target dir, apply found entry (if any).	4. Append initial current dir's entry (from step #1) to	   the back list.	4. Clear forward list.	5. Done!DirRescan	Refreshes the display of a directory, by reading the dir's	contents back from the disk. Does not alter the length or	contents of any history lists, but makes use of the information	in them nevertheless. Detailed steps of operation:	1. Find the current directory's history entry. Should be	   really simple, since it should be in the "current" slot.	2. Update history information.	3. Reread the directory from disk.	4. Apply previously stored history info.	5. Done!DirBack	Changes to the previous directory, i.e. the one that is	last in the back list. Painfully detailed description:	1. Find current dir's slot.	2. Update history information.	3. Prepend current to forward history list.	4. Change to directory at end of backward list.	5. Done!DirForward	Goes one step forward in the directory history, to the dir	specified by the first item in the forward list. Steps:	1. Find current.	2. Update it.	3. Append current to backward history listt.	4. Change to directory at beginning of forward list.	5. Done!3.4 Initial Example	Illustration, showing a command, the back list, currentdir, and forward list _after_ the command has executed:Command			Back		Current		Forward(start, initial state)	()		""		()DirEnter "/"		()		"/"		()DirEnter "/home"	("/")		"/home"		()DirEnter "/home/emil"	("/" "/home")	"/home/emil"	()DirBack			("/")		"/home"		("/home/emil")DirBack			()		"/"		("/home" "/home/emil")DirForward		("/")		"/home"		("/home/emil")DirForward		("/" "/home")	"/home/emil"	()3.5 No DuplicatesThe new history system (just like the old) will not allow duplicateentries in the history. If there is an entry for a path in one ofthe history lists, that entry will always be used whenever that pathbecomes current again. This is unlike e.g. Netscape's behaviour, andmotivated by two main factors: 1) it's necessary in order to preserveselection info, and 2) it's simpler and I think I understand it. :)3.6 Second ExampleThe example continues, from the last state shown above:Command		Back List			Current Dir	Forward List(initial)	("/" "/home")			"/home/emil"	()DirEnter "/usr"	("/" "/home" "/home/emil")	"/usr"		()DirBack		("/" "/home")			"/home/emil"	("/usr")DirBack		("/")				"/home"		("/home/emil" "/usr")DirEnter "/usr"	("/" "/home")			"/usr"		()Note that for the last line here, the "/usr" record on the forwardlist would NOT be completely ignored: both lists are searched be-fore changing the directory, so that any old selection in "/usr"could be found and applied.	When the record has been found and used, though, it willbe deleted together with the rest of the forward list.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -