aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-06-02Increase version v0.0.2 -> v0.0.3HEADv0.0.3masterTeddy Wing
2019-06-02Merge branch 'fix-string-join-function-undefined-error'Teddy Wing
2019-06-02Fix void `string-join` function errorTeddy Wing
Upon running `'w3m-session-backup`, this error message would be printed: Symbol's function definition is void: string-join I learned that Emacs doesn't load all functions at load. In particular for this case, the `string-join` function was in a file not loaded by default. Thanks to the following resources: https://emacs.stackexchange.com/questions/22142/cannot-open-load-file-subr-x https://github.com/ralesi/ranger.el/blob/9db73d61/ranger.el#L84 I discovered I could require the `subr-x.el` file that contains the `string-join` function needed. Decided to keep using `string-join` instead of `(mapconcat 'identity ...` as it reads better in my mind.
2018-04-12Increase version v0.0.1 -> v0.0.2v0.0.2Teddy Wing
2018-04-12Merge branch 'add-minibuffer-message'Teddy Wing
2018-04-12Include the file path in the minibuffer confirmation messageTeddy Wing
Instead of printing a generic success message, include the filename and path of the newly saved backup file. Extract the code that generates the file path from `w3m-session-backup--save-backup` to a new function so it can be reused.
2018-04-12Print a message to the minibuffer when executedTeddy Wing
Provide some user confirmation of the backup action. Otherwise, you're left in doubt about whether the command actually ran.
2018-04-12Add CHANGELOGTeddy Wing
2018-04-12Add URL header commentv0.0.1Teddy Wing
Now that the package is published on GitHub, use that as the URL.
2018-04-12README: Add link to download the package script from GitHubTeddy Wing
2018-04-12README: Use project page in example YAMLTeddy Wing
2018-04-12README: Finalise Install sectionTeddy Wing
2018-04-12README: Show default filename exampleTeddy Wing
2018-04-12Add draft READMETeddy Wing
Incomplete, but includes a description, and sections for usage, customisation options, dependencies, installation instructions, and license information.
2018-04-12Delete development commentsTeddy Wing
These were reference comments I took during development and are no longer needed.
2018-04-12save-directory: Describe default in doc stringTeddy Wing
2018-04-12Fix filename function referenceTeddy Wing
When I renamed my functions to prepend the `w3m-session-backup` prefix, I forgot to add it to this variable's default value. Update it to use the correct function name.
2018-04-12Add COPYING (GNU GPLv3+)Teddy Wing
2018-04-11Add a `provide` call at the end of the packageTeddy Wing
Follow the Coding Conventions and call `provide` at the end of the package file. This allows our code to be `require`d if so desired. References: - https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html#Coding-Conventions - https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#Named-Features
2018-04-11Add "tools" to the "Keywords" listTeddy Wing
This is the only one from `finder-by-keyword` that even remotely seemed to relate to this package.
2018-04-11Add a version dependency on `w3m`Teddy Wing
This is the version I currently have installed, so I'm going to use that as the dependency. The Melpa version is apparently "20180116.135", but I guess I'll go with this (taken from my `~/.w3m/.sessions` file). Presumably my package also works with earlier versions, but this is just easier than making sure myself.
2018-04-11Autoload the `M-x` `w3m-session-backup` commandTeddy Wing
Since this is a user command, autoload it to ensure it's recognised.
2018-04-11Get rid of old commented code and test function callsTeddy Wing
2018-04-11Add missing doc strings to functionsTeddy Wing
Fill in our TODO-ed doc strings with real descriptions.
2018-04-11Add package headersTeddy Wing
Still need to figure out the values for the "Package-Requires", "Keywords", and "URL" sections.
2018-04-11Add a `M-x` command to run the backup operationTeddy Wing
2018-04-11Prefix all functions and variables with `w3m-session-backup-`Teddy Wing
Since these are global Lisp-style functions, they need to be prefixed for namespacing. Looks like I'm going to call this package "w3m-session-backup" as I can't think of anything more concise and similarly descriptive. As per the Coding Conventions document, use a two-hyphen separator for private functions. > Use two hyphens to separate prefix and name if the symbol is not meant > to be used by other packages. (https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html#Coding-Conventions)
2018-04-11Rename `filename` variable to `filename-function`Teddy Wing
The Emacs "Coding Conventions" documentation (https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html#Coding-Conventions) recommends that variables that store functions be named ending in "-function".
2018-04-11Make the `filename` function user-customisableTeddy Wing
Allow users to customise the name of the file that gets generated and saved with a custom function.
2018-04-11Create a `w3m-session-backup` customisation groupTeddy Wing
It's apparently recommended that packages define groups for their custom variables. Do this, and put the `save-directory` custom variable we defined earlier in it.
2018-04-11Use `defcustom` instead of `setq` for the `save-directory` variableTeddy Wing
This allows us to document the variable and designate it as a user-customisable variable.
2018-04-11Add a reminder to make the filename customisableTeddy Wing
2018-04-11Add seconds to default filename timestampTeddy Wing
Helps to allow us to create multiple files. If multiple sessions are saved in the span of a minute, only the last session file for the minute is really persisted. This extends the chances of saving separate backup files.
2018-04-11Make the save directory configurableTeddy Wing
Put the save directory in a variable to make it configurable. Default it to the current directory. Thanks to Trey Jackson for the `FILE-NAME-AS-DIRECTORY` function: https://stackoverflow.com/questions/3964715/what-is-the-correct-way-to-join-multiple-path-components-into-a-single-complete/3964815#3964815
2018-04-11Replace hard-coded filename with a generated oneTeddy Wing
Generate a filename using the current date and time. Still saves to the home directory. That's the next step, we'll need to find a way to customise the save directory.
2018-04-11Wrap page title and URL in single quotes with escapeTeddy Wing
Ensure that special characters don't cause the YAML to be invalid by wrapping the URL and page title in quotes to force them to be strings. Escape any literal single quotes in the page title by doubling them. Didn't escape single quotes in the URL because I'm assuming any present will be URL encoded.
2018-04-11Save YAML to the fileTeddy Wing
* Change the temp file's extension to ".yml" * Remove blank line between pages * Output a YAML array of hashes containing the page titles and URLs in Copy URLs From All Tabs format
2018-04-11save-backup: Unwrap list around page titleTeddy Wing
Turns out `(last page 1)` didn't actually extract the page title string from the list previously created by `LAST`. To extract the title string from the list, just use `FIRST` and get rid of the now seemingly unnecessary third argument.
2018-04-11save-backup: Get rid of commented FORMAT callTeddy Wing
Ended up not using this. Wrote that when I started writing the function, but I ended up needed something a bit more complicated with maps and joins etc.
2018-04-11Fix file saving issuesTeddy Wing
* Use a real path for the temporary file because otherwise it either doesn't get saved, or I have no idea where it gets saved to. * Use the `INSERT` function to actually write the string to the temporary file buffer. * Use `(last page 1)` with the `1` argument at the end now as a way to try to get it to return us the string instead of a single-element list containing the page title. Not sure if this works though.
2018-04-11Write the session backup to a fileTeddy Wing
Use a temporary hard-coded file. Construct a string with each page turning into a URL and page title on separate lines, and a blank line between pages. Doesn't quite work just yet, but the general idea is there.
2018-04-11Get list of URL and page title pairsTeddy Wing
* Extract the list of crash recovery session buffers to a function to give it a name. I'll come up with a better name later. * Grab the first and last elements of each buffer sub-list and create tuples from them. This gives us a list of two-element lists containing the URL and title of the pages.
2018-04-11Get a list of w3m buffers from the saved session fileTeddy Wing
Grab the buffers saved to the "Crash recovery session" in "emacs-w3m"'s session file. Just list them for now. We'll be using this to create a backup file.