Showing preview only (292K chars total). Download the full file or copy to clipboard to get everything.
Repository: nobiot/org-remark
Branch: main
Commit: 4389853625f5
Files: 28
Total size: 280.8 KB
Directory structure:
gitextract_gk7ypw4z/
├── .dir-locals.el
├── .elpaignore
├── .github/
│ └── workflows/
│ └── gh-docs.yml
├── .gitignore
├── CHANGELOG
├── LICENSE
├── Makefile
├── NEWS
├── README-elpa
├── README.org
├── docs/
│ ├── .nojekyll
│ ├── Makefile
│ ├── articles/
│ │ ├── 2023-08-20T183400_how-to-buffer-window.org
│ │ └── 2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md
│ ├── fdl.texi
│ ├── marginalia.org
│ ├── org-remark.org
│ └── resources/
│ ├── manual.css
│ ├── reset.css
│ └── style.css
├── org-remark-convert-legacy.el
├── org-remark-eww.el
├── org-remark-global-tracking.el
├── org-remark-icon.el
├── org-remark-info.el
├── org-remark-line.el
├── org-remark-nov.el
└── org-remark.el
================================================
FILE CONTENTS
================================================
================================================
FILE: .dir-locals.el
================================================
((nil
(time-stamp-format . "%02d %:B %Y")
(time-stamp-start . "modified:[ ]+\\\\?")
(time-stamp-end . "$")
;; "Last modified in source code files are at line 20"
(time-stamp-line-limit . 20)
;; Need this locale to be "C" or "en_US.UTF-8" or something to standardize the
;; time stamp with English
(system-time-locale . "C"))
(fill-column . 80)
(indent-tabs-mode . nil))
================================================
FILE: .elpaignore
================================================
demo
test
test*
docs
resources
Makefile
.gitignore
.elpaignore
.github
.dir-locals.el
================================================
FILE: .github/workflows/gh-docs.yml
================================================
name: GH-Page AutoGen
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v2
- uses: purcell/setup-emacs@master
with:
version: '27.2'
- name: Install dependencies
run: sudo apt-get install texinfo
- name: Run docs/make gh-html
run: |
cd docs
make gh-html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
================================================
FILE: .gitignore
================================================
*/#marginalia.org#
*.bak
*.log
*.elc
test
test*
# ELPA-generated files.
/org-remark-autoloads.el
/org-remark-pkg.el
================================================
FILE: CHANGELOG
================================================
[More recent changes v1.0.0 are in NEWS file]
Version 0.2.0
- add: org-remark-delete
- rm: Adding Org-ID automatically to file level when file is empty
Version 0.1.0
* Features & additions
- docs: comprehensive user manual (online - Info to be added on ELPA release)
- feat: org-remark-create macro to let users create their own custom pens
- feat: minor-mode menu for menu-bar-mode
This works as mouse context-menu for the new context-menu-mode (>=
Emacs 28)
- add: browse-next/prev: move and display next/prev marginal notes at the same
time
- add: view/open to display side-window by default (user option)
- add: org-remark-link property in marginal notes file with ::line-number
search option
- feat: org-remark-legacy-convert as a separate feature
This is for automatically converting legacy Org-marginalia file to
Org-remark.
- feat: Legacy data facility with org-remark-tracking
* Changes
- chg: `remove' (and delete) only removes one highlight at a time instead of
remove all at point
- chg: Save marginal notes on `mark' instead of wainting for `save'
- chg: define org-remark-mark explicitly for autoload cookie
- chg: `org-remark-view' and `org-remark-open'. View will stay in the
current main note; open will move the cursor to the marginal notes
buffer for further editing.
- chg: When updating the existing headline and position properties, don't
update the headline text when it already exists. Let the user decide
how to manage headlines.
- doc: copyright assignment to FSF; copyright years
* Alpha
** 0.0.6
Feature:
- feat: Add =org-marginalia-global-tracking-mode= with a separate .el file
- feat: Use Org-ID to create a link from the marginal notes back to the main file
Add Customizable variable =org-marginalia-use-org-id=; default is =t=
Change:
- chg: Highlights are now overlay; no longer text-properties
Improvement to existing functions
- add: Deactivate mark after highlighting
- add: org-marginalia-remove can take C-u to delete
Fix & Internal Refactor
- intrnl: Add housekeeping for =org-marginalia-highlights= variable
- fix: org-id-uuid is not found
- fix: Add highlighter face def for terminal
** 0.0.5
- break: Replace the prefix "om/" in the source code with "org-marginalia"
- break: Remove default keybindings; add examples in readme instead. Addresses [#3](https://github.com/nobiot/org-marginalia/issues/3)
** 0.0.4
- feat: Add transient navigation to next/prev
See [[*Credits][§ Credits]] for the piece of code to achieve the transient map I used.
** 0.0.3
- feat: Add om/toggle for show/hide highlighters
** 0.0.2
- feat: Add om/next and /prev
- break: Change om/open-at-point to org-marginalia-open
- break: Change om/save-all to org-marginalia-save
** 0.0.1
Initial alpha release. I consider it to be the minimal viable scope.
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 3 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, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: Makefile
================================================
# For ELPA, below should be added to the spec:
# ("org-remark" :url "https://github.com/nobiot/org-remark"
# :make "README-elpa"
# :doc "docs/org-remark.org"
# :auto-sync t)
README-elpa: README.org
-emacs --batch $< -f org-ascii-export-to-ascii
-mv README.txt README-elpa
.PHONY: test-compile
test-compile:
emacs --batch --eval "(add-to-list 'load-path default-directory)" \
-f batch-byte-compile ./*.el
# Check declare-function
emacs --batch --eval "(check-declare-directory default-directory)"
.PHONY: clean
clean:
find . -name "*.elc" -delete
================================================
FILE: NEWS
================================================
Current development version
Fixes:
- fix: When the notes = source, the title is incorrect #97
Version 1.3.0 - 2025-01-28
Features:
- feat: Define `org-remark-report-no-highlights`
krisbalintona/chatty-no-highlights (#86) by Kristoffer Balintona
- Ability to highlight a whole line and show a mark on the margin (#71)
- Option to delete the whole notes entry when highlight is removed if
there is no notes body text (#21)
- `org-remark-open` to open the associated marginal notes file if
cursor outside a highlight (#72)
Fixes:
- fix: crash when highlighting non-org source and org-remark-use-org-id is
true (#95)
- fix: org-remark-info-mode interfering with isearch-forward (#93)
- fix: fix: args-out-of-range error during loading highlights (#89)
- fix: `org-remark-link` gets wrongly referenced (#83)
- fix: josephmturner/fixes (#87): typo in package description
- fix: compiler warning ‘org-remark-highlight-save’ is an obsolete...
- fix: Highlights overlay can get added to unsupported buffer (ef98c27)
- fix(highlights-delay-load): rm window-state-change-functions (#82)
Version 1.2.2 - 2024-03-25
- fix: program error #78 mapconcat's 3rd arg is not optional in Emacs 28
Version 1.2.1 - 2023-08-20
- fix: org-remark-icon-mode is a void symbol
Version 1.2.0 - 2023-08-20
- feat(info): Org-remark supports Info
+ Advice has been implemented. It is added and removed by
`org-remark-info-mode`.
+ No suitable hook is avaialble to trigger a function after the Info node
is rendered. This is necessary as Info renders a new node in the same
buffer (in the same way as Nov.el does).
- feat: icons for additional information for highlights
+ Notes exists for the highlight (*)
+ The highlight position auto-adjusted (d)
+ Uses the new `org-remark-highlights-after-load-functions'
+ Icons are customizable. You can also disable icons by setting
the respective customizing variable to nil
+ The default face of auto-adjusted icon is customizable with
face `org-remark-highlighter-warning'
+ `org-remark-toggle' also toggles the icon display
- feat: nov.el support for epub books
+ The link is added to the notes org file correctly pointing
back to epub's highlight location with using :nov link type
added by nov.el.l
- feat: Adjust positions after load
+ This is useful especially for epubs via nov.el. Nov.el
renders tables on differently depending on the size of the
window. This causes the positions of subsequent text elements
to move depending on the window size when the page is
rendered, dislocating the positions of highlights. This
feature attemps to auto-correct the location on the fly. The
feature works generically, so Org-remark attemps to correct
minior edits to websites (for EWW).
+ The fact that a given highlight has been automatically moved
is indicated by an icon
- feat: org-remark-highlights-after-load-functions
Abnormal hook
Fixes:
- fix: org 9.6.7 breaks org-remark-highlights-get (#70)
- fix: Make load process robust
+ When error occurs during the load process, instead of
emitting an error, Org-remark now halts the load process and
returns without an error. This has been proven useful
especially for epub support with nov.el. Nov.el renders by
reusing the same buffer instead of generating a new one. When
error occurs during the load process (e.g. user accidentally
deletes some property data in the notes org buffer), the
error would cause nov.el to not properly render the epub
book. This could override the epub archive file wiht a plain
text file of a single file from the book, errasing the entire
book. With this change, Org-remark does not cause the error
when loading highlights from the notes org file to preven
this distructive process from happening.
+ `org-remark-highlights-get' existence checks beg and end
beg and end must exist. If either is nil, `number-to-string`
errors and load stops prematurely. This can happen when the
user manually manages the notes file and accidentally deletes
the beg/end props.
- fix: default highlighter color for dark theme
No functional change. Changed the default color of the
highlighter to be more visible in the dark theme.
Version 1.1.0 - 2023-05-20
Features:
- feat: notes-and-source sync
Previously, Org-remark was designed to create/update/delete
highlights from the source buffer to its marginal notes
buffer; this was always one-way from the source to the notes.
Now we have implemented the updating process in the other
direction from the notes to source.
Functionally, we currently have echo-text/tooltip containing
an excerpt from the body of notes from the notes buffer
(thanks to @mooseyboots).
Other than this additional feature, there should be no visible
change for end users. The update should all happen
transparently behind the scenes with no to little change for
end users of Org-remark.
- feat: echo-text update from the marginal notes to the source buffer
This is a code contribution by marty hiatt (@mooseyboots). He
has done FSF copyright assignment in July, 2022.
Now the source buffer can Display annotation text as help-echo
or tooltip. Thank you, @mooseyboots.
This has opened up an avenue to implement "notes sync" feature
which updates select elements of marginal notes buffer back
into the source buffer for highlight overlays.
- feat: Extend support for non-file-visiting buffer
We now have an approach to extend Org-remark to support
non-file-visiting buffers of various modes. Currently it is
assumed that the support is to be implemented per mode
basis. We have support for EWW with 'org-remark-eww-mode' and
its dedicated file and feature 'org-remark-eww'. Refer to its
implementation as a reference as to how this approach is
currently practiced.
- feat: Global minor mode org-remark-eww-mode
Support taking annotations in eww buffers for websites A new
feature contributed by Vedang Manerikar (@vedang). He has
completed FSF paperwork in May, 2022 and received a PDF
regarding the same from the FSF.
This has opened up a big new avenue to support highlights in
non-file visiting buffers. Thank you @vedang.
EWW support is modularized in a separate file
'org-remark-eww.el'.
org-remark-link: prop for EWW
Now 'org-remark-link' property in the marginal notes buffer
contains the URL that you can follow for the source website.
- add: org-remark-open-hook #40
Hook run when a note buffer is opened/visited. The current
buffer is the note buffer.
Fixes:
- refactor: change the default colors of yellow pen #52
This is to cater to users who have dark theme that may render
the highlighted text illegible due to the default background
color of yellow.
- fix: Text cut off in notes if the highlight spans across two lines #56
Thanks to GitHub user @sati-bodhi for reporting and suggesting a fix
(code implemented by nobiot). Thank you @sati-bodhi.
- fix: issue #44 change CATEGORY
Now CATEGORY property from the highlight can be properly
deleted if a new pen does not have CATEGORY.
- fix: case for highlight-get-text empty notes at the bottom of buffer
- fix: text-property org-remark-label to be symbol
Fixes the error when you do 'describe-text-properties' on the
highlight overlay
- fix: move org-remark-source-find-file-name to tracking
After EWW support, 'org-remark-source-get-file-name' is now
moved to 'org-remark-global-tracking.el' file
- fix: source-file-name incorrect issue #39
PR #38 by Nan Jun Jie (@nanjj). Thank you @nanjj.
Version 1.0.5
- fix #28 toggle causes error on saving highlights
- fix #39 source-file-name incorrect issue
Version 1.0.4
- fix: "Wrong type argument: stringp, nil" on highlightintg in scratch
Version 1.0.3
- fix #23: "Wrong type argument: stringp, nil" on org export
- fix #22: highlights not found when marginalia does not show all
Version 1.0.2
- Update README, user manual, and doc strings in source
Version 1.0.1
- Update user manual
Version 1.0.0
- chg: align with GNU convention: path -> file name
Regarding user option `org-remark-notes-file-path`, the GNU convention
is to call this a "file name" rather than a "path"; "path" is only used
for lists of directories as in `load-path` (pointed out by Stefan
Monnier; thank you).
To align with the GNU convention, the following changes are done.
Users should not have to change their existing customization as the old
names are aliased to the new ones.
User option:
- org-remark-notes-file-path -> org-remark-notes-file-name
- org-remark-source-path-function -> 'org-remark-source-file-name
Function:
- org-remark-notes-file-path-function -> org-remark-notes-file-name-function
Private Function:
- org-remark-notes-get-file-path -> org-remark-notes-get-file-name
`org-remark-notes-file-path`, `org-remark-source-path-function`, and
`org-remark-notes-file-path-function` are used by existing
customization, thus both explicitly made obsolete and aliased to the
new file-name equivalents.
- fix: Relative file name of the source file in the notes file
The relative file name of the source was not relative from the marginal notes
file but from the source file itself -- this should be relative from the
marginal notes.
- chg: `org-remark-global-tracking-mode' has been simplified.
This is not expected to break the user's workflow or configuration
-- simply removing a superfluous feature.
.org-remark-tracking file is no longer necessary and can be safely
deleted from the user's Emacs configuraiton directory if present.
Automatic activation of `org-remark-mode' is done by looking the
presence of a marginal notes file for current buffer open.
`org-remark-global-tracking-mode' itself is still relevant and
recommended to be setup as was previously in the user manual.
- add: Option to use relative links from the marginal notes back to the source
Adding user option org-remark-source-path-function. The default is
file-relative-name.
- add: Adding a new option to org-remark-notes-file-path to use a function
Its default function is org-remark-notes-file-path-function. It
returns a file name like this: "FILE-notes.org" by adding
"-notes.org" as a suffix to the file name without the extension.
[Older changes before v1.0.0 are in CHANGELOG file]
================================================
FILE: README-elpa
================================================
_____________________
README – ORG-REMARK
_____________________
Table of Contents
_________________
1. Introduction
2. Features
3. Installation
4. Contributing and Feedback
5. Contributors
6. License
1 Introduction
==============
Org-remark lets you highlight and annotate text files, websites, EPUB
books and Info documentation with using Org mode.
A user manual is available [online] or Emacs in-system as an Info node
`(org-remark)': (`C-h i' and find the `Org-remark' node) .
The user manual is also available in Japanese: [マニュアル日本語版] 🇯🇵
(translated by ayatajesi, GitHub user @ayatakesi) together with his
review with EWW, "[org-remarkでウェブページに注釈をつける]".
For installation and minimum configuration, refer to [Installation]
below or the user manual: [online] or Info node `(org-remark)
Installation'.
Getting Started in the user manual will get you started in 5 minutes:
[online] or or Info node `(org-remark) Getting Started'.
For customization, refer to the customization group `org-remark' or
user manual: [online] or Info node `(org-remark) Customizing'. A
[separate online article] has been written to guide you on how to
customize an icon (also part of the user manual. Evaluate (info
"(or-gremark) How to Set Org-remark to Use SVG Icons").
An [introductory video] (8 minutes) and [V1.1.0 release introduction]
(12 minutes) are available on YouTube.
[online] <https://nobiot.github.io/org-remark/>
[マニュアル日本語版]
<https://qiita.com/ayatakesi/items/69d43671b28bb27a9c52>
[org-remarkでウェブページに注釈をつける]
<https://qiita.com/ayatakesi/items/8986af2bf2ccca170439>
[Installation] See section 3
[online] <https://nobiot.github.io/org-remark/#Installation>
[online] <https://nobiot.github.io/org-remark/#Getting-Started>
[online] <https://nobiot.github.io/org-remark/#Customizing>
[separate online article]
<https://github.com/nobiot/org-remark/tree/main/docs/articles/2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md>
[introductory video] <https://youtu.be/c8DHrAsFiLc>
[V1.1.0 release introduction] <https://youtu.be/BTFuS21N00k>
2 Features
==========
- Highlight and annotate any text file. The highlights and notes are
kept in an Org file as the plain text database. This lets you easily
manage your marginal notes and use the built-in Org facilities on
them -- e.g. create a sparse tree based on the category of the notes
- Create your your own highlighter pens with different colors, type
(e.g. underline, squiggle, etc. optionally with Org's category for
search and filter on your highlights and notes)
- Have the same highlighting and annotating functionality for
+ Websites when you use EWW to browse them
+ EPUB books with [nov.el]
+ Info documentation
+ [wallabag.el] (it has been [reported])
Refer to [NEWS] file for a list of new features and fixes.
[nov.el] <https://depp.brause.cc/nov.el/>
[wallabag.el] <https://github.com/chenyanming/wallabag.el>
[reported]
<https://github.com/nobiot/org-remark/issues/92#issuecomment-2601307855>
[NEWS] <https://github.com/nobiot/org-remark/blob/main/NEWS>
3 Installation
==============
This package is available on:
- [GNU-ELPA] (releases only; equivalent to MELPA-Stable)
- [GNU-devel ELPA] (unreleased main branch; equivalent to MELPA)
GNU ELPA should be already set up in your Emacs by default. If you
wish to add GNU-devel ELPA, simply add its URL to `package-archives'
like this:
,----
| (add-to-list 'package-archives
| '("gnu-devel" . "https://elpa.gnu.org/devel/") :append)
`----
After installation, we suggest you put the setup below in your
configuration.
,----
| (org-remark-global-tracking-mode +1)
|
| ;; Optional if you would like to highlight websites via eww-mode
| (with-eval-after-load 'eww
| (org-remark-eww-mode +1))
|
| ;; Optional if you would like to highlight EPUB books via nov.el
| (with-eval-after-load 'nov
| (org-remark-nov-mode +1))
|
| ;; Optional if you would like to highlight Info documentation via Info-mode
| (with-eval-after-load 'info
| (org-remark-info-mode +1))
`----
Unless you explicitly load `org' during Emacs initialization, I
suggest to defer loading `org-remark' (thus there is no `(require
'org-remark)' in the example above). This is because it will also pull
in `org', which can slow down initialization. You can control the
timing of loading `org-remark' by autoloading some commands in a
similar way with the example keybindings below.
Below are example keybindings you might like to consider:
,----
| ;; Key-bind `org-remark-mark' to global-map so that you can call it
| ;; globally before the library is loaded.
|
| (define-key global-map (kbd "C-c n m") #'org-remark-mark)
|
| ;; The rest of keybidings are done only on loading `org-remark'
| (with-eval-after-load 'org-remark
| (define-key org-remark-mode-map (kbd "C-c n o") #'org-remark-open)
| (define-key org-remark-mode-map (kbd "C-c n ]") #'org-remark-view-next)
| (define-key org-remark-mode-map (kbd "C-c n [") #'org-remark-view-prev)
| (define-key org-remark-mode-map (kbd "C-c n r") #'org-remark-remove)
| (define-key org-remark-mode-map (kbd "C-c n d") #'org-remark-delete))
`----
Alternatively, you can use `use-package' to set up Org-remark. The
example provided below should be equivalent to the setup described
above.
,----
| (use-package org-remark-global-tracking
| ;; It is recommended that `org-remark-global-tracking-mode' be
| ;; enabled when Emacs initializes. You can set it in
| ;; `after-init-hook'.
| :hook after-init
| :config
| ;; Selectively keep or comment out the following if you want to use
| ;; extensions for Info-mode, EWW, and NOV.el (EPUB) respectively.
| (use-package org-remark-info :after info :config (org-remark-info-mode +1))
| (use-package org-remark-eww :after eww :config (org-remark-eww-mode +1))
| (use-package org-remark-nov :after nov :config (org-remark-nov-mode +1)))
|
| (use-package org-remark
| :bind (;; :bind keyword also implicitly defers org-remark itself.
| ;; Keybindings before :map is set for global-map. Adjust the keybinds
| ;; as you see fit.
| ("C-c n m" . org-remark-mark)
| ("C-c n l" . org-remark-mark-line)
| :map org-remark-mode-map
| ("C-c n o" . org-remark-open)
| ("C-c n ]" . org-remark-view-next)
| ("C-c n [" . org-remark-view-prev)
| ("C-c n r" . org-remark-remove)
| ("C-c n d" . org-remark-delete)))
`----
[GNU-ELPA] <https://elpa.gnu.org/packages/org-remark.html>
[GNU-devel ELPA] <https://elpa.gnu.org/devel/org-remark.html>
4 Contributing and Feedback
===========================
Create issues, discussion, and/or pull requests in the GitHub
repository. All welcome.
Org-remark is available on GNU ELPA and thus copyrighted by the [Free
Software Foundation] (FSF). This means that anyone who is making a
substantive code contribution will need to "assign the copyright for
your contributions to the FSF so that they can be included in GNU
Emacs" ([Org Mode website]).
Thank you.
[Free Software Foundation] <http://fsf.org>
[Org Mode website] <https://orgmode.org/contribute.html#copyright>
5 Contributors
==============
*New features*
- User option `org-remark-report-no-highlights`by Kristoffer Balintona
(@krisbalintona)
- EPUB books (nov.el) support would not have been possible without
collaboration with @sati-bodhi
- `echo-text' update from the marginal notes to the source buffer by
marty hiatt (@mooseyboots)
- Support for websites with `eww-mode' by Vedang Manerikar (@vedang)
*Bug fixes*
Joseph Turner (@josephmturner) @alan-w-255, Nan Jun Jie (@nanjj),
@sgati-bodhi
*Documentation (including README, NEWS, CHANGELOG)*
@randomwangran, marty hiatt (@mooseyboots), @jsntn
Thank-you to all the comments, issues, and questions on GitHub!
6 License
=========
This work is licensed under a GPLv3 license. For a full copy of the
license, refer to [LICENSE].
[LICENSE] <./LICENSE>
================================================
FILE: README.org
================================================
#+title: README – Org-remark
#+options: toc:t creator:nil author:nil broken-links:t
#+html: <a href="https://www.gnu.org/software/emacs/"><img alt="GNU Emacs" src="https://img.shields.io/static/v1?logo=gnuemacs&logoColor=fafafa&label=Made%20for&message=GNU%20Emacs&color=7F5AB6&style=flat"/></a>
#+html: <a href="https://github.com/nobiot/org-remark/blob/main/LICENSE"><img alt="GPLv3" src="https://img.shields.io/badge/License-GPLv3-blue.svg"></a>
#+html: <a href="http://elpa.gnu.org/packages/org-remark.html"><img alt="GNU ELPA" src="https://elpa.gnu.org/packages/org-remark.svg"/></a>
#+html: <a href="http://elpa.gnu.org/devel/org-remark.html"><img alt="GNU-devel ELPA" src="https://elpa.gnu.org/devel/org-remark.svg"/></a>
* Introduction
Org-remark lets you highlight and annotate text files, websites, EPUB books and Info documentation with using Org mode.
A user manual is available [[https://nobiot.github.io/org-remark/][online]] or Emacs in-system as an Info node `(org-remark)': (~C-h i~ and find the =Org-remark= node) .
The user manual is also available in Japanese: [[https://qiita.com/ayatakesi/items/69d43671b28bb27a9c52][マニュアル日本語版]] 🇯🇵
(translated by ayatajesi, GitHub user @ayatakesi) together with his review with EWW, "[[https://qiita.com/ayatakesi/items/8986af2bf2ccca170439][org-remarkでウェブページに注釈をつける]]".
For installation and minimum configuration, refer to [[#installation][Installation]] below or the user manual: [[https://nobiot.github.io/org-remark/#Installation][online]] or Info node `(org-remark) Installation'.
Getting Started in the user manual will get you started in 5 minutes: [[https://nobiot.github.io/org-remark/#Getting-Started][online]] or or Info node `(org-remark) Getting Started'.
For customization, refer to the customization group `org-remark' or user manual: [[https://nobiot.github.io/org-remark/#Customizing][online]] or Info node `(org-remark) Customizing'. A [[https://github.com/nobiot/org-remark/tree/main/docs/articles/2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md][separate online article]] has been written to guide you on how to customize an icon (also part of the user manual. Evaluate (info "(or-gremark) How to Set Org-remark to Use SVG Icons").
An [[https://youtu.be/c8DHrAsFiLc][introductory video]] (8 minutes) and [[https://youtu.be/BTFuS21N00k][V1.1.0 release introduction]] (12 minutes) are available on YouTube.
* Features
- Highlight and annotate any text file. The highlights and notes are kept in an Org file as the plain text database. This lets you easily manage your marginal notes and use the built-in Org facilities on them -- e.g. create a sparse tree based on the category of the notes
- Create your your own highlighter pens with different colors, type (e.g. underline, squiggle, etc. optionally with Org's category for search and filter on your highlights and notes)
- Have the same highlighting and annotating functionality for
+ Websites when you use EWW to browse them
+ EPUB books with [[https://depp.brause.cc/nov.el/][nov.el]]
+ Info documentation
+ [[https://github.com/chenyanming/wallabag.el][wallabag.el]] (it has been [[https://github.com/nobiot/org-remark/issues/92#issuecomment-2601307855][reported]])
Refer to [[https://github.com/nobiot/org-remark/blob/main/NEWS][NEWS]] file for a list of new features and fixes.
* Screenshots and Videos :noexport:
[[./resources/images/2022-01-22-Title.png]]
*Figure 1*. Left: Org-mode with text enlarged; Right: marginal notes with an inline image. [[https://youtu.be/c8DHrAsFiLc][Introductory video]] (8 minutes) and [[https://youtu.be/BTFuS21N00k][v1.1.0 release introduction]] (12 minutes) are available on YouTube
[[./resources/images/2022-01-22-Context-menu.png]]
*Figure 2*. Mouse context menu with built-in ~context-menu-mode~ available with Emacs version 28 onward
[[./resources/images/2023-08-20-epub-prince-icon.png]]
*Figure 3*. EPUB book ("Prince" by Niccolò Machiavelli via https://www.gutenberg.org/) with icon indicating there are annotations to the highlight: new features with v1.2.0 (2023-08-20). Left: marginal notes file with annotations; Right: an EPUB book file with a highlight and simple ASCII icon.
[[./resources/images/v1.3.0/2023-08-19-line-highlights-with-icons.png]]
*Figure 4*. Line-highlights with using icons (as of v1.3.0). Refer to the user manual or [[https://nobiot.com/blog/2023-09-11_org-remark-v1.3-line-highlight/][this article]] for more detail.
* Installation
:PROPERTIES:
:CUSTOM_ID: installation
:END:
This package is available on:
- [[https://elpa.gnu.org/packages/org-remark.html][GNU-ELPA]] (releases only; equivalent to MELPA-Stable)
- [[https://elpa.gnu.org/devel/org-remark.html][GNU-devel ELPA]] (unreleased main branch; equivalent to MELPA)
GNU ELPA should be already set up in your Emacs by default. If you wish to add GNU-devel ELPA, simply add its URL to ~package-archives~ like this:
#+BEGIN_SRC elisp
(add-to-list 'package-archives
'("gnu-devel" . "https://elpa.gnu.org/devel/") :append)
#+END_SRC
After installation, we suggest you put the setup below in your configuration.
#+begin_src emacs-lisp
(org-remark-global-tracking-mode +1)
;; Optional if you would like to highlight websites via eww-mode
(with-eval-after-load 'eww
(org-remark-eww-mode +1))
;; Optional if you would like to highlight EPUB books via nov.el
(with-eval-after-load 'nov
(org-remark-nov-mode +1))
;; Optional if you would like to highlight Info documentation via Info-mode
(with-eval-after-load 'info
(org-remark-info-mode +1))
#+end_src
Unless you explicitly load ~org~ during Emacs initialization, I suggest to defer loading ~org-remark~ (thus there is no ~(require 'org-remark)~ in the example above). This is because it will also pull in ~org~, which can slow down initialization. You can control the timing of loading ~org-remark~ by autoloading some commands in a similar way with the example keybindings below.
Below are example keybindings you might like to consider:
#+begin_src emacs-lisp
;; Key-bind `org-remark-mark' to global-map so that you can call it
;; globally before the library is loaded.
(define-key global-map (kbd "C-c n m") #'org-remark-mark)
;; The rest of keybidings are done only on loading `org-remark'
(with-eval-after-load 'org-remark
(define-key org-remark-mode-map (kbd "C-c n o") #'org-remark-open)
(define-key org-remark-mode-map (kbd "C-c n ]") #'org-remark-view-next)
(define-key org-remark-mode-map (kbd "C-c n [") #'org-remark-view-prev)
(define-key org-remark-mode-map (kbd "C-c n r") #'org-remark-remove)
(define-key org-remark-mode-map (kbd "C-c n d") #'org-remark-delete))
#+end_src
Alternatively, you can use ~use-package~ to set up Org-remark. The example provided below should be equivalent to the setup described above.
#+begin_src emacs-lisp
(use-package org-remark-global-tracking
;; It is recommended that `org-remark-global-tracking-mode' be
;; enabled when Emacs initializes. You can set it in
;; `after-init-hook'.
:hook after-init
:config
;; Selectively keep or comment out the following if you want to use
;; extensions for Info-mode, EWW, and NOV.el (EPUB) respectively.
(use-package org-remark-info :after info :config (org-remark-info-mode +1))
(use-package org-remark-eww :after eww :config (org-remark-eww-mode +1))
(use-package org-remark-nov :after nov :config (org-remark-nov-mode +1)))
(use-package org-remark
:bind (;; :bind keyword also implicitly defers org-remark itself.
;; Keybindings before :map is set for global-map. Adjust the keybinds
;; as you see fit.
("C-c n m" . org-remark-mark)
("C-c n l" . org-remark-mark-line)
:map org-remark-mode-map
("C-c n o" . org-remark-open)
("C-c n ]" . org-remark-view-next)
("C-c n [" . org-remark-view-prev)
("C-c n r" . org-remark-remove)
("C-c n d" . org-remark-delete)))
#+end_src
* Contributing and Feedback
Create issues, discussion, and/or pull requests in the GitHub repository. All welcome.
Org-remark is available on GNU ELPA and thus copyrighted by the [[http://fsf.org][Free Software Foundation]] (FSF). This means that anyone who is making a substantive code contribution will need to "assign the copyright for your contributions to the FSF so that they can be included in GNU Emacs" ([[https://orgmode.org/contribute.html#copyright][Org Mode website]]).
Thank you.
* Contributors
*New features*
- User option `org-remark-report-no-highlights`by Kristoffer Balintona (@krisbalintona)
- EPUB books (nov.el) support would not have been possible without
collaboration with @sati-bodhi
- ~echo-text~ update from the marginal notes to the source buffer by marty hiatt (@mooseyboots)
- Support for websites with ~eww-mode~ by Vedang Manerikar (@vedang)
*Bug fixes*
Joseph Turner (@josephmturner) @alan-w-255, Nan Jun Jie (@nanjj), @sgati-bodhi
*Documentation (including README, NEWS, CHANGELOG)*
@randomwangran, marty hiatt (@mooseyboots), @jsntn
Thank-you to all the comments, issues, and questions on GitHub!
* License
This work is licensed under a GPLv3 license. For a full copy of the license, refer to [[./LICENSE][LICENSE]].
================================================
FILE: docs/.nojekyll
================================================
================================================
FILE: docs/Makefile
================================================
.POSIX:
EMACS = emacs
MAKEINFO = makeinfo
INSTALLINFO = install-info
MV = mv
RM = rm
MANUAL_HTML_ARGS =--html --no-split --footnote-style=separate --css-ref=resources/manual.css
## Build #############################################################
.PHONY: gh-html
gh-html: index.html clean
.PHONY: all
all: index.html org-remark.info clean
index.html: org-remark.texi
@printf "\n\n### Generating manual .html files \n\n"
$(MAKEINFO) $(MANUAL_HTML_ARGS) $< -o index.html
org-remark.texi: org-remark.org
@printf "\n\n### Generating manual .texi file \n\n"
$(EMACS) --batch -L --file $< \
-f org-texinfo-export-to-texinfo
org-remark.info: org-remark.texi
@printf "\n\n### Generating manual .info file \n\n"
makeinfo org-remark.texi -o org-remark.info
.PHONY: clean
clean:
@printf "\n\n### Clear .texi file \n\n"
$(RM) org-remark.texi*
================================================
FILE: docs/articles/2023-08-20T183400_how-to-buffer-window.org
================================================
Buffer window customization #43
https://github.com/nobiot/org-remark/discussions/43
================================================
FILE: docs/articles/2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md
================================================
---
title: How to Set Org-remark to Use SVG Icons
created: 2023-08-20
modified: 16 September 2023
category: #creation
id: 2023-08-20T184309
---
# How to Set Org-remark to Use SVG Icons

I have released version 1.2.0 of Org-remark. In this version, highlights can display an icon to visually indicate that annotations exist for them. This was implemented in response to a feature request I received via YouTube comments and recorded in [issue #64](https://github.com/nobiot/org-remark/issues/64).
The icon by default is a string of ASCII characters "`(*)`" so that it can be used for terminals. You can easily customize Org-remark to use an SVG image as shown in the image above.
There are mainly two ways:
1. Use the new built-in `icons` library available as of Emacs version 29.1
2. Create a custom function and use a third-party library such as [`svg-lib`](https://github.com/rougier/svg-lib) by Nicolas Rougier
I will quickly show you the first option to use the new built-in library, which I believe is the easier.
## Define an icon
1. Get or create an SVG icon
In my example, I downloaded a "pen" icon as an `.svg` file from [Boxicons](https://boxicons.com/?query=pen) ([licensed under The MIT License](https://boxicons.com/usage#license)).
2. Put the downloaded SVG file somewhere in your local
I put it at `~/.config/emacs/.cache/svg/bx-pen.svg`.
3. Use `define-icon` macro to create an icon with the SVG file
For example, I used the code below. Make sure to change my example to your own file name. You can also play with the `:height` property as you see fit. You can refer to the relevant Info nodes for more configuration detail by evaluating `(info "(elisp)icons)` and `(info "(emacs)icons")` in Emacs (version 29.1 onward).
``` emacs-lisp
(define-icon annotation nil
'((image "/home/nobiot/.config/emacs/.cache/svg/bx-pen.svg"
:height (0.8 . em)))
"Notes svg icon for Org-remark"
:version 29.1)
```
## Customize Org-remark to use the icon
Now the icon has been defined, you can set it to customizing variable `org-remark-icon-notes`, like so:
``` emacs-lisp
;; I use `setopt` that is made available as of 29.1. `setq` works too.
;; Use whichever you prefer.
(setopt org-remark-icon-notes (icon-string 'annotation))
```
If you have a buffer with highlights already open, you would need to `revert-buffer` to reload the highlights. You should see the icon you have defined instead of the default "`(*)`" string, like you see in the screen capture at the top of this article.
================================================
FILE: docs/fdl.texi
================================================
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{https://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, La@TeX{} input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification. Examples
of transparent image formats include PNG, XCF and
JPG@. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The ``publisher'' means any person or entity that distributes copies
of the Document to the public.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{https://www.gnu.org/licenses/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation. If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
@item
RELICENSING
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server. A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@end enumerate
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
================================================
FILE: docs/marginalia.org
================================================
:PROPERTIES:
:ID: 2022-01-15T093859
:END:
* Org-remark User Manual
:PROPERTIES:
:org-remark-file: ~/src/org-remark/docs/org-remark.org
:END:
** TODO vindex
:PROPERTIES:
:CATEGORY: important
:END:
- (defcustom org-remark-create-default-pen-set t
- [ ] #+vindex: org-remark-notes-file-path
- [ ] #+vindex: org-remark-notes-display-buffer-action
- (defcustom org-remark-notes-buffer-name "*marginal notes*" - (defcustom org-remark-use-org-id nil
================================================
FILE: docs/org-remark.org
================================================
#+title: Org-remark User Manual
#+author: Noboru Ota <me@nobiot.com>
#+macro: version 1.3.x
#+macro: modified 01 February 2024
#+language: en
#+export_file_name: org-remark.texi
#+texinfo_dir_category: Emacs
#+texinfo_dir_title: Org-remark: (org-remark)
#+texinfo_dir_desc: Highlight and annotate any text file
#+texinfo: @paragraphindent asis
#+options: toc:nil ':t
This manual is for Org-remark version {{{version}}}. The new features introduced with version {{{version}}} are currently only available [[https://elpa.gnu.org/devel/org-remark.html][GNU-devel ELPA]] until the new version is released to [[https://elpa.gnu.org/packages/org-remark.html][GNU-ELPA]].
Last updated: {{{modified}}}.
Org-remark lets you highlight and annotate text files, websites (EWW), EPUB books (nov.el) and Info documentation (Info-mode).
#+texinfo: @insertcopying
* COPYING
:PROPERTIES:
:COPYING: t
:END:
Copyright \copy 2021-2023 Free Software Foundation, Inc.
#+begin_quote
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and
with the Back-Cover Texts as in (a) below. A copy of the license is
included in the section entitled “GNU Free Documentation License.”
(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
modify this GNU manual.”
#+end_quote
* Installation
:PROPERTIES:
:CUSTOM_ID: installation
:END:
This package is available on:
- [[https://elpa.gnu.org/packages/org-remark.html][GNU-ELPA]] (releases only; equivalent to MELPA-Stable)
- [[https://elpa.gnu.org/devel/org-remark.html][GNU-devel ELPA]] (unreleased main branch; equivalent to MELPA)
GNU ELPA should be already set up in your Emacs by default. If you wish to add GNU-devel ELPA, simply add its URL to ~package-archives~ like this:
#+BEGIN_SRC elisp
(add-to-list 'package-archives
'("gnu-devel" . "https://elpa.gnu.org/devel/") :append)
#+END_SRC
** Basic Setup
After installation, we suggest you put the setup below in your configuration.
#+name: basic-setup
#+begin_src emacs-lisp
(org-remark-global-tracking-mode +1)
;; Optional if you would like to highlight websites via eww-mode
(with-eval-after-load 'eww
(org-remark-eww-mode +1))
;; Optional if you would like to highlight EPUB books via nov.el
(with-eval-after-load 'nov
(org-remark-nov-mode +1))
;; Optional if you would like to highlight Info documentation via Info-mode
(with-eval-after-load 'info
(org-remark-info-mode +1))
#+end_src
~org-remark-global-tracking-mode~ automatically turns on ~org-remark-mode~ when you open a file, website via EWW, EPUB book via nov.el, or other supported buffer that has a marginal notes file associated with it. This is useful to keep the location of your highlights correct across Emacs sessions after you shutdown Emacs.
Unless you explicitly load ~org~ during Emacs initialization, we suggest to defer loading ~org-remark~ (thus there is no ~(require 'org-remark)~ in the example above). This is because it will also pull in ~org~, which can slow down initialization. You can control the timing of loading ~org-remark~ by autoloading some commands in a similar way with the example keybindings below.
Below are example keybindings you might like to consider:
#+begin_src emacs-lisp
;; Key-bind `org-remark-mark' to global-map so that you can call it
;; globally before the library is loaded.
(define-key global-map (kbd "C-c n m") #'org-remark-mark)
(define-key global-map (kbd "C-c n l") #'org-remark-mark-line) ; new in v1.3
;; The rest of keybidings are done only on loading `org-remark'
(with-eval-after-load 'org-remark
(define-key org-remark-mode-map (kbd "C-c n o") #'org-remark-open)
(define-key org-remark-mode-map (kbd "C-c n ]") #'org-remark-view-next)
(define-key org-remark-mode-map (kbd "C-c n [") #'org-remark-view-prev)
(define-key org-remark-mode-map (kbd "C-c n r") #'org-remark-remove)
(define-key org-remark-mode-map (kbd "C-c n d") #'org-remark-delete))
#+end_src
** Setup with ~use-package~
Alternatively, you can use ~use-package~ to set up Org-remark. The example provided below should be equivalent to the setup described above.
#+name: setup-with-use-package
#+begin_src emacs-lisp
(use-package org-remark-global-tracking
;; It is recommended that `org-remark-global-tracking-mode' be
;; enabled when Emacs initializes. You can set it in
;; `after-init-hook'.
:hook after-init
:config
;; Selectively keep or comment out the following if you want to use
;; extensions for Info-mode, EWW, and NOV.el (EPUB) respectively.
(use-package org-remark-info :after info :config (org-remark-info-mode +1))
(use-package org-remark-eww :after eww :config (org-remark-eww-mode +1))
(use-package org-remark-nov :after nov :config (org-remark-nov-mode +1)))
(use-package org-remark
:bind (;; :bind keyword also implicitly defers org-remark itself.
;; Keybindings before :map is set for global-map. Adjust the keybinds
;; as you see fit.
("C-c n m" . org-remark-mark)
("C-c n l" . org-remark-mark-line)
:map org-remark-mode-map
("C-c n o" . org-remark-open)
("C-c n ]" . org-remark-view-next)
("C-c n [" . org-remark-view-prev)
("C-c n r" . org-remark-remove)
("C-c n d" . org-remark-delete)))
#+end_src
* Getting Started
:PROPERTIES:
:CUSTOM_ID: getting-started
:END:
** Highlighting and Annotating
#+findex: org-remark-mark
#+findex: org-remark-mark-line
#+findex: org-remark-open
#+findex: org-remark-view
#+cindex: Marginal notes file
#+cindex: line-highlight
#+cindex: range-highlight
#+vindex: org-remark-line-margin-side
#+vindex: org-remark-notes-display-buffer-action
Once you have installed and set it up ([[#installation][Installation]]), Org-remark is simple to use. Select a part of text and call ~M-x org-remark-mark~ to highlight it. You will see the selected text gets highlighted. This is a range-highlight. With the new version 1.3, you can also highlight a whole line in addition to a range of text by calling ~org-remark-mark-line~. Visually, instead of adding a highlight to the line, it will add a mark on the margin of the buffer (the left margin is the default and you can customize it with ~org-remark-line-margin-side~). This is a line-highlight. Both the range- and line-highlights behave the same way except for how they appear in the buffer you are editing or viewing. You can mix them in the same buffer as you see fit for your purposes.
The menu bar item "Org-remark" is available when you turn on ~org-remark-mode~. It helps you discover Org-remark's main commands. If you use Emacs version 28 or newer, a context menu is also available by right-clicking your mouse. Turn on the Emacs built-in ~context-menu-mode~ to enable the context menu.
To display the marginal notes for the highlight you have just marked, place your cursor on the highlight and call ~M-x org-remark-open~ or ~M-x org-remark-view~. This will create a new buffer to the left of the current buffer you are editing. You can customize where the marginal notes buffer is to be placed (see the documentation of customizing variable ~org-remark-notes-display-buffer-action~).
The ~open~ command takes the cursor to the marginal notes buffer for you to edit notes; the ~view~ command keeps the cursor in the current buffer only to display the marginal notes. Both commands narrow the *marginal notes file* to the entry for the highlight under the cursor. The marginal notes file is a normal Org file. Edit your notes just as you would do with any other Org files and save the buffer.
** Navigating from One Highlight to Another
#+findex: org-remark-view-next
#+findex: org-remark-view-prev
#+cindex: Menu in the menu bar
#+cindex: Context menu
After you have added a couple of highlights in the text, you can move through the highlights easily. Use ~org-remark-view-next~ and ~org-remark-view-prev~ to browse the marginal notes as you move from one highlight to another. They display the marginal notes on the side-window by default. Or use ~org-remark-next~ and ~org-remark-prev~ if you simply want to move to the next/previous highlight without displaying marginal notes for them.
To make navigation easy, you can use define the same "prefix key" to Org-remark commands like this:
- ~C-c n o~: ~org-remark-open~
- ~C-c n ]~: ~org-remark-view-next~
- ~C-c n [~: ~org-remark-view-prev~
- ~C-c n r~: ~org-remark-remove~
- ~C-c n d~: ~org-remark-delete~
The ~C-c n~ part is the prefix key common to all of them. If you set the keybindings like this, you can use ~C-c n ]~ once to view the next highlight and keep pressing a single key ~]~ or ~[~ to browse through the next/previous highlights. After you have reached the one you like to act on, press ~o~ to open it, ~r~ or ~d~ to remove/delete it.
** Create Your Own Highlighter Pens
#+cindex: Custom highlighter pens
Org-remark has a default highlighter pen function, and comes with a set of two additional pens by default:
- ~org-remark-mark~ :: default highlighter pen
- ~org-remark-mark-line~ :: default line-highlighter pen, which adds a mark on the margin instead of a range of text
- ~org-remark-mark-yellow~ :: yellow highlight with "important" category in the marginal notes entry
- ~org-remark-mark-red-line~ :: wavy red underline with "review" category in the marginal notes entry and "Review this" in tool-tips
Org-remark lets you create your own custom pen functions with ~org-remark-create~. Use the yellow and red line pens as examples, and create your own. For how to do it, [[#create-custom-pens][How to Create Custom Highlighter Pens]].
This is all you need to get started. For more detail, refer to the rest of this user manual, especially [[#usage][Usage]] and [[#customizing][Customizing]] sections. There is more to the commands introduced in this section and more ways in which you can customize Org-remark.
** Highlight and Annotate Websites
#+cindex: Highlighting websites with EWW
#+findex: org-remark-eww-mode
~org-remark-eww-mode~ lets you highlight and annotate websites just like text files. It is a global minor mode. It does not require any additional configuration. All you need is to turn it on, visit a website with ~eww-mode~, and select text and highlight it. Refer to the example of a basic setup given in [[#installation][Installation]]. Org-remark can attempt to automatically adjust the position of highlights when a websites get edited. Learn more about the feature in [[#auto-adjust][What is Automatic Adjustment of Highlight Positions?]]
** Highlight and Annotate EPUB Books
#+cindex: Highlighting EPUB Books with nov.el
#+findex: org-remark-nov-mode
~org-remark-nov-mode~ lets you highlight and annotate EPUB books just like text files. It is a global minor mode. It does not require any additional configuration. All you need is to turn it on, open a EPUB book with ~nov-mode~, and select text and highlight it. Refer to the example of a basic setup given in [[#installation][Installation]]. If you read books with tables, it is useful to learn about the feature that automatically adjust the highlight positions: [[#auto-adjust][What is Automatic Adjustment of Highlight Positions?]]
** Highlight and Annotate Info documentation in ~Info-mode~
#+cindex: Highlighting Info documentation with Info-mode
#+findex: org-remark-info-mode
~org-remark-info-mode~ lets you highlight and annotate Info documentation just like text files. It is a global minor mode. It does not require any additional configuration. All you need is to turn it on, open an Info node with ~Info-mode~, and select text and highlight it. Refer to the example of a basic setup given in [[#installation][Installation]].
* Usage, Features, Concepts
:PROPERTIES:
:CUSTOM_ID: usage
:END:
** How to Create Custom Highlighter Pens
:PROPERTIES:
:CUSTOM_ID: create-custom-pens
:END:
#+cindex: Custom highlighter pens
#+cindex: Org-remark properties for highlights
#+findex: org-remark-mark
#+findex: org-remark-mark-yellow
#+findex: org-remark-mark-red-line
#+findex: org-remark-create
~org-remark-create~ is a macro that lets you create your own custom pen functions. Org-remark comes with two additional pens that are created by default. Use them as examples to learn how to create your own.
#+begin_src elisp
(org-remark-create "red-line"
'(:underline (:color "dark red" :style wave))
'(CATEGORY "review" help-echo "Review this"))
(org-remark-create "yellow"
'(:underline "gold" :background "lemon chiffon")
'(CATEGORY "important"))
#+end_src
- Macro: ~org-remark-create~ label &optional face properties ::
Create and register new highlighter pen functions. The newly created pen function will be registered to variable ~org-remark-available-pens~. It is used by ~org-remark-change~ as a selection list.
~LABEL~ is the name of the highlighter and mandatory. The function will be named ~org-remark-mark-LABEL~.
The highlighter pen function will apply ~FACE~ to the selected region. ~FACE~ can be an anonymous face. When ~FACE~ is nil, this macro uses the default face ~org-remark-highlighter~.
~PROPERTIES~ is a plist of pairs of a symbol and value. Each highlighted text region will have a corresponding Org headline in the notes file, and it can have additional properties in the property drawer from the highlighter pen. To do this, prefix property names with "=org-remark-=" or use "=CATEGORY=".
As of version 1.3, you can use ~org-remark-create~ to create a new line-highlighter pen. Use the ~PROPERTIES~ parameter like the example below to specify ~org-remark-type~ to be ~line~. This tells Org-remark to create a line-highlighter pen function instead of a default range-highlighter one. The ~LABEL~ does not need to include the string "line", but it is recommended for consistency with the default command ~org-remark-mark-line~.
#+begin_src emacs-lisp
;; This creates a custom command named org-remark-mark-line-alt with
;; face diff-hunk-header
(org-remark-create "line-alt"
'diff-hunk-header
'(org-remark-type line))
#+end_src
#+ATTR_TEXINFO: :tag NOTE
#+begin_quote
Don't use =category= (all lowercase, symbol) as a property -- it's a special one for text properties. If you use it, the value also need to be a symbol; otherwise, you will get an error. You can use =CATEGORY= (all uppercase, symbol), which will result in adding =CATEGORY= with the value in the property drawer in marginal notes Org files.
#+end_quote
** How to Automatically Turn On Highlights after Re-starting Emacs
#+findex: org-remark-global-tracking-mode
#+findex: org-remark-mode
It is recommended that ~org-remark-global-tracking-mode~ be turned on as part of your Emacs initialization. This should be done before you start adding highlights in any file.
Once you have added highlights to some files, quit Emacs, and re-start it, active ~org-remark-global-tracking-mode~ will automatically turn on ~org-remark-mode~ and load the highlights from your previous sessions for the files being globally tracked.
Without this global minor mode, you would need to remember to activate ~org-remark-mode~ for each file where you add highlights and annotation. This is often unpractical.
** How to Manage Marginal Notes
:PROPERTIES:
:DESCRIPTION: Where Org-remark stores highlights and how to control it
:END:
*** Marginal Notes File
#+cindex: Marginal notes file
#+cindex: Org-remark properties for highlights
When you mark a part of text with a highlighter pen function, Org-remark will automatically create a *marginal notes file*. By default, it will be named ~marginalia.org~ and created in the same directory as the file you are editing ([[#change-marginal-notes-filename][How to Change Where Marginal Notes File is Saved]] [[#customizing][;Customizing]], ~org-remark-notes-file-name~).
The important thing to note is that Org-remark uses following properties in the property drawer of the headline to remember the highlights:
- :org-remark-beg:
- :org-remark-end:
- :org-remark-id:
- :org-remark-label:
Essentially, the marginal notes file is a database in the plain text with using Org mode. As a plain text database, you can easily edit these properties manually if necessary. You can directly edit the marginal notes file as a normal Org file.
The marginal notes file stores highlights and notes like this below; it is designed to organize highlights and notes for multiple files and multiple highlights (You are free to change the default headline titles Org-remark automatically inserts. Refer to section [[#organize-headlines][Organize Headlines in Marginal Notes Buffer in Your Way]]).
#+begin_src org
,* File 1
,** Highlight 1 in File 1
,** Highlight 2 in File 1
[...]
,* File 2
,** Highlight 1 in File 2
[...]
#+end_src
You can leave the marginal notes file as it is without writing any notes. In this case, the entries in marginal notes file simply save the locations of your highlighted text. After you quit Emacs, re-start it, and visit the same source file, Org-remark uses this information to highlight the text again.
In addition to the properties above that Org-remark reserves for itself, you can add your own custom properties and ~CATEGORY~ property. Use "org-remark-" as the prefix to the property names (or "CATEGORY", which is the only exception), and Org-remark put them to the property drawer of highlight's headline entry in the marginal notes buffer. Define the custom properties in your own custom pen functions (for how to create your own pens, [[#create-custom-pens][How to Create Custom Highlighter Pens]]).
*** Organize Headlines in Marginal Notes Buffer in Your Way
:PROPERTIES:
:CUSTOM_ID: organize-headlines
:END:
#+vindex: org-remark-line-heading-title-max-length
#+vindex: org-remark-line-ellipsis
When you highlight a range of text or a line, Org-remark creates a corresponding headline in the marginal notes buffer with using Org mode. By default, the headline's title is either the selected text for the range-highlight or the first 40 characters of the line for the line-highlight. For the latter, if the string is longer than the maximum characters, it will be truncated and replaced by an ellipsis "…". Both the 40 character maximum length and the ellipsis can be customized with customizing variables ~org-remark-line-heading-title-max-length~ and ~org-remark-line-ellipsis~ respectively.
These are only default initial headline titles and you are free to change them as you see fit. For example, you may add a line-highlight to the line where you define a function in an Emacs Lisp script file. The initial title of the corresponding headline in the marginal notes buffer will be something like this below.
#+begin_example
,** (defun name-of-the-function (arg)...)
:PROPERTIES:...
I will revisit this function later.
#+end_example
It may make sense to change this to something like this, especially if you would prefer to organize marginal notes as ~TODO~ items so as to show the headlines in your agenda.
#+begin_example
,** TODO review name-of-the-function
:PROPERTIES:...
I will revisit this function later.
#+end_example
*** =*marginal-notes*= Buffer
#+cindex: *marginal notes* buffer
#+cindex: Echo text / Tool tip on the Highlight
When you display the marginal notes with ~org-remark-view~ or ~org-remark-open~ for a given highlight, Org-remark creates a cloned indirect buffer visiting the marginal notes file. By default, it is a dedicated side-window opened to the left part of the current frame, and it is named =*marginal notes*=. You can change the behavior of ~display-buffer~ function and the name of the buffer ([[#customizing][Customizing]]).
Org-remark displays the marginal notes buffer narrowed to the highlight the cursor is on.
After all the properties, you can freely write your notes for the highlight. Once you save the notes buffer, an excerpt of the text (currently up to 200 characters) gets updated back onto the highlight in the source buffer. You can hover your mouse over the highlight to see the excerpt displayed in the echo area (bottom of the screen) of Emacs. If you have ~tooltip-mode~ mode turned on, the excerpt is displayed as a took tip for the highlight.
*** How to Change Where Marginal Notes File is Saved
:PROPERTIES:
:CUSTOM_ID: change-marginal-notes-filename
:END:
#+vindex: org-remark-notes-file-name
The location of the marginal notes file is specified by user option ~org-remark-notes-file-name~ and its default is "marginalia.org". This means the marginal notes file will reside in the same directory as the source files as a separate file.
If you use the ~customize~ command to customize ~org-remark-notes-file-name~, you will have an option to choose a =File= or =Function= (customization group ~org-remark~). The default is =File= with the default "marginal.org" as noted above. Use a string to specify the single file name; you can specify a relative path like the default or an absolute path.
If you would like to dynamically change the location based on the file and various different conditions, select the function as an option. The default function is ~org-remark-notes-file-name-function~. It adds =-notes.org= as a suffix to the source file's name without the extension. For example, for a file named =my-source-file.txt=, Org-remark will store highlights in =my-source-file-notes.org=. You can create your own function and use it.
Some examples and use cases are listed below:
- Store Marginal Notes in the Source File ::
In order to use the source file also as the marginal notes file (storing the notes in the source file), you can set the built-in function ~buffer-file-name~ as the value of ~org-remark-notes-file-name~. Note that you will need to ensure that the source files are an Org file.
- Create a marginal notes file for each source file and store all of them in a specific location ::
Create a custom function that returns an absolute file name per source file, and set ~org-remark-notes-file-name~ to the function name. It might look like this:
#+begin_src elisp
(defun my/function ()
(concat "~/path/to/note-files/"
(file-name-base (org-remark-notes-file-name-function))
".org"))
(setq org-remark-notes-file-name
#'my/function)
#+end_src
*** How to Use Relative or Absolute File Names for Links in Marginal Notes File
#+cindex: Relative or absolute file names pointing back at source files in marginal notes
#+vindex: org-remark-source-file-name
The marginal notes file stores the file name pointing back at source files. For example, a marginal notes entry for File1.txt might look like this example below.
#+begin_src org
,* File 1
:PROPERTIES:
:org-remark-file: path/to/File1.txt
:END:
,** Highlight 1 in File 1
:PROPERTIES:
:[...other-properties]:
:org-remark-link: [[file:path/to/File1.txt::14]]
:END:
#+end_src
The level-1 headline named "File 1" records the file name of the source file =path/to/File1.txt=. Similarly, the level-2 headline named "Highlight 1 in File 1" stores the link pointing back at the source file and the line number of the highlight.
As you can see, both file names use a relative file name from the marginal notes file. This is the default setting of ~org-remark-source-file-name~.
You can customize the variable to use absolute file names, or to use a function of your choice. The function is called with a single argument: the absolute file name of source file. The ~default-directory~ is temporarily set to the directory where the marginal notes file resides. If you choose to use relative file names, the relative path is computed from ~default-directory~.
** How to Remove and Delete Highlights
#+findex: org-remark-remove
#+findex: org-remark-delete
#+vindex: org-remark-notes-auto-delete
You can remove the highlight under the cursor with command ~org-remark-remove~. This command does not delete the corresponding entry in the marginal notes file. This is intentional; Org-remark is conservative when it deletes anything that the user might have edited.
If you wish to delete the entry and the highlight at the same time, pass a universal argument to `org-remark-remove` (e.g. by adding ~C-u~ before ~M-x org-remark-remove~) or use ~org-remark-delete~. ~org-remark-delete~ is identical with adding ~C-u~ to ~org-remark-remove~.
The delete function will prompt for confirmation if it detects any notes present in the corresponding entry for the highlight in question in the marginal notes buffer.
#+ATTR_TEXINFO: :tag NOTE
#+begin_quote
Note that you can undo the deletion or removal *in the marginal notes buffer* -- not in the source buffer where you mark text with a highlighter. Technically, highlights are overlays and are therefore not part of the undo tree in the source buffer.
#+end_quote
As of version 1.3, you can use a new optional feature, automatic deletion. When the feature is enabled, Org-remark will automatically delete the highlight's headline when you delete text that includes a highlight, provided there is no marginal notes for it. If marginal notes are present for the highlight's headline, Org-remark only removes the highlight, deleting the properties from the highlight headline -- same operation as ~org-remark-remove~. Your marginal notes will be kept intact. In either case, Org-remark does not ask for your confirmation.
You can enable it with the new user option ~org-remark-notes-auto-delete~ like this example below.
#+begin_src emacs-lisp
(setopt org-remark-notes-auto-delete :auto-delete)
#+end_src
Furthermore, with v1.3, if you pass a universal argument to ~org-remark-delete~ (e.g. ~C-u M-x org-remark-delete~) you can manually get Org-remark to do automatic deletion for the highlight at point. You can also pass double universal arguments to ~org-remark-remove~ (e.g. ~C-u C-u M-x org-remark-remove~) for the same operation. This should make sense because passing a single universal argument to ~org-remark-remove~ is the same as ~org-remark-delete~. Refer to the documentation of the customizing variable ~org-remark-notes-auto-delete,~ the functions ~org-remark-remove~ and ~org-remark-delete~.
** What is Automatic Adjustment of Highlight Positions?
:PROPERTIES:
:CUSTOM_ID: auto-adjust
:END:
#+cindex: Org-remark automatically adjusts positions of highlights
#+vindex: org-remark-icon-position-adjusted
#+vindex: org-remark-highlighter-warning
Org-remark by default attempts to automatically adjust the position of highlights when they are loaded. This is useful especially for EPUB books read by nov.el. It renders tables in different sizes depending on the available space of the window to maximize their readability.
This is a good feature for reading; however, it also changes the positions of subsequent text elements depending on the window size when the page is rendered. It can result in dislocating the positions of highlights, different from they are originally created.
Org-remark attempts to automatically corrects the highlights dislocated. This is a general feature so Org-remark attempts to correct minor edits to websites (for EWW).
More technically, it works as follows.
1. When you create a new highlight, Org-remark records the original text highlighted in the Org property named "~org-remark-original-text~".
2. Next time when you open a new file (EPUB book as an example), Org-remark loads the highlights from the notes Org buffer.
3. For each highlight, it compares the currently highlighted text with the value of ~org-remark-original-text~ property.
4. If they are the same, Org-remark does nothing.
5. If different, Org-remark by default looks for the same text string +- two paragraphs. When it finds the *first* matching text string, it automatically moves the highlight to the matched text string.
6. Org-remark adds an icon to the auto-adjusted highlight to make it clear that the position of highlight has been adjusted.
7. This adjustment is temporary. If you prefer to change the position permanently, you can do so by manually changing the ~org-remark-beg~ and ~org-remark-end~ properties in the notes buffer and save. You can also choose to alter the value of ~org-remark-original-text~ if you have adjusted the range of highlighted text.
You can customize the icon itself and its face with the following customizing variables:
- Option: ~org-remark-icon-position-adjusted~
- Face: ~org-remark-highlighter-warning~
** How to Set Org-remark to Use SVG Icons
:PROPERTIES:
:CUSTOM_ID: icon
:END:
As of v1.2, highlights can display an icon. With this option, you can customize Org-remark to visually indicate that marginal notes exist for them instead of the default ASCII string "(*)", or to indicate that the Org-remark has automatically adjusted the highlight position (default ASCII string "(d)"; refer to [[#auto-adjust][What is Automatic Adjustment of Highlight Positions?]]).
There are mainly two ways to set up SVG icons.
1. Use the new built-in `icons` library available as of Emacs version 29.1
2. Create a custom function and use a third-party library such as [[https://github.com/rougier/svg-lib][~svg-lib~]] by Nicolas Rougier
Below is a quick guide on the first option to use the built-in library
1. Get or create an SVG icon
2. Put the downloaded SVG file somewhere in your local
3. Use define-icon macro to create an icon with the SVG file
First, create or download an icon as an ~.svg~ file. For example, [[https://boxicons.com/][Boxicons]] has a collection of SVG icons, which [[https://boxicons.com/usage#license][are provided under The MIT License]]. Second, place the SVG file in your local directory, e.g. ~~/.config/emacs/.cache/svg/bx-pen.svg~. And finally, use ~define-icon~ to define the icon in your configuration like this example below.
#+begin_src emacs-lisp
(define-icon annotation nil
'((image "~/.config/emacs/.cache/svg/bx-pen.svg"
:height (0.8 . em)))
"Notes svg icon for Org-remark"
:version 29.1)
#+end_src
Now the icon has been defined, you can set it to customizing variable ~org-remark-icon-notes~ like so:
#+begin_src emacs-lisp
;; This example uses `setopt' that is made available as of 29.1. `setq' works too.
(setopt org-remark-icon-notes (icon-string 'annotation))
#+end_src
If you have a buffer with highlights already open, use ~revert-buffer~ to reload the highlights. You should see the icon you have defined instead of the default “(*)” string.
** Other Commands
#+findex: org-remark-toggle
#+findex: org-remark-change
#+findex: org-remark-next
#+findex: org-remark-prev
- Command ~org-remark-toggle~ ::
Toggle showing/hiding of highlights in current buffer.
If you would like to hide/show the highlights in the current buffer, it is recommended to use this command instead of ~org-remark-mode~. This command only affects the display of the highlights and their locations are still kept tracked. Toggling off ~org-remark-mode~ stops this tracking completely, which will likely result in inconsistency between the marginal notes file and the current source buffer.
- Command ~org-remark-change~ ::
Change the highlight at point to one by another pen. This command will show you a list of available pens to choose from.
To navigate through highlights in the current buffer, you can use ~org-remark-view-next~ / ~org-remark-view-prev~ or the following pair of commands. The former moves your cursor and displays the marginal notes buffer; the latter only moves your cursor.
- Command ~org-remark-next~ ::
Move to the next highlight, if any.
If there is none below the point but there is a highlight in the buffer, cycle back to the first one.
After the point has moved to the next highlight, this command lets you move further by re-entering only the last letter like this example: =C-n ] ] ] ] ]= (assuming this command is bound to C-n ])
- Command ~org-remark-prev~ ::
Move to the previous highlight, if any.
* Customizing
:PROPERTIES:
:CUSTOM_ID: customizing
:END:
#+vindex: org-remark-highlighter
#+vindex: org-remark-create-default-pen-set
#+vindex: org-remark-notes-file-name
#+vindex: org-remark-notes-display-buffer-action
#+vindex: org-remark-notes-buffer-name
#+vindex: org-remark-source-file-name
#+vindex: org-remark-use-org-id
#+vindex: org-remark-open-hook
#+vindex: org-remark-icon-notes
#+vindex: org-remark-icon-position-adjusted
#+vindex: org-remark-highlights-after-load-functions
#+vindex: org-remark-highlighter-warning
Org-remark's user options are available in the customization group ~org-remark~.
- Face: ~org-remark-highlighter~ ::
Default face for ~org-remark-mark~
- Option: ~org-remark-create-default-pen-set~ ::
When non-nil, Org-remark creates default pen set. Set to nil if you prefer for it not to.
- Option: ~org-remark-notes-file-name~ ::
Name of the file where we store highlights and marginal notes. It can be either a string or function.
If it is a string, it should be a file name to the marginal notes file. The default is =marginalia.org=. The default will result in one marginal notes file per directory. Ensure that it is an Org file.
If it is a function, the default function is ~org-remark-notes-file-name-function~. It returns a file name like this: =FILE-notes.org= by adding =-notes.org= as a suffix to the file name without the extension.
- Option: ~org-remark-notes-display-buffer-action~ ::
Buffer display action that Org-remark uses to open marginal notes buffer.
- Option: ~org-remark-notes-buffer-name~ ::
Buffer name of the marginal notes buffer. ~org-remark-open~ and ~org-remark-visit~ create an indirect clone buffer with this name.
- Option: ~org-remark-source-file-name~ ::
Function that returns the file name to point back at the source file.
The function is called with a single argument: the absolute file name of source file. The =default-directory= is temporarily set to the directory where the marginal notes file resides.
This means that when the =Relative file name= option is selected, the source file name recorded in the marginal notes file will be relative to it.
- Option: ~org-remark-use-org-id~ ::
When non-nil, Org-remark adds an Org-ID link to marginal notes. The link points at the relevant Org-ID in the source file. Org-remark does not create this ID, which needs to be added manually or some other function to either the headline or file.
- Option: ~org-remark-icon-notes~ ::
It's the icon used to indicate that a given highlight has its associated notes entry. The default is a combination of ASCII characters to be compatible with terminal and others. If it is preferred, you can set an emoji to it. The author has not experienced well with icon fonts and other means of displaying graphic elements. The face of the icon becomes the same as the highlight, thus it does not have its own face definition.
By setting it to ~nil~, you can disable the icon altogether.
~org-remark-toggle~ also toggles the icon along with the highlight
- Option: ~org-remark-icon-position-adjusted~ :
It's the icon used to indicate that the position of a given highlight has been automatically adjusted by Org-remark. The default is a combination of ASCII characters to be compatible with terminal and others. If it is preferred, you can set an emoji to it. The author has not experienced well with icon fonts and other means of displaying graphic elements.
By setting it to ~nil~, you can disable the icon altogether.
~org-remark-toggle~ also toggles the icon along with the highlight
- Face: ~org-remark-highlighter-warning~ ::
This face is used by the icon to indicate that the position of a given highlight has been adjusted. To know more about the feature itself, refer to [[#auto-adjust][What is Automatic Adjustment of Highlight Positions?]].
- Option: ~org-remark-open-hook~ ::
Hook run when a note buffer is opened/visited. It gets run with no additional argument but the current buffer will become the note buffer.
- Option ~org-remark-highlights-after-load-functions~ ::
Abnormal hook run after Org-remark loads the highlights from the note org buffer. It is run with OVERLAYS and NOTES-BUF as arguments. OVERLAYS are highlights. It is run with the source buffer as current buffer. This hook is used by the automatic adjustment feature. To know more about the feature itself, refer to [[#auto-adjust][What is Automatic Adjustment of Highlight Positions?]].
** Customizing Line Highlights
#+vindex: org-remark-line-highlighter
#+vindex: org-remark-line-icon
#+vindex: org-remark-line-minimum-margin-width
#+vindex: org-remark-line-margin-padding
#+vindex: org-remark-line-margin-side
#+vindex: org-remark-line-heading-title-max-length
#+vindex: org-remark-line-ellipsis
These are user options for line highlights available as of v1.3. They are listed in customizing group ~org-remark-line~.
- Face: ~org-remark-line-highlighter~ ::
Face for the default line highlighter pen.
- Option: ~org-remark-line-icon~ ::
Glyph displayed on the margin to indicate the line-highlight. You can set an SVG icon to it. Refer to [[#icon][How to Set Org-remark to Use SVG Icons]].
- Option: ~org-remark-line-minimum-margin-width~ ::
Margin width in a natural number. It can be a single number or a cons cell of two. When it is a single number, both the left and right margin widths will be the
same. When this customizing variable is a cons cell, the format is as follows: (LEFT-MARGIN-WIDTH . RIGHT-MARGIN-WIDTH).
- Option: ~org-remark-line-margin-padding~ ::
Padding between the main text area the glyph/icon on the margin.
- Option: ~org-remark-line-margin-side~ ::
The side of margin to display line highlights.
Left or Right can be chosen.
- Option: ~org-remark-line-heading-title-max-length~ ::
Maximum length of string included as the highlight title.
- Option ~org-remark-line-ellipsis~ ::
Ellipsis used when the highlight title is longer than maximum.
The maximum is set in ~org-remark-line-heading-title-max-length~.
* Known Limitations
- No export together with the source file :: There is no out-of-the-box feature to export marginal notes together with the source file. Nevertheless, the marginal notes is a normal Org file, thus if the source file is also an Org file, you could use the built-in =include= feature, for example, to include relevant parts of the marginal notes into the export output.
- Copy & pasting loses highlights :: Overlays are not part of the kill; thus cannot be yanked.
- Undo highlight does not undo it :: Overlays are not part of the undo list; you cannot undo highlighting. Use ~org-remark-remove~ or ~org-remark-delete~ commands instead.
- Moving source files and marginal notes files :: Moving your files and remark file to another directory does not update the source paths and file names stored in the marginal notes file. One way to keep the links between the source files and marginal notes files is to use relative file names with ~org-remark-source-file-name~ (default).
- With ~org-remark-eww-mode~ highlights can get displaced :: This happens when the website is edited and its content changes outside Emacs -- of course this is normal for websites. Currently there is no way to fix the location of highlights.
* Credits
To create this package, I was inspired by the following packages. I did not copy any part of them, but borrowed some ideas from them -- e.g. saving the margin notes in a separate file.
- [[https://github.com/jkitchin/ov-highlight][Ov-highlight]] :: John Kitchin's (author of Org-ref). Great UX for markers with hydra. Saves the marker info and comments directly within the Org file as Base64 encoded string. It uses overlays with using ~ov~ package.
- [[https://github.com/bastibe/annotate.el][Annotate.el]] :: Bastian Bechtold's (author of Org-journal). Unique display of annotations right next to (or on top of) the text. It seems to be designed for very short annotations, and perhaps for code review (programming practice); I have seen recent issues reported when used with variable-pitch fonts (prose).
- [[https://github.com/tkf/org-mode/blob/master/contrib/lisp/org-annotate-file.el][Org-annotate-file]] :: Part of Org's contrib library. It seems to be designed to annotate a whole file in a separate Org file, rather than specific text items.
- [[https://github.com/IdoMagal/ipa.el][InPlaceAnnotations (ipa-mode)]] :: It looks similar to Annotate.el above.
- Transient navigation feature :: To implement the transient navigation feature, I liberally copied the relevant code from a wonderful Emacs package, [[https://github.com/rnkn/binder/blob/24d55db236fea2b405d4bdc69b4c33d0f066059c/binder.el#L658-L665][Binder]] by Paul W. Rankin (GitHub user [[https://github.com/rnkn][rnkn]]).
* Contributing & Feedback
Create issues, discussion, and/or pull requests in the GitHub repository. All welcome.
Org-remark is planned to be submitted to GNU ELPA and thus copyrighted by the [[http://fsf.org][Free Software Foundation]] (FSF). This means that anyone who is making a substantive code contribution will need to "assign the copyright for your contributions to the FSF so that they can be included in GNU Emacs" ([[https://orgmode.org/contribute.html#copyright][Org Mode website]]).
Thank you.
* Index - Features
:PROPERTIES:
:CUSTOM_ID: cindex
:APPENDIX: t
:INDEX: cp
:DESCRIPTION: Key concepts & features
:END:
* Index - Commands
:PROPERTIES:
:APPENDIX: t
:INDEX: fn
:DESCRIPTION: Interactive functions
:END:
* Index - User Options
:PROPERTIES:
:APPENDIX: t
:INDEX: vr
:DESCRIPTION: Customizable variables & faces
:END:
* GNU Free Documentation License
:PROPERTIES:
:appendix: t
:END:
#+texinfo: @include fdl.texi
# Local Variables:
# time-stamp-start: "modified +\\\\?"
# End:
================================================
FILE: docs/resources/manual.css
================================================
/* Style-sheet to use for Emacs manuals */
/* Copyright (C) 2013-2022 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
*/
@import url('style.css');
/* makeinfo convert @deffn and similar functions to something inside
<blockquote>. style.css uses italic for blockquote. This looks poor
in the Emacs manuals, which make extensive use of @defun (etc).
In particular, references to function arguments appear as <var>
inside <blockquote>. Since <var> is also italic, it makes it
impossible to distinguish variables. We could change <var> to
e.g. bold-italic, or normal, or a different color, but that does
not look as good IMO. So we just override blockquote to be non-italic.
*/
blockquote { font-style: normal; }
var { font-style: italic; }
================================================
FILE: docs/resources/reset.css
================================================
/*
Software License Agreement (BSD License)
Copyright (c) 2006, Yahoo! Inc.
All rights reserved.
Redistribution and use of this software in source and
binary forms, with or without modification, arepermitted
provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of Yahoo! Inc. nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of Yahoo! Inc.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
html {
color: #000;
background: #FFF;
}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4,
h5, h6, pre, code, form, fieldset, legend, input,
button, textarea, p, blockquote, th, td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img {
border: 0;
}
address, caption, cite, code, dfn, em, strong,
th, var, optgroup {
font-style: inherit;
font-weight: inherit;
}
del, ins {
text-decoration: none;
}
li {
list-style:none;
}
caption, th {
text-align: left;
}
h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: normal;
}
q:before, q:after {
content:'';
}
abbr, acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input, button, textarea, select, optgroup, option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input, button, textarea, select {
*font-size: 100%;
}
================================================
FILE: docs/resources/style.css
================================================
/* This stylesheet is used by manuals and a few older resources. */
@import url('reset.css');
/*** PAGE LAYOUT ***/
html, body {
font-size: 1em;
text-align: left;
text-decoration: none;
}
html { background-color: #e7e7e7; }
body {
max-width: 74.92em;
margin: 0 auto;
padding: .5em 1em 1em 1em;
background-color: white;
border: .1em solid #c0c0c0;
}
/*** BASIC ELEMENTS ***/
/* Size and positioning */
p, pre, li, dt, dd, table, code, address { line-height: 1.3em; }
h1 { font-size: 2em; margin: 1em 0 }
h2 { font-size: 1.50em; margin: 1.0em 0 0.87em 0; }
h3 { font-size: 1.30em; margin: 1.0em 0 0.87em 0; }
h4 { font-size: 1.13em; margin: 1.0em 0 0.88em 0; }
h5 { font-size: 1.00em; margin: 1.0em 0 1.00em 0; }
p, pre { margin: 1em 0; }
pre { overflow: auto; padding-bottom: .3em; }
ul, ol, blockquote { margin-left: 1.5%; margin-right: 1.5%; }
hr { margin: 1em 0; }
/* Lists of underlined links are difficult to read. The top margin
gives a little more spacing between entries. */
ul li { margin: .5em 1em; }
ol li { margin: 1em; }
ol ul li { margin: .5em 1em; }
ul li p, ul ul li { margin-top: .3em; margin-bottom: .3em; }
ul ul, ol ul { margin-top: 0; margin-bottom: 0; }
/* Separate description lists from preceding text */
dl { margin: 1em 0 0 0; }
/* separate the "term" from subsequent "description" */
dt { margin: .5em 0; }
/* separate the "description" from subsequent list item
when the final <dd> child is an anonymous box */
dd { margin: .5em 3% 1em 3%; }
/* separate anonymous box (used to be the first element in <dd>)
from subsequent <p> */
dd p { margin: .5em 0; }
table {
display: block; overflow: auto;
margin-top: 1.5em; margin-bottom: 1.5em;
}
th { padding: .3em .5em; text-align: center; }
td { padding: .2em .5em; }
address { margin-bottom: 1em; }
caption { margin-bottom: .5em; text-align: center; }
sup { vertical-align: super; }
sub { vertical-align: sub; }
/* Style */
h1, h2, h3, h4, h5, h6, strong, dt, th { font-weight: bold; }
/* The default color (black) is too dark for large text in
bold font. */
h1, h2, h3, h4 { color: #333; }
h5, h6, dt { color: #222; }
a[href] { color: #005090; }
a[href]:visited { color: #100070; }
a[href]:active, a[href]:hover {
color: #100070;
text-decoration: none;
}
h1 a[href]:visited, h2 a[href]:visited, h3 a[href]:visited,
h4 a[href]:visited { color: #005090; }
h1 a[href]:hover, h2 a[href]:hover, h3 a[href]:hover,
h4 a[href]:hover { color: #100070; }
ol { list-style: decimal outside;}
ul { list-style: square outside; }
ul ul, ol ul { list-style: circle; }
li { list-style: inherit; }
hr { background-color: #ede6d5; }
table { border: 0; }
abbr,acronym {
border-bottom:1px dotted #000;
text-decoration: none;
cursor:help;
}
del { text-decoration: line-through; }
em { font-style: italic; }
small { font-size: .9em; }
img { max-width: 100%}
/*** SIMPLE CLASSES ***/
.center, .c { text-align: center; }
.nocenter{ text-align: left; }
.underline { text-decoration: underline; }
.nounderline { text-decoration: none; }
.no-bullet { list-style: none; }
.inline-list li { display: inline }
.netscape4, .no-display { display: none; }
/*** MANUAL PAGES ***/
/* This makes the very long tables of contents in Gnulib and other
manuals easier to read. */
.contents ul, .shortcontents ul { font-weight: bold; }
.contents ul ul, .shortcontents ul ul { font-weight: normal; }
.contents ul { list-style: none; }
/* For colored navigation bars (Emacs manual): make the bar extend
across the whole width of the page and give it a decent height. */
.header, .node { margin: 0 -1em; padding: 0 1em; }
.header p, .node p { line-height: 2em; }
/* For navigation links. We can't use inline-block display to avoid wrapping
because this makes the links appear much smaller than normal text on
phones with Chromium (RT #1872370). */
.node a, .header a { /*display: inline-block;*/ line-height: 2em; }
.node a:hover, .header a:hover { background: #f2efe4; }
/* Inserts */
table.cartouche td { padding: 1.5em; }
div.display, div.lisp, div.smalldisplay,
div.smallexample, div.smalllisp { margin-left: 3%; }
div.example { padding: .8em 1.2em .4em; }
pre.example { padding: .8em 1.2em; }
div.example, pre.example {
margin: 1em 0 1em 3% ;
-webkit-border-radius: .3em;
-moz-border-radius: .3em;
border-radius: .3em;
border: 1px solid #d4cbb6;
background-color: #f2efe4;
}
div.example > pre.example {
padding: 0 0 .4em;
margin: 0;
border: none;
}
pre.menu-comment { padding-top: 1.3em; margin: 0; }
/*** FOR WIDE SCREENS ***/
@media (min-width: 40em) {
body { padding: .5em 3em 1em 3em; }
div.header, div.node { margin: 0 -3em; padding: 0 3em; }
}
================================================
FILE: org-remark-convert-legacy.el
================================================
;;; org-remark-convert-legacy.el --- Convert legacy Org-marginalia files to Org-remark -*- lexical-binding: t; -*-
;; Copyright (C) 2022-2025 Free Software Foundation, Inc.
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Last modified: 23 January 2025
;; Created: 16 January 2022
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, writing, note-taking, marginal notes
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This file is part of Org-remark and contains a feature that helps users of
;; Org-marginalia (former name of Org-remark) convert their legacy
;; marginalia.org files to those compatible with Org-remark.
;;
;; (require 'org-remark-convert-legacy-data) for `org-remark' to use
;; `org-remark-convert-legacy-data' function to automatically convert legacy
;; data on save and load. Alternatively, use the same function as an
;; interactive command on a marginalia.org buffer that contains legacy
;; Org-marginalia data.
;;; Code:
(require 'org)
(require 'org-remark)
(defun org-remark-convert-legacy-data ()
"Convert the legacy Org-marginalia properties to those for Org-remark.
You can call this function interactively to convert the current
buffer. It also gets automatically triggered when you save or
load Org-remark marginal notes file if
`org-remark-convert-legacy' user option is non-nil.
This function checks whether or not there is at least one legacy entry with
property \"marginalia-source-file\" in the current buffer.
If one found, this function will:
1. Create a backup copy with the filename \"<current-file-name>_archive\"
2. Convert all \"marginalia-*\" properties to \"org-remark-*\" equivalents
- marginalia-source-file -> org-remark-file
- marginalia-id -> org-remark-id
- marginalia-source-beg -> org-remark-beg
- marginalia-source-end -> org-remark-end
This assumes that all the \"marginalia-*\" properties were used
solely by Org-marginalia."
(interactive)
(org-with-wide-buffer
;; Check that there is at least one legacy entry in the current buffer
(goto-char (point-min))
(when (save-excursion (org-find-property "marginalia-source-file"))
;; Do the process only when there is at least one entry
;; Create a backup copy
(let ((filename (abbreviate-file-name
(concat (buffer-file-name) "_archive"))))
(write-region (point-min) (point-max) filename)
(message (format "org-remark: created backup file %s" filename)))
;; Scan the whole marginal notes file
(while (not (org-next-visible-heading 1))
(when-let (source-file (org-entry-get (point) "marginalia-source-file"))
(org-delete-property "marginalia-source-file")
(org-set-property org-remark-prop-source-file source-file))
(when-let ((id (org-entry-get (point) "marginalia-id"))
(beg (string-to-number
(org-entry-get (point)
"marginalia-source-beg")))
(end (string-to-number
(org-entry-get (point)
"marginalia-source-end"))))
(org-delete-property "marginalia-id")
(org-delete-property "marginalia-source-beg")
(org-delete-property "marginalia-source-end")
(org-set-property org-remark-prop-id id)
(let ((props '()))
(plist-put props org-remark-prop-source-beg (number-to-string beg))
(plist-put props org-remark-prop-source-end (number-to-string end))
(org-remark-notes-set-properties props))))
(goto-char (point-min))
(message (format "org-remark: Legacy \"marginalia-*\" properties updated for %s"
(abbreviate-file-name (buffer-file-name))))
t)))
(provide 'org-remark-convert-legacy)
;;; org-remark-convert-legacy.el ends here
================================================
FILE: org-remark-eww.el
================================================
;;; org-remark-eww.el --- Enable Org-remark for EWW -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Authors: Vedang Manerikar <ved.manerikar@gmail.com>
;; Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Created: 23 December 2022
;; Last modified: 23 January 2025
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This file is part of org-remark.
;; This feature to support for EWW was originally added by Vedang
;; Manerika with commit 5e4b27ar feat: Support taking annotations in eww
;; buffers. nobit has refactored it as a separate file.
;;; Code:
(require 'eww)
(require 'org-remark-global-tracking)
;;;###autoload
(define-minor-mode org-remark-eww-mode
"Enable Org-remark to work with EWW."
:global t
:group 'org-remark-eww
(if org-remark-eww-mode
;; Enable
(progn
(add-hook 'eww-after-render-hook #'org-remark-auto-on)
(add-hook 'org-remark-source-find-file-name-functions
#'org-remark-eww-find-file-name)
(add-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-eww-highlight-link-to-source))
;; Disable
(remove-hook 'eww-after-render-hook #'org-remark-auto-on)
(remove-hook 'org-remark-source-find-file-name-functions
#'org-remark-eww-find-file-name)
(remove-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-eww-highlight-link-to-source)))
(defun org-remark-eww-find-file-name ()
"Return URL without the protocol as the file name for the website.
It assumes the buffer is the source website to be annotated.
This function is meant to be set to hook
`org-remark-source-find-file-name-functions'."
(when (eq major-mode 'eww-mode)
(let ((url-parsed (url-generic-parse-url (eww-current-url))))
(concat (url-host url-parsed) (url-filename url-parsed)))))
(defun org-remark-eww-highlight-link-to-source (filename _point)
"Return URL pointinting to the source website (FILENAME).
It assumes https:
This function is meant to be set to hook
`org-remark-highlight-link-to-source-functions'."
(when (eq major-mode 'eww-mode)
;;; FIXME we shhould not assume https?
(concat "[[https://" filename "]]")))
(provide 'org-remark-eww)
;;; org-remark-eww.el ends here
================================================
FILE: org-remark-global-tracking.el
================================================
;;; org-remark-global-tracking.el --- Track files and auto-activate Org-remark -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Created: 15 August 2021
;; Last modified: 23 January 2025
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This file is part of org-remark
;;; Code:
(declare-function org-remark-mode "org-remark")
(defvaralias 'org-remark-notes-file-path 'org-remark-notes-file-name)
(make-obsolete-variable
'org-remark-notes-file-path 'org-remark-notes-file-name "0.2.0")
(defcustom org-remark-notes-file-name "marginalia.org"
"Name of the file where we store highlights and marginal notes.
It can be either a string or function.
If it is a string, it should be a file name to the marginal notes
file. The default is \"marginalia.org\". The default will
result in one marginal notes file per directory. Ensure that it
is an Org file.
If it is a function, the default function is
`org-remark-notes-file-name-function'. It returns a file name
like this: \"FILE-notes.org\" by adding \"-notes.org\" as a
suffix to the file name without the extension. When the buffer is
not visiting a file (e.g. a website via EWW), the file name will
be \"marginalia.org\" in your `user-emacs-directory'."
:group 'org-remark
:safe #'stringp
:type '(choice
(file "marginalia.org")
(function org-remark-notes-file-name-function)))
(defcustom org-remark-highlight-link-to-source-functions nil
"Abnormal hook called to create a link to source in notes file.
Each one is called with FILENAME as an argument."
:group 'org-remark
:type '(repeat function))
(defvar org-remark-source-find-file-name-functions nil
"List of functions to get the source file name.
It is an abnormal hook run with no argument and each function
must return a file-name-equvalent as a string that uniquely
identifies the source. The hook is run when `buffer-file-name`
in source buffer returns nil, meaning the source buffer is not
visiting a file.
Meant to be set by extensions such as `org-remark-eww'")
;;;###autoload
(define-minor-mode org-remark-global-tracking-mode
"Automatically activates local minor mode `org-remark-mode'.
When this global minor mode is active, a function added to
`find-file-hook' will look for a marginal notes file for the file
as defined by `org-remark-notes-file-path'. If it is found and
readable, the function automatically activates `org-remark'."
:init-value nil
:lighter " ormk-auto"
:global t
:group 'org-remark
(if org-remark-global-tracking-mode
;; Enable
(add-hook 'find-file-hook #'org-remark-auto-on)
;; Disable
(remove-hook 'find-file-hook #'org-remark-auto-on)))
;;; Functions
(defun org-remark-notes-file-name-function ()
"Return a marginal notes file name for the current buffer.
This is the default function for the customizing variable
`org-remark-notes-file-name' for its function option.
When the current buffer is visiting a file, the name of marginal
notes file will be \"FILE-notes.org\", adding \"-notes.org\" as a
suffix to the file name without the extension.
If the current buffer is not visiting a file, the file name will
be marginalia.org in your `user-emacs-directory'. If this file
name is not suitable, either override the function or set the
user option to use your own custom function."
(if buffer-file-name
(let ((source-filename (org-remark-source-find-file-name)))
(when (and (stringp source-filename)
(file-exists-p source-filename))
(concat (file-name-sans-extension
(file-name-nondirectory source-filename))
"-notes.org")))
;; If buffer is not visiting a file, we use the default file name.
;; If this file name is not suitable, either override the function
;; or set the user option to a custom function.
(expand-file-name "marginalia.org" user-emacs-directory)))
(defalias
'org-remark-notes-file-path-function
'org-remark-notes-file-name-function)
(make-obsolete
'org-remark-notes-file-path-function
'org-remark-notes-file-name-function "0.2.0" )
;;;; Private Functions
(defun org-remark-auto-on ()
"Automatically activates `org-remark-mode' for current buffer when relevant.
This function is meant to be added to `find-file-hook' by
`org-remark-global-tracking-mode'."
(when-let (notes-file (org-remark-notes-get-file-name))
(when (file-readable-p notes-file)
(unless (featurep 'org-remark) (require 'org-remark))
(org-remark-mode +1))))
(cl-defgeneric org-remark-notes-get-file-name ()
"Return the name of marginal notes file for current buffer.")
(cl-defmethod org-remark-notes-get-file-name ()
"Return the name of marginal notes file for current buffer.
This method is major modes derived from `text-mode'."
(if (functionp org-remark-notes-file-name)
(funcall org-remark-notes-file-name)
(if buffer-file-name org-remark-notes-file-name
(expand-file-name org-remark-notes-file-name user-emacs-directory))))
(defun org-remark-source-find-file-name ()
"Return the filename for the source buffer.
We use this filename to identify the source buffer in all
operations related to marginal notes.
Assumes that we are currently in the source buffer."
(let ((filename (or (and (not (derived-mode-p 'special-mode))
buffer-file-name)
(run-hook-with-args-until-success
'org-remark-source-find-file-name-functions))))
filename))
(provide 'org-remark-global-tracking)
;;; org-remark-global-tracking.el ends here
================================================
FILE: org-remark-icon.el
================================================
;;; org-remark-icon.el --- Enable Org-remark to use icons -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Created: 29 July 2023
;; Last modified: 23 January 2025
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'cl-macs)
;; Silence compiler
(defvar org-remark-default-feature-modes)
(defgroup org-remark-icon nil
"Enable `org-remark' to display glyph/icon indicators."
:group 'org-remark
:prefix "org-remark-icon"
:link '(url-link :tag "GitHub" "https://github.com/nobiot/org-remark"))
(defcustom org-remark-icon-notes "(*)"
"String to be displayed when notes exist for a given highlight.
You can set a function to this user option. In this case, the
function must take one argument, which is FACE. FACE can be a
named face (a symbol), or an anonymous face (plist of face
attributes). The function can ignore them and set its own face
and/or text-property to the string. This means you can return a
string with a display property to show an SVG icon instead of the
underlying string.
Nil means no icon is to be displayed.
If you wants to use image icons (e.g. SVG image icon created with
package `icons', available Emacs 29.1 or higher), you're limited
to a single character with no space before and after the
character. This limitation does not apply to string of characters
without images, but it is generally assumed that the the value
set to this customizing variable will be a short string (e.g 3
characters long with a pair of parentheses before and after a
single character, such as the default value.)"
:safe #'stringp
:type '(choice
(string "(*)")
(function)))
(defcustom org-remark-icon-position-adjusted "(d)"
"String to be displayed when a highlight position adjusted.
You can set a function to this user option. In this case, the
function must take one argument, which is FACE. FACE can be a
named face (a symbol), or an anonymous face (plist of face
attributes). The function can ignore them and set its own face
and/or text-property to the string. This means you can return a
string with a display property to show an SVG icon instead of the
underlying string.
Nil means no icon is to be displayed.
If you wants to use image icons (e.g. SVG image icon created with
package `icons', available Emacs 29.1 or higher), you're limited
to a single character with no space before and after the
character. This limitation does not apply to string of characters
without images, but it is generally assumed that the the value
set to this customizing variable will be a short string (e.g 3
characters long with a pair of parentheses before and after a
single character, such as the default value."
:safe #'stringp
:type '(choice
(string "(d)")
(function)))
;; Register a mode for automatic enablement at the same time as
;; `org-remark-mode'.
(add-to-list 'org-remark-default-feature-modes #'org-remark-icon-mode)
;;;###autoload
(define-minor-mode org-remark-icon-mode
"Enable Org-remark to display icons.
The icons currently available are defined in `org-remark-icons'."
:global nil
:group 'org-remark
(if org-remark-icon-mode
;; Enable
(progn
(add-hook 'org-remark-highlights-toggle-hide-functions
#'org-remark-icon-toggle-hide nil :local)
(add-hook 'org-remark-highlights-toggle-show-functions
#'org-remark-icon-toggle-show :local)
;; Add-icons should be the last function because other functions may do
;; something relevant for an icon -- e.g. adjust-positon."
(add-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-add-icons-maybe 80 :local))
;; Disable
(remove-hook 'org-remark-highlights-toggle-hide-functions
#'org-remark-icon-toggle-hide :local)
(remove-hook 'org-remark-highlights-toggle-show-functions
#'org-remark-icon-toggle-show :local)
(remove-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-add-icons-maybe :local)))
(defvar org-remark-icons
(list
(list 'notes
#'org-remark-icon-notes-p
nil)
(list 'position-adjusted
#'org-remark-icon-position-adjusted-p
'org-remark-highlighter-warning))
"List of icons enabled.
It is an alist. Each element is a list of this form:
(ICON-NAME PREDICATE DEFAULT-FACE)
ICON-NAME must be a symbol such as \\='notes\\=' and
\\='position-adjusted\\='. They are used as a suffix to be added to
\\='org-remark-icon-\\=' to form a customizing variable such as
`org-remark-icon-notes' and `org-remark-icon-position-adjusted'.
PREDICATE must be a function that accepts one argument OV, which
is the highlight overlay. If PREDICATE returns non-nil, the icon
for ICON-NAME will be added to the highlight.
DEFAULT FACE must be a named face. It is optinal and can be nil.")
(defun org-remark-icon-notes-p (ov)
(and org-remark-icon-notes
(overlay-get ov '*org-remark-note-body)))
(defun org-remark-icon-position-adjusted-p (ov)
(and org-remark-icon-position-adjusted
(overlay-get ov '*org-remark-position-adjusted)))
(defun org-remark-icon-toggle-hide (highlight)
(overlay-put highlight '*org-remark-icons (overlay-get highlight 'after-string))
(overlay-put highlight 'after-string nil))
(defun org-remark-icon-toggle-show (highlight)
(overlay-put highlight 'after-string (overlay-get highlight '*org-remark-icons))
(overlay-put highlight '*org-remark-icons nil))
(defun org-remark-highlights-add-icons-maybe (overlays _notes-buf)
"Add icons to OVERLAYS.
Each overlay is a highlight."
(dolist (ov overlays)
;; icons added to line highlighters differently from normal ones.
(cl-flet ((add-icon-maybe (icon)
(cl-destructuring-bind
(icon-name pred default-face) icon
(when (funcall pred ov)
(org-remark-icon-propertize icon-name ov default-face)))))
(let ((icon-string
;; The third arg of `mapconcat' is not optional in Emacs 28 or lower.
(mapconcat #'add-icon-maybe org-remark-icons nil)))
(when (length> icon-string 0)
(org-remark-icon-overlay-put
ov icon-string
(overlay-get ov 'org-remark-type)))))))
(cl-defgeneric org-remark-icon-overlay-put (_ov _icon-string _org-remark-type)
"Default method to deal with icon.
This is used when a method specific \\='org-remark-type\\=' not
implemented."
(ignore))
(cl-defmethod org-remark-icon-overlay-put (ov icon-string (_org-remark-type (eql nil)))
(overlay-put ov 'after-string icon-string))
(defun org-remark-icon-propertize (icon-name highlight default-face)
"Return a propertized string.
ICON-NAME is a symbol such as \\='notes\\=' and
\\='position-adjusted\\='. They are used as a suffix to be added
to \\='org-remark-icon-\\=' to form an ICON, which is a
customizing variable such as `org-remark-icon-notes' and
`org-remark-icon-position-adjusted'.
HIGHLIGHT is the current highlight overlay being worked on. It is
useful to obtain its face to add the matching face to the
icon (HIGHLIGHT-FACE).
DEFAULT-FACE is the default face for the ICON. It can be nil, in
which case the face of the HIGHLIGHT should be used. This
depends on the value of ICON.
ICON is a customizing variable, it can be set to a string. In
this case, the DEFAULT-FACE is used when available; if not,
HIGHLIGHT-FACE. ICON can also be a function. In this case, three
arguments are pass to it: ICON-NAME, HIGHLIGHT-FACE, and
DEFAULT-FACE. It is up to the function whether or not to use any
of them. All it needs to do is to return a string that represents
an icon, typically propertized with a face."
(let ((icon (symbol-value (intern (concat "org-remark-icon-"
(symbol-name icon-name)))))
(highlight-face (org-remark-icon-highlight-get-face
highlight
(overlay-get highlight 'org-remark-type)))
(default-face default-face))
(if (functionp icon)
(funcall icon icon-name highlight-face default-face)
(propertize icon 'face (if default-face default-face highlight-face)))))
(cl-defgeneric org-remark-icon-highlight-get-face (highlight _org-remark-type)
"Return the face of the HIGHLIGHT overlay.
This is default method for range-highlights."
(overlay-get highlight 'face))
(provide 'org-remark-icon)
;;; org-remark-icon.el ends here
================================================
FILE: org-remark-info.el
================================================
;;; org-remark-info.el --- Support Org-remark with Info-mode -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Created: 16 July 2023
;; Last modified: 23 January 2025
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; This file is an Org-remark extension to add highlights and
;; annotation support for Info-mode.
;;
;; The extension can be enabled globally with `org-remark-info-mode'
;;
;; Highlights will include the links to the original with using
;; `ol-info' (Org mode's info: link type). By default, it opens the
;; node within the same window as the Org buffer, which is not
;; convenient for the purpose of Org-remark. You can configure Emacs to
;; open info: link into another window. See an example of such a
;; customization below:
;;
;; (setopt switch-to-buffer-obey-display-actions t)
;; (add-to-list 'display-buffer-alist
;; '("\*info\*.*"
;; (display-buffer-reuse-mode-window)
;; (mode . Info-mode)))
;;
;; You will need to use `org-remark-info-mode' in conjunction with
;; `org-remark-global-tracking-mode' and `org-remark-mode'. For more,
;; refer to the following Info node:
;;
;; - Info node `(org-remark) Installation'
;; - Info node `(org-remark) Getting Started'
;;; Code:
(require 'ol-info)
(require 'info)
(require 'org-remark-global-tracking)
(defvar org-remark-prop-source-file)
(defvar org-remark-mode)
(declare-function org-remark-highlights-load "org-remark")
(declare-function org-remark-mode "org-remark")
;;;###autoload
(define-minor-mode org-remark-info-mode
"Enable Org-remark to work with `Info-mode' for Info documentation reader."
:global t
:group 'org-remark-info
(if org-remark-info-mode
;; Enable
(progn
(add-hook 'org-remark-source-find-file-name-functions
#'org-remark-info-get-node)
(add-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-info-link)
(add-hook 'Info-selection-hook #'org-remark-info-highlights-load))
;; Disable
(remove-hook 'org-remark-source-find-file-name-functions
#'org-remark-info-get-node)
(remove-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-info-link)
(remove-hook 'Info-selection-hook #'org-remark-info-highlights-load)))
(defun org-remark-info-highlights-load (&rest _args)
"Wrapper for `org-remark-highlights-load'.
It is necessary as this function is intended to be used as part
of advice for `Info-goto-node', which gets arguments passed to
it. `org-remark-highlights-load' should be called with no
arguments for the purpose of `org-remark-info-mode'."
;; Enabling `org-remark-mode' runs `org-remark-highlights-load', which
;; would result in duplicating the highlights. As this function should
;; be run only once for initial load or only once for subsequent
;; re-load. This `if' statement is to differentiate the initial load
;; when no Info node has been opened from subsequent reloads when the
;; user moves to another Info node. In addition, `featurep' is used
;; because variable `org-remark-mode' may not have been loaded yet to
;; avoid symbol void.
(if (or (not (featurep 'org-remark))
(not org-remark-mode))
(org-remark-mode +1)
(org-remark-highlights-load)))
(defun org-remark-info-get-node ()
"Return the current Info file/node."
(when (eq major-mode 'Info-mode)
(concat (file-name-nondirectory Info-current-file)
"/"
Info-current-node)))
(defun org-remark-info-link (_filname _point)
"Return \"info:\" link with current point in `Info-mode' buffer.
This function only works when the mode is `Info-mode'.
Assume the point is on the highlight in source Info document
buffer and `ol-info' is loaded. The latter is necessary for
`org-store-link' to work wiht Info buffer."
(when (eq major-mode 'Info-mode)
(org-store-link nil nil)))
(cl-defmethod org-remark-highlight-get-constructors (&context (major-mode Info-mode))
"Construct lists for creating MAJOR-MODE specific hierarchy.
This method is for `Info-mode'. Return the value in a alist like
this:
(SOURCE-FILENAME-FN TITLE-FN PROP-TO-FIND)"
(let* ((headline-1 (list
;; SOURCE-FILENAME-FN
;; Don't include the full directory path for Info
;; node. This may change when Emacs version or
;; package version changes.
(lambda () (file-name-nondirectory Info-current-file))
;; TITLE-FN
(lambda () (file-name-nondirectory Info-current-file))
;; PROP-TO-FIND
"org-remark-info-file"))
(headline-2 (list
;; SOURCE-FILENAME-FN
#'org-remark-info-get-node
;; TITLE-FN
(lambda () Info-current-node)
;; PROP-TO-FIND
org-remark-prop-source-file))
(headline-constructors (list headline-1 headline-2)))
headline-constructors))
(provide 'org-remark-info)
;;; org-remark-info.el ends here
================================================
FILE: org-remark-line.el
================================================
;;; org-remark-line.el --- Enable Org-remark to highlight a line -*- lexical-binding: t; -*-
;; Copyright (C) 2021-2025 Free Software Foundation, Inc.
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-remark
;; Created: 01 August 2023
;; Last modified: 23 January 2025
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
;; This file is not part of GNU Emacs.
;; 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 3 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, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'org-remark)
(defgroup org-remark-line nil
"Enable`org-remark' to highlight and annotate whole lines."
:group 'org-remark
:prefix "org-remark-line"
:link '(url-link :tag "GitHub" "https://github.com/nobiot/org-remark"))
(defcustom org-remark-line-icon " * "
"Glyph displayed on the margin to indicate the line-highlight.
If you wants to use image icons (e.g. SVG image icon created with
package `icons', available Emacs 29.1 or higher), you're limited
to a single character with no space before and after the
character. This limitation does not apply to string of characters
without images, but it is generally assumed that the the value
set to this customizing variable will be a short string (e.g 3
characters long with a padding spaces before and after a single
character, such as the default value.)"
:local t
:type 'string
:safe 'stringp)
(defcustom org-remark-line-minimum-margin-width 3
"Margin width in a natural number.
It can be a single number or a cons cell of two. When it is a
single number, both the left and right margin widths will be the
same. When this customizing variable is a cons cell, the format
is as follows: (LEFT-MARGIN-WIDTH . RIGHT-MARGIN-WIDTH)."
:local t
:type '(choice
(natnum :tag "Minimum margin width for both left and right margins" 3)
(cons :tag "Left and right margin widths" natnum natnum)))
(defcustom org-remark-line-margin-padding 1
"Padding between the main text area the glyph/icon on the margin."
:local t
:type 'natnum)
(defcustom org-remark-line-margin-side 'left-margin
"The side of margin to display line highlights.
Left or right can be chosen."
:local t
:type '(radio
(const :tag "Left margin" left-margin)
(const :tag "Right margin" right-margin)))
(defcustom org-remark-line-heading-title-max-length 40
"Maximum length of string included as the highlight title."
:type 'natnum)
(defcustom org-remark-line-ellipsis "…"
"Ellipsis used when the highlight title is longer than maximum.
The maximum is set in `org-remark-line-heading-title-max-length'."
:type 'string
:safe 'stringp)
(defface org-remark-line-highlighter
'((((class color) (min-colors 88) (background light))
:foreground "#dbba3f" :inherit default)
(((class color) (min-colors 88) (background dark))
:foreground "#e2d980" :inherit default)
(t
:inherit highlight))
"Face for the default line highlighter pen.")
(defvar-local org-remark-line-minimum-left-margin-width nil
"Computed minimum `left-margin' width.")
(defvar-local org-remark-line-minimum-right-margin-width nil
"Computed minimum `right-margin' width.")
(defvar-local org-remark-line-margins-original '()
"Original window margin width values.
It is the original margins returned by function `window-margins'
in cons cell (or nil) before function
`org-remark-line-set-window-margins' set margins.")
(defvar-local org-remark-line-margins-set-p nil
"Status indicating if margins are set by `org-remark-line'.")
;;;###autoload
(define-minor-mode org-remark-line-mode
"Enable Org-remark to highlight and annotate the whole line."
:global nil
:group 'org-remark
(if org-remark-line-mode
;; Enable
(progn
;; Depth is deeper than the default one for range-highlight.
;; This is to prioritize it over line-highlight when the fomer
;; is at point and yet on the same line of another
;; line-highlight.
(add-hook 'org-remark-find-dwim-functions
#'org-remark-line-find 80 :local)
;; olivetti sets DEPTH to t (=90). We need go lower priority than it
(add-hook 'window-size-change-functions
#'org-remark-line-set-window-margins 95 :local)
;; Need to reload to cater to margin changes done by `olivetti'.
(add-hook 'window-size-change-functions
#'org-remark-line-highlights-redraw 96 :local)
(add-hook 'org-remark-highlight-other-props-functions
#'org-remark-line-prop-line-number-get)
(org-remark-line-set-window-margins))
;; Disable
(remove-hook 'org-remark-find-dwim-functions #'org-remark-line-find :local)
(remove-hook 'window-size-change-functions
#'org-remark-line-set-window-margins :local)
(remove-hook 'window-size-change-functions
#'org-remark-line-highlights-redraw :local)
(remove-hook 'org-remark-highlight-other-props-functions
#'org-remark-line-prop-line-number-get)
(when org-remark-line-margins-set-p
(setq left-margin-width (car org-remark-line-margins-original))
(setq right-margin-width (cdr org-remark-line-margins-original))
(set-window-margins nil left-margin-width right-margin-width)
(set-window-buffer (get-buffer-window) (current-buffer) nil)
(setq org-remark-line-minimum-left-margin-width nil)
(setq org-remark-line-minimum-right-margin-width nil)
(setq org-remark-line-margins-set-p nil))))
;; Default line-highlighter pen
;;;###autoload
(defun org-remark-mark-line (_beg _end &optional _id _mode)
"Apply face to the region selected by BEG and END.
Dummy function definition to let autoload work.
The actual implementation is added when this library is loaded
and macro `org-remark-create' creates the actual function.")
(org-remark-create "line"
`org-remark-line-highlighter
`(org-remark-type line))
(defun org-remark-line-set-window-margins (&optional window)
"Set the margins of WINDOW or window that displays current buffer.
Return a cons of the form (LEFT-WIDTH . RIGHT-WIDTH). If a
marginal area does not exist, return nil."
(let ((window (or window (get-buffer-window))))
(when (and (windowp window) (not (window-minibuffer-p window)))
(cl-destructuring-bind (left-width . right-width) (window-margins)
(unless org-remark-line-margins-set-p
(setq org-remark-line-margins-original (window-margins))
(setq org-remark-line-margins-set-p t)
(setq org-remark-line-minimum-left-margin-width
(+ (if (numberp org-remark-line-minimum-margin-width)
org-remark-line-minimum-margin-width
(car org-remark-line-minimum-margin-width))
org-remark-line-margin-padding))
(setq org-remark-line-minimum-right-margin-width
(+ (if (numberp org-remark-line-minimum-margin-width)
org-remark-line-minimum-margin-width
(cdr org-remark-line-minimum-margin-width))
org-remark-line-margin-padding)))
(if (or (eq left-width nil) (< left-width
org-remark-line-minimum-left-margin-width))
(setq left-margin-width org-remark-line-minimum-left-margin-width)
(setq left-margin-width left-width))
(if (or (eq right-width nil) (< right-width
org-remark-line-minimum-right-margin-width))
(setq right-margin-width org-remark-line-minimum-right-margin-width)
(setq right-margin-width right-width))
;; For `set-window-margins' window should be specified.
;; Howerver, `set-window-buffer' should get nil for window.
;; Otherwise, the minibuffer also gets the margins. It's a
;; little tricky behaviour. Both functions seem to be required.
;; The former changes the current window's margin display
;; immediately. The latter makes the margin widths the default
;; for future, when window gets split, etc.
(set-window-margins window left-margin-width right-margin-width)
(set-window-buffer nil (current-buffer) 'keep-margins)
(window-margins)))))
(defun org-remark-line-pos-bol (pos)
"Return the beginning of the line position for POS."
(save-excursion
(goto-char pos)
(pos-bol)))
(defun org-remark-line-highlight-p (highlight)
"Return t if HIGHLIGHT is one for the line.
HIGHLIGHT is an overlay."
(eql 'line (overlay-get highlight 'org-remark-type)))
(defun org-remark-line-find (&optional point)
"Return the line-highight (overlay) of the current line.
When POINT is passed, one for the line it belongs to. If there
are multiple line-hilights, return the car of the list returned
by `overlays-in'."
(let* ((point (or point (point)))
(bol (org-remark-line-pos-bol point))
(highlights (overlays-in bol bol)))
(seq-find #'org-remark-line-highlight-p highlights)))
(defun org-remark-line-prop-line-number-get (highlight)
"Return the line number for HIGHLIGHT overlay.
This happens only when HIGHLIGHT is a line-highlight."
(when (org-remark-line-highlight-p highlight)
(list 'org-remark-line-number
(number-to-string (org-current-line (overlay-start highlight))))))
(cl-defmethod org-remark-beg-end ((_org-remark-type (eql 'line)))
"Return beg and end for ORG-REMARK-TYPE line."
(let ((bol (org-remark-line-pos-bol (point))))
(list bol bol)))
(defun org-remark-line-make-spacer-overlay (pos)
"Return a spacer overlay at POS."
(let* ((left-margin (or (car (window-margins)) left-margin-width))
;;(right-margin (or (cdr (window-margins)) right-margin-width))
(string-length (length org-remark-line-icon))
(spaces-base-length (if (eql org-remark-line-margin-side 'right-margin)
org-remark-line-margin-padding
(- left-margin
(+ string-length org-remark-line-margin-padding))))
(spaces-length (if (> spaces-base-length 0) spaces-base-length 0))
(spacer-ov (make-overlay pos pos nil :front-advance)))
;; Add a spacing overlay before the line-highlight overlay but we
;; only need one of these; remove it if one already exits
(remove-overlays (overlay-start spacer-ov) (overlay-end spacer-ov)
'category 'org-remark-spacer)
(overlay-put spacer-ov 'before-string
(propertize " "
'display
`((margin ,org-remark-line-margin-side)
(space . (:width ,spaces-length)))))
(overlay-put spacer-ov 'category 'org-remark-spacer)
spacer-ov))
(defun org-remark-line-highlights-redraw (&optional window)
"Redraw line-highlights to adjust the spaces/padding.
When WINDOW is nil, this function gets window that current buffer is displayed."
(let ((window (or window (get-buffer-window))))
(when (and (windowp window) (not (window-minibuffer-p window)))
(org-with-wide-buffer
(let ((highlights
(seq-filter (lambda (ov) (eql 'line (overlay-get ov 'org-remark-type)))
org-remark-highlights)))
(dolist (ov highlights)
(let* ((beg (overlay-start ov))
(spacer-ov (org-remark-line-make-spacer-overlay beg))
(copied-highlight (copy-overlay ov))
(display-props
(get-text-property 0 'display (overlay-get copied-highlight 'before-string))))
(setf (car display-props) `(margin ,org-remark-line-margin-side))
(push copied-highlight org-remark-highlights)
(copy-overlay spacer-ov)
(delete-overlay ov)
(org-remark-highlights-housekeep)
(org-remark-highlights-sort))))))))
(defun org-remark-line-highlight-propertize (ov icon-string)
"Propertize ICON-STRING and add it to OV."
;; If the icon-string has a display properties, assume it is an icon image
(let ((display-prop (get-text-property 0 'display icon-string)))
(cond (display-prop ; svg-based icon
(let* ((display-prop (list `(margin ,org-remark-line-margin-side) display-prop))
;; TODO margin needs to be calculated
;; (list `(margin ,org-remark-line-margin-side)
;; (append display-prop '(:margin (10 . 0))))))
(icon-face (get-text-property 0 'face icon-string))
(icon-string (propertize " " 'display display-prop)))
(when icon-face
(setq icon-string (propertize icon-string 'face icon-face)))
(overlay-put ov 'before-string icon-string)))
(icon-string ; text/string-based icon
(let ((icon-string icon-string))
(overlay-put
ov
'before-string
(propertize
" " 'display
(list `(margin ,org-remark-line-margin-side) icon-string)))))
(t (ignore)))))
(cl-defmethod org-remark-highlight-make-overlay (beg end face (_org-remark-type (eql 'line)))
"Make and return a highlight overlay in BEG END for line-highlight.
This function adds FACE to line icon string. If FACE is nil, this
function uses default `org-remark-line-highlighter'. Return nil
when no window is created for current buffer."
(when (get-buffer-window)
(unless org-remark-line-mode (org-remark-line-mode +1))
(let* ((face (or face 'org-remark-line-highlighter))
(string (propertize org-remark-line-icon 'face face))
(spacer-ov (org-remark-line-make-spacer-overlay beg))
(ov (make-overlay beg end nil :front-advance)))
;; line-highlight overlay
(org-remark-line-highlight-propertize ov string)
;; Let highlight overlay to take care of the spacer movement
(overlay-put ov 'insert-in-front-hooks (list 'org-remark-line-highlight-modified))
;; Copy spacer overlay. It is put after the line-highlight to
;; limit and reset the face added by the line-highlight back to
;; default. This is especially done for RTL languages and when the
;; face include a background color different from that of default.
;; Without it, the background color goes all the way to the end of
;; the right margin.
(copy-overlay spacer-ov)
ov)))
(defun org-remark-line-highlight-find-spacers (pos)
"Find the two spacers for POS."
(let ((highlights (overlays-in pos pos)))
(seq-filter (lambda (ov)
(eql 'org-remark-spacer (overlay-get ov 'category)))
highlights)))
(defun org-remark-line-highlight-modified (ov after-p beg _end &optional _length)
"Move spacers and lighlight OV to follow the point.
Without this function, the line-highlighter mark does not move
when the user press RET to add a newline at the beginning of the
line-highlight. This is unintuitive for the user.
This function is meant to be added to insert-in-front-hooks of
the overlay that represents line-highlight. It must be called
AFTER-P is non-nil and move BEG to one position forward."
(when after-p
(save-excursion (goto-char beg)
(when (looking-at "\n")
;; The sequence must be 1. spacer; 2. highlight 3. spacer
(let ((spacers (org-remark-line-highlight-find-spacers beg)))
(when spacers
(move-overlay (pop spacers) (1+ beg) (1+ beg)))
(move-overlay ov (1+ beg) (1+ beg))
(when spacers
(move-overlay (pop spacers) (1+ beg) (1+ beg))))))))
(cl-defmethod org-remark-highlight-headline-text (ov (_org-remark-type (eql 'line)))
"Return the first N characters of the highlighted line OV.
N is customized with `org-remark-line-heading-title-max-length'.
If the line starts with any space or tab, they will be trimmed.
If the line (after trimming) is shorter than N, then this
function will include the charcters up to the newline char.
In addition, if the text happens to be empty, the function uses
\"Empty line highlight\" as the fallback; headlines with no title
is not considered valid for the purpose of `org-remark' and thus
risks unexpected results (mostly the highlight skipped when
loading highlights)."
(let ((line-text (buffer-substring-no-properties
(overlay-start ov) (pos-eol))))
(if (or (eq line-text nil)
(string= line-text ""))
"Empty line highlight"
(setq line-text (string-trim-left line-text))
(if (length< line-text
(1+ org-remark-line-heading-title-max-length))
line-text
(concat (substring line-text 0 org-remark-line-heading-title-max-length)
org-remark-line-ellipsis)))))
(cl-defmethod org-remark-highlights-adjust-positions-p ((_org-remark-type (eql 'line)))
"Return t if adjust-positions feature is relevant.
For line-highlights, adjust-positions is not relevant."
nil)
(cl-defmethod org-remark-highlights-housekeep-delete-p (_ov (_org-remark-type (eql 'line)))
"Always return nil when ORG-REMARK-TYPE is \\='line\\='.
Line-highlights are designed to be zero length with the start and
end of overlay being identical."
nil)
(cl-defmethod org-remark-highlights-housekeep-per-type (ov (_org-remark-type (eql 'line)))
"Ensure line-highlight OV is always at the beginning of line."
;; if `pos-bol' is used to move, you can actually get the highlight to
;; always follow the point, keeping the original place unless you
;; directly change the notes. That's not really an intutive behaviour,
;; though in some cases, it imay be useful.
;; (if (not (overlay-start ov)) (delete-overlay ov)
(when (overlay-buffer ov)
(let* ((ov-start (overlay-start ov))
(ov-line-bol (org-remark-line-pos-bol ov-start)))
(unless (= ov-start ov-line-bol)
(move-overlay ov ov-line-bol ov-line-bol)))))
(cl-defmethod org-remark-icon-overlay-put (ov icon-string (_org-remark-type (eql 'line)))
"Add ICON-STRING to OV.
Each overlay is a highlight. Return nil when no window is created
for current buffer."
(when (get-buffer-window)
(org-remark-line-highlight-propertize ov icon-string)))
(cl-defmethod org-remark-icon-highlight-get-face (highlight (_org-remark-type (eql 'line)))
"Return the face of HIGHLIGHT in margin for line-highlight."
(let* ((before-string (overlay-get highlight 'before-string))
(face (get-text-property 0 'face before-string)))
;; When the highlight already is an SVG icon, face is in the display
;; property of before-string
(unless face
(let ((display-string
(cadr (get-text-property 0 'display before-stri
gitextract_gk7ypw4z/ ├── .dir-locals.el ├── .elpaignore ├── .github/ │ └── workflows/ │ └── gh-docs.yml ├── .gitignore ├── CHANGELOG ├── LICENSE ├── Makefile ├── NEWS ├── README-elpa ├── README.org ├── docs/ │ ├── .nojekyll │ ├── Makefile │ ├── articles/ │ │ ├── 2023-08-20T183400_how-to-buffer-window.org │ │ └── 2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md │ ├── fdl.texi │ ├── marginalia.org │ ├── org-remark.org │ └── resources/ │ ├── manual.css │ ├── reset.css │ └── style.css ├── org-remark-convert-legacy.el ├── org-remark-eww.el ├── org-remark-global-tracking.el ├── org-remark-icon.el ├── org-remark-info.el ├── org-remark-line.el ├── org-remark-nov.el └── org-remark.el
Condensed preview — 28 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (297K chars).
[
{
"path": ".dir-locals.el",
"chars": 396,
"preview": "((nil\n (time-stamp-format . \"%02d %:B %Y\")\n (time-stamp-start . \"modified:[ ]+\\\\\\\\?\")\n (time-stamp-end . \"$\")\n "
},
{
"path": ".elpaignore",
"chars": 85,
"preview": "demo\ntest\ntest*\ndocs\nresources\nMakefile\n.gitignore\n.elpaignore\n.github\n.dir-locals.el"
},
{
"path": ".github/workflows/gh-docs.yml",
"chars": 670,
"preview": "name: GH-Page AutoGen\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n build-and-depl"
},
{
"path": ".gitignore",
"chars": 119,
"preview": "*/#marginalia.org#\n*.bak\n*.log\n\n*.elc\n\ntest\ntest*\n\n# ELPA-generated files.\n/org-remark-autoloads.el\n/org-remark-pkg.el\n"
},
{
"path": "CHANGELOG",
"chars": 2940,
"preview": "[More recent changes v1.0.0 are in NEWS file]\n\nVersion 0.2.0\n - add: org-remark-delete\n - rm: Adding Org-ID automatica"
},
{
"path": "LICENSE",
"chars": 35149,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Makefile",
"chars": 565,
"preview": "# For ELPA, below should be added to the spec:\n# (\"org-remark\"\t:url \"https://github.com/nobiot/org-remark\"\n# :make \"REA"
},
{
"path": "NEWS",
"chars": 11612,
"preview": "Current development version\n\n Fixes:\n\n - fix: When the notes = source, the title is incorrect #97\n\nVersion 1.3.0 -"
},
{
"path": "README-elpa",
"chars": 8323,
"preview": " _____________________\n\n README – ORG-REMARK\n _"
},
{
"path": "README.org",
"chars": 9367,
"preview": "#+title: README – Org-remark\n#+options: toc:t creator:nil author:nil broken-links:t\n\n#+html: <a href=\"https://www.gnu.or"
},
{
"path": "docs/.nojekyll",
"chars": 0,
"preview": ""
},
{
"path": "docs/Makefile",
"chars": 867,
"preview": ".POSIX:\nEMACS = emacs\nMAKEINFO = makeinfo\nINSTALLINFO = install-info\nMV = mv\nRM = rm\nMANUAL_HTML_ARGS =--html --no-split"
},
{
"path": "docs/articles/2023-08-20T183400_how-to-buffer-window.org",
"chars": 84,
"preview": "Buffer window customization #43\nhttps://github.com/nobiot/org-remark/discussions/43\n"
},
{
"path": "docs/articles/2023-08-20T184309_C_how-to-set-icons-to-be-svg-images.md",
"chars": 2701,
"preview": "---\ntitle: How to Set Org-remark to Use SVG Icons\ncreated: 2023-08-20\nmodified: 16 September 2023\ncategory: #creatio"
},
{
"path": "docs/fdl.texi",
"chars": 23434,
"preview": "@c The GNU Free Documentation License.\n@center Version 1.3, 3 November 2008\n\n@c This file is intended to be included wit"
},
{
"path": "docs/marginalia.org",
"chars": 701,
"preview": ":PROPERTIES:\n:ID: 2022-01-15T093859\n:END:\n\n* Org-remark User Manual\n:PROPERTIES:\n:org-remark-file: ~/src/org-remar"
},
{
"path": "docs/org-remark.org",
"chars": 42156,
"preview": "#+title: Org-remark User Manual\n#+author: Noboru Ota <me@nobiot.com>\n#+macro: version 1.3.x\n#+macro: modified 01 Februar"
},
{
"path": "docs/resources/manual.css",
"chars": 980,
"preview": "/* Style-sheet to use for Emacs manuals */\n\n/* Copyright (C) 2013-2022 Free Software Foundation, Inc.\n\nCopying and dist"
},
{
"path": "docs/resources/reset.css",
"chars": 2596,
"preview": "/*\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2006, Yahoo! Inc.\nAll rights reserved.\n\nRedistribution and us"
},
{
"path": "docs/resources/style.css",
"chars": 4731,
"preview": "/* This stylesheet is used by manuals and a few older resources. */\n\n@import url('reset.css');\n\n\n/*** PAGE LAYOUT ***/"
},
{
"path": "org-remark-convert-legacy.el",
"chars": 4563,
"preview": ";;; org-remark-convert-legacy.el --- Convert legacy Org-marginalia files to Org-remark -*- lexical-binding: t; -*-\n\n;; C"
},
{
"path": "org-remark-eww.el",
"chars": 3115,
"preview": ";;; org-remark-eww.el --- Enable Org-remark for EWW -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2021-2025 Free Softwar"
},
{
"path": "org-remark-global-tracking.el",
"chars": 6459,
"preview": ";;; org-remark-global-tracking.el --- Track files and auto-activate Org-remark -*- lexical-binding: t; -*-\n\n;; Copyright"
},
{
"path": "org-remark-icon.el",
"chars": 9391,
"preview": ";;; org-remark-icon.el --- Enable Org-remark to use icons -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2021-2025 Free S"
},
{
"path": "org-remark-info.el",
"chars": 6088,
"preview": ";;; org-remark-info.el --- Support Org-remark with Info-mode -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2021-2025 Fre"
},
{
"path": "org-remark-line.el",
"chars": 19796,
"preview": ";;; org-remark-line.el --- Enable Org-remark to highlight a line -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2021-2025"
},
{
"path": "org-remark-nov.el",
"chars": 6805,
"preview": ";;; org-remark-nov.el --- Compatibility with nov-mode -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2021-2025 Free Softw"
},
{
"path": "org-remark.el",
"chars": 83813,
"preview": ";;; org-remark.el --- Highlight & annotate text, Info, EPUB, EWW -*- lexical-binding: t; -*-\n\n;; Copyright (C) 2020-2025"
}
]
About this extraction
This page contains the full source code of the nobiot/org-remark GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 28 files (280.8 KB), approximately 68.9k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.