diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/calendar.texi | 318 | ||||
| -rw-r--r-- | doc/emacs/custom.texi | 109 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 9 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 3 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 41 | ||||
| -rw-r--r-- | doc/emacs/package.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 43 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 34 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 72 | ||||
| -rw-r--r-- | doc/lispref/sequences.texi | 15 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 16 | ||||
| -rw-r--r-- | doc/misc/dbus.texi | 151 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 10 | ||||
| -rw-r--r-- | doc/misc/widget.texi | 14 |
18 files changed, 657 insertions, 216 deletions
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index d57d0b442f9..957cfbd9d8f 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi | |||
| @@ -1005,7 +1005,7 @@ entries. | |||
| 1005 | * Adding to Diary:: Commands to create diary entries. | 1005 | * Adding to Diary:: Commands to create diary entries. |
| 1006 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. | 1006 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. |
| 1007 | * Appointments:: Reminders when it's time to do something. | 1007 | * Appointments:: Reminders when it's time to do something. |
| 1008 | * Importing Diary:: Converting diary events to/from other formats. | 1008 | * Diary Conversion:: Converting diary events to/from other formats. |
| 1009 | @end menu | 1009 | @end menu |
| 1010 | 1010 | ||
| 1011 | @node Format of Diary File | 1011 | @node Format of Diary File |
| @@ -1549,71 +1549,287 @@ clock. The command @kbd{M-x appt-add} adds entries to the appointment | |||
| 1549 | list without affecting your diary file. You delete entries from the | 1549 | list without affecting your diary file. You delete entries from the |
| 1550 | appointment list with @kbd{M-x appt-delete}. | 1550 | appointment list with @kbd{M-x appt-delete}. |
| 1551 | 1551 | ||
| 1552 | @node Importing Diary | 1552 | @node Diary Conversion |
| 1553 | @subsection Importing and Exporting Diary Entries | 1553 | @subsection Importing and Exporting Diary Entries |
| 1554 | @cindex importing diary entries | 1554 | @cindex diary import |
| 1555 | @cindex diary export | ||
| 1555 | 1556 | ||
| 1556 | You can transfer diary entries between Emacs diary files and a | 1557 | You can transfer diary entries between Emacs diary files and other |
| 1557 | variety of other formats. | 1558 | formats. |
| 1558 | 1559 | ||
| 1559 | @vindex diary-outlook-formats | 1560 | @menu |
| 1560 | You can import diary entries from Outlook-generated appointment | 1561 | * Diary iCalendar Import:: Importing iCalendar data to the Diary. |
| 1561 | messages. While viewing such a message in Rmail or Gnus, do @kbd{M-x | 1562 | * Diary iCalendar Display:: Displaying iCalendar data without importing. |
| 1562 | diary-from-outlook} to import the entry. You can make this command | 1563 | * Diary iCalendar Export:: Exporting Diary entries to iCalendar. |
| 1563 | recognize additional appointment message formats by customizing the | 1564 | * Diary Outlook Import:: Importing Outlook appointments to the Diary. |
| 1564 | variable @code{diary-outlook-formats}. Other mail clients can set | 1565 | @end menu |
| 1565 | @code{diary-from-outlook-function} to an appropriate value. | 1566 | |
| 1567 | @node Diary iCalendar Import | ||
| 1568 | @subsubsection Importing iCalendar data as Diary Entries | ||
| 1569 | @cindex import iCalendar to diary | ||
| 1570 | |||
| 1571 | @cindex iCalendar support in diary | ||
| 1572 | @dfn{iCalendar} is an Internet standard format for exchanging calendar | ||
| 1573 | data. Many calendar applications can export and import data in | ||
| 1574 | iCalendar format. iCalendar data is also often sent as email | ||
| 1575 | attachments. iCalendar data usually uses the @file{.ics} file | ||
| 1576 | extension, and is sent with the `text/calendar' @acronym{MIME} type in | ||
| 1577 | email. (@xref{Mail Misc}, for more information on @acronym{MIME} and | ||
| 1578 | email attachments.) | ||
| 1579 | |||
| 1580 | The @code{diary-icalendar} package allows you to make use of iCalendar | ||
| 1581 | data with the Emacs diary. You can import and export data between | ||
| 1582 | iCalendar format and your Emacs diary file, and also display iCalendar | ||
| 1583 | data directly in the diary. | ||
| 1584 | |||
| 1585 | The following commands will import iCalendar data to your diary file: | ||
| 1566 | 1586 | ||
| 1567 | @c FIXME the name of the RFC is hardly very relevant. | 1587 | @ftable @code |
| 1568 | @cindex iCalendar support | 1588 | @item diary-icalendar-import-file |
| 1569 | The icalendar package allows you to transfer data between your Emacs | 1589 | Imports an iCalendar file to an Emacs diary file. |
| 1570 | diary file and iCalendar files, which are defined in @cite{RFC | 1590 | |
| 1571 | 2445---Internet Calendaring and Scheduling Core Object Specification | 1591 | @item diary-icalendar-import-buffer |
| 1572 | (iCalendar)} (as well as the earlier vCalendar format). | 1592 | Imports iCalendar data from the current buffer to an Emacs diary file. |
| 1573 | 1593 | @end ftable | |
| 1574 | @c Importing works for ordinary (i.e., non-recurring) events, but | 1594 | |
| 1575 | @c (at present) may not work correctly (if at all) for recurring events. | 1595 | @code{diary-icalendar-import-buffer} is also suitable for importing |
| 1576 | @c Exporting of diary files into iCalendar files should work correctly | 1596 | iCalendar data from email attachments. For example, with the Rmail mail |
| 1577 | @c for most diary entries. This feature is a work in progress, so the | 1597 | client, you could use: |
| 1578 | @c commands may evolve in future. | ||
| 1579 | |||
| 1580 | @findex icalendar-import-buffer | ||
| 1581 | The command @code{icalendar-import-buffer} extracts | ||
| 1582 | iCalendar data from the current buffer and adds it to your | ||
| 1583 | diary file. This function is also suitable for automatic extraction of | ||
| 1584 | iCalendar data; for example with the Rmail mail client one could use: | ||
| 1585 | 1598 | ||
| 1586 | @example | 1599 | @example |
| 1587 | (add-hook 'rmail-show-message-hook 'icalendar-import-buffer) | 1600 | (add-hook 'rmail-show-message-hook #'diary-icalendar-import-buffer) |
| 1588 | @end example | 1601 | @end example |
| 1589 | 1602 | ||
| 1590 | @findex icalendar-import-file | 1603 | Diary import depends on a number of user-customizable variables, which |
| 1591 | The command @code{icalendar-import-file} imports an iCalendar file | 1604 | are in the @code{diary-icalendar-import} customization group. You can |
| 1592 | and adds the results to an Emacs diary file. For example: | 1605 | review and customize these variables with @kbd{M-x customize-group}. |
| 1606 | @xref{Customization Groups}. | ||
| 1607 | |||
| 1608 | iCalendar data is grouped into @dfn{components} which represent calendar | ||
| 1609 | events (the VEVENT component), tasks (VTODO), and other text data | ||
| 1610 | (VJOURNAL). Because these components contain different types of data, | ||
| 1611 | they are imported by different functions, determined by the following | ||
| 1612 | variables: | ||
| 1613 | |||
| 1614 | @vtable @code | ||
| 1615 | @item diary-icalendar-vevent-format-function | ||
| 1616 | Function to format VEVENT components for the diary. | ||
| 1617 | |||
| 1618 | @item diary-icalendar-vjournal-format-function | ||
| 1619 | Function to format VJOURNAL components for the diary. | ||
| 1620 | |||
| 1621 | @item diary-icalendar-vtodo-format-function | ||
| 1622 | Function to format VTODO components for the diary. | ||
| 1623 | @end vtable | ||
| 1624 | |||
| 1625 | You can customize the format of the imported diary entries by writing | ||
| 1626 | your own formatting functions. It is convenient (but not required) to | ||
| 1627 | express such functions as templates called @dfn{skeletons}. | ||
| 1628 | @ifinfo | ||
| 1629 | @xref{Top, Autotyping, The Autotype Manual, autotype}, for more about | ||
| 1630 | skeletons. | ||
| 1631 | @end ifinfo | ||
| 1632 | |||
| 1633 | For example, suppose you only want to import the date, time, summary, | ||
| 1634 | and location of each calendar event, and to write them on a single line | ||
| 1635 | like: | ||
| 1593 | 1636 | ||
| 1594 | @example | 1637 | @example |
| 1595 | (icalendar-import-file "/here/is/calendar.ics" | 1638 | 2025/11/11 Summary @@ Some Location |
| 1596 | "/there/goes/ical-diary") | ||
| 1597 | @end example | 1639 | @end example |
| 1598 | 1640 | ||
| 1599 | @noindent | 1641 | @noindent |
| 1600 | You can use an @code{#include} directive to add the import file contents | 1642 | Then you could write the import formatting function as a skeleton and |
| 1601 | to the main diary file, if these are different files. | 1643 | set it to the value of @code{diary-icalendar-vevent-format-function} as |
| 1602 | @iftex | 1644 | follows: |
| 1603 | @xref{Fancy Diary Display,,, emacs-xtra, Specialized Emacs Features}. | 1645 | |
| 1604 | @end iftex | 1646 | @lisp |
| 1605 | @ifnottex | 1647 | @group |
| 1606 | @xref{Fancy Diary Display}. | 1648 | (require 'skeleton) |
| 1607 | @end ifnottex | 1649 | |
| 1650 | (defun simple-vevent (_) | ||
| 1651 | "Format a VEVENT summary and location on a single line" | ||
| 1652 | (skeleton-insert | ||
| 1653 | '(nil | ||
| 1654 | ical-start-to-end & " " & ical-summary & " " | ||
| 1655 | (when ical-location "@@ ") & ical-location "\n"))) | ||
| 1656 | |||
| 1657 | (setopt diary-icalendar-vevent-format-function #'simple-vevent) | ||
| 1658 | @end group | ||
| 1659 | @end lisp | ||
| 1660 | |||
| 1661 | The variables @code{ical-start-to-end}, @code{ical-summary} and | ||
| 1662 | @code{ical-location} in this example are dynamically bound to | ||
| 1663 | appropriate values when the skeleton is called. See the docstring of | ||
| 1664 | @code{diary-icalendar-vevent-format-function} for more information. | ||
| 1665 | |||
| 1666 | Any errors encountered during import will be reported in a buffer named | ||
| 1667 | @file{*icalendar-errors*}. You can review these errors with the | ||
| 1668 | @code{next-error} command. @xref{Compilation Mode}. If you regularly | ||
| 1669 | need to import malformed iCalendar data, there are several hooks | ||
| 1670 | available for this purpose; see the @code{icalendar-parser} | ||
| 1671 | customization group. | ||
| 1672 | |||
| 1673 | @node Diary iCalendar Display | ||
| 1674 | @subsubsection Displaying iCalendar entries in the Diary | ||
| 1675 | @cindex display iCalendar in diary | ||
| 1676 | |||
| 1677 | If you primarily store your calendar data outside of Emacs, but still | ||
| 1678 | want to see it in the Emacs calendar and diary, you can do so by | ||
| 1679 | including an iCalendar file from your diary file. | ||
| 1680 | |||
| 1681 | Suppose, for example, that you download your calendar from an | ||
| 1682 | external server to a file called @file{Appointments.ics}. Then you can | ||
| 1683 | include this file in your diary by writing a line like | ||
| 1608 | 1684 | ||
| 1685 | @example | ||
| 1686 | #include "path/to/Appointments.ics" | ||
| 1687 | @end example | ||
| 1688 | |||
| 1689 | @noindent | ||
| 1690 | in your diary file. You must also set up some hooks to display the | ||
| 1691 | data in that file as diary entries and mark them in the calendar: | ||
| 1692 | |||
| 1693 | @lisp | ||
| 1694 | @group | ||
| 1695 | (add-hook 'diary-mark-entries-hook | ||
| 1696 | #'diary-mark-included-diary-files) | ||
| 1697 | (add-hook 'diary-nongregorian-marking-hook | ||
| 1698 | #'diary-icalendar-mark-entries) | ||
| 1699 | (add-hook 'diary-list-entries-hook | ||
| 1700 | #'diary-include-other-diary-files) | ||
| 1701 | (add-hook 'diary-nongregorian-listing-hook | ||
| 1702 | #'diary-icalendar-display-entries) | ||
| 1703 | @end group | ||
| 1704 | @end lisp | ||
| 1705 | |||
| 1706 | @noindent | ||
| 1707 | Events, tasks, and journal entries in @file{Appointments.ics} will then show | ||
| 1708 | up on the appropriate days when you display the diary from the calendar. | ||
| 1709 | @xref{Displaying the Diary}. | ||
| 1710 | |||
| 1711 | The advantage of doing this is that you don't need to synchronize the | ||
| 1712 | data between the calendar server and your diary file. This is simpler | ||
| 1713 | and more reliable than regularly importing and exporting between diary | ||
| 1714 | and iCalendar format. | ||
| 1715 | |||
| 1716 | @findex diary-icalendar-mailcap-viewer | ||
| 1717 | You can also display iCalendar attachments in email messages | ||
| 1718 | without importing them to your diary file using the function | ||
| 1719 | @code{diary-icalendar-mailcap-viewer}. You can add this function, for | ||
| 1720 | example, to the variable @code{mailcap-user-mime-data}; see its docstring | ||
| 1721 | for more information. | ||
| 1722 | |||
| 1723 | Displaying iCalendar entries uses the same infrastructure as importing | ||
| 1724 | them, so customizing the import format will also change the format of | ||
| 1725 | the displayed entries. @xref{Diary iCalendar Import}. | ||
| 1726 | |||
| 1727 | @node Diary iCalendar Export | ||
| 1728 | @subsubsection Exporting Diary Entries to iCalendar | ||
| 1729 | @cindex export diary to iCalendar | ||
| 1730 | |||
| 1731 | The following commands will export diary entries in iCalendar format: | ||
| 1732 | |||
| 1733 | @ftable @code | ||
| 1734 | @item diary-icalendar-export-file | ||
| 1735 | Exports a diary file to iCalendar format. | ||
| 1736 | |||
| 1737 | @item diary-icalendar-export-region | ||
| 1738 | Exports a region of diary text to iCalendar format. | ||
| 1739 | @end ftable | ||
| 1740 | |||
| 1741 | iCalendar export depends on a number of user-customizable variables, which | ||
| 1742 | are in the @code{diary-icalendar-export} customization group. You can | ||
| 1743 | review and customize these variables with @kbd{M-x customize-group}. | ||
| 1744 | @xref{Customization Groups}. | ||
| 1745 | |||
| 1746 | Exporting diary entries to iCalendar requires you to respect certain | ||
| 1747 | conventions in your diary, so that iCalendar properties can be parsed | ||
| 1748 | from your diary entries. | ||
| 1749 | |||
| 1750 | By default, the exporter will use the first line of the entry (after the | ||
| 1751 | date and time) as the iCalendar summary and the rest of the entry as its | ||
| 1752 | iCalendar description. Other iCalendar properties can also be encoded in | ||
| 1753 | the entry on separate lines, like this: | ||
| 1754 | |||
| 1755 | @example | ||
| 1756 | @group | ||
| 1757 | 2025/11/11 Bender's birthday bash | ||
| 1758 | Location: Robot House | ||
| 1759 | Attendees: | ||
| 1760 | Fry <philip.fry@@mars.edu> | ||
| 1761 | Günter <guenter@@mars.edu> | ||
| 1762 | @end group | ||
| 1763 | @end example | ||
| 1764 | |||
| 1765 | @noindent | ||
| 1766 | This format matches the format produced by the default import | ||
| 1767 | functions. | ||
| 1768 | |||
| 1769 | @vindex diary-icalendar-address-regexp | ||
| 1770 | @vindex diary-icalendar-class-regexp | ||
| 1771 | @vindex diary-icalendar-description-regexp | ||
| 1772 | @vindex diary-icalendar-location-regexp | ||
| 1773 | @vindex diary-icalendar-organizer-regexp | ||
| 1774 | @vindex diary-icalendar-status-regexp | ||
| 1775 | @vindex diary-icalendar-summary-regexp | ||
| 1776 | @vindex diary-icalendar-todo-regexp | ||
| 1777 | @vindex diary-icalendar-uid-regexp | ||
| 1778 | @vindex diary-icalendar-url-regexp | ||
| 1779 | If you customize the import format, or you want to export diary entries | ||
| 1780 | in a different format, you will need to customize the export variables | ||
| 1781 | to detect the format of your diary entries. The most common iCalendar | ||
| 1782 | properties are parsed from diary entries using regular expressions. See | ||
| 1783 | the variables named @code{diary-icalendar-*-regexp} in the | ||
| 1784 | @code{diary-icalendar-export} customization group to modify how these | ||
| 1785 | properties are parsed. | ||
| 1786 | |||
| 1787 | @vindex diary-icalendar-other-properties-parser | ||
| 1788 | If you need to export other iCalendar properties, or do more | ||
| 1789 | complicated parsing, you can define a function to do so and set it as | ||
| 1790 | the value of the variable @code{diary-icalendar-other-properties-parser}; | ||
| 1791 | see its docstring for details. | ||
| 1792 | |||
| 1793 | @vindex diary-icalendar-export-linewise | ||
| 1794 | By default, the exporter assumes that each diary entry represents a | ||
| 1795 | single iCalendar event. If you like to keep your diary in a | ||
| 1796 | one-entry-per-day format, with different events on continuation | ||
| 1797 | lines within the same entry, you can still export such entries as | ||
| 1798 | distinct iCalendar events. To do this, set the variable | ||
| 1799 | @code{diary-icalendar-export-linewise} to a non-nil value. | ||
| 1800 | |||
| 1801 | For example, after setting this variable, an entry like: | ||
| 1802 | |||
| 1803 | @example | ||
| 1804 | @group | ||
| 1805 | 2025-05-03 | ||
| 1806 | 9AM Lab meeting | ||
| 1807 | Günter to present on new assay | ||
| 1808 | Start experiment A | ||
| 1809 | 12:30-1:30PM Lunch with Phil | ||
| 1810 | 16:00 Experiment A finishes; move to freezer | ||
| 1811 | @end group | ||
| 1812 | @end example | ||
| 1813 | |||
| 1814 | @noindent | ||
| 1815 | will be exported as four events, each on the same day, but with | ||
| 1816 | different start times (except for the second event, ``Start experiment | ||
| 1817 | A'', which has no start time). See the docstring of | ||
| 1818 | @code{diary-icalendar-export-linewise} for more information. | ||
| 1819 | |||
| 1820 | @node Diary Outlook Import | ||
| 1821 | @subsubsection Importing Outlook appointments as Diary Entries | ||
| 1822 | @cindex diary outlook import | ||
| 1823 | |||
| 1824 | @vindex diary-outlook-formats | ||
| 1825 | @vindex diary-from-outlook-function | ||
| 1826 | You can also import diary entries from Outlook-generated appointment | ||
| 1827 | messages. While viewing such a message in Rmail or Gnus, do @kbd{M-x | ||
| 1828 | diary-from-outlook} to import the entry. You can make this command | ||
| 1829 | recognize additional appointment message formats by customizing the | ||
| 1830 | variable @code{diary-outlook-formats}. Other mail clients can set | ||
| 1831 | @code{diary-from-outlook-function} to an appropriate value. | ||
| 1609 | 1832 | ||
| 1610 | @findex icalendar-export-file | ||
| 1611 | @findex icalendar-export-region | ||
| 1612 | @cindex export diary | ||
| 1613 | Use @code{icalendar-export-file} to interactively export an entire | ||
| 1614 | Emacs diary file to iCalendar format. To export only a part of a diary | ||
| 1615 | file, mark the relevant area, and call @code{icalendar-export-region}. | ||
| 1616 | In both cases, Emacs appends the result to the target file. | ||
| 1617 | 1833 | ||
| 1618 | @node Daylight Saving | 1834 | @node Daylight Saving |
| 1619 | @section Daylight Saving Time | 1835 | @section Daylight Saving Time |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 7663e2b21df..b2fcb3c489f 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -1615,24 +1615,30 @@ your preference, such as @code{ws-butler-mode}. | |||
| 1615 | @cindex per-connection local variables | 1615 | @cindex per-connection local variables |
| 1616 | 1616 | ||
| 1617 | Most of the variables reflect the situation on the local machine. | 1617 | Most of the variables reflect the situation on the local machine. |
| 1618 | Often, they must use a different value when you operate in buffers | 1618 | Often, they must use a different value when you operate in buffers with |
| 1619 | with a remote default directory. Think about the behavior when | 1619 | a remote default directory. Think about the behavior when calling |
| 1620 | calling @code{shell} -- on your local machine, you might use | 1620 | @code{shell} --- on your local machine, you might use @file{/bin/bash} |
| 1621 | @file{/bin/bash} and rely on termcap, but on a remote machine, it may | 1621 | and rely on termcap, but on a remote machine, it may be @file{/bin/ksh} |
| 1622 | be @file{/bin/ksh} and terminfo. | 1622 | and terminfo. |
| 1623 | 1623 | ||
| 1624 | This can be accomplished with @dfn{connection-local variables}. | 1624 | This can be accomplished with @dfn{connection-local variables}. Such |
| 1625 | Directory and file local variables override connection-local | 1625 | variables are declared depending on the value of |
| 1626 | variables. Unsafe connection-local variables are handled in the same | 1626 | @code{default-directory} of the current buffer. When a buffer has a |
| 1627 | way as unsafe file-local variables (@pxref{Safe File Variables}). | 1627 | remote @code{default-directory}, and there exist a connection-local |
| 1628 | variable which matches @code{default-directory}, this alternative value | ||
| 1629 | of the variable is used. Directory and file local variables override | ||
| 1630 | connection-local variables. Unsafe connection-local variables are | ||
| 1631 | handled in the same way as unsafe file-local variables (@pxref{Safe File | ||
| 1632 | Variables}). | ||
| 1628 | 1633 | ||
| 1629 | @findex connection-local-set-profile-variables | 1634 | @findex connection-local-set-profile-variables |
| 1630 | @findex connection-local-set-profiles | 1635 | @findex connection-local-set-profiles |
| 1631 | Connection-local variables are declared as a group of | 1636 | Connection-local variables are declared as a group of variables/value |
| 1632 | variables/value pairs in a @dfn{profile}, using the | 1637 | pairs in a @dfn{profile}, using the |
| 1633 | @code{connection-local-set-profile-variables} function. The function | 1638 | @code{connection-local-set-profile-variables} function. The function |
| 1634 | @code{connection-local-set-profiles} activates profiles for a given | 1639 | @code{connection-local-set-profiles} declares profiles for a given |
| 1635 | criteria, identifying a remote machine: | 1640 | criteria (the first argument), identifying a remote machine with respect |
| 1641 | to @code{default-directory} of the current buffer: | ||
| 1636 | 1642 | ||
| 1637 | @example | 1643 | @example |
| 1638 | (connection-local-set-profile-variables 'remote-terminfo | 1644 | (connection-local-set-profile-variables 'remote-terminfo |
| @@ -1654,12 +1660,46 @@ criteria, identifying a remote machine: | |||
| 1654 | 1660 | ||
| 1655 | This code declares three different profiles, @code{remote-terminfo}, | 1661 | This code declares three different profiles, @code{remote-terminfo}, |
| 1656 | @code{remote-ksh}, and @code{remote-bash}. The profiles | 1662 | @code{remote-ksh}, and @code{remote-bash}. The profiles |
| 1657 | @code{remote-terminfo} and @code{remote-ksh} are applied to all | 1663 | @code{remote-terminfo} and @code{remote-ksh} are applied to all buffers |
| 1658 | buffers which have a remote default directory matching the regexp | 1664 | which have a remote @code{default-directory} matching the string |
| 1659 | @code{"remotemachine"} as host name. Such a criteria can also | 1665 | @code{"remotemachine"} as host name. |
| 1660 | discriminate for the properties @code{:protocol} (this is the Tramp | 1666 | |
| 1661 | method) or @code{:user} (a remote user name). The @code{nil} criteria | 1667 | Criteria, the first argument of @code{connection-local-set-profiles}, |
| 1662 | matches all buffers with a remote default directory. | 1668 | specifies, how the profiles match @code{default-directory}. It is a |
| 1669 | plist identifying a connection and the application using this | ||
| 1670 | connection. Property names might be @code{:application}, | ||
| 1671 | @code{:protocol}, @code{:user} and @code{:machine}. The property value | ||
| 1672 | of @code{:application} is a symbol, all other property values are | ||
| 1673 | strings. In general the symbol @code{tramp} should be used as | ||
| 1674 | @code{:application} value. Some packages use a different | ||
| 1675 | @code{:application} (for example @code{eshell} or @code{vc-git}); they | ||
| 1676 | say it in their documentation then. All properties are optional. | ||
| 1677 | |||
| 1678 | The other properties are used for checking @code{default-directory}. | ||
| 1679 | The propertiy @code{:protocol} is used for the method a remote | ||
| 1680 | @code{default-directory} uses, the property | ||
| 1681 | @code{:user} is the remote user name, and the property @code{:machine} | ||
| 1682 | is the remote host name. All checks are performed via | ||
| 1683 | @code{string-equal}. The @code{nil} criteria matches all buffers | ||
| 1684 | with a remote default directory. | ||
| 1685 | |||
| 1686 | Connection-local variables are not activated by default. A package | ||
| 1687 | which uses connection-local variables must activate them for a given | ||
| 1688 | buffer, specifying for which @code{:application} it uses them. | ||
| 1689 | @xref{Applying Connection Local Variables,,, elisp, The Emacs Lisp | ||
| 1690 | Reference Manual}, for details. | ||
| 1691 | |||
| 1692 | After the above definition of profiles and their activation, any | ||
| 1693 | connection made by Tramp to the @samp{remotemachine} system will use | ||
| 1694 | |||
| 1695 | @itemize | ||
| 1696 | @item @code{t} as the connection-specific value of @code{system-uses-terminfo}, | ||
| 1697 | @item @samp{dumb-emacs-ansi} as the connection-specific value of | ||
| 1698 | @code{comint-terminfo-terminal}, | ||
| 1699 | @item @samp{/bin/ksh} as the connection-specific value of as | ||
| 1700 | @code{shell-file-name}, | ||
| 1701 | @item @samp{-c} as the connection-specific value of @code{shell-command-switch}. | ||
| 1702 | @end itemize | ||
| 1663 | 1703 | ||
| 1664 | Be careful when declaring different profiles with the same variable, | 1704 | Be careful when declaring different profiles with the same variable, |
| 1665 | and setting these profiles to criteria which could match in parallel. | 1705 | and setting these profiles to criteria which could match in parallel. |
| @@ -3098,30 +3138,33 @@ elisp, The Emacs Lisp Reference Manual}. | |||
| 3098 | If the directory specified by @code{user-lisp-directory}, defaulting | 3138 | If the directory specified by @code{user-lisp-directory}, defaulting |
| 3099 | to @file{~/.config/emacs/user-lisp/} or @file{~/.emacs.d/user-lisp/}, | 3139 | to @file{~/.config/emacs/user-lisp/} or @file{~/.emacs.d/user-lisp/}, |
| 3100 | exists, then at startup Emacs will prepare Lisp files within that | 3140 | exists, then at startup Emacs will prepare Lisp files within that |
| 3101 | directory for use in the session. Emacs does the following things: | 3141 | directory for use in the session. Specifically, Emacs does the |
| 3142 | following: | ||
| 3102 | 3143 | ||
| 3103 | @itemize | 3144 | @itemize |
| 3104 | @item | 3145 | @item |
| 3105 | Gather and activate autoload cookies. This means that you can use | 3146 | Gather and activate autoload cookies. This means that you can use |
| 3106 | autoloaded commands and other entry points for the files in your | 3147 | autoloaded commands and other entry points for the files in your |
| 3107 | @code{user-lisp-directory} without explicitly loading any of the | 3148 | @code{user-lisp-directory} without explicitly loading any of the |
| 3108 | files in your initialization file. (@pxref{Autoload,,, elisp, The | 3149 | files in your initialization file. @xref{Autoload,,, elisp, The |
| 3109 | Emacs Lisp Reference Manual}.) | 3150 | Emacs Lisp Reference Manual}. |
| 3110 | @item | 3151 | @item |
| 3111 | Byte-compile all files, and if supported on your system, natively | 3152 | Byte-compile all the files (@pxref{Byte Compilation,,, elisp, The Emacs |
| 3112 | compile them too. This speeds up the execution of the code in the | 3153 | Lisp Reference Manual}), and if supported by your build of Emacs, |
| 3113 | files when they are loaded. (@pxref{Byte Compilation,,, elisp, The | 3154 | compile them to native code as well (@pxref{Native Compilation,,, elisp, |
| 3114 | Emacs Lisp Reference Manual}.) | 3155 | The Emacs Lisp Reference Manual}). This speeds up the execution of the |
| 3156 | code in those files when they are loaded and when they are executed | ||
| 3157 | later. | ||
| 3115 | @item | 3158 | @item |
| 3116 | Adjust @code{load-path} such that all the files can be loaded and | 3159 | Adjust @code{load-path} such that all the files can be loaded and |
| 3117 | autoloaded in the usual ways. (@pxref{Library Search,,, elisp, The | 3160 | autoloaded in the usual ways. @xref{Library Search,,, elisp, The |
| 3118 | Emacs Lisp Reference Manual}.) | 3161 | Emacs Lisp Reference Manual}. |
| 3119 | @end itemize | 3162 | @end itemize |
| 3120 | 3163 | ||
| 3121 | The User Lisp directory is processed before loading the @ref{Init | 3164 | The User Lisp directory is processed before loading your init file |
| 3122 | File} file. Therefore any customizations to the user options discussed | 3165 | (@pxref{Init File}). Therefore any customizations to the user |
| 3123 | below must be made in your early init file (@pxref{Early Init File}) in | 3166 | options discussed below must be made in your early init file |
| 3124 | order to have any effect. | 3167 | (@pxref{Early Init File}) in order to have any effect. |
| 3125 | 3168 | ||
| 3126 | @vindex user-lisp-ignored-directories | 3169 | @vindex user-lisp-ignored-directories |
| 3127 | @vindex user-lisp-auto-scrape | 3170 | @vindex user-lisp-auto-scrape |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 49a3ba57b1c..05ced62dd9c 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -1020,7 +1020,14 @@ The Diary | |||
| 1020 | * Adding to Diary:: Commands to create diary entries. | 1020 | * Adding to Diary:: Commands to create diary entries. |
| 1021 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. | 1021 | * Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. |
| 1022 | * Appointments:: Reminders when it's time to do something. | 1022 | * Appointments:: Reminders when it's time to do something. |
| 1023 | * Importing Diary:: Converting diary events to/from other formats. | 1023 | * Diary Conversion:: Converting diary events to/from other formats. |
| 1024 | |||
| 1025 | Diary Conversion | ||
| 1026 | |||
| 1027 | * Diary iCalendar Import:: Importing iCalendar data to the Diary. | ||
| 1028 | * Diary iCalendar Display:: Displaying iCalendar data without importing. | ||
| 1029 | * Diary iCalendar Export:: Exporting Diary entries to iCalendar. | ||
| 1030 | * Diary Outlook Import:: Importing Outlook appointments to the Diary. | ||
| 1024 | 1031 | ||
| 1025 | @ifnottex | 1032 | @ifnottex |
| 1026 | More advanced features of the Calendar and Diary | 1033 | More advanced features of the Calendar and Diary |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 567c1492518..a9bcee0b060 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1835,7 +1835,8 @@ the start of the @var{n}th previous file. | |||
| 1835 | 1835 | ||
| 1836 | @findex diff-hunk-kill | 1836 | @findex diff-hunk-kill |
| 1837 | @item M-k | 1837 | @item M-k |
| 1838 | Kill the hunk at point (@code{diff-hunk-kill}). | 1838 | Kill the hunk at point (@code{diff-hunk-kill}). If the region is |
| 1839 | active, kills all hunks the region overlaps. | ||
| 1839 | 1840 | ||
| 1840 | @findex diff-file-kill | 1841 | @findex diff-file-kill |
| 1841 | @item M-K | 1842 | @item M-K |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index aebe31b478e..1d54af130a9 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -2323,6 +2323,11 @@ configuration (if any), excluding the ``ignored'' files from the output. | |||
| 2323 | It has some performance optimizations for listing the files with some of | 2323 | It has some performance optimizations for listing the files with some of |
| 2324 | the popular VCS systems (currently Git and Mercurial). | 2324 | the popular VCS systems (currently Git and Mercurial). |
| 2325 | 2325 | ||
| 2326 | @findex project-remember-projects-under | ||
| 2327 | It also uses a time-based cache. If the mode line shows stale project | ||
| 2328 | information, you can type @kbd{M-x project-remember-projects-under RET} | ||
| 2329 | to refresh the stale cached info. | ||
| 2330 | |||
| 2326 | @defopt project-vc-include-untracked | 2331 | @defopt project-vc-include-untracked |
| 2327 | By default, files which are neither registered with nor ignored by the | 2332 | By default, files which are neither registered with nor ignored by the |
| 2328 | VCS are considered part of the project. Customize this variable to nil | 2333 | VCS are considered part of the project. Customize this variable to nil |
| @@ -2569,12 +2574,13 @@ files, and build a database of these references. A backend can then | |||
| 2569 | access this database whenever it needs to list or look up references. | 2574 | access this database whenever it needs to list or look up references. |
| 2570 | The Emacs distribution includes @command{etags}, a command for tagging | 2575 | The Emacs distribution includes @command{etags}, a command for tagging |
| 2571 | identifier definitions in programs, which supports many programming | 2576 | identifier definitions in programs, which supports many programming |
| 2572 | languages and other major modes, such as HTML, by extracting | 2577 | languages and other major modes, such as HTML, by extracting references |
| 2573 | references into @dfn{tags tables}. @xref{Create Tags Table}. Major | 2578 | into @dfn{tags tables}. Major modes for languages supported by |
| 2574 | modes for languages supported by @command{etags} can use tags tables | 2579 | @command{etags} can use tags tables as basis for their backend. Enable |
| 2575 | as basis for their backend. (One disadvantage of this kind of backend | 2580 | @code{etags-regen-mode} to have tags tables generated across the current |
| 2576 | is that tags tables need to be kept reasonably up to date, by | 2581 | project for supported file types and updated automatically upon edit. |
| 2577 | rebuilding them from time to time.) | 2582 | Alternatively, you can build the table manually to control the set of |
| 2583 | files and when it is updated, see @ref{Create Tags Table}. | ||
| 2578 | @end enumerate | 2584 | @end enumerate |
| 2579 | 2585 | ||
| 2580 | @menu | 2586 | @menu |
| @@ -2648,6 +2654,9 @@ to always prompt, customize @code{xref-prompt-for-identifier} to | |||
| 2648 | usual minibuffer completion commands (@pxref{Completion}), with the | 2654 | usual minibuffer completion commands (@pxref{Completion}), with the |
| 2649 | known identifier names being the completion candidates. | 2655 | known identifier names being the completion candidates. |
| 2650 | 2656 | ||
| 2657 | It uses the current Xref backend, and will signal an error when there | ||
| 2658 | is none configured, with some recommendations. | ||
| 2659 | |||
| 2651 | @kindex C-x 4 . | 2660 | @kindex C-x 4 . |
| 2652 | @findex xref-find-definitions-other-window | 2661 | @findex xref-find-definitions-other-window |
| 2653 | @kindex C-x 5 . | 2662 | @kindex C-x 5 . |
| @@ -3028,7 +3037,9 @@ writes the tags to a @dfn{tags table file}, or @dfn{tags file} in | |||
| 3028 | short. The conventional name for a tags file is @file{TAGS}@. | 3037 | short. The conventional name for a tags file is @file{TAGS}@. |
| 3029 | @xref{Create Tags Table}. (It is also possible to create a tags table | 3038 | @xref{Create Tags Table}. (It is also possible to create a tags table |
| 3030 | by using one of the commands from other packages that can produce such | 3039 | by using one of the commands from other packages that can produce such |
| 3031 | tables in the same format.) | 3040 | tables in the same format.) If you enable the @code{etags-regen-mode} |
| 3041 | global minor mode, Emacs will generate and update the tags tables | ||
| 3042 | automatically as needed. | ||
| 3032 | 3043 | ||
| 3033 | Emacs uses the tags tables via the @code{etags} package as one of | 3044 | Emacs uses the tags tables via the @code{etags} package as one of |
| 3034 | the supported backends for @code{xref}. Because tags tables are | 3045 | the supported backends for @code{xref}. Because tags tables are |
| @@ -3310,6 +3321,10 @@ You should update a tags table when you define new tags that you want | |||
| 3310 | to have listed, or when you move tag definitions from one file to | 3321 | to have listed, or when you move tag definitions from one file to |
| 3311 | another, or when changes become substantial. | 3322 | another, or when changes become substantial. |
| 3312 | 3323 | ||
| 3324 | If the @code{etags-regen-mode} minor mode, described below, is | ||
| 3325 | enabled, Emacs will automatically keep the tags tables up-to-date as | ||
| 3326 | needed. | ||
| 3327 | |||
| 3313 | You can make a tags table @dfn{include} another tags table, by | 3328 | You can make a tags table @dfn{include} another tags table, by |
| 3314 | passing the @samp{--include=@var{file}} option to @command{etags}. It | 3329 | passing the @samp{--include=@var{file}} option to @command{etags}. It |
| 3315 | then covers all the files covered by the included tags file, as well | 3330 | then covers all the files covered by the included tags file, as well |
| @@ -3418,11 +3433,11 @@ Command-line options to pass to the program which regenerates tags | |||
| 3418 | tables. | 3433 | tables. |
| 3419 | 3434 | ||
| 3420 | @item etags-regen-ignores | 3435 | @item etags-regen-ignores |
| 3421 | List of glob patterns which specify files to ignore when regenerating | 3436 | List of glob wildcard patterns which specify files to ignore when |
| 3422 | tags tables. | 3437 | regenerating tags tables. |
| 3423 | @end vtable | 3438 | @end vtable |
| 3424 | 3439 | ||
| 3425 | @cindex tags-reset-tags-tables | 3440 | @findex tags-reset-tags-tables |
| 3426 | If you select a tags table manually, with @kbd{M-x visit-tags-table} | 3441 | If you select a tags table manually, with @kbd{M-x visit-tags-table} |
| 3427 | (@pxref{Select Tags Table}), @code{etags-regen-mode} effectively | 3442 | (@pxref{Select Tags Table}), @code{etags-regen-mode} effectively |
| 3428 | disables itself: it will no longer automatically create and update | 3443 | disables itself: it will no longer automatically create and update |
| @@ -3607,6 +3622,12 @@ to the first directory that contains a file named @file{TAGS} | |||
| 3607 | encountered when recursively searching upward from the default | 3622 | encountered when recursively searching upward from the default |
| 3608 | directory. | 3623 | directory. |
| 3609 | 3624 | ||
| 3625 | If you enable the @code{etags-regen-mode} global minor mode, it will | ||
| 3626 | automatically find and visit the tags table file when needed. If you | ||
| 3627 | then invoke @code{visit-tags-table} manually to select a tags table, | ||
| 3628 | @code{etags-regen-mode} will disable automatic regeneration of the tags | ||
| 3629 | table. @xref{Create Tags Table}. | ||
| 3630 | |||
| 3610 | @vindex tags-file-name | 3631 | @vindex tags-file-name |
| 3611 | Emacs does not actually read in the tags table contents until you | 3632 | Emacs does not actually read in the tags table contents until you |
| 3612 | try to use them; all @code{visit-tags-table} does is store the file | 3633 | try to use them; all @code{visit-tags-table} does is store the file |
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index e6432678c62..fdb0822e85c 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi | |||
| @@ -454,6 +454,17 @@ case, Emacs retrieves packages from this archive via ordinary file | |||
| 454 | access. Such local archives are mainly useful for testing. | 454 | access. Such local archives are mainly useful for testing. |
| 455 | @end defopt | 455 | @end defopt |
| 456 | 456 | ||
| 457 | @cindex suggestions | ||
| 458 | @findex package-autosuggest | ||
| 459 | @findex package-autosuggest-mode | ||
| 460 | Emacs has a built-in database of suggested packages for certain file | ||
| 461 | types. If Emacs opens a file with no specific mode, you can use the | ||
| 462 | @code{package-autosuggest} command to install the recommended packages | ||
| 463 | from ELPA. After enabling @code{package-autosuggest-mode}, Emacs will | ||
| 464 | display a clickable hint in the mode-line if it there is a suggested | ||
| 465 | package. Using the @code{package-autosuggest-style} user option, you | ||
| 466 | can adjust how Emacs presents the hint to install a package. | ||
| 467 | |||
| 457 | @anchor{Package Signing} | 468 | @anchor{Package Signing} |
| 458 | @cindex package security | 469 | @cindex package security |
| 459 | @cindex package signing | 470 | @cindex package signing |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index bd31798d431..0583179ed31 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -2778,12 +2778,12 @@ To test the signal handler, you can make Emacs send a signal to itself: | |||
| 2778 | @end smallexample | 2778 | @end smallexample |
| 2779 | 2779 | ||
| 2780 | @cindex @code{sleep-event} event | 2780 | @cindex @code{sleep-event} event |
| 2781 | @item (sleep-event @var{sleep-wake}) | 2781 | @item (sleep-event @var{state}) |
| 2782 | This event is injected when the device Emacs is running on enters or | 2782 | This event is injected when the device Emacs is running on is about to |
| 2783 | leaves the sleep state. A non-@code{nil} @var{sleep-wake} indicates | 2783 | enter a sleep state, or has just awoken from one. @var{state} will be |
| 2784 | entering the sleep state. | 2784 | the symbol @code{pre-sleep} or @code{post-wake}. |
| 2785 | 2785 | ||
| 2786 | This is implemented only on GNU/Linux. | 2786 | This is implemented on GNU/Linux, macOS, and MS-Windows. |
| 2787 | 2787 | ||
| 2788 | @cindex @code{language-change} event | 2788 | @cindex @code{language-change} event |
| 2789 | @item language-change | 2789 | @item language-change |
| @@ -4062,7 +4062,8 @@ definition to find the actual event. | |||
| 4062 | user signals like @code{sigusr1} are normally handled in this way. | 4062 | user signals like @code{sigusr1} are normally handled in this way. |
| 4063 | The keymap which defines how to handle special events---and which | 4063 | The keymap which defines how to handle special events---and which |
| 4064 | events are special---is in the variable @code{special-event-map} | 4064 | events are special---is in the variable @code{special-event-map} |
| 4065 | (@pxref{Controlling Active Maps}). | 4065 | (@pxref{Controlling Active Maps}). @xref{Misc Events}, for more details |
| 4066 | about these and other special events. | ||
| 4066 | 4067 | ||
| 4067 | @defun insert-special-event | 4068 | @defun insert-special-event |
| 4068 | @cindex inserting special events | 4069 | @cindex inserting special events |
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index a4776030cf2..85e13952cfb 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -1493,25 +1493,27 @@ argument: | |||
| 1493 | @subsection The @code{cond*} macro | 1493 | @subsection The @code{cond*} macro |
| 1494 | @findex cond*@r{, a macro} | 1494 | @findex cond*@r{, a macro} |
| 1495 | 1495 | ||
| 1496 | The @code{cond*} macro is an alternative to @code{pcase}, and supports | 1496 | You can use the @code{cond*} macro as an alternative to @code{pcase} |
| 1497 | the same functionality, but using syntax that some might find less | 1497 | if you find @code{pcase}'s syntax too cryptic. In addition, |
| 1498 | cryptic. | 1498 | @code{cond*} offers some new forms of control flow that aren't related |
| 1499 | to being an alternative to @code{pcase}. | ||
| 1499 | 1500 | ||
| 1500 | @defmac cond* &rest clauses | 1501 | @defmac cond* &rest clauses |
| 1501 | The @code{cond*} macro is an extended form of the traditional | 1502 | The @code{cond*} macro is an extended form of the traditional |
| 1502 | @code{cond}. A @code{cond*} expression contains a series of | 1503 | @code{cond}. A @code{cond*} expression contains a series of |
| 1503 | @var{clauses}, each of which can use @code{bind*} to specify binding | 1504 | @var{clauses}, each of which can use @code{bind*} or @code{bind-and*} to |
| 1504 | variables, use @code{match*} to specify matching a pattern as a | 1505 | specify binding variables, use @code{match*} or @code{pcase*} to specify |
| 1505 | condition, or specify an expression as a condition to evaluate as a | 1506 | matching a pattern as a condition, or specify an expression as a |
| 1506 | test. | 1507 | condition to evaluate as a test. |
| 1507 | 1508 | ||
| 1508 | Each clause normally has the form @w{@code{(@var{condition} | 1509 | Each clause normally has the form @w{@code{(@var{condition} |
| 1509 | @var{body}@dots{})}}. | 1510 | @var{body}@dots{})}}. |
| 1510 | 1511 | ||
| 1511 | @var{condition} can be a Lisp expression, as in @code{cond} | 1512 | @var{condition} can be a Lisp expression, as in @code{cond} |
| 1512 | (@pxref{Conditionals}). Or it can be @w{@code{(bind* | 1513 | (@pxref{Conditionals}). Or it can be @w{@code{(bind* |
| 1513 | @var{bindings}@dots{})}} or @w{@code{(match* @var{pattern} | 1514 | @var{bindings}@dots{})}}, @w{@code{(match* @var{pattern} @var{datum})}}, |
| 1514 | @var{datum})}}. | 1515 | @w{@code{(bind-and* @var{bindings}@dots{})}} or @w{@code{(pcase* |
| 1516 | @var{pattern} @var{datum})}} | ||
| 1515 | 1517 | ||
| 1516 | @findex bind* | 1518 | @findex bind* |
| 1517 | @code{(bind* @var{bindings}@dots{})} means to bind @var{bindings} (like | 1519 | @code{(bind* @var{bindings}@dots{})} means to bind @var{bindings} (like |
| @@ -1536,21 +1538,22 @@ bind to the parts of @var{datum} that they match. | |||
| 1536 | @code{(pcase* @var{pattern} @var{datum})} works in the same way except it | 1538 | @code{(pcase* @var{pattern} @var{datum})} works in the same way except it |
| 1537 | uses the Pcase syntax for @var{pattern}. | 1539 | uses the Pcase syntax for @var{pattern}. |
| 1538 | 1540 | ||
| 1539 | @code{bind*}, @code{match*}, and @code{pcase*} normally bind their bindings over | 1541 | @code{match*}, and @code{pcase*} normally bind their bindings over the |
| 1540 | the execution of the whole containing clause. However, if the clause is | 1542 | execution of the whole containing clause. However, if the clause is |
| 1541 | written to specify ``non-exit'', the clause's bindings cover the whole | 1543 | written to specify ``non-exit'' (see below), the clause's bindings cover |
| 1542 | rest of the @code{cond*}. | 1544 | the whole rest of the @code{cond*}. |
| 1543 | 1545 | ||
| 1544 | When a clause's condition is true, and it exits the @code{cond*} or is | 1546 | When a clause's condition is true, and it exits the @code{cond*} or is |
| 1545 | the last clause, the value of the last expression in the clause's body | 1547 | the last clause, the value of the last expression in the clause's body |
| 1546 | becomes the return value of the @code{cond*} construct. | 1548 | becomes the return value of the @code{cond*} construct. |
| 1547 | 1549 | ||
| 1548 | @subheading Non-exit clause | 1550 | @subheading Non-exit clauses |
| 1549 | 1551 | ||
| 1550 | If a clause has only one element, or if its first element is @code{t}, | 1552 | If a clause has only one element, or if its first element is @code{t} or |
| 1551 | or if it ends with the keyword @code{:non-exit}, then this clause never | 1553 | a @code{bind*} form, or if it ends with the keyword @code{:non-exit}, |
| 1552 | exits the @code{cond*} construct. Instead, control falls through to the | 1554 | then this clause never exits the @code{cond*} construct. Instead, |
| 1553 | next clause (if any). The bindings made in @var{condition} for the | 1555 | control falls through to the next clause (if any). Except for a |
| 1556 | @code{bind-and*} clause, the bindings made in @var{condition} for the | ||
| 1554 | @var{body} of the non-exit clause are passed along to the rest of the | 1557 | @var{body} of the non-exit clause are passed along to the rest of the |
| 1555 | clauses in this @code{cond*} construct. | 1558 | clauses in this @code{cond*} construct. |
| 1556 | 1559 | ||
| @@ -2344,7 +2347,9 @@ the other usual filtering mechanisms say it should. @xref{Error Debugging}. | |||
| 2344 | The macro @code{condition-case-unless-debug} provides another way to | 2347 | The macro @code{condition-case-unless-debug} provides another way to |
| 2345 | handle debugging of such forms. It behaves exactly like | 2348 | handle debugging of such forms. It behaves exactly like |
| 2346 | @code{condition-case}, unless the variable @code{debug-on-error} is | 2349 | @code{condition-case}, unless the variable @code{debug-on-error} is |
| 2347 | non-@code{nil}, in which case it does not handle any errors at all. | 2350 | non-@code{nil}, in which case it causes Emacs to enter the debugger |
| 2351 | before executing any applicable handler. (The applicable handler, if | ||
| 2352 | any, will still run when the debugger exits.) | ||
| 2348 | @end defmac | 2353 | @end defmac |
| 2349 | 2354 | ||
| 2350 | Once Emacs decides that a certain handler handles the error, it | 2355 | Once Emacs decides that a certain handler handles the error, it |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 4211b435db5..464c0badc36 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2243,6 +2243,9 @@ means hide the excess parts of @var{string} with a @code{display} text | |||
| 2243 | property (@pxref{Display Property}) showing the ellipsis, instead of | 2243 | property (@pxref{Display Property}) showing the ellipsis, instead of |
| 2244 | actually truncating the string. | 2244 | actually truncating the string. |
| 2245 | 2245 | ||
| 2246 | See also the function @code{truncate-string-pixelwise} for pixel-level | ||
| 2247 | resolution. | ||
| 2248 | |||
| 2246 | @example | 2249 | @example |
| 2247 | @group | 2250 | @group |
| 2248 | (truncate-string-to-width "\tab\t" 12 4) | 2251 | (truncate-string-to-width "\tab\t" 12 4) |
| @@ -2440,6 +2443,37 @@ non-@code{nil}, use any face remappings (@pxref{Face Remapping}) from | |||
| 2440 | that buffer when computing the width of @var{string}. | 2443 | that buffer when computing the width of @var{string}. |
| 2441 | @end defun | 2444 | @end defun |
| 2442 | 2445 | ||
| 2446 | @defun truncate-string-pixelwise string max-pixels &optional buffer ellipsis ellipsis-pixels | ||
| 2447 | This is a convenience function that uses @code{window-text-pixel-size} | ||
| 2448 | to truncate @var{string} to @var{max-pixels} pixels. Caveat: if you | ||
| 2449 | call this function to measure the width of a string with embedded | ||
| 2450 | newlines, it will then return the width of the widest substring that | ||
| 2451 | does not include newlines. The meaning of this result is the widest | ||
| 2452 | line taken by the string if inserted into a buffer. If @var{buffer} is | ||
| 2453 | non-@code{nil}, use any face remappings (@pxref{Face Remapping}) from | ||
| 2454 | that buffer when computing the width of @var{string}. | ||
| 2455 | |||
| 2456 | If @var{ellipsis} is non-@code{nil}, it should be a string which will | ||
| 2457 | replace the end of @var{string} when it is truncated. In this case, | ||
| 2458 | more characters will be removed from @var{string} to free enough space | ||
| 2459 | for @var{ellipsis} to fit within @var{max-pixels} pixels. However, if | ||
| 2460 | the pixel width of @var{string} is less than the pixel width of | ||
| 2461 | @var{ellipsis}, @var{ellipsis} will not be appended to the result. If | ||
| 2462 | @var{ellipsis} is non-@code{nil} and not a string, it stands for the | ||
| 2463 | value returned by the function @code{truncate-string-ellipsis}, | ||
| 2464 | described above. | ||
| 2465 | |||
| 2466 | If @var{ellipsis-pixels} is non-@code{nil} and @var{ellipsis} is | ||
| 2467 | non-@code{nil}, it should be the number of pixels of @var{ellipsis} that | ||
| 2468 | you should precompute using @code{string-pixel-width}, specifying the | ||
| 2469 | same buffer. This is useful to avoid the cost of recomputing this value | ||
| 2470 | repeatedly when you have many strings to truncate using the same | ||
| 2471 | ellipsis string. | ||
| 2472 | |||
| 2473 | See also the function @code{truncate-string-to-width} for | ||
| 2474 | character-level resolution. | ||
| 2475 | @end defun | ||
| 2476 | |||
| 2443 | @defun line-pixel-height | 2477 | @defun line-pixel-height |
| 2444 | This function returns the height in pixels of the line at point in the | 2478 | This function returns the height in pixels of the line at point in the |
| 2445 | selected window. The value includes the line spacing of the line | 2479 | selected window. The value includes the line spacing of the line |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index c64ec3ea715..5444cea7fa9 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -674,6 +674,7 @@ variable; these two uses of a symbol are independent and do not | |||
| 674 | conflict. (This is not the case in some dialects of Lisp, like | 674 | conflict. (This is not the case in some dialects of Lisp, like |
| 675 | Scheme.) | 675 | Scheme.) |
| 676 | 676 | ||
| 677 | @cindex internal functions, naming conventions | ||
| 677 | By convention, if a function's symbol consists of two names | 678 | By convention, if a function's symbol consists of two names |
| 678 | separated by @samp{--}, the function is intended for internal use and | 679 | separated by @samp{--}, the function is intended for internal use and |
| 679 | the first part names the file defining the function. For example, a | 680 | the first part names the file defining the function. For example, a |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 2214a30c170..13a8ec46a8a 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -5026,7 +5026,7 @@ should return the @var{offset} to use to indent @var{arg} itself. | |||
| 5026 | @item | 5026 | @item |
| 5027 | @code{:elem}, in which case the function should return either the offset | 5027 | @code{:elem}, in which case the function should return either the offset |
| 5028 | to use to indent function arguments (if @var{arg} is the symbol | 5028 | to use to indent function arguments (if @var{arg} is the symbol |
| 5029 | @code{arg}) or the basic indentation step (if @var{arg} is the symbol | 5029 | @code{args}) or the basic indentation step (if @var{arg} is the symbol |
| 5030 | @code{basic}). | 5030 | @code{basic}). |
| 5031 | @item | 5031 | @item |
| 5032 | @code{:list-intro}, in which case @var{arg} is a token and the function | 5032 | @code{:list-intro}, in which case @var{arg} is a token and the function |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index f5ca6efa21b..ccc0f69a12d 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -35,6 +35,7 @@ terminal and the screen. | |||
| 35 | * Session Management:: Saving and restoring state with X Session Management. | 35 | * Session Management:: Saving and restoring state with X Session Management. |
| 36 | * Desktop Notifications:: Desktop notifications. | 36 | * Desktop Notifications:: Desktop notifications. |
| 37 | * System Taskbar:: Controlling system GUI taskbar features. | 37 | * System Taskbar:: Controlling system GUI taskbar features. |
| 38 | * System Sleep:: Block system sleep and process sleep events. | ||
| 38 | * File Notifications:: File notifications. | 39 | * File Notifications:: File notifications. |
| 39 | * Dynamic Libraries:: On-demand loading of support libraries. | 40 | * Dynamic Libraries:: On-demand loading of support libraries. |
| 40 | * Security Considerations:: Running Emacs in an unfriendly environment. | 41 | * Security Considerations:: Running Emacs in an unfriendly environment. |
| @@ -2285,7 +2286,7 @@ be protected by wrapping the timer function body with | |||
| 2285 | 2286 | ||
| 2286 | @lisp | 2287 | @lisp |
| 2287 | @group | 2288 | @group |
| 2288 | (ignore-error 'remote-file-error | 2289 | (ignore-error remote-file-error |
| 2289 | @dots{}) | 2290 | @dots{}) |
| 2290 | @end group | 2291 | @end group |
| 2291 | @end lisp | 2292 | @end lisp |
| @@ -3493,6 +3494,75 @@ Examples of system taskbar functions: | |||
| 3493 | @end group | 3494 | @end group |
| 3494 | @end lisp | 3495 | @end lisp |
| 3495 | 3496 | ||
| 3497 | @node System Sleep | ||
| 3498 | @section Block System Sleep and Process Sleep Events | ||
| 3499 | @cindex system sleep | ||
| 3500 | @cindex mode, system sleep | ||
| 3501 | |||
| 3502 | @defun system-sleep-block-sleep &optional why allow-display-sleep | ||
| 3503 | This function blocks the system from entering its idle sleep state. | ||
| 3504 | |||
| 3505 | It returns a token that must be passed to | ||
| 3506 | @code{system-sleep-unblock-sleep} to unblock this specific block (other | ||
| 3507 | sleep blocks may be simultaneously in force for other purposes). | ||
| 3508 | Otherwise, it returns @code{nil} if the sleep blocking fails. | ||
| 3509 | |||
| 3510 | @var{why} is a string and, when non-@code{nil}, is used to identify the | ||
| 3511 | sleep block as it may appear on the system's inspectable block lists. | ||
| 3512 | It defaults to @samp{Emacs}. | ||
| 3513 | |||
| 3514 | If @var{allow-display-sleep} is non-@code{nil}, allow the display to | ||
| 3515 | sleep. By default, the display is kept active. | ||
| 3516 | |||
| 3517 | Note that when the Emacs process terminates, blocks are released on all | ||
| 3518 | platforms. | ||
| 3519 | @end defun | ||
| 3520 | |||
| 3521 | @defun system-sleep-unblock-sleep token | ||
| 3522 | This function unblocks the sleep block associated with @var{token}. It | ||
| 3523 | returns non-@code{nil} on success, otherwise it returns @code{nil}. | ||
| 3524 | @end defun | ||
| 3525 | |||
| 3526 | @defmac with-system-sleep-block (&optional why allow-display-sleep) body@dots{} | ||
| 3527 | This is a convenience macro that lets you wrap the forms in @var{body} | ||
| 3528 | with a sleep block that is unblocked for you when @var{body} completes. | ||
| 3529 | This guarantees that the system will never go to sleep while @var{body} | ||
| 3530 | executes. The arguments have the same meaning as in | ||
| 3531 | @code{system-sleep-block-sleep}, above. | ||
| 3532 | @end defmac | ||
| 3533 | |||
| 3534 | @defun system-sleep-sleep-blocked-p | ||
| 3535 | This predicate function returns non-@code{nil} if there are any | ||
| 3536 | active @code{system-sleep} blocks, otherwise it returns @code{nil}. | ||
| 3537 | @end defun | ||
| 3538 | |||
| 3539 | @defun system-sleep-unblock-all-sleep-blocks | ||
| 3540 | This function unblocks all active sleep blocks. It is unlikely that you | ||
| 3541 | will need to call this function. | ||
| 3542 | @end defun | ||
| 3543 | |||
| 3544 | @defopt system-sleep-event-functions | ||
| 3545 | When the system is about to enter a sleep state or after it wakes from | ||
| 3546 | one, each function on this abnormal hook is called with one argument, | ||
| 3547 | @var{event}, a sleep event. Its state can be retrieved via | ||
| 3548 | @samp{@code{(sleep-event-state event)}}. State will be one of the | ||
| 3549 | symbols @code{pre-sleep} or @code{post-wake}. | ||
| 3550 | |||
| 3551 | Handling @code{pre-sleep} events should be done as fast as possible and | ||
| 3552 | avoid user prompting. Systems often grant a very short pre-sleep | ||
| 3553 | processing interval, typically ranging between 2 and 5 seconds. The | ||
| 3554 | system may sleep even if your processing is not complete, so be sure you | ||
| 3555 | do as little as possible. For example, your function could close active | ||
| 3556 | connections or serial ports. | ||
| 3557 | |||
| 3558 | Handling @code{post-wake} events offers more leeway. Use this, for | ||
| 3559 | example, to reestablish connections. | ||
| 3560 | |||
| 3561 | Note: Your code, or the functions it calls, should not raise any signals | ||
| 3562 | or all hooks will be halted. You can wrap your code in a | ||
| 3563 | @code{condition-case} block (@pxref{Errors}). | ||
| 3564 | @end defopt | ||
| 3565 | |||
| 3496 | @node File Notifications | 3566 | @node File Notifications |
| 3497 | @section Notifications on File Changes | 3567 | @section Notifications on File Changes |
| 3498 | @cindex file notifications | 3568 | @cindex file notifications |
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 4de739aa915..afee255346c 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -1110,9 +1110,9 @@ instead of the default @code{equal}. | |||
| 1110 | @cindex sequences, intersection of | 1110 | @cindex sequences, intersection of |
| 1111 | @cindex intersection of sequences | 1111 | @cindex intersection of sequences |
| 1112 | This function returns a copy of @var{sequence1} from which the | 1112 | This function returns a copy of @var{sequence1} from which the |
| 1113 | elements that appear in @var{sequence2} where removed. If the optional | 1113 | elements that do not appear in @var{sequence2} were removed. If the |
| 1114 | argument @var{function} is non-@code{nil}, it is a function of two | 1114 | optional argument @var{function} is non-@code{nil}, it is a function of |
| 1115 | arguments to use to compare elements instead of the default | 1115 | two arguments to use to compare elements instead of the default |
| 1116 | @code{equal}. | 1116 | @code{equal}. |
| 1117 | 1117 | ||
| 1118 | @example | 1118 | @example |
| @@ -1125,10 +1125,11 @@ arguments to use to compare elements instead of the default | |||
| 1125 | 1125 | ||
| 1126 | 1126 | ||
| 1127 | @defun seq-difference sequence1 sequence2 &optional function | 1127 | @defun seq-difference sequence1 sequence2 &optional function |
| 1128 | This function returns a list of the elements that appear in | 1128 | This function returns a copy of @var{sequence1} from which the |
| 1129 | @var{sequence1} but not in @var{sequence2}. If the optional argument | 1129 | elements that appear in @var{sequence2} were removed. If the optional |
| 1130 | @var{function} is non-@code{nil}, it is a function of two arguments to | 1130 | argument @var{function} is non-@code{nil}, it is a function of two |
| 1131 | use to compare elements instead of the default @code{equal}. | 1131 | arguments to use to compare elements instead of the default |
| 1132 | @code{equal}. | ||
| 1132 | 1133 | ||
| 1133 | @example | 1134 | @example |
| 1134 | @group | 1135 | @group |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 44be529d562..d073d3ffe2f 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -281,6 +281,17 @@ another string, alter a constant string in the program, or even raise | |||
| 281 | an error. To obtain a string that you can safely mutate, use | 281 | an error. To obtain a string that you can safely mutate, use |
| 282 | @code{copy-sequence} on the result. | 282 | @code{copy-sequence} on the result. |
| 283 | 283 | ||
| 284 | If you need to create a string made from @var{n} copies of a given | ||
| 285 | source string @var{source}, you can use @code{concat} as follows: | ||
| 286 | |||
| 287 | @lisp | ||
| 288 | (apply #'concat (make-list @var{n} @var{source})) | ||
| 289 | @end lisp | ||
| 290 | |||
| 291 | @noindent | ||
| 292 | This uses the fact that @code{concat} can take any kind of sequence as | ||
| 293 | its arguments. | ||
| 294 | |||
| 284 | For information about other concatenation functions, see the | 295 | For information about other concatenation functions, see the |
| 285 | description of @code{mapconcat} in @ref{Mapping Functions}, | 296 | description of @code{mapconcat} in @ref{Mapping Functions}, |
| 286 | @code{vconcat} in @ref{Vector Functions}, and @code{append} in @ref{Building | 297 | @code{vconcat} in @ref{Vector Functions}, and @code{append} in @ref{Building |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 29a272eec92..e89b28eb0c0 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -617,6 +617,8 @@ float-pi | |||
| 617 | 617 | ||
| 618 | @node Tips for Defining | 618 | @node Tips for Defining |
| 619 | @section Tips for Defining Variables Robustly | 619 | @section Tips for Defining Variables Robustly |
| 620 | @cindex variables, naming conventions | ||
| 621 | @cindex naming conventions, variables | ||
| 620 | 622 | ||
| 621 | When you define a variable whose value is a function, or a list of | 623 | When you define a variable whose value is a function, or a list of |
| 622 | functions, use a name that ends in @samp{-function} or | 624 | functions, use a name that ends in @samp{-function} or |
| @@ -659,6 +661,7 @@ The value is a whole shell command. | |||
| 659 | @item @dots{}-switches | 661 | @item @dots{}-switches |
| 660 | The value specifies options for a command. | 662 | The value specifies options for a command. |
| 661 | 663 | ||
| 664 | @cindex internal variables, naming conventions | ||
| 662 | @item @var{prefix}--@dots{} | 665 | @item @var{prefix}--@dots{} |
| 663 | The variable is intended for internal use and is defined in the file | 666 | The variable is intended for internal use and is defined in the file |
| 664 | @file{@var{prefix}.el}. (Emacs code contributed before 2018 may | 667 | @file{@var{prefix}.el}. (Emacs code contributed before 2018 may |
| @@ -2653,6 +2656,19 @@ This macro returns the connection-local value of @var{symbol} for | |||
| 2653 | 2656 | ||
| 2654 | If @var{symbol} does not have a connection-local | 2657 | If @var{symbol} does not have a connection-local |
| 2655 | binding, the value is the default binding of the variable. | 2658 | binding, the value is the default binding of the variable. |
| 2659 | |||
| 2660 | The difference to @code{with-connection-local@{-application@}-variables} | ||
| 2661 | is, that @code{symbol} is not set buffer-local. A typical usage pattern | ||
| 2662 | is to use only the the connection value of a variable if it exists, and | ||
| 2663 | not to use its default value otherwise (using @code{my-app-variable} | ||
| 2664 | initialized above): | ||
| 2665 | |||
| 2666 | @lisp | ||
| 2667 | (if (connection-local-p my-app-variable 'my-app) | ||
| 2668 | (connection-local-value my-app-variable 'my-app) | ||
| 2669 | ;; Something else. | ||
| 2670 | ) | ||
| 2671 | @end lisp | ||
| 2656 | @end defmac | 2672 | @end defmac |
| 2657 | 2673 | ||
| 2658 | @defvar enable-connection-local-variables | 2674 | @defvar enable-connection-local-variables |
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 59685087ae8..5b302c883ad 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi | |||
| @@ -64,7 +64,7 @@ another. An overview of D-Bus can be found at | |||
| 64 | * Alternative Buses:: Alternative buses and environments. | 64 | * Alternative Buses:: Alternative buses and environments. |
| 65 | * Errors and Events:: Errors and events. | 65 | * Errors and Events:: Errors and events. |
| 66 | * Monitoring Messages:: Monitoring messages. | 66 | * Monitoring Messages:: Monitoring messages. |
| 67 | * Inhibitor Locks:: Inhibit system shutdowns and sleep states. | 67 | * File Descriptors:: Handle file descriptors. |
| 68 | * Index:: Index including concepts, functions, variables. | 68 | * Index:: Index including concepts, functions, variables. |
| 69 | 69 | ||
| 70 | * GNU Free Documentation License:: The license for this documentation. | 70 | * GNU Free Documentation License:: The license for this documentation. |
| @@ -1212,7 +1212,7 @@ which carries the input parameters to the object owning the method to | |||
| 1212 | be called, and a reply message returning the resulting output | 1212 | be called, and a reply message returning the resulting output |
| 1213 | parameters from the object. | 1213 | parameters from the object. |
| 1214 | 1214 | ||
| 1215 | @defun dbus-call-method bus service path interface method &optional :timeout timeout :authorizable auth &rest args | 1215 | @defun dbus-call-method bus service path interface method &optional :timeout timeout :authorizable auth :keep-fd &rest args |
| 1216 | @anchor{dbus-call-method} | 1216 | @anchor{dbus-call-method} |
| 1217 | This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is | 1217 | This function calls @var{method} on the D-Bus @var{bus}. @var{bus} is |
| 1218 | either the keyword @code{:system} or the keyword @code{:session}. | 1218 | either the keyword @code{:system} or the keyword @code{:session}. |
| @@ -1245,6 +1245,11 @@ running): | |||
| 1245 | @result{} "/org/freedesktop/systemd1/job/17508" | 1245 | @result{} "/org/freedesktop/systemd1/job/17508" |
| 1246 | @end lisp | 1246 | @end lisp |
| 1247 | 1247 | ||
| 1248 | If the parameter @code{:keep-fd} is given, and the return message has a | ||
| 1249 | first argument with a D-Bus type @code{:unix-fd}, the returned file | ||
| 1250 | descriptor is kept internally, and can be used in a later call of | ||
| 1251 | @code{dbus--close-fd} (@pxref{File Descriptors}). | ||
| 1252 | |||
| 1248 | The remaining arguments @var{args} are passed to @var{method} as | 1253 | The remaining arguments @var{args} are passed to @var{method} as |
| 1249 | arguments. They are converted into D-Bus types as described in | 1254 | arguments. They are converted into D-Bus types as described in |
| 1250 | @ref{Type Conversion}. | 1255 | @ref{Type Conversion}. |
| @@ -1324,7 +1329,7 @@ emulate the @code{lshal} command on GNU/Linux systems: | |||
| 1324 | @cindex method calls, asynchronous | 1329 | @cindex method calls, asynchronous |
| 1325 | @cindex asynchronous method calls | 1330 | @cindex asynchronous method calls |
| 1326 | 1331 | ||
| 1327 | @defun dbus-call-method-asynchronously bus service path interface method handler &optional :timeout timeout :authorizable auth &rest args | 1332 | @defun dbus-call-method-asynchronously bus service path interface method handler &optional :timeout timeout :authorizable auth :keep-fd &rest args |
| 1328 | This function calls @var{method} on the D-Bus @var{bus} | 1333 | This function calls @var{method} on the D-Bus @var{bus} |
| 1329 | asynchronously. @var{bus} is either the keyword @code{:system} or the | 1334 | asynchronously. @var{bus} is either the keyword @code{:system} or the |
| 1330 | keyword @code{:session}. | 1335 | keyword @code{:session}. |
| @@ -1347,6 +1352,11 @@ If the parameter @code{:authorizable} is given and the following | |||
| 1347 | @var{auth} is non-@code{nil}, the invoked method may interactively | 1352 | @var{auth} is non-@code{nil}, the invoked method may interactively |
| 1348 | prompt the user for authorization. The default is @code{nil}. | 1353 | prompt the user for authorization. The default is @code{nil}. |
| 1349 | 1354 | ||
| 1355 | If the parameter @code{:keep-fd} is given, and the return message has a | ||
| 1356 | first argument with a D-Bus type @code{:unix-fd}, the returned file | ||
| 1357 | descriptor is kept internally, and can be used in a later call of | ||
| 1358 | @code{dbus--close-fd} (@pxref{File Descriptors}). | ||
| 1359 | |||
| 1350 | The remaining arguments @var{args} are passed to @var{method} as | 1360 | The remaining arguments @var{args} are passed to @var{method} as |
| 1351 | arguments. They are converted into D-Bus types as described in | 1361 | arguments. They are converted into D-Bus types as described in |
| 1352 | @ref{Type Conversion}. | 1362 | @ref{Type Conversion}. |
| @@ -2205,109 +2215,90 @@ switches to the monitor buffer. | |||
| 2205 | @end deffn | 2215 | @end deffn |
| 2206 | 2216 | ||
| 2207 | 2217 | ||
| 2208 | @node Inhibitor Locks | 2218 | @node File Descriptors |
| 2209 | @chapter Inhibit system shutdowns and sleep states | 2219 | @chapter Handle file descriptors |
| 2210 | |||
| 2211 | @uref{https://systemd.io/INHIBITOR_LOCKS/, Systemd} includes a logic to | ||
| 2212 | inhibit system shutdowns and sleep states. It can be controlled by a | ||
| 2213 | D-Bus API@footnote{@uref{https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html}}. | ||
| 2214 | Because this API includes handling of file descriptors, not all | ||
| 2215 | functions can be implemented by simple D-Bus method calls. Therefore, | ||
| 2216 | the following functions are provided. | ||
| 2217 | |||
| 2218 | @defun dbus-make-inhibitor-lock what why &optional block | ||
| 2219 | This function creates an inhibitor for system shutdowns and sleep states. | ||
| 2220 | |||
| 2221 | @var{what} is a colon-separated string of lock types: @samp{shutdown}, | ||
| 2222 | @samp{sleep}, @samp{idle}, @samp{handle-power-key}, | ||
| 2223 | @samp{handle-suspend-key}, @samp{handle-hibernate-key}, | ||
| 2224 | @samp{handle-lid-switch}. Example: @samp{shutdown:idle}. | ||
| 2225 | |||
| 2226 | @c@var{who} is a descriptive string of who is taking the lock. If it is | ||
| 2227 | @c@code{nil}, it defaults to @samp{Emacs}. | ||
| 2228 | 2220 | ||
| 2229 | @var{why} is a descriptive string of why the lock is taken. Example: | 2221 | Methods offered by the D-Bus API could return a file descriptor, which |
| 2230 | @samp{Package Update in Progress}. | 2222 | must be handled further. This is indicated by the @code{:keep-fd} |
| 2223 | parameter when calling the method (@pxref{dbus-call-method}). | ||
| 2231 | 2224 | ||
| 2232 | The optional @var{block} is the mode of the inhibitor lock, either | 2225 | For example, @uref{https://systemd.io/INHIBITOR_LOCKS/, Systemd} |
| 2233 | @samp{block} (@var{block} is non-@code{nil}), or @samp{delay}. | 2226 | includes a logic to inhibit system shutdowns and sleep states. It can |
| 2234 | 2227 | be controlled by a the method @samp{Inhibit} of interface | |
| 2235 | Note, that the @code{who} argument of the inhibitor lock object of the | 2228 | @samp{org.freedesktop.login1.Manager}@footnote{@uref{https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html}}. |
| 2236 | systemd manager is always set to the string @samp{Emacs}. | 2229 | This function returns a file descriptor, which must be used to unlock |
| 2237 | 2230 | the locked resource, some of which lock the system. In order to keep | |
| 2238 | It returns a file descriptor or @code{nil}, if the lock cannot be | 2231 | this file descriptor internally, the respective D-Bus method call looks |
| 2239 | acquired. If there is already an inhibitor lock for the triple | 2232 | like (@var{what}, @var{who}, @var{why} and @var{mode} are |
| 2240 | @code{(WHAT WHY BLOCK)}, this lock is returned. Example: | 2233 | method-specific string arguments) |
| 2241 | 2234 | ||
| 2242 | @lisp | 2235 | @lisp |
| 2243 | (dbus-make-inhibitor-lock "sleep" "Test") | 2236 | (dbus-call-method |
| 2237 | :system | ||
| 2238 | "org.freedesktop.login1" "/org/freedesktop/login1" | ||
| 2239 | "org.freedesktop.login1.Manager" "Inhibit" | ||
| 2240 | :keep-fd WHAT WHO WHY MODE) | ||
| 2244 | 2241 | ||
| 2245 | @result{} 25 | 2242 | @result{} 25 |
| 2246 | @end lisp | 2243 | @end lisp |
| 2247 | @end defun | ||
| 2248 | 2244 | ||
| 2249 | @defun dbus-registered-inhibitor-locks | 2245 | The inhibition lock is unlocked, when the returned file descriptor is |
| 2250 | Return registered inhibitor locks, an alist. | 2246 | removed from the file system. This cannot be achieved on Lisp level. |
| 2251 | This allows to check, whether other packages of the running Emacs | 2247 | Therefore, there is the function @code{dbus--fd-close} to performs this |
| 2252 | instance have acquired an inhibitor lock as well. | 2248 | task (see below). |
| 2249 | |||
| 2250 | @strong{Note}: When the Emacs process itself dies, all such locks are | ||
| 2251 | released. | ||
| 2253 | 2252 | ||
| 2254 | An entry in this list is a list @code{(@var{fd} @var{what} @var{why} | 2253 | @strong{Note}: The following functions are internal to the D-Bus |
| 2255 | @var{block})}. The car of the list is the file descriptor retrieved | 2254 | implementation of Emacs. Use them with care. |
| 2256 | from a @code{dbus-make-inhibitor-lock} call. The cdr of the list | 2255 | |
| 2257 | represents the three arguments @code{dbus-make-inhibitor-lock} was | 2256 | @defun dbus--fd-open filename |
| 2258 | called with. Example: | 2257 | Open @var{filename} and return the respective read-only file descriptor. |
| 2258 | This is another function to keep a file descriptor internally. The | ||
| 2259 | returned file descriptor can be closed by @code{dbus--fd-close}. | ||
| 2260 | Example: | ||
| 2259 | 2261 | ||
| 2260 | @lisp | 2262 | @lisp |
| 2261 | (dbus-registered-inhibitor-locks) | 2263 | (dbus--fd-open "~/.emacs") |
| 2262 | 2264 | ||
| 2263 | @result{} ((25 "sleep" "Test" nil)) | 2265 | @result{} 20 |
| 2264 | @end lisp | 2266 | @end lisp |
| 2265 | @end defun | 2267 | @end defun |
| 2266 | 2268 | ||
| 2267 | @defun dbus-close-inhibitor-lock lock | 2269 | @defun dbus--fd-close fd |
| 2268 | Close inhibitor lock file descriptor. | 2270 | Close file descriptor @var{fd}. |
| 2269 | 2271 | @var{fd} must be the result of a @code{dbus-call-method} or | |
| 2270 | @var{lock}, a file descriptor, must be the result of a | 2272 | @code{dbus--fd-open} call, see @code{dbus--registered-fds}. It returns |
| 2271 | @code{dbus-make-inhibitor-lock} call. It returns @code{t} in case of | 2273 | @code{t} in case of success, or @code{nil} if it isn’t be possible to |
| 2272 | success, or @code{nil} if it isn't be possible to close the lock, or if | 2274 | close the file descriptor, or if the file descriptor is closed already. |
| 2273 | the lock is closed already. Example: | 2275 | Example: |
| 2274 | 2276 | ||
| 2275 | @lisp | 2277 | @lisp |
| 2276 | (dbus-close-inhibitor-lock 25) | 2278 | (dbus--fd-close 25) |
| 2277 | 2279 | ||
| 2278 | @result{} t | 2280 | @result{} t |
| 2279 | |||
| 2280 | @end lisp | 2281 | @end lisp |
| 2281 | @end defun | 2282 | @end defun |
| 2282 | 2283 | ||
| 2283 | A typical scenario for these functions is to register for the | 2284 | @defun dbus--registered-fds |
| 2284 | D-Bus signal @samp{org.freedesktop.login1.Manager.PrepareForSleep}: | 2285 | Return registered file descriptors, an alist. |
| 2286 | The key is an open file descriptor, retrieved via | ||
| 2287 | @code{dbus-call-method} or @code{dbus--open-fd}. The value is a string | ||
| 2288 | @var{object-path} or @var{filename}, which represents the arguments the | ||
| 2289 | function was called with. Those values are not needed for further | ||
| 2290 | operations; they are just shown for information. | ||
| 2285 | 2291 | ||
| 2286 | @lisp | 2292 | This alist allows to check, whether other packages of the running Emacs |
| 2287 | (defvar my-inhibitor-lock | 2293 | instance have acquired a file descriptor as well. Example: |
| 2288 | (dbus-make-inhibitor-lock "sleep" "Test")) | ||
| 2289 | 2294 | ||
| 2290 | (defun my-dbus-PrepareForSleep-handler (start) | 2295 | @lisp |
| 2291 | (if start ;; The system goes down for sleep | 2296 | (dbus--registered-fds) |
| 2292 | (progn | ||
| 2293 | @dots{} | ||
| 2294 | ;; Release inhibitor lock. | ||
| 2295 | (when (natnump my-inhibitor-lock) | ||
| 2296 | (dbus-close-inhibitor-lock my-inhibitor-lock) | ||
| 2297 | (setq my-inhibitor-lock nil))) | ||
| 2298 | ;; Reacquire inhibitor lock. | ||
| 2299 | (setq my-inhibitor-lock | ||
| 2300 | (dbus-make-inhibitor-lock "sleep" "Test")))) | ||
| 2301 | |||
| 2302 | (dbus-register-signal | ||
| 2303 | :system "org.freedesktop.login1" "/org/freedesktop/login1" | ||
| 2304 | "org.freedesktop.login1.Manager" "PrepareForSleep" | ||
| 2305 | #'my-dbus-PrepareForSleep-handler) | ||
| 2306 | 2297 | ||
| 2307 | @result{} ((:signal :system "org.freedesktop.login1.Manager" "PrepareForSleep") | 2298 | @result{} ((20 . "/home/user/.emacs") |
| 2308 | ("org.freedesktop.login1" "/org/freedesktop/login1" | 2299 | (25 . "/org/freedesktop/login1")) |
| 2309 | my-dbus-PrepareForSleep-handler)) | ||
| 2310 | @end lisp | 2300 | @end lisp |
| 2301 | @end defun | ||
| 2311 | 2302 | ||
| 2312 | 2303 | ||
| 2313 | @node Index | 2304 | @node Index |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index c916588a060..73c3e1ed326 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -6658,7 +6658,7 @@ root directory, it is most likely sufficient to make the | |||
| 6658 | @code{default-directory} of the process buffer as the root directory. | 6658 | @code{default-directory} of the process buffer as the root directory. |
| 6659 | 6659 | ||
| 6660 | 6660 | ||
| 6661 | @subsection Timers, process filters, process sentinels, redisplay | 6661 | @subsection Timers, process filters, process sentinels, special events, redisplay |
| 6662 | 6662 | ||
| 6663 | @vindex remote-file-error | 6663 | @vindex remote-file-error |
| 6664 | Timers run asynchronously at any time when Emacs is waiting for | 6664 | Timers run asynchronously at any time when Emacs is waiting for |
| @@ -6678,7 +6678,13 @@ wrapping the timer function body as follows: | |||
| 6678 | @end lisp | 6678 | @end lisp |
| 6679 | 6679 | ||
| 6680 | A similar problem could happen with process filters, process | 6680 | A similar problem could happen with process filters, process |
| 6681 | sentinels, and redisplay (updating the mode line). | 6681 | sentinels, special event handlers, and redisplay (updating the mode |
| 6682 | line). | ||
| 6683 | |||
| 6684 | @strong{Note} that @value{tramp} raises a @code{remote-file-error} | ||
| 6685 | error for any connection-related problem. You can protect against all | ||
| 6686 | such problems with the code snippet above (or with a | ||
| 6687 | @code{condition-case} form with a @code{remote-file-error} handler). | ||
| 6682 | 6688 | ||
| 6683 | 6689 | ||
| 6684 | @node Extension packages | 6690 | @node Extension packages |
diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi index 1cdeab5bbaa..b7ce3f7a262 100644 --- a/doc/misc/widget.texi +++ b/doc/misc/widget.texi | |||
| @@ -785,13 +785,19 @@ The following navigation commands are available: | |||
| 785 | 785 | ||
| 786 | @table @kbd | 786 | @table @kbd |
| 787 | @item @key{TAB} | 787 | @item @key{TAB} |
| 788 | @deffn Command widget-forward &optional count | 788 | @deffn Command widget-forward count &optional suppress-echo |
| 789 | Move point @var{count} buttons or editing fields forward. | 789 | Move point @var{count} buttons or editing fields forward. The optional |
| 790 | @var{suppress-echo} argument suppresses showing in the echo-area the | ||
| 791 | help-echo text, if any, for the final position after the move; it is | ||
| 792 | always @code{nil} in interactive invocations. | ||
| 790 | @end deffn | 793 | @end deffn |
| 791 | @item M-@key{TAB} | 794 | @item M-@key{TAB} |
| 792 | @itemx S-@key{TAB} | 795 | @itemx S-@key{TAB} |
| 793 | @deffn Command widget-backward &optional count | 796 | @deffn Command widget-backward count &optional suppress-echo |
| 794 | Move point @var{count} buttons or editing fields backward. | 797 | Move point @var{count} buttons or editing fields backward. The optional |
| 798 | @var{suppress-echo} argument suppresses showing in the echo-area the | ||
| 799 | help-echo text, if any, for the final position after the move; it is | ||
| 800 | always @code{nil} in interactive invocations. | ||
| 795 | @end deffn | 801 | @end deffn |
| 796 | @end table | 802 | @end table |
| 797 | 803 | ||