;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312&\210\303\313\305\314\307\310\311\315&\207" [require cl-lib w3m-util custom-declare-variable w3m-history-reuse-history-elements nil "Non-nil means reuse the history element when re-visiting the page.\nOtherwise, a new history element will be created even if there are\nelements for the same url in the history.\n\nEmacs-w3m used to operate as the case in which it is non-nil, however\nit sometimes brought about users' dissatisfaction. For example, if a\nuser visited the pages A -> B -> C -> B in order, performing BACK on\nthe second B would let a user visit A. The reason why a user was\ntaken to A rather than C is that the `w3m-history' variable only had\nthe list `(A B C)' as a history and B was the current position at that\ntime.\n\nThe default value for this variable is nil which allows the\n`w3m-history' variable to have the list `(A B C B)'. Where contents\nof two B's are the identical Lisp objects. So, too much wasting the\nLisp resources will be avoided.\n\nSee the documentation for the variables `w3m-history' and\n`w3m-history-flat' for more information." :group w3m :type (boolean :format "%{%t%}: %[%v%]" :on "On" :off "Off") w3m-history-minimize-in-new-session "Non-nil means minimize copied history so that there's only current page.\nThis variable is effective when creating of the new session by copying\n(i.e., `w3m-copy-buffer')." (boolean :format "%{%t%}: %[%v%]" :on "On" :off "Off")] 8) #@4444 A tree-structured complex list of all the links which you have visited. This is a buffer-local variable. For example, it will grow as follows: [Branch-1.0.0.0]: +--> U1.0.0.0.0 --> U1.0.0.0.1 | [Branch-1.0]: +--> U1.0.0 --> U1.0.1 --> U1.0.2 | [Trunk]: U0 --> U1 --> U2 --> U3 --> U4 --> U5 --> U6 | [Branch-2.0]: +--> U2.0.0 --> U2.0.1 | [Branch-2.1]: +--> U2.1.0 --> U2.1.1 --> U2.1.2 | [Branch-2.1.1.0]: +--> U2.1.1.0.0 In this case, the U1.0.0.0.0 history element represents the first link of the first branch which is sprouted from the U1.0.0 history element. The trunk or each branch is a simple list which will contain some history elements. History elements in the trunk or each branch will be arranged in increasing order (the newest history element will be the last element of the list). Each history element represents a link which consists of the following records: (URL PROPERTIES BRANCH BRANCH ...) Where URL is a string of an address of a link. PROPERTIES is a plist which is able to contain any kind of data to supplement the URL as follows: (KEYWORD VALUE KEYWORD VALUE ...) A note for programmers: PROPERTIES should always be a non-nil value in order to make it easy to share the value in every history element in every emacs-w3m buffer. The remaining BRANCHes are branches of the history element. Branches will also be arranged in increasing order (the newest one will be the rightmost element). Each BRANCH will also be a tree-structured complex list. Therefore, the history structure will grow up infinitely. In order to save the Lisp resources, URL strings and PROPERTIES in the `w3m-history' variables are shared in every emacs-w3m buffer (it means each element in two `w3m-history' variables can be compared by `eq' rather than `equal'). If there is necessity to make buffer-local properties, in other words, to make properties of which values differ in every emacs-w3m buffer, use the `w3m-history-flat' variable instead. There are special rules on the emacs-w3m history management system. As you perhaps foresaw, the operation BACK on U2.0.0 brings you to U2, and one more BACK brings you to U1. Well, where do you think we should go next when the operation FORWARD is performed on U1? The rule is to go to the newest link you have ever visited. So, that operation should take you to U1.0.0. Another rule is that the new U4 link should sprout from U1.0.1 if `w3m-history-reuse-history-elements' is nil when you visit the U4 link directly from U1.0.1. In contrast, you should be taken to the existing U4 link instead of sprouting the new branch from U1.0.1 if `w3m-history-reuse-history-elements' is non-nil. In addition, the first element of `w3m-history' is special. It is a list containing pointers which point to three history elements as shown below: (PREV CURRENT NEXT) PREV points to the previous history element, CURRENT points to the current one and NEXT points to the next one. Each of them is a list which contains an odd number of integers. For example, `(0)' does point to U0 and `(2 1 0)' does point to U2.1.0. Finally, the value of the `w3m-history' variable will be constructed as follows: (((1) (2) (2 1 0)) ("http://www.U0.org/" (:title "U0" :foo "bar")) ("http://www.U1.org/" (:title "U1" :foo "bar") (("http://www.U100.org/" (:title "U100" :foo "bar") (("http://www.U10000.org/" (:title "U10000" :foo "bar")) ("http://www.U10001.org/" (:title "U10001" :foo "bar")))) ("http://www.U101.org/" (:title "U101" :foo "bar")) ("http://www.U102.org/" (:title "U102" :foo "bar")))) ("http://www.U2.org/" (:title "U2" :foo "bar") (("http://www.U200.org/" (:title "U200" :foo "bar")) ("http://www.U201.org/" (:title "U201" :foo "bar"))) (("http://www.U210.org/" (:title "U210" :foo "bar")) ("http://www.U211.org/" (:title "U211" :foo "bar") (("http://www.U21100.org/" (:title "U21100" :foo "bar")))) ("http://www.U212.org/" (:title "U212" :foo "bar")))) ("http://www.U3.org/" (:title "U3" :foo "bar")) ("http://www.U4.org/" (:title "U4" :foo "bar")) ("http://www.U5.org/" (:title "U5" :foo "bar")) ("http://www.U6.org/" (:title "U6" :foo "bar"))) (defvar w3m-history nil (#$ . 1584)) #@950 A flattened alist of all the links which you have visited. All history elements except for buffer-local properties are the same as ones of `w3m-history'. Each element will contain the following records: (URL PROPERTIES POSITION [KEYWORD VALUE [KEYWORD VALUE ...]]) Where URL is a string of an address of a link, PROPERTIES is a plist which is able to contain any kind of data to supplement the URL. Each PROPERTIES is the Lisp object identical with that corresponding element of `w3m-history'. POSITION is a list of integers to designate the current position in the history. The remaining [KEYWORD VALUE [KEYWORD VALUE ...]] is a plist similar to PROPERTIES, but it is buffer-local. You can manipulate buffer-local properties using the functions `w3m-history-plist-get', `w3m-history-plist-put', `w3m-history-add-properties' and `w3m-history-remove-properties'. See the documentation for the `w3m-history' variable for more information. (defvar w3m-history-flat nil (#$ . 6071)) (byte-code "\300\301!\210\300\302!\207" [make-variable-buffer-local w3m-history w3m-history-flat] 2) #@72 Extract a history element associated with URL from `w3m-history-flat'. (defalias 'w3m-history-assoc #[(url) "\302 \"\207" [url w3m-history-flat assoc] 3 (#$ . 7169)]) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put w3m-history-assoc speed -1 put byte-optimizer byte-compile-inline-expand] 5) #@215 Modify `w3m-history' so that POSITION might be the current position. What is called the current position is the `cadar' of `w3m-history'. The previous position and the next position will be computed automatically. (defalias 'w3m-history-set-current #[(position) "\302 !\240\207" [w3m-history position w3m-history-regenerate-pointers] 3 (#$ . 7487)]) #@431 Return a history element located in the POSITION of the history. If FLAT is nil, the value will be extracted from `w3m-history' and represented with the `(URL PROPERTIES BRANCH BRANCH ...)' form. Otherwise, the value will be extracted from `w3m-history-flat' and represented with the `(URL PROPERTIES POSITION [KEYWORD VALUE ...])' form. FYI, to know the current position, the `(cadar w3m-history)' form for example can be used. (defalias 'w3m-history-element #[(position &optional flat) "\205Q \203-\n\305 \203* \211A\242\211AA@\232\203%\305\211\202 \305\202\f *\207\211A\242\fA8\203O\211A\242 AA8\211A\242 8\2026 )\207" [position flat w3m-history-flat element w3m-history nil] 3 (#$ . 7845)]) #@193 Return a history position of the previous location of POSITION. POSITION is a list of integers of the same form as being used in one of the elements of the `car' of `w3m-history' (which see). (defalias 'w3m-history-previous-position #[(position) "\304\211\211 \2038 GS\211 8\211\305U\203-\n\305U\2048\306 !\n\307Z\233\304\241\210\2028\306 !\n\233 S\240\210+\207" [previous number class position nil 0 copy-sequence 2] 4 (#$ . 8574)]) #@189 Return a history position of the next location of POSITION. POSITION is a list of integers of the same form as being used in one of the elements of the `car' of `w3m-history' (which see). (defalias 'w3m-history-next-position #[(position) "\306\211\211\211\f\203f\f A \211A\242\n8 \2032 \211A\242 AA8 \211A\242\n8\202\307 8\203L\310\f!\211GS \233 G\311Z\312D\241\210\202f\nG\fGS\f8T\211V\203f\310\f!\211GS \233\240\210 ,\207" [number element branch next position w3m-history nil 2 copy-sequence 3 0] 5 (#$ . 9029)]) #@247 Similar to `plist-put' but PLIST is actually modified. If VALUE is nil, the pair of PROPERTY and VALUE is removed from PLIST. Exceptionally, if PLIST is made empty because of removing, it will be instead set to `(nil nil)'. Return PLIST itself. (defalias 'w3m-history-set-plist #[(plist property value) "\204\304\211D >\211\203J \203\nA \240\210\202X@ =\203:\3058\240\210A\3068\240\210A\307\233\241\210\202XG\nGZS\233\nAA\241\210\202X \203XGS\233 D\241\210)\207" [plist property pair value nil 2 3 4] 4 (#$ . 9574)]) #@373 Merge NEW plist into OLD plist and return a modified plist. If REPLACE is non-nil, OLD will be replaced with NEW. OLD plist is modified and also the new value is shared in all the history elements containing OLD plist. Properties whose values are nil are removed from OLD plist, but if OLD plist is made empty because of removing, it will be instead set to `(nil nil)'. (defalias 'w3m-history-modify-properties #[(old new &optional replace) " \203\n@\240\210\nA\206\303C\241\210\202,\n\203,\304\n@\nA@#\210\nAA\211\204\2044\303\211D\305!\211\203M\304\n@\nA@#\210\nAA\211\204<\207" [old replace new nil w3m-history-set-plist copy-sequence] 6 (#$ . 10126)]) #@286 Return a copy of history element corresponding to URL. Searching is performed in all emacs-w3m buffers and the first match found is returned. If REPLACE is nil, NEPROPS will be merged into properties of an element. Otherwise, properties of an element will be replaced with NEWPROPS. (defalias 'w3m-history-seek-element #[(url &optional newprops replace) "p\211\306\307 \"B\310 \203/ \211A\242q\210 \311=\203\f\f\312\f \")\211\203\f\310\211\204q\210\313\n!\n\203C\314\nA@ #\210+\207" [current buffers element major-mode url w3m-history-flat delq buffer-list nil w3m-mode assoc copy-sequence w3m-history-modify-properties newprops replace] 6 (#$ . 10813)]) #@62 Return non-nil if the previous history element is available. (defalias 'w3m-history-previous-link-available-p #[nil "@@\207" [w3m-history] 1 (#$ . 11494)]) #@58 Return non-nil if the next history element is available. (defalias 'w3m-history-next-link-available-p #[nil "@AA@\207" [w3m-history] 1 (#$ . 11657)]) #@340 Move backward COUNT times in the history structure. Return a cons of a new history element and new position pointers of the history. The position pointers of `w3m-history' will not change. If COUNT is omitted, it defaults to the number one. If COUNT is negative, moving forward is performed. Return nil if there is no previous element. (defalias 'w3m-history-backward #[(&optional count) "\205r\305@!\306\211\f\204\307\211\204\f\310V\2038\f\310V\203`@@\211\203`\311\n\211!\210\fS\211\202\f\310W\203[\f\310W\203`@AA@\211\203`\311\n\211!\210\fT\211\202?@A@ \205m\312@A@!@B \240\210+\207" [w3m-history last position oposition count copy-sequence nil 1 0 w3m-history-set-current w3m-history-element] 4 (#$ . 11815)]) #@365 Move forward COUNT times in the history structure. Return a cons of a new history element and new position pointers of the history. The position pointers of `w3m-history' will not change. If COUNT is omitted, it defaults to the number one. If COUNT is negative, moving backward is performed. If there is no room to move in the history, move as far as possible. (defalias 'w3m-history-forward #[(&optional count) "\301\206\302[!\207" [count w3m-history-backward 1] 2 (#$ . 12572)]) #@202 Regenerate the position pointers due to only the current POSITION. The history position pointers are made with the `(PREV CURRENT NEXT)' form which is mentioned in the documentation for `w3m-history'. (defalias 'w3m-history-regenerate-pointers #[(position) "\301!\302!E\207" [position w3m-history-previous-position w3m-history-next-position] 4 (#$ . 13066)]) #@121 Set the value of `w3m-history-flat' due to the value of `w3m-history'. See also the documentations for those variables. (defalias 'w3m-history-flat #[nil "\306 \205\271 A\307C\306\211\211\211 \f\f\211A\f\242\211\203\263 @;\203\244 @ A@\310 !EB AA\211\203U\311 \f\"\f\311\307\211D \" G\fB\202 \211@T\240\210\312 \203\n\203\n\211@S\240\307U\203\nA\f\211@S\240\307U\203\217\fA AA\211 \211@T\240\210\202^ \307\240\210 A A@T\240\210\306\211\202_\311 \f\"\f G\nB\202.\237\211\207" [w3m-history-flat w3m-history children flag branches element nil 0 reverse append t position history] 7 (#$ . 13435)]) #@231 Set the value of `w3m-history' due to the value of `w3m-history-flat'. See also the documentations for those variables. NEWPOS specifies the current position of the history. It defaults to the beginning position of the history. (defalias 'w3m-history-tree #[(&optional newpos) "\203\236\306\211\211\211\306\211DC \211A\242\211\203\212\fAA@  \203{ \211A\242\nG V\204H\nGS\n\233\307 \nGZT\306\211D\"\241\210 \n8 \203& \211A\242\nG\310Z V\204r\nGS\n\233\307 \nGZ\311Z\306\211DC\"\241\210 \310\\\n8\202&\n\f@\240\210\nA\fA@\240\210\202\312 B \313\206\230\314C!\210 -\207\306\211 \207" [w3m-history-flat position rest positions element flat nil make-list 2 -3 dummy w3m-history-set-current 0 w3m-history newpos] 5 (#$ . 14089)]) #@1016 Push URL into the history structure. A history which corresponds to URL becomes the current one. NEWPROPS is a plist which supplements URL. Return a new history position pointers. How this function behaves to the history structure (i.e., `w3m-history' and `w3m-history-flat') is controlled by the value of `w3m-history-reuse-history-elements'. The case where `w3m-history-reuse-history-elements' is nil: A new history element is always created. If there is another element corresponding to the same URL, its properties are inherited into the new history element. The case where `w3m-history-reuse-history-elements' is non-nil: If there is an element corresponding to URL in the history, it becomes the current history element. Otherwise, this function behaves like the case where `w3m-history-reuse-history-elements' is nil. If REPLACE is nil, NEWPROPS is merged into properties of the current history element. Otherwise, properties of the current history element are replaced with NEWPROPS. (defalias 'w3m-history-push #[(url &optional newprops replace) "\306\307\"?\205\356\310 \n#\311\211\211\211\211\203%A\311\241\210\202-\312 \311\"D\204N\311\313C\311E\211D\314\313CC\"C\202\355\203k\315\")AA@\211\203k\316!\202\355\317@A@!\211GS\313@A\233 \fV\203\242\fT\2118 @AA8\fT\2118 \233\202\202 A\203\303 @GS \233\fS\313D\241\210\f @\233CC\241\210\202\325 \233 \233@T\240\210 C\241\210\314C\"C\244\211@A@\311E\240-\207" [url newprops replace branch number class string-match "^about://" w3m-history-seek-element nil w3m-history-modify-properties 0 append assoc w3m-history-set-current copy-sequence position element w3m-history w3m-history-flat w3m-history-reuse-history-elements] 6 (#$ . 14859)]) #@487 Copy the history structure from BUFFER to the current buffer. This function keeps corresponding elements identical Lisp objects between buffers while copying the frameworks of `w3m-history' and `w3m-history-flat'. Exceptionally, buffer-local properties contained in `w3m-history-flat' will not be copied except for the positions. If `w3m-history-minimize-in-new-session' is non-nil, the copied history structure will be shrunk so that it may contain only the current history element. (defalias 'w3m-history-copy #[(buffer) "p\306\211\211\211\211\211q\210\203#\307@A@!q\210 \205\231\203U\f\307\310 \311\"!\211A\306\241\210\306\312C\306E D\313 \312CC\"C\211\202\231\f\203\222\307\f@!\fA AAA\314\n\315\"\211\203\205 AA\315 \316\314\n\316\"\317\314\n\317\"\257\241\210\202\213 AA\306\241\210 B\202U\237\320 !.\207" [rest window-start props element flat position nil copy-sequence w3m-history-element t 0 append plist-get :window-start :position :window-hscroll w3m-history-tree current buffer w3m-history w3m-history-flat w3m-history-minimize-in-new-session] 10 (#$ . 16676)]) #@357 Extract a value from the properties of the current history element. KEYWORD is usually a symbol. This function returns the value corresponding to KEYWORD, but it returns nil if the properties don't contain KEYWORD. If NOT-BUFFER-LOCAL is nil, this function searches a value in buffer-local properties, otherwise looks over the global properties instead. (defalias 'w3m-history-plist-get #[(keyword &optional not-buffer-local) "\304@A@\305\"\306\n\203 A@\202 AAA \")\207" [w3m-history element not-buffer-local keyword w3m-history-element t plist-get] 3 (#$ . 17806)]) #@305 Add NEWPROPS to the properties of the current history element. NEWPROPS should be a plist, which is merged into the properties. Return new properties. If NOT-BUFFER-LOCAL is nil, NEWPROPS will be added to the buffer-local properties. Otherwise, NEWPROPS will be added to the global properties instead. (defalias 'w3m-history-add-properties #[(newprops &optional not-buffer-local) "\203\305\306 @A@!@\n\"A@\207\306 @A@\307\"\310\211\205@\fAAA\211\203/\311 \n\"\2023\311\n\310\"\211@\204;\310\fAA \241*\207" [not-buffer-local w3m-history newprops properties element w3m-history-seek-element w3m-history-element t nil w3m-history-modify-properties] 4 (#$ . 18388)]) #@251 Put KEYWORD and VALUE into the current history element. Return new properties. If NOT-BUFFER-LOCAL is nil, KEYWORD and VALUE will be put into the buffer-local properties. Otherwise, KEYWORD and VALUE will be put into the global properties instead. (defalias 'w3m-history-plist-put #[(keyword value &optional not-buffer-local) "\303 D\n\"\207" [keyword value not-buffer-local w3m-history-add-properties] 3 (#$ . 19072)]) #@319 Remove PROPERTIES from the current history element. PROPERTIES should be one or more keyword-value pairs (i.e., plist) but values are ignored (treated as nil). Return new properties. If NOT-BUFFER-LOCAL is nil, the buffer-local properties will be modified. Otherwise, the global properties will be modified instead. (defalias 'w3m-history-remove-properties #[(properties &optional not-buffer-local) "\303 \203\303 @BB AA\211\204\304\237\n\")\207" [rest properties not-buffer-local nil w3m-history-add-properties] 4 (#$ . 19502)]) #@200 Store the current cursor position into the current history element. Data consist of the position where the window starts and the cursor position. Naturally, those should be treated as buffer-local. (defalias 'w3m-history-store-position #[nil "@A@\205li\304 \305o\204P\306`\307\"\204P\306`S\307\"\203'`Sb\202=\310`\307\305\311 $\211\203P \311 U\204P Sb\203Pi\312 !\210\n ZZ\313] \314\315\316 \317\320e\311 \" B\321\n\257!\210+\322\323!\205l\324\325!\207" [w3m-history pos hscroll column window-hscroll nil get-text-property w3m-image previous-single-property-change point-at-bol move-to-column 0 w3m-history-add-properties :window-start window-start :position count-lines :window-hscroll called-interactively-p any message "The current cursor position saved"] 7 (#$ . 20050) nil]) #@159 Restore the saved cursor position in the page. Even if the page has been shrunk (by reloading, for example), somehow it works although it may not be perfect. (defalias 'w3m-history-restore-position #[nil "@A@\205Y\305\306!\307\211\211\203O\305\310!\211\203O dX\205Xeb\210\n@y\210\311p\312\"\211\203A\313 \"\210\314 \305\315!\206?\316\"\210\317\nA!\210\307\320\321!)\202X\322\323!\205X\324\325!+\207" [w3m-history window position start deactivate-mark w3m-history-plist-get :window-start nil :position get-buffer-window all-frames set-window-start set-window-hscroll :window-hscroll 0 move-to-column run-hooks w3m-after-cursor-move-hook called-interactively-p any message "No cursor position saved"] 5 (#$ . 20857) nil]) #@66 Minimize the history so that there may be the current page only. (defalias 'w3m-history-minimize #[nil "@A@\304\211\205(\305\n\306\"\211AA\307C\240\210 C\304\307C\304E @ A@DD\211*\207" [w3m-history element position w3m-history-flat nil w3m-history-element t 0] 4 (#$ . 21599) nil]) #@25 Return slimmed history. (defalias 'w3m-history-slimmed-history-flat #[nil "@A@\306\211\f\306\211 \203' @\307 8 B\nB A\211 \204*\310 \n\"AC\311 !\211\f\203K\310\f\n\"A B\311\f!\211\f\2048)\312 !\211\f\203h\310\f\n\"A B\312\f!\211\f\204U) +\207" [w3m-history new-flat flat-map position w3m-history-flat l nil 2 assoc w3m-history-previous-position w3m-history-next-position --dolist-tail-- pos] 4 (#$ . 21894)]) #@131 Slim the history. This makes the history slim so that it may have only the pages that are accessible by PREV and NEXT operations. (defalias 'w3m-history-slim #[nil "@A@\303 \304 !)\207" [w3m-history position w3m-history-flat w3m-history-slimmed-history-flat w3m-history-tree] 2 (#$ . 22339) nil]) #@223 Add the arrived database to the history structure unreasonably. This function is useless normally, so you may not want to use it. (The reason it is here is because it is useful once in a while when debugging w3m-hist.el.) (defalias 'w3m-history-add-arrived-db #[nil "\306=\204 \307\310 \"\210\n\205X\311\312!\313\314!\210\205X\315\211\316\315\211\317\320\n\"\210\321\322\323G!8\"\210\203S\322\323\fG!\f8@!\210\321\322\211A\242\"\210\2026+\324\325\316\"\207" [major-mode this-command w3m-arrived-db w3m-history w3m-history-flat title w3m-mode error "`%s' must be invoked from an emacs-w3m buffer" yes-or-no-p "Are you sure you really want to destroy the history? " message "" nil t maphash #[(_key symbol) "\205 \301N\211\203\303!\304 DD\nB\211\207\303!C\nB\211\207" [symbol title url-title symbol-name :title] 3] apply w3m-history-push random w3m-goto-url "about://history/" url-title w3m-history-reuse-history-elements] 5 (#$ . 22646) nil]) (provide 'w3m-hist)