[-- Attachment #1: Type: text/plain, Size: 4375 bytes --] Thank you very much for your comments, Stefan. As you point out, the previous code is found to fail when regular expressions and sexp comments exist in the same line. Now I put the logic to scan the beginning of sexp comments and regular expressions in syntax-propertize-rules macro. I use different functions to be invoked by them, because the beginning of regular expressions need to be canceled when they are already in normal strings or comments. (This kind of logic might be required also for sexp comment, but the current implementation does not do that and does not seem to cause any harms.) Therefore, if I use the same function, it requires an extra conditional code only for regular expressions, which is a repetition of what is done in syntax-propertize-rules level. (At syntax-propertize-rules leve, we already know it's a beginning of a sexp comment or a possible beginning of regular expression). The following explains the functions implemented. - scheme-syntax-propertize-sexp-comment No change from the current built-in implementation - scheme-syntax-propertize-regexp-end If the posistion is already in regular expressions and not in comments, it searches regular expression end (/) ignoring backslash slash (\/). - scheme-syntax-propertize-regexp This is invoked in syntax-propertize-rules. It cancels syntax class assignment to # of #/ if the # part is already in strings or comments. (Precisely, it assigns @ syntax class to # .) Otherwise it continues to scan the end of regular expression by calling scheme-syntax-propertize-regexp-end. Thanks. #+BEGIN_SRC (add-hook 'scheme-mode-hook (lambda () (setq-local syntax-propertize-function (lambda (beg end) (goto-char beg) (scheme-syntax-propertize-sexp-comment (point) end) (scheme-syntax-propertize-regexp-end (point) end) (funcall (syntax-propertize-rules ("\\(#\\);" (1 (prog1 "< cn" (scheme-syntax-propertize-sexp-comment (point) end)))) ("\\(#\\)/" (1 (prog1 "|" (scheme-syntax-propertize-regexp (point) end)))) ) (point) end) )))) (defun scheme-syntax-propertize-sexp-comment (_ end) (let ((state (syntax-ppss))) (when (eq 2 (nth 7 state)) ;; It's a sexp-comment. Tell parse-partial-sexp where it ends. (condition-case nil (progn (goto-char (+ 2 (nth 8 state))) ;; FIXME: this doesn't handle the case where the sexp ;; itself contains a #; comment. (forward-sexp 1) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "> cn"))) (scan-error (goto-char end)))))) (defun scheme-syntax-propertize-regexp-end (_ end) (let* ((state (syntax-ppss)) (within-str (nth 3 state)) (within-comm (nth 4 state)) (start-delim-pos (nth 8 state))) (if (and (not within-comm) (and within-str (string= (buffer-substring-no-properties start-delim-pos (1+ start-delim-pos)) "#"))) (let ((end-found nil)) (while (and (not end-found) (re-search-forward "\\(/\\)" end t)) (progn (if (not (char-equal (char-before (match-beginning 1)) ?\\ )) (progn (put-text-property (match-beginning 1) (1+ (match-beginning 1)) 'syntax-table (string-to-syntax "|")) (setq end-found t) ))))) ))) (defun scheme-syntax-propertize-regexp (_ end) (let* ((match-start-state (save-excursion (syntax-ppss (match-beginning 1)))) (within-str (nth 3 match-start-state)) (within-comm (nth 4 match-start-state))) (if (or within-str within-comm) (put-text-property ;; Cancel regular expression start (match-beginning 1) (1+ (match-beginning 1)) 'syntax-table (string-to-syntax "@")) (scheme-syntax-propertize-regexp-end _ end) ))) #+END_SRC [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: deals with scheme regular expression syntax --] [-- Type: text/x-patch, Size: 2791 bytes --] diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 67abab6913d..98405513099 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -410,11 +410,18 @@ scheme-sexp-comment-syntax-table (defun scheme-syntax-propertize (beg end) (goto-char beg) (scheme-syntax-propertize-sexp-comment (point) end) + (scheme-syntax-propertize-regexp-end (point) end) (funcall (syntax-propertize-rules ("\\(#\\);" (1 (prog1 "< cn" - (scheme-syntax-propertize-sexp-comment (point) end))))) - (point) end)) + (scheme-syntax-propertize-sexp-comment + (point) end)))) + ("\\(#\\)/" (1 (prog1 "|" + (scheme-syntax-propertize-regexp + (point) end)))) + ) + (point) end) + ) (defun scheme-syntax-propertize-sexp-comment (_ end) (let ((state (syntax-ppss))) @@ -430,6 +437,49 @@ scheme-syntax-propertize-sexp-comment 'syntax-table (string-to-syntax "> cn"))) (scan-error (goto-char end)))))) +(defun scheme-syntax-propertize-regexp-end (_ end) + (let* ((state (syntax-ppss)) + (within-str (nth 3 state)) + (within-comm (nth 4 state)) + (start-delim-pos (nth 8 state))) + (if (and (not within-comm) + (and within-str + (string= + (buffer-substring-no-properties + start-delim-pos + (1+ start-delim-pos)) + "#"))) + (let ((end-found nil)) + (while (and + (not end-found) + (re-search-forward "\\(/\\)" end t)) + (progn + (if + (not (char-equal + (char-before (match-beginning 1)) + ?\\ )) + (progn + (put-text-property + (match-beginning 1) + (1+ (match-beginning 1)) + 'syntax-table (string-to-syntax "|")) + (setq end-found t) + ))))) + ))) + +(defun scheme-syntax-propertize-regexp (_ end) + (let* ((match-start-state (save-excursion + (syntax-ppss (match-beginning 1)))) + (within-str (nth 3 match-start-state)) + (within-comm (nth 4 match-start-state))) + (if (or within-str within-comm) + (put-text-property ;; Cancel regular expression start + (match-beginning 1) + (1+ (match-beginning 1)) + 'syntax-table (string-to-syntax "@")) + (scheme-syntax-propertize-regexp-end _ end) + ))) + ;;;###autoload (define-derived-mode dsssl-mode scheme-mode "DSSSL" "Major mode for editing DSSSL code. [-- Attachment #3: Type: text/plain, Size: 32 bytes --] -- Toshi (Toshihiro Umehara)
On 3/18/24 7:02 PM, Richard Stallman wrote:
> Could you explain which characters you mean by "typographic quotation
> marks"?
I think he is referencing Unicode quotes which are angled to
differentiate between closing and opening brackets.
As an interesting expirement in Emacs:
# U+2018 LEFT SINGLE QUOTATION MARK
$ find . -name 'ChangeLog*' | xargs grep ‘ | wc -l
705
# U+2019 RIGHT SINGLE QUOTATION MARK
$ find . -name 'ChangeLog*' | xargs grep ’ | wc -l
1599
# U+201C LEFT DOUBLE QUOTATION MARK
find . -name 'ChangeLog*' | xargs grep “ | wc -l
119
# U+201D RIGHT DOUBLE QUOTATION MARK
$ find . -name 'ChangeLog*' | xargs grep ” | wc -l
119
Collin
[[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > However, typographic quotation marks are widely used Could you explain which characters you mean by "typographic quotation marks"? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)
"Sparapani, Rodney" <rsparapa@mcw.edu> writes: > Usually, this will lock-up emacs and you have to kill it from > > the window manager which seems to be the only option available. > > When there are unsaved files, you still get a prompt for that > so it is not a crash, but just very annoying. > > However, I realized that this bug/feature had already been > > addressed for LUCID scrollbars in lwlib/xlwmenu.c but that code > > is inactive for Motif. So the simple solution is to uncomment > > this block from lines 2906 to 2913 for Motif as well... > > //#ifdef emacs > > if (x_had_errors_p (display)) > > { > > pointer_grabbed = 0; > > XtUngrabPointer ((Widget)mw, event->time); > > } > > x_uncatch_errors (); > > //#endif The macro emacs is always defined, and this block of code relies on the presence of an earlier call to x_catch_errors, which would not have been satisified if this "#ifdef emacs" was inactive. Therefore, something else is at work here.
[-- Attachment #1.1: Type: text/plain, Size: 14494 bytes --] 2024-03-18 Emacs news ===================== - Help wanted: - [ivy-posframe looking for new maintainer] (<https://github.com/tumashu/ivy-posframe/issues/130>) ([@Mehrad@fosstodon.org] (<https://fosstodon.org/@Mehrad/112106996615935396>)) - [Looking for Emacs users in Hamburg for meetups] (<https://floss.social/@momo/112116674531213196>) - Upcoming events: - M-x Research: TBA <https://m-x-research.github.io/> Wed Mar 20 0900 America/Vancouver - 1100 America/Chicago - 1200 America/Toronto - 1600 Etc/GMT - 1700 Europe/Berlin - 2130 Asia/Kolkata -- Thu Mar 21 0000 Asia/Singapore - Emacs APAC (virtual) <https://emacs-apac.gitlab.io/> Sat Mar 23 0130 America/Vancouver - 0330 America/Chicago - 0430 America/Toronto - 0830 Etc/GMT - 0930 Europe/Berlin - 1400 Asia/Kolkata - 1630 Asia/Singapore - Emacs Berlin (virtual, in English) <https://emacs-berlin.org/> Wed Mar 27 1030 America/Vancouver - 1230 America/Chicago - 1330 America/Toronto - 1730 Etc/GMT - 1830 Europe/Berlin - 2300 Asia/Kolkata -- Thu Mar 28 0130 Asia/Singapore - EmacsSF (in person): Emacs Lisp Hacking Night: Org Mode (Hybrid) <https://www.meetup.com/emacs-sf/events/299740714/> Thu Mar 28 1800 America/Vancouver - 2000 America/Chicago - 2100 America/Toronto -- Fri Mar 29 0100 Etc/GMT - 0200 Europe/Berlin - 0630 Asia/Kolkata - 0900 Asia/Singapore - Beginner: - [Introduction to GNU Emacs] (<https://www.youtube.com/watch?v=bdyV72QohXw>) (54:27) - Emacs configuration: - [Structuring an Emacs configuration] (<https://web.archive.org/web/20220612233234/https://ruzkuku.com/texts/emacs-conf.html>) - [chaosemer/init-dir] (<https://github.com/chaosemer/init-dir>) - [Project-specific packages] (<https://fnlog.page/@fn/112098672283192093>) - [Accepting your own solutions to your own problems] (<https://andreyor.st/posts/2024-03-05-accepting-your-own-solutions-to-your-own-problems/>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bg4j18/accepting_your_own_solutions_to_your_own_problems/>)) - [James Dyer: My Dotfile] (<https://www.emacs.dyerdwelling.family/emacs/emacs--init.html>) - [public/emacs_settings.org · master · JTR / Taonah] (<https://gitlab.com/taonaw/taonah/-/blob/master/public/emacs_settings.org>) ([@jtr@fosstodon.org] (<https://fosstodon.org/@jtr/112088505867410130>)) - [haplo's Emacs Config] (<https://github.com/haplo/dotemacs>) - [shaleh's Emacs Config] (<https://github.com/shaleh/dot-emacs/blob/master/settings.org>) - [broquaint's Emacs Config] (<https://github.com/broquaint/emacs-d>) - [Wai Hon's Emacs Config] (<https://whhone.com/emacs-config/>) - Emacs Lisp: - [Arialdo Martini: Emacs: Let's surround! - Prompt the user for inputs] (<http://arialdomartini.github.io//emacs-surround-2>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bhmegv/emacs_lets_surround_prompting_the_user_for_inputs/>)) - [Wrote my first function :) - highlight-word] (<https://www.reddit.com/r/emacs/comments/1bgyq3y/wrote_my_first_function/>) - [m-buffer-el: List Oriented Buffer Operations for Emacs] (<https://github.com/phillord/m-buffer-el>) - [Declaring Lisp function types] (<https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00777.html>) - Appearance: - [Protesilaos Stavrou: Emacs: ef-themes version 1.6.0] (<https://protesilaos.com/codelog/2024-03-11-ef-themes-1-6-0/>) - [Protesilaos Stavrou: Emacs: modus-themes version 4.4.0] (<https://protesilaos.com/codelog/2024-03-17-modus-themes-4-4-0/>) - [`lsp-treemacs-nerd-icons` - Nerd Icons for `lsp-treemacs`] (<https://www.reddit.com/r/emacs/comments/1bguo9x/lsptreemacsnerdicons_nerd_icons_for_lsptreemacs/>) - [Gruvbox theme Emacs logo] (<https://i.redd.it/3fthokihn4oc1.png>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bdvlhh/gruvbox_theme_emacs_logo/>)) - Navigation: - [Arthur A. Gleckler: narrow-to-focus] (<https://speechcode.com/blog/narrow-to-focus>) ([Irreal] (<https://irreal.org/blog/?p=12048>)) - [replace-from-region: Perform `query-replace-regexp', but getting FROM string from region] (<https://github.com/rubikitch/replace-from-region>) - [diff-so-fancy: Good-lookin' diffs. Actually… nah… The best-lookin' diffs. 🎉] (<https://github.com/so-fancy/diff-so-fancy>) - Hyperbole: - [ANNOUNCE: GNU Hyperbole package major release 9 (V9.0.1) released] (<https://www.reddit.com/r/emacs/comments/1bdh29d/announce_gnu_hyperbole_package_major_release_9/>) - Dired: - [Dired-auto-readme is now available via Melpa] (<https://www.reddit.com/r/emacs/comments/1bhmvb5/diredautoreadme_is_now_available_via_melpa/>) - Writing: - [Some meow configuration for friendlier LaTeX editing] (<https://aatmunbaxi.netlify.app/comp/configuring_meow_friendly_latex/>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bdza9f/some_meow_configuration_for_friendlier_latex/>)) - Org Mode: - [Ace Maths tool for training basic math skills - Org Mode document with Javascript, tangle and detangle - @ArneBab@rollenspiel.social] (<https://rollenspiel.social/@ArneBab/112090101963669413>) - [A meow-state for speedy org structure navigation] (<https://aatmunbaxi.netlify.app/comp/meow_state_org_speed/>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bfm2zm/a_meowstate_for_speedy_org_structure_navigation/>)) - [orgtbljoin: Enrich an Org-table with a reference table] (<https://github.com/tbanel/orgtbljoin>) - [orgtblfit: Do regression fitting on Org Mode tables] (<https://github.com/tbanel/orgtblfit>) - [[Blog] Org, AWK, and Anki] (<https://ismailefe.org/blog/org-awk-anki/>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bh91s7/blog_org_awk_and_anki/>)) - [Jeremy Friesen: Completion at Point for Org Macros] (<https://takeonrules.com/2024/03/16/completion-at-point-for-org-macros/>) - [Org-roam causes less complications than Denote] (<https://edstrom.dev/wzvdr/2023-02-26>) ([Reddit] (<https://www.reddit.com/r/planetemacs/comments/1bcz9ai/orgroam_causes_less_complications_than_denote/>)) - Org development: - [ob-calc.el: Add support for tables in Calc source block :var] (<https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=89b0773c3f54c1cb513802d562e42b5ea0c4afef>) - [etc/ORG-NEWS: Fix typo] (<https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=a862ef69061ffdda8133f1a0a791c85a4e1eb4f0>) - [org-export: Do not strip link type by default during export] (<https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=72b0e9ff0460aa1d2c734a6d22d970c9942fa188>) - Completion: - [Emacs Recipes With Yasnippet | Mark's Project Blog] (<https://blog.fixermark.com/posts/2024/emacs-recipes-with-yasnippet/>) ([@mark@mastodon.fixermark.com] (<https://mastodon.fixermark.com/@mark/112107194852116882>)) - [2024-03-15 Emacs: Completion And Function Bundles] (<http://gem.librehacker.com/gemlog/starlog/20240315-0.gmi>) - Coding: - [dape: Debug Adapter Protocol for Emacs - Version 0.9] (<https://github.com/svaante/dape>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bhmpfq/dape_debug_adapter_protocol_for_emacs_version_09/>)) - [Let's talk about Clojure editors and IDEs: Emacs, IntelliJ IDEA Cursive, VSCode Calva, Vim] (<https://www.youtube.com/watch?v=Wfzg2EYU6NA>) (11:41) - [Jeremy Friesen: An Emacs Function for Wrapping Ruby Functions] (<https://takeonrules.com/2024/03/17/an-emacs-function-for-wrapping-ruby-functions/>) - [Robe 0.8.4 released] (<https://github.com/dgutov/robe/releases/tag/0.8.4>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bfwzmq/robe_084_released/>)) - Ruby 3 compatibility, etc. - [RPM Treesitter grammar parser packaging for Emacs, Vim and co] (<https://mastodon.social/@thaodan/112113040844752251>) - [Committing a partial changeset in Emacs | On coding and tools] (<https://gutov.dev/blog/2024/03/03/committing-a-partial-changeset-in-emacs/>) ([@ArneBab@rollenspiel.social] (<https://rollenspiel.social/@ArneBab/112081066594213680>)) - Web: - [EWW Redirecting reddit to old.reddit.com automatically] (<https://www.reddit.com/r/emacs/comments/1bcf8v3/eww_redirecting_reddit_to_oldredditcom/>) - Fun: - [Spotted Emacs in a comic - Emacs Cultural References in the Wild] (<https://www.reddit.com/r/emacs/comments/1bcxyps/spotted_emacs_in_a_comic_emacs_cultural/>) - [GC-geiger: Make a click sound when emacs does garbage collection] (<https://github.com/mpardalos/gc-geiger>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bcfehe/gcgeiger_make_a_click_sound_when_emacs_does/>)) - AI: - [Release Version 0.8.0 · gptel (LLM client for Emacs)] (<https://github.com/karthink/gptel/releases/tag/v0.8.0>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bgp9bb/release_version_080_gptel_llm_client_for_emacs/>)) - Community: - [Weekly Tips, Tricks, &c. Thread] (<https://www.reddit.com/r/emacs/comments/1bdm6mc/weekly_tips_tricks_c_thread/>) - [Things you do in Emacs that will make non-Emacs users go WOW?] (<https://www.reddit.com/r/emacs/comments/1benj4g/things_you_do_in_emacs_that_will_make_nonemacs/>) ([Irreal] (<https://irreal.org/blog/?p=12044>)) - [How do you collaborate/interact with the non-emacs users in your life?] (<https://www.reddit.com/r/emacs/comments/1bg9vq1/how_do_you_collaborateinteract_with_the_nonemacs/>) - [A little vent about people who are trying to change Emacs] (<https://youtube.com/shorts/rdH45hlG3xQ?si=8sYgVmLl88r6qnk5>) ([Reddit] (<https://www.reddit.com/r/emacs/comments/1bfvif9/a_little_vent_about_people_who_are_trying_to/>)) - [GNU Emacs sessions streaming on Twitch, Sundays] (<https://www.twitch.tv/shakthimaan/schedule>) ([@shakthimaan@mastodon.social] (<https://mastodon.social/@shakthimaan/112105551921552243>)) - [emacs@groups.io: Emacs users group Slovenia] (<https://groups.io/g/emacs>) - [emacs_si: Spletna stran slovenske skupnosti, ki se dobiva na temo emacsa] (<https://codeberg.org/g1smo/emacs_si>) - [Telegram Channel Emacs (español) A nosotros nos gusta Emacs, y hablamos en español ;)] (<https://t.me/emacs_es>) ([Reddit] (<https://www.reddit.com/r/planetemacs/comments/1beb300/telegram_channel_emacs_español_a_nosotros_nos/>)) - Other: - [Emacs Mode Specific Commands 2024_03_17_06:27:52] (<https://www.youtube.com/watch?v=UlzyzPqv8zw>) (04:28) - [lentic-server: A literate web server for Emacs] (<https://github.com/phillord/lentic-server>) - [The revised edition of the howm manual.] (<https://www.reddit.com/r/emacs/comments/1bh5kh2/the_revised_edition_of_the_howm_manual/>) - [Anand Tamariya: Data Visualization with GNU Emacs] (<https://lifeofpenguin.blogspot.com/2024/03/data-visualization-with-gnu-emacs.html>) ([YouTube] (<https://www.youtube.com/watch?v=XdXlIV2Hvk4>) 00:50, [Reddit] (<https://www.reddit.com/r/emacs/comments/1bduco6/data_visualization_with_gnu_emacs/>)) - [Gijs Hillenius: Blog - Gopher - Elpher] (<https://hillenius.net/post/getback/>) - [boox-attach.el · GitHub] (<https://gist.github.com/lucasvreis/d031bb66ec5a4b4af15e80024dc64064>) ([@lucasvreis@mathstodon.xyz] (<https://mathstodon.xyz/@lucasvreis/112114936249699585>)) - insert last figure drawn on Boox tablet into an Org note as SVG - [Introducing Chrome-Emacs: Elevate Your Live Coding Experience in Online Editors] (<https://www.reddit.com/r/emacs/comments/1bg7tgn/introducing_chromeemacs_elevate_your_live_coding/>) - Emacs development: - [An alternate pattern-matching conditional for Elisp] (<https://lwn.net/Articles/961682/>) - [Continued work on faster JSON parsing] (<https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00360.html>) - [* lisp/tab-bar.el (tab-bar-select-restore-windows): New defcustom.] (<https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=c29b6df2273347946d5b8c88b5dee39d8d6fd202>) - [Document and announce 'marker-last-position'] (<https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=c12852bbf61ebb9ae124033deb427b15ce1a2ffb>) - [Further adjustments for restoring killed buffer windows (Bug#68235)] (<https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=5bba1b95b8088048808b306bf8b00eb9b342ce92>) - [* lisp/textmodes/flyspell.el (flyspell-check-changes): New user option.] (<https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=f03f14165ed51148b72b431ac99c4a4829bb1a7f>) - [Add user option to disable JavaScript in xwidget webview] (<https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=f6a27bc32d19727dfcbee65fb9894b53aec46c65>) - New packages: - bril-mode: Major mode for Bril text format (MELPA) - dired-auto-readme: Auto-display README file in Dired buffers (MELPA) - dired-hist: Traverse Dired buffer history: back, forward (MELPA) - elisa: Emacs Lisp Information System Assistant (MELPA) - mpdired <https://elpa.gnu.org/packages/mpdired.html>: A dired-like client for Music Player Daemon (GNU ELPA) - sops: SOPS encrypt and decrypt without leaving the editor (MELPA) - sqlite-mode-extras: Extensions for sqlite-mode (MELPA) Links from [reddit.com/r/emacs] (<https://www.reddit.com/r/emacs>), [r/orgmode] (<https://www.reddit.com/r/orgmode>), [r/spacemacs] (<https://www.reddit.com/r/spacemacs>), [r/planetemacs] (<https://www.reddit.com/r/planetemacs>), [Hacker News] (<https://hn.algolia.com/?query=emacs&sort=byDate&prefix&page=0&dateRange=all&type=story>), [lobste.rs] (<https://lobste.rs/search?q=emacs&what=stories&order=newest>), [kbin] (<https://kbin.social/m/emacs/newest>), [programming.dev] (<https://programming.dev/c/emacs?dataType=Post&page=1&sort=New>), [lemmy] (<https://lemmy.ml/c/emacs?dataType=Post&page=1&sort=New>), [communick.news] (<https://communick.news/c/emacs?dataType=Post&page=1&sort=New>), [planet.emacslife.com] (<https://planet.emacslife.com>), [YouTube] (<https://www.youtube.com/playlist?list=PL4th0AZixyREOtvxDpdxC9oMuX7Ar7Sdt>), [the Emacs NEWS file] (<http://git.savannah.gnu.org/cgit/emacs.git/log/etc/NEWS>), [Emacs Calendar] (<https://emacslife.com/calendar/>), and [emacs-devel] (<http://lists.gnu.org/archive/html/emacs-devel/2024-03>). Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at [sacha@sachachua.com] (<mailto:sacha@sachachua.com>). Thank you! [-- Attachment #1.2: Type: text/html, Size: 16758 bytes --] [-- Attachment #2: emacs-news.org --] [-- Type: text/x-org, Size: 14133 bytes --] * 2024-03-18 Emacs news - Help wanted: - [[https://github.com/tumashu/ivy-posframe/issues/130][ivy-posframe looking for new maintainer]] ([[https://fosstodon.org/@Mehrad/112106996615935396][@Mehrad@fosstodon.org]]) - [[https://floss.social/@momo/112116674531213196][Looking for Emacs users in Hamburg for meetups]] - Upcoming events: - M-x Research: TBA https://m-x-research.github.io/ Wed Mar 20 0900 America/Vancouver - 1100 America/Chicago - 1200 America/Toronto - 1600 Etc/GMT - 1700 Europe/Berlin - 2130 Asia/Kolkata -- Thu Mar 21 0000 Asia/Singapore - Emacs APAC (virtual) https://emacs-apac.gitlab.io/ Sat Mar 23 0130 America/Vancouver - 0330 America/Chicago - 0430 America/Toronto - 0830 Etc/GMT - 0930 Europe/Berlin - 1400 Asia/Kolkata - 1630 Asia/Singapore - Emacs Berlin (virtual, in English) https://emacs-berlin.org/ Wed Mar 27 1030 America/Vancouver - 1230 America/Chicago - 1330 America/Toronto - 1730 Etc/GMT - 1830 Europe/Berlin - 2300 Asia/Kolkata -- Thu Mar 28 0130 Asia/Singapore - EmacsSF (in person): Emacs Lisp Hacking Night: Org Mode (Hybrid) https://www.meetup.com/emacs-sf/events/299740714/ Thu Mar 28 1800 America/Vancouver - 2000 America/Chicago - 2100 America/Toronto -- Fri Mar 29 0100 Etc/GMT - 0200 Europe/Berlin - 0630 Asia/Kolkata - 0900 Asia/Singapore - Beginner: - [[https://www.youtube.com/watch?v=bdyV72QohXw][Introduction to GNU Emacs]] (54:27) - Emacs configuration: - [[https://web.archive.org/web/20220612233234/https://ruzkuku.com/texts/emacs-conf.html][Structuring an Emacs configuration]] - [[https://github.com/chaosemer/init-dir][chaosemer/init-dir]] - [[https://fnlog.page/@fn/112098672283192093][Project-specific packages]] - [[https://andreyor.st/posts/2024-03-05-accepting-your-own-solutions-to-your-own-problems/][Accepting your own solutions to your own problems]] ([[https://www.reddit.com/r/emacs/comments/1bg4j18/accepting_your_own_solutions_to_your_own_problems/][Reddit]]) - [[https://www.emacs.dyerdwelling.family/emacs/emacs--init.html][James Dyer: My Dotfile]] - [[https://gitlab.com/taonaw/taonah/-/blob/master/public/emacs_settings.org][public/emacs_settings.org · master · JTR / Taonah]] ([[https://fosstodon.org/@jtr/112088505867410130][@jtr@fosstodon.org]]) - [[https://github.com/haplo/dotemacs][haplo's Emacs Config]] - [[https://github.com/shaleh/dot-emacs/blob/master/settings.org][shaleh's Emacs Config]] - [[https://github.com/broquaint/emacs-d][broquaint's Emacs Config]] - [[https://whhone.com/emacs-config/][Wai Hon's Emacs Config]] - Emacs Lisp: - [[http://arialdomartini.github.io//emacs-surround-2][Arialdo Martini: Emacs: Let's surround! - Prompt the user for inputs]] ([[https://www.reddit.com/r/emacs/comments/1bhmegv/emacs_lets_surround_prompting_the_user_for_inputs/][Reddit]]) - [[https://www.reddit.com/r/emacs/comments/1bgyq3y/wrote_my_first_function/][Wrote my first function :) - highlight-word]] - [[https://github.com/phillord/m-buffer-el][m-buffer-el: List Oriented Buffer Operations for Emacs]] - [[https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00777.html][Declaring Lisp function types]] - Appearance: - [[https://protesilaos.com/codelog/2024-03-11-ef-themes-1-6-0/][Protesilaos Stavrou: Emacs: ef-themes version 1.6.0]] - [[https://protesilaos.com/codelog/2024-03-17-modus-themes-4-4-0/][Protesilaos Stavrou: Emacs: modus-themes version 4.4.0]] - [[https://www.reddit.com/r/emacs/comments/1bguo9x/lsptreemacsnerdicons_nerd_icons_for_lsptreemacs/][`lsp-treemacs-nerd-icons` - Nerd Icons for `lsp-treemacs`]] - [[https://i.redd.it/3fthokihn4oc1.png][Gruvbox theme Emacs logo]] ([[https://www.reddit.com/r/emacs/comments/1bdvlhh/gruvbox_theme_emacs_logo/][Reddit]]) - Navigation: - [[https://speechcode.com/blog/narrow-to-focus][Arthur A. Gleckler: narrow-to-focus]] ([[https://irreal.org/blog/?p=12048][Irreal]]) - [[https://github.com/rubikitch/replace-from-region][replace-from-region: Perform `query-replace-regexp', but getting FROM string from region]] - [[https://github.com/so-fancy/diff-so-fancy][diff-so-fancy: Good-lookin' diffs. Actually… nah… The best-lookin' diffs. 🎉]] - Hyperbole: - [[https://www.reddit.com/r/emacs/comments/1bdh29d/announce_gnu_hyperbole_package_major_release_9/][ANNOUNCE: GNU Hyperbole package major release 9 (V9.0.1) released]] - Dired: - [[https://www.reddit.com/r/emacs/comments/1bhmvb5/diredautoreadme_is_now_available_via_melpa/][Dired-auto-readme is now available via Melpa]] - Writing: - [[https://aatmunbaxi.netlify.app/comp/configuring_meow_friendly_latex/][Some meow configuration for friendlier LaTeX editing]] ([[https://www.reddit.com/r/emacs/comments/1bdza9f/some_meow_configuration_for_friendlier_latex/][Reddit]]) - Org Mode: - [[https://rollenspiel.social/@ArneBab/112090101963669413][Ace Maths tool for training basic math skills - Org Mode document with Javascript, tangle and detangle - @ArneBab@rollenspiel.social]] - [[https://aatmunbaxi.netlify.app/comp/meow_state_org_speed/][A meow-state for speedy org structure navigation]] ([[https://www.reddit.com/r/emacs/comments/1bfm2zm/a_meowstate_for_speedy_org_structure_navigation/][Reddit]]) - [[https://github.com/tbanel/orgtbljoin][orgtbljoin: Enrich an Org-table with a reference table]] - [[https://github.com/tbanel/orgtblfit][orgtblfit: Do regression fitting on Org Mode tables]] - [[https://ismailefe.org/blog/org-awk-anki/][[Blog] Org, AWK, and Anki]] ([[https://www.reddit.com/r/emacs/comments/1bh91s7/blog_org_awk_and_anki/][Reddit]]) - [[https://takeonrules.com/2024/03/16/completion-at-point-for-org-macros/][Jeremy Friesen: Completion at Point for Org Macros]] - [[https://edstrom.dev/wzvdr/2023-02-26][Org-roam causes less complications than Denote]] ([[https://www.reddit.com/r/planetemacs/comments/1bcz9ai/orgroam_causes_less_complications_than_denote/][Reddit]]) - Org development: - [[https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=89b0773c3f54c1cb513802d562e42b5ea0c4afef][ob-calc.el: Add support for tables in Calc source block :var]] - [[https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=a862ef69061ffdda8133f1a0a791c85a4e1eb4f0][etc/ORG-NEWS: Fix typo]] - [[https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/etc/ORG-NEWS?id=72b0e9ff0460aa1d2c734a6d22d970c9942fa188][org-export: Do not strip link type by default during export]] - Completion: - [[https://blog.fixermark.com/posts/2024/emacs-recipes-with-yasnippet/][Emacs Recipes With Yasnippet | Mark's Project Blog]] ([[https://mastodon.fixermark.com/@mark/112107194852116882][@mark@mastodon.fixermark.com]]) - [[http://gem.librehacker.com/gemlog/starlog/20240315-0.gmi][2024-03-15 Emacs: Completion And Function Bundles]] - Coding: - [[https://github.com/svaante/dape][dape: Debug Adapter Protocol for Emacs - Version 0.9]] ([[https://www.reddit.com/r/emacs/comments/1bhmpfq/dape_debug_adapter_protocol_for_emacs_version_09/][Reddit]]) - [[https://www.youtube.com/watch?v=Wfzg2EYU6NA][Let's talk about Clojure editors and IDEs: Emacs, IntelliJ IDEA Cursive, VSCode Calva, Vim]] (11:41) - [[https://takeonrules.com/2024/03/17/an-emacs-function-for-wrapping-ruby-functions/][Jeremy Friesen: An Emacs Function for Wrapping Ruby Functions]] - [[https://github.com/dgutov/robe/releases/tag/0.8.4][Robe 0.8.4 released]] ([[https://www.reddit.com/r/emacs/comments/1bfwzmq/robe_084_released/][Reddit]]) - Ruby 3 compatibility, etc. - [[https://mastodon.social/@thaodan/112113040844752251][RPM Treesitter grammar parser packaging for Emacs, Vim and co]] - [[https://gutov.dev/blog/2024/03/03/committing-a-partial-changeset-in-emacs/][Committing a partial changeset in Emacs | On coding and tools]] ([[https://rollenspiel.social/@ArneBab/112081066594213680][@ArneBab@rollenspiel.social]]) - Web: - [[https://www.reddit.com/r/emacs/comments/1bcf8v3/eww_redirecting_reddit_to_oldredditcom/][EWW Redirecting reddit to old.reddit.com automatically]] - Fun: - [[https://www.reddit.com/r/emacs/comments/1bcxyps/spotted_emacs_in_a_comic_emacs_cultural/][Spotted Emacs in a comic - Emacs Cultural References in the Wild]] - [[https://github.com/mpardalos/gc-geiger][GC-geiger: Make a click sound when emacs does garbage collection]] ([[https://www.reddit.com/r/emacs/comments/1bcfehe/gcgeiger_make_a_click_sound_when_emacs_does/][Reddit]]) - AI: - [[https://github.com/karthink/gptel/releases/tag/v0.8.0][Release Version 0.8.0 · gptel (LLM client for Emacs)]] ([[https://www.reddit.com/r/emacs/comments/1bgp9bb/release_version_080_gptel_llm_client_for_emacs/][Reddit]]) - Community: - [[https://www.reddit.com/r/emacs/comments/1bdm6mc/weekly_tips_tricks_c_thread/][Weekly Tips, Tricks, &c. Thread]] - [[https://www.reddit.com/r/emacs/comments/1benj4g/things_you_do_in_emacs_that_will_make_nonemacs/][Things you do in Emacs that will make non-Emacs users go WOW?]] ([[https://irreal.org/blog/?p=12044][Irreal]]) - [[https://www.reddit.com/r/emacs/comments/1bg9vq1/how_do_you_collaborateinteract_with_the_nonemacs/][How do you collaborate/interact with the non-emacs users in your life?]] - [[https://youtube.com/shorts/rdH45hlG3xQ?si=8sYgVmLl88r6qnk5][A little vent about people who are trying to change Emacs]] ([[https://www.reddit.com/r/emacs/comments/1bfvif9/a_little_vent_about_people_who_are_trying_to/][Reddit]]) - [[https://www.twitch.tv/shakthimaan/schedule][GNU Emacs sessions streaming on Twitch, Sundays]] ([[https://mastodon.social/@shakthimaan/112105551921552243][@shakthimaan@mastodon.social]]) - [[https://groups.io/g/emacs][emacs@groups.io: Emacs users group Slovenia]] - [[https://codeberg.org/g1smo/emacs_si][emacs_si: Spletna stran slovenske skupnosti, ki se dobiva na temo emacsa]] - [[https://t.me/emacs_es][Telegram Channel Emacs (español) A nosotros nos gusta Emacs, y hablamos en español ;)]] ([[https://www.reddit.com/r/planetemacs/comments/1beb300/telegram_channel_emacs_español_a_nosotros_nos/][Reddit]]) - Other: - [[https://www.youtube.com/watch?v=UlzyzPqv8zw][Emacs Mode Specific Commands 2024_03_17_06:27:52]] (04:28) - [[https://github.com/phillord/lentic-server][lentic-server: A literate web server for Emacs]] - [[https://www.reddit.com/r/emacs/comments/1bh5kh2/the_revised_edition_of_the_howm_manual/][The revised edition of the howm manual.]] - [[https://lifeofpenguin.blogspot.com/2024/03/data-visualization-with-gnu-emacs.html][Anand Tamariya: Data Visualization with GNU Emacs]] ([[https://www.youtube.com/watch?v=XdXlIV2Hvk4][YouTube]] 00:50, [[https://www.reddit.com/r/emacs/comments/1bduco6/data_visualization_with_gnu_emacs/][Reddit]]) - [[https://hillenius.net/post/getback/][Gijs Hillenius: Blog - Gopher - Elpher]] - [[https://gist.github.com/lucasvreis/d031bb66ec5a4b4af15e80024dc64064][boox-attach.el · GitHub]] ([[https://mathstodon.xyz/@lucasvreis/112114936249699585][@lucasvreis@mathstodon.xyz]]) - insert last figure drawn on Boox tablet into an Org note as SVG - [[https://www.reddit.com/r/emacs/comments/1bg7tgn/introducing_chromeemacs_elevate_your_live_coding/][Introducing Chrome-Emacs: Elevate Your Live Coding Experience in Online Editors]] - Emacs development: - [[https://lwn.net/Articles/961682/][An alternate pattern-matching conditional for Elisp]] - [[https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00360.html][Continued work on faster JSON parsing]] - [[https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=c29b6df2273347946d5b8c88b5dee39d8d6fd202][* lisp/tab-bar.el (tab-bar-select-restore-windows): New defcustom.]] - [[https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=c12852bbf61ebb9ae124033deb427b15ce1a2ffb][Document and announce 'marker-last-position']] - [[https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=5bba1b95b8088048808b306bf8b00eb9b342ce92][Further adjustments for restoring killed buffer windows (Bug#68235)]] - [[https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=f03f14165ed51148b72b431ac99c4a4829bb1a7f][* lisp/textmodes/flyspell.el (flyspell-check-changes): New user option.]] - [[https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=f6a27bc32d19727dfcbee65fb9894b53aec46c65][Add user option to disable JavaScript in xwidget webview]] - New packages: - bril-mode: Major mode for Bril text format (MELPA) - dired-auto-readme: Auto-display README file in Dired buffers (MELPA) - dired-hist: Traverse Dired buffer history: back, forward (MELPA) - elisa: Emacs Lisp Information System Assistant (MELPA) - https://elpa.gnu.org/packages/mpdired.html: A dired-like client for Music Player Daemon (GNU ELPA) - sops: SOPS encrypt and decrypt without leaving the editor (MELPA) - sqlite-mode-extras: Extensions for sqlite-mode (MELPA) Links from [[https://www.reddit.com/r/emacs][reddit.com/r/emacs]], [[https://www.reddit.com/r/orgmode][r/orgmode]], [[https://www.reddit.com/r/spacemacs][r/spacemacs]], [[https://www.reddit.com/r/planetemacs][r/planetemacs]], [[https://hn.algolia.com/?query=emacs&sort=byDate&prefix&page=0&dateRange=all&type=story][Hacker News]], [[https://lobste.rs/search?q=emacs&what=stories&order=newest][lobste.rs]], [[https://kbin.social/m/emacs/newest][kbin]], [[https://programming.dev/c/emacs?dataType=Post&page=1&sort=New][programming.dev]], [[https://lemmy.ml/c/emacs?dataType=Post&page=1&sort=New][lemmy]], [[https://communick.news/c/emacs?dataType=Post&page=1&sort=New][communick.news]], [[https://planet.emacslife.com][planet.emacslife.com]], [[https://www.youtube.com/playlist?list=PL4th0AZixyREOtvxDpdxC9oMuX7Ar7Sdt][YouTube]], [[http://git.savannah.gnu.org/cgit/emacs.git/log/etc/NEWS][the Emacs NEWS file]], [[https://emacslife.com/calendar/][Emacs Calendar]], and [[http://lists.gnu.org/archive/html/emacs-devel/2024-03][emacs-devel]]. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at [[mailto:sacha@sachachua.com][sacha@sachachua.com]]. Thank you! [-- Attachment #3: Type: text/plain, Size: 92 bytes --] --- via emacs-tangents mailing list (https://lists.gnu.org/mailman/listinfo/emacs-tangents)
[-- Attachment #1: Type: text/plain, Size: 797 bytes --] On 3/18/2024 5:37 AM, Eli Zaretskii wrote: >> Date: Sun, 17 Mar 2024 12:24:26 -0700 >> Cc: 68254@debbugs.gnu.org >> From: Jim Porter <jporterbugs@gmail.com> >> >> Here's a patch for this. It turns 'eww-readable' into a toggle (using >> the same semantics as minor modes), and also adds an option to prevent >> adding a new history entry for each call. > > Thanks. Thanks for looking. I've addressed all of your comments, and made some more extensive changes to the implementation. I split up some of the logic in the first patch so that it's easier to reuse without error, and then added 'eww-readable-urls' in the second. Because of how much I changed, I'd like to add some regression tests to make sure everything still works correctly, but otherwise these patches should be ready to go. [-- Attachment #2: 0001-Allow-toggling-readable-mode-in-EWW.patch --] [-- Type: text/plain, Size: 10793 bytes --] From 4839990148e2a58cf44c04547994611392ff1955 Mon Sep 17 00:00:00 2001 From: Jim Porter <jporterbugs@gmail.com> Date: Sun, 17 Mar 2024 12:01:59 -0700 Subject: [PATCH 1/2] Allow toggling "readable" mode in EWW Additionally, add an option to prevent adding a new history entry for each call of 'eww-readable' (bug#68254). * lisp/net/eww.el (eww-retrieve): * lisp/net/eww.el (eww-readable-adds-to-history): New option. (eww-retrieve): Make sure we call CALLBACK in all configurations. (eww-render): Simplify how to pass encoding. (eww--parse-html-region, eww-display-document): New functions, extracted from... (eww-display-html): ... here. (eww-document-base): New function. (eww-readable): Toggle "readable" mode interactively, like with a minor mode. Consult 'eww-readable-adds-to-history'. (eww-reload): Use 'eshell-display-document'. * doc/misc/eww.texi (Basics): Describe the new behavior. * etc/NEWS: Announce this change. --- doc/misc/eww.texi | 5 ++ etc/NEWS | 12 +++++ lisp/net/eww.el | 127 ++++++++++++++++++++++++++++++---------------- 3 files changed, 99 insertions(+), 45 deletions(-) diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index d31fcf1802b..522034c874d 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -146,6 +146,11 @@ Basics which part of the document contains the ``readable'' text, and will only display this part. This usually gets rid of menus and the like. + When called interactively, this command toggles the display of the +readable parts. With a positive prefix argument, this command always +displays the readable parts, and with a zero or negative prefix, it +always displays the full page. + @findex eww-toggle-fonts @vindex shr-use-fonts @kindex F diff --git a/etc/NEWS b/etc/NEWS index b02712dd21c..b23754fb17f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1054,6 +1054,18 @@ entries newer than the current page. To change the behavior when browsing from "historical" pages, you can customize 'eww-before-browse-history-function'. ++++ +*** 'eww-readable' now toggles display of the readable parts of a web page. +When called interactively, 'eww-readable' toggles whether to display +only the readable parts of a page or the full page. With a positive +prefix argument, always display the readable parts, and with a zero or +negative prefix, always display the full page. + +--- +*** New option 'eww-readable-adds-to-history'. +When non-nil (the default), calling 'eww-readable' adds a new entry to +the EWW page history. + ** go-ts-mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 54847bdf396..fd697846988 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -275,6 +275,11 @@ eww-url-transformers :type '(repeat function) :version "29.1") +(defcustom eww-readable-adds-to-history t + "If non-nil, calling `eww-readable' adds a new entry to the history." + :type 'boolean + :version "30.1") + (defface eww-form-submit '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) @@ -464,11 +469,11 @@ eww (defun eww-retrieve (url callback cbargs) (cond ((null eww-retrieve-command) - (url-retrieve url #'eww-render cbargs)) + (url-retrieve url callback cbargs)) ((eq eww-retrieve-command 'sync) (let ((data-buffer (url-retrieve-synchronously url))) (with-current-buffer data-buffer - (apply #'eww-render nil cbargs)))) + (apply callback nil cbargs)))) (t (let ((buffer (generate-new-buffer " *eww retrieve*")) (error-buffer (generate-new-buffer " *eww error*"))) @@ -673,9 +678,9 @@ eww-render (insert (format "<a href=%S>Direct link to the document</a>" url)) (goto-char (point-min)) - (eww-display-html charset url nil point buffer encode)) + (eww-display-html (or encode charset) url nil point buffer)) ((eww-html-p (car content-type)) - (eww-display-html charset url nil point buffer encode)) + (eww-display-html (or encode charset) url nil point buffer)) ((equal (car content-type) "application/pdf") (eww-display-pdf)) ((string-match-p "\\`image/" (car content-type)) @@ -723,37 +728,43 @@ eww-detect-charset "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)") (match-string 1))))) +(defun eww--parse-html-region (start end &optional encode) + "Parse the HTML between START and END, returning the DOM as an S-expression. +Use ENCODE to decode the region; if nil, decode as UTF-8. + +This replaces the region with the preprocessed HTML." + (setq encode (or encode 'utf-8)) + (with-restriction start end + (condition-case nil + (decode-coding-region (point-min) (point-max) encode) + (coding-system-error nil)) + ;; Remove CRLF and replace NUL with � before parsing. + (while (re-search-forward "\\(\r$\\)\\|\0" nil t) + (replace-match (if (match-beginning 1) "" "�") t t)) + (eww--preprocess-html (point-min) (point-max)) + (libxml-parse-html-region (point-min) (point-max)))) + +(defsubst eww-document-base (url dom) + `(base ((href . ,url)) ,dom)) + (declare-function libxml-parse-html-region "xml.c" (start end &optional base-url discard-comments)) -(defun eww-display-html (charset url &optional document point buffer encode) +(defun eww-display-document (document &optional point buffer) (unless (fboundp 'libxml-parse-html-region) (error "This function requires Emacs to be compiled with libxml2")) + (setq buffer (or buffer (current-buffer))) (unless (buffer-live-p buffer) (error "Buffer %s doesn't exist" buffer)) ;; There should be a better way to abort loading images ;; asynchronously. (setq url-queue nil) - (let ((document - (or document - (list - 'base (list (cons 'href url)) - (progn - (setq encode (or encode charset 'utf-8)) - (condition-case nil - (decode-coding-region (point) (point-max) encode) - (coding-system-error nil)) - (save-excursion - ;; Remove CRLF and replace NUL with � before parsing. - (while (re-search-forward "\\(\r$\\)\\|\0" nil t) - (replace-match (if (match-beginning 1) "" "�") t t))) - (eww--preprocess-html (point) (point-max)) - (libxml-parse-html-region (point) (point-max)))))) - (source (and (null document) - (buffer-substring (point) (point-max))))) + (let ((url (when (eq (car document) 'base) + (alist-get 'href (cadr document))))) + (unless url + (error "Document is missing base URL")) (with-current-buffer buffer (setq bidi-paragraph-direction nil) - (plist-put eww-data :source source) (plist-put eww-data :dom document) (let ((inhibit-read-only t) (inhibit-modification-hooks t) @@ -794,6 +805,16 @@ eww-display-html (forward-line 1))))) (eww-size-text-inputs)))) +(defun eww-display-html (charset url &optional document point buffer) + (let ((source (buffer-substring (point) (point-max)))) + (with-current-buffer buffer + (plist-put eww-data :source source))) + (eww-display-document + (or document + (eww-document-base + url (eww--parse-html-region (point) (point-max) charset))) + point buffer)) + (defun eww-handle-link (dom) (let* ((rel (dom-attr dom 'rel)) (href (dom-attr dom 'href)) @@ -1055,30 +1076,47 @@ eww-toggle-paragraph-direction "automatic" bidi-paragraph-direction))) -(defun eww-readable () - "View the main \"readable\" parts of the current web page. +(defun eww-readable (&optional arg) + "Toggle display of only the main \"readable\" parts of the current web page. This command uses heuristics to find the parts of the web page that -contains the main textual portion, leaving out navigation menus and -the like." - (interactive nil eww-mode) +contain the main textual portion, leaving out navigation menus and the +like. + +If called interactively, toggle the display of the readable parts. If +the prefix argument is positive, display the readable parts, and if it +is zero or negative, display the full page. + +If called from Lisp, toggle the display of the readable parts if ARG is +`toggle'. Display the readable parts if ARG is nil, omitted, or is a +positive number. Display the full page if ARG is a negative number. + +When `eww-readable-adds-to-history' is non-nil, calling this function +adds a new entry to `eww-history'." + (interactive (list (if current-prefix-arg + (prefix-numeric-value current-prefix-arg) + 'toggle)) + eww-mode) (let* ((old-data eww-data) - (dom (with-temp-buffer + (make-readable (cond + ((eq arg 'toggle) + (not (plist-get old-data :readable))) + ((and (numberp arg) (< arg 1)) + nil) + (t t))) + (dom (with-temp-buffer (insert (plist-get old-data :source)) - (condition-case nil - (decode-coding-region (point-min) (point-max) 'utf-8) - (coding-system-error nil)) - (eww--preprocess-html (point-min) (point-max)) - (libxml-parse-html-region (point-min) (point-max)))) + (eww--parse-html-region (point-min) (point-max)))) (base (plist-get eww-data :url))) - (eww-score-readability dom) - (eww-save-history) - (eww--before-browse) - (eww-display-html nil nil - (list 'base (list (cons 'href base)) - (eww-highest-readability dom)) - nil (current-buffer)) - (dolist (elem '(:source :url :title :next :previous :up :peer)) - (plist-put eww-data elem (plist-get old-data elem))) + (when make-readable + (eww-score-readability dom) + (setq dom (eww-highest-readability dom))) + (when eww-readable-adds-to-history + (eww-save-history) + (eww--before-browse) + (dolist (elem '(:source :url :title :next :previous :up :peer)) + (plist-put eww-data elem (plist-get old-data elem)))) + (eww-display-document (eww-document-base base dom)) + (plist-put eww-data :readable make-readable) (eww--after-page-change))) (defun eww-score-readability (node) @@ -1398,8 +1436,7 @@ eww-reload (if local (if (null (plist-get eww-data :dom)) (error "No current HTML data") - (eww-display-html 'utf-8 url (plist-get eww-data :dom) - (point) (current-buffer))) + (eww-display-document (plist-get eww-data :dom) (point))) (let ((parsed (url-generic-parse-url url))) (if (equal (url-type parsed) "file") ;; Use Tramp instead of url.el for files (since url.el -- 2.25.1 [-- Attachment #3: 0002-Add-eww-readable-urls.patch --] [-- Type: text/plain, Size: 4771 bytes --] From a6634a1d5d0cb440554eeaa5a014406e40ffeee9 Mon Sep 17 00:00:00 2001 From: Jim Porter <jporterbugs@gmail.com> Date: Mon, 18 Mar 2024 16:52:34 -0700 Subject: [PATCH 2/2] Add 'eww-readable-urls' * lisp/net/eww.el (eww-readable-urls): New option. (eww-default-readable-p): New function... (eww-display-html): ... use it. * doc/misc/eww.texi (Basics): Document 'eww-readable-urls'. * etc/NEWS: Announce this change. --- doc/misc/eww.texi | 16 ++++++++++++++++ etc/NEWS | 6 ++++++ lisp/net/eww.el | 38 +++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index 522034c874d..a08d6694892 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -151,6 +151,22 @@ Basics displays the readable parts, and with a zero or negative prefix, it always displays the full page. +@vindex eww-readable-urls + If you want EWW to render a certain page in ``readable'' mode by +default, you can add a regular expression matching its URL to +@code{eww-readable-urls}. Each entry can either be a regular expression +as a string or a cons cell of the form @code{(@var{regexp} +. @var{readability})}. If @var{readability} is non-@code{nil}, this +behaves the same as the string form; otherwise, URLs matching +@var{regexp} will never be displayed in readable mode by default. For +example, you can use this to make all pages default to readable mode, +except for a few outliers: + +@example +(setq eww-readable-urls '(("https://example\\.com/" . nil) + ".*")) +@end example + @findex eww-toggle-fonts @vindex shr-use-fonts @kindex F diff --git a/etc/NEWS b/etc/NEWS index b23754fb17f..2af00f712a4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1061,6 +1061,12 @@ only the readable parts of a page or the full page. With a positive prefix argument, always display the readable parts, and with a zero or negative prefix, always display the full page. ++++ +*** New option 'eww-readable-urls'. +This is a list of regular expressions matching the URLs where EWW should +display only the readable parts by default. For more details, see +"(eww) Basics" in the EWW manual. + --- *** New option 'eww-readable-adds-to-history'. When non-nil (the default), calling 'eww-readable' adds a new entry to diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fd697846988..9505378e040 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -275,6 +275,19 @@ eww-url-transformers :type '(repeat function) :version "29.1") +(defcustom eww-readable-urls nil + "A list of regexps matching URLs to display in readable mode by default. +Each element can be either a string regexp or a cons cell of the +form (REGEXP . READABILITY). If READABILITY is non-nil, this behaves +the same as the string form; otherwise, URLs matching REGEXP will never +be displayed in readable mode by default." + :type '(repeat (choice (string :tag "Readable URL") + (cons :tag "URL and Readability" + (string :tag "URL") + (radio (const :tag "Readable" t) + (const :tag "Non-readable" nil))))) + :version "30.1") + (defcustom eww-readable-adds-to-history t "If non-nil, calling `eww-readable' adds a new entry to the history." :type 'boolean @@ -809,11 +822,13 @@ eww-display-html (let ((source (buffer-substring (point) (point-max)))) (with-current-buffer buffer (plist-put eww-data :source source))) - (eww-display-document - (or document - (eww-document-base - url (eww--parse-html-region (point) (point-max) charset))) - point buffer)) + (unless document + (let ((dom (eww--parse-html-region (point) (point-max) charset))) + (when (eww-default-readable-p url) + (eww-score-readability dom) + (setq dom (eww-highest-readability dom))) + (setq document (eww-document-base url dom)))) + (eww-display-document document point buffer)) (defun eww-handle-link (dom) (let* ((rel (dom-attr dom 'rel)) @@ -1159,6 +1174,19 @@ eww-highest-readability (setq result highest)))) result)) +(defun eww-default-readable-p (url) + "Return non-nil if URL should be displayed in readable mode by default. +This consults the entries in `eww-readable-urls' (which see)." + (catch 'found + (let (result) + (dolist (regexp eww-readable-urls) + (if (consp regexp) + (setq result (cdr regexp) + regexp (car regexp)) + (setq result t)) + (when (string-match regexp url) + (throw 'found result)))))) + (defvar-keymap eww-mode-map "g" #'eww-reload ;FIXME: revert-buffer-function instead! "G" #'eww -- 2.25.1
How can I make this function allow to user to select the input method interactively from a list. For instance, have a list composed of italian-keyboard and italian-postfix, with the user selecting one of them. then applying activate-input-method to the user selection? (defun multilinge () "Activate the Italian Dictionary and the Italian Environmment." (interactive) (setq ispell-local-dictionary "it_IT") (activate-input-method XXX) )
Cygw32 build fails on master $ make (snip) CC w32xfns.o In file included from ../../../emacs/trunk/src/w32xfns.c:35: /usr/include/w32api/wtsapi32.h:147:16: error: redeclaration of ‘enum _WTS_VIRTUAL_CLASS’ 147 | typedef enum _WTS_VIRTUAL_CLASS { | ^~~~~~~~~~~~~~~~~~ ../../../emacs/trunk/src/w32xfns.c:30:14: note: originally defined here 30 | typedef enum _WTS_VIRTUAL_CLASS { | ^~~~~~~~~~~~~~~~~~ In file included from ../../../emacs/trunk/src/w32xfns.c:35: /usr/include/w32api/wtsapi32.h:148:5: error: redeclaration of enumerator ‘WTSVirtualClientData’ 148 | WTSVirtualClientData,WTSVirtualFileHandle | ^~~~~~~~~~~~~~~~~~~~ ../../../emacs/trunk/src/w32xfns.c:31:3: note: previous definition of ‘WTSVirtualClientData’ with type ‘enum _WTS_VIRTUAL_CLASS’ 31 | WTSVirtualClientData, | ^~~~~~~~~~~~~~~~~~~~ In file included from ../../../emacs/trunk/src/w32xfns.c:35: /usr/include/w32api/wtsapi32.h:148:26: error: redeclaration of enumerator ‘WTSVirtualFileHandle’ 148 | WTSVirtualClientData,WTSVirtualFileHandle | ^~~~~~~~~~~~~~~~~~~~ ../../../emacs/trunk/src/w32xfns.c:32:3: note: previous definition of ‘WTSVirtualFileHandle’ with type ‘enum _WTS_VIRTUAL_CLASS’ 32 | WTSVirtualFileHandle | ^~~~~~~~~~~~~~~~~~~~ ../../../emacs/trunk/src/w32xfns.c: In function ‘drain_message_queue’: ../../../emacs/trunk/src/w32xfns.c:431:13: warning: implicit declaration of function ‘reset_w32_kbdhook_state’ [-Wimplicit-function-declaration] 431 | reset_w32_kbdhook_state (); | ^~~~~~~~~~~~~~~~~~~~~~~ ../../../emacs/trunk/src/w32xfns.c:431:13: warning: nested extern declaration of ‘reset_w32_kbdhook_state’ [-Wnested-externs] it seems that _WTS_VIRTUAL_CLASS is defines in Cygwin's headaer and reset_w32_kbdhook_state is not defined on Cygw32 build. -- Kazuhiro Ito
What is the difference between 'italian-keyboard' and 'italian-postfix' ?
[-- Attachment #1: Type: text/plain, Size: 312 bytes --] Philip Kaludercic <philipk@posteo.net> writes: Philip, Thanks for all the comments on the macrostep.el code, I'll work on what I can. > Isn't there also a C-preprecossor implementation for macrostep? Would > the plan be to include that as well? Presumably, also. Any comments on macrostep-c.el (attached)? [-- Attachment #2: macrostep-c.el --] [-- Type: application/emacs-lisp, Size: 6627 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Jeremy Bryant <jb@jeremybryant.net>
>> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org, j.j.oddie@gmail.com,
>> stefan@marxist.se, stefankangas@gmail.com, jonas@bernoul.li
>> Date: Sun, 17 Mar 2024 21:48:08 +0000
>>
>> Manual?
>> Should the documentation for macrostep be included in the Emacs Lisp
>> manual section Macros?
>
> Yes, I think so.
>
> Please also provide a suitable entry for NEWS.
>
>> Code?
>> The main file is attached for convenience, from the orphanage upstream
>> (https://github.com/emacsorphanage/macrostep).
>> Are any changes needed before this is merged into Emacs?
>> I volunteer to write some code towards this, please let me know.
>
> Please add :version tags to all the defcustom's and defface's.
>
>> (define-obsolete-variable-alias 'macrostep-mode-keymap
>> 'macrostep-mode-map "2023")
>> (define-obsolete-variable-alias 'macrostep-keymap 'macrostep-mode-map "2022")
>
> The years there should be changed to Emacs versions, I think.
>
>> (defvar macrostep-mode-map
>> (let ((map (make-sparse-keymap)))
>> (define-key map (kbd "RET") #'macrostep-expand)
>> (define-key map "=" #'macrostep-expand)
>> (define-key map "e" #'macrostep-expand)
>
> Bonus points for converting this into defvar-keymap.
>
>> ;; Local Variables:
>> ;; indent-tabs-mode: nil
>> ;; End:
>
> I think this should be deleted, as this is now the default in ELisp
> buffers.
OK, I'll start working on these.
For the macrostep commits, is it easier for future integration that this
is done externally and submitted in one go, or would something like a
new macrostep branch in the Emacs tree be more appropriate?
Eli Zaretskii <eliz@gnu.org> writes: >> c:\msys64\usr\bin\ matters. And iconv.exe under it makes the difference. >> In the log below, the process continues after the first call of gdb.exe, >> while iconv.exe does not exist. >> And the process finishes after the second call of gdb.exe, >> while iconv.exe exists. > > So what is special with iconv.exe? What does "iconv --version" say? Here is the log, and the process finished automatically. c:\tmp>c:\msys64\usr\bin\iconv.exe --version c:\msys64\usr\bin\iconv.exe --version iconv (GNU libiconv 1.17) Copyright (C) 2000-2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Bruno Haible. c:\tmp> Process shell finished > Also, what DLLs does it load? You can find out like this: > > objdump -x c:\msys64\usr\bin\iconv.exe | grep -F "DLL Name:" I have no objdump. I hope output of ldd.exe helps. c:\tmp>c:\msys64\usr\bin\ldd.exe c:\msys64\usr\bin\iconv.exe c:\msys64\usr\bin\ldd.exe c:\msys64\usr\bin\iconv.exe ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffd19ad0000) KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffd17c60000) KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffd172f0000) msys-iconv-2.dll => /usr/bin/msys-iconv-2.dll (0x5603f0000) msys-intl-8.dll => /usr/bin/msys-intl-8.dll (0x430b30000) msys-2.0.dll => /usr/bin/msys-2.0.dll (0x180040000) c:\tmp> Process shell finished /usr/bin/ is same as c:\msys64\usr\bin\. c:\tmp>c:\msys64\usr\bin\mount.exe c:\msys64\usr\bin\mount.exe C:/msys64 on / type ntfs (binary,noacl,auto) C:/msys64/usr/bin on /bin type ntfs (binary,noacl,auto) C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto) c:\tmp> Process shell finished
On Tuesday, March 19th, 2024 at 10:20 AM, Henrique Martins <emacs@martins.cc> wrote: > One way is to enter this in the scratch buffer > (describe-variable 'input-method-alist) > > Place the cursor after the closing parenthesis and type C-u > C-x C-e. Look in the Help buffer that opens, or close it > and look in the scratch buffer. > -- Henrique Would I actually need to set the input method ? What do you this of this (defun heime-multilingu_envir () "Display a list of Multilingual Environments." (interactive) (set-input-method nil) (call-interactively 'set-input-method))
One way is to enter this in the *scratch* buffer (describe-variable 'input-method-alist) Place the cursor after the closing parenthesis and type C-u C-x C-e. Look in the *Help* buffer that opens, or close it and look in the *scratch* buffer. -- Henrique
On Tuesday, March 19th, 2024 at 3:31 AM, Henrique Martins <emacs@martins.cc> wrote: > > I am writing a latex document in italian. How can one introduce the italian > > accented characters. > > > (defun heime-italian() > "Enable it_IT dictionary and italian-prefix." > (setq ispell-local-dictionary "it_IT") > (activate-input-method XXX-prefix)) > ) > > where XXX-prefix could be italian-keyboard, italian-postfix, > italian-alt-postfix, or any of the latin-1 prefixes that > suits you. > > Then execute heime-italian in your latex buffer. > > Try M-x set-input-method then type TAB to list all > input-methods, or search for "italian" in your emacs > distribution, in these files: > lisp/language/european.el.gz > lisp/leim/quail/latin-alt.el.gz > lisp/leim/quail/latin-post.el.gz I would like to have a command that does the equivalent of 'M-x set-input-method' that would show me the list of input methods. > I do that for portuguese/french/spanish, where to type, > e.g. á, type ', then a. Never tried italian. > > -- Henrique
On 16/03/2024 15:31, sbaugh@catern.com wrote: >> This is technically doable, but what looks worrying to me, is that >> this would make 'project-current' lose more of its idempotency. >> >> Originally, the DIRECTORY argument for it was intended to make sure >> that all calls from the same directory would return the same >> instance. But of course a hook can be local, so some can find it >> practical to define buffer-local projects. This side-steps the >> original design, making, for example, the relation "files A and B are >> in the same project" not necessarily symmetric or transitive. > > True, that's annoying. > > Here's an alternative implementation: Maybe we could have a new > project-guess-functions hook which is only run when maybe-prompt=t. And > these functions should return either nil, or a directory in which to > find a project. And they're allowed to prompt or error or whatever. > > And project-guess-functions would only be called if a DIRECTORY wasn't > provided to project-current. (And maybe only if default-directory is > nil? I'm indifferent about whether project-guess-functions or > default-directory takes precedence) > > Then project-find-functions could still be globally the same, so > project-current would always return the same result for the same > DIRECTORY. That still sounds like the same semantics change in 'project-current', something that would reflect on its callers. >>> Possible new functions for project-find-functions which would benefit >>> from this: >>> - A local project-find-function in a version control buffer for >>> viewing >>> a branch log; if the branch is not currently checked out, prompt to >>> check out that branch (or create a worktree for it) before returning the >>> project >>> - A local project-find-function in a buffer from a package for Git >>> forges; if the buffer corresponds to a repository which is not currently >>> cloned locally, prompt to clone the repository. >>> These behaviors should of course be suppressed if maybe-prompt is >>> nil, >>> which is why it would be nice to be able to access maybe-prompt. >> >> What would such project functions return when maybe-prompt is nil? >> Also nil, right? That would kind of create a separate category of >> projects, interactive-only. > > They would always return nil when maybe-prompt is nil. But when they > return something, it would be a normal vc project. All right, that's what I thought. >> With regards to caching, for example, if some caller wanted to do so >> (some related discussion: >> https://github.com/joaotavora/breadcrumb/issues/18#issuecomment-1984615275), >> then would also need to take this parameter into account. > > True, but it's already not correct to cache when maybe-prompt=t, right? > Because the returned project may just be the one that the user choose > interactively at the prompt. It's... a good point, but so far the main exception was the "transient" project, for which one could make an exception somehow, or even cache without major downsides, as long as buffer stays the same and the cache interval is low. Disabling cache altogether with maybe-prompt=t might be a net negative, given that many users' interaction with project.el might be limited to commands that only do such invocations. But perhaps it's the price to pay for flexibility: as long as we're talking about external cache, it will be up to the callers to avoid caching where the results can be non-deterministic, such as after a prompt. >> So the first thing I'd ask is whether you see a different way to >> implement the same features. I don't see the whole usage scenarios, so >> it's hard to judge. > > Let me give some context about my concrete use case. > > At Jane Street we have a code review system built on top of Emacs, > called FE. A user opens a code review in a buffer in Emacs, and can see > that review's diff. If they want to comment on the review, or build the > code or test it or anything like that, they need to also have a local > working copy of the code in the review. The local working copy for each > review is kept separately, like git worktrees. > > (There are some other details and screenshots in > https://blog.janestreet.com/putting-the-i-back-in-ide-towards-a-github-explorer/ > but this should suffice) > > So my use case then is this: when a user opens code review FE-123 in a > buffer, they look at the diff and then decide they want to do something > in a working copy of the code. Currently, to do that they run one of a > variety of internal commands which duplicate things like > project-find-file, but which are aware of whether or not there's a local > working copy, and operate the local working copy if any, and otherwise > prompt to create a local working copy and then error. > > I'd like to replace those internal commands with just normal > project-find-file, and also allow other commands which use > project-current to determine the current project to just work. If you set up a project instance in a buffer-local way, would it even work correctly outside of that buffer? Would project history work fine? When you pick a project from recently visited, you basically just apply its last root directory and expect the project to be "found". I've read the article (thanks!), but I'm not sure yet of what would be the ergonomic savings in such scenario when instead of having a separate command to check out a branch and visit a file in it (perhaps bound to 'o f' inside the major mode map for the branches list's buffer), you call project-find-file right away. In the former scenario such command would make sure the branch is checked out, so its directory has proper contents, and then it could delegate to project-find-file inside said directory. And later visits (e.g. from project-switch-project) would work fine until the directory is deleted. > (Now that I've framed it this way, I guess a good comparison is to > debbugs. It might be cool if, when you run a project command from a > debbugs buffer, you land in a worktree which has the changes from (any?) > patches in that bug. Although that's obviously quite a bit harder since > you need to find the patch in the thread, and find the base branch to > apply it to.) It seems to me the same principle can apply, with the exception of the difficulties you mention, of course. >>> Since adding a new argument to project-find-functions is hard, maybe we >>> could do this by introducing a new dynamic variable >>> project-find-functions-may-prompt which we let-bind? Like: >>> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >>> index c7c07c3d34c..3975182b88d 100644 >>> --- a/lisp/progmodes/project.el >>> +++ b/lisp/progmodes/project.el >>> @@ -242,8 +242,9 @@ project-current >>> (setq pr (cons 'transient directory)))) >>> pr)) >>> -(defun project--find-in-directory (dir) >>> - (run-hook-with-args-until-success 'project-find-functions dir)) >>> +(defun project--find-in-directory (dir &optional maybe-prompt) >>> + (let ((project-find-functions-may-prompt maybe-prompt)) >>> + (run-hook-with-args-until-success 'project-find-functions dir))) >>> (defvar project--within-roots-fallback nil) >> >> As far as the implementation goes, a dynamic variable can work. We >> could also try reusing an existing one: non-essential, and we'd set it >> to nil when maybe-prompt is non-nil. >> >> I wonder how it would interact with Tramp (ask for password in >> disconnected buffers?), but that seems to fall into the same general >> category as your other cases. > > Nice idea, it does seem like we should probably already be binding > non-essential=t around project-find-functions when maybe-prompt is nil. > Since already TRAMP can cause prompting even when a programmer calls > project-current with maybe-prompt=nil. If this change will be enough to cover your scenario, let's go ahead and add the 'non-essential' binding. It does seem to make sense for Tramp, at least.
This variable was new to me when I saw it mentioned last week, so I turned it on, but either it doesn't work or I'm doing something wrong. My steps: In Org source tree, `make repro`. In Emacs: `M-: (setq org-fontify-quote-and-verse-blocks t) RET` Create a temporary Org file like this: #+begin_quote This is a quote. #+end_quote Put pointer inside the quote block and run `M-x describe-text-properties`. It says that the face is org-block, not org-quote as expected: There are text properties here: face (org-block) Bill -- William Denton https://www.miskatonic.org/ Librarian, artist and licensed private investigator. Toronto, Canada
Max Nikulin writes:
> An update with a couple of bugs fixed. Now it is possible to specify
> different export rules for a backend and all its derivatives:
I have implemented your code in the last commit. I think it is a great
improvement, thanks a lot.
As I mentioned in a past email, these days I will be somewhat busy, but
I will try to keep up to date with your comments. Although it may take a
while to respond.
Gabriele Nicolardi <gabriele@medialab.sissa.it> writes:
> Il 15/03/24 14:52, Andrea Corallo ha scritto:
>
> kay I've installed 00553628558 into master, I believe it does what we
> want and seems to fix the minimal reproducer I made from the original
> example.
>
> Gabriele could you check it solves the issue for you?
>
> I confirm that the version compiled from master resolves my issue.
>
> Thank you!
>
> Gabriele
Very cool. I'll keep this bug open a bit just so we remeber to
re-evaluate the backport.
Thanks!
Andrea
[-- Attachment #1: Type: text/plain, Size: 573 bytes --] john muhl <jm@pub.pink> writes: > The test you added here fails when run by a user that doesn’t have > Git configured. When run by such a user the ‘git commit -mFirst’ > command errors which causes the test to fail: > > $ git commit -mFirst > Author identity unknown > > *** Please tell me who you are. I can reproduce the failure running 'EMAIL= make test' (since EMAIL is how I let Git know about my email, rather than ~/.gitconfig:user.email). The attached patch lets the test pass; let me know if it looks sensible? I'll install it then. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Fix-vc-git-test-when-no-identities-are-configured.patch --] [-- Type: text/x-patch, Size: 1595 bytes --] From 5b4456728ef7957d5e858d41834adbb7eeab8b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com> Date: Mon, 18 Mar 2024 19:47:59 +0100 Subject: [PATCH] Fix vc-git test when no identities are configured Reported by john muhl <jm@pub.pink>. * test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Set some environment variables (lifted from vc-tests.el) to let 'git commit' compute dummy author and committer identities. --- test/lisp/vc/vc-git-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el index fd3e8ccd602..bbf0c4277dd 100644 --- a/test/lisp/vc/vc-git-tests.el +++ b/test/lisp/vc/vc-git-tests.el @@ -88,10 +88,17 @@ vc-git-test--with-repo The current directory will be set to the top of that repository; NAME will be bound to that directory's file name. Once BODY exits, the -directory will be deleted." +directory will be deleted. + +Some dummy environment variables will be set for the duration of BODY to +allow 'git commit' to determine identities for authors and committers." (declare (indent 1)) `(ert-with-temp-directory ,name - (let ((default-directory ,name)) + (let ((default-directory ,name) + (process-environment (append '("EMAIL=john@doe.ee" + "GIT_AUTHOR_NAME=A" + "GIT_COMMITTER_NAME=C") + process-environment))) (vc-create-repo 'Git) ,@body))) -- 2.44.0
[-- Attachment #1.1.1: Type: text/plain, Size: 331 bytes --] Hi again, I hope this time I'm not mistaken. When I compile the attached file into a PDF with org-beamer-export-to-pdf, I get a PDF file where the footnotes numbering are using numbers in the text and letters in the footer. Am I doing something wrong? Is there a simple workaround? Good night -- Guillaume MULLER [-- Attachment #1.1.2: BuggyFootnotes.org --] [-- Type: application/vnd.lotus-organizer, Size: 476 bytes --] [-- Attachment #1.1.3: OpenPGP public key --] [-- Type: application/pgp-keys, Size: 673 bytes --] [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 236 bytes --]
[-- Attachment #1: Type: text/plain, Size: 433 bytes --] On Mon 2024-03-18 13:30 -0400, Andrea Corallo wrote: > Okay after reducing it I believe it's a duplicate of 67883 so I'm > merging them. > > Andrea Thank you Andrea! Now I'm going to try living with package.el for a while to see if I still have friction with it. Maybe I can just never trigger this again :) cheers Jon -- In this world / we walk on the roof of hell / gazing at flowers - Kobayashi Issa [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --]
merge 69872 67883
thanks
Andrea Corallo <acorallo@gnu.org> writes:
> Jon Levin via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <bug-gnu-emacs@gnu.org> writes:
>
>> When I update my installed packages on some version of emacs which
>> is build with native-compilation enabled, most times I end up
>> having to kill emacs and restart it in order to sidestep a problem
>> where a single emacs process, seemingly running a compilation step
>> (I think) uses 100% of a single virtual core and never completes.
>>
>> This is the process responsible:
>>
>> mhcat 12800 6874 99 09:10 pts/96 00:10:41 /usr/bin/emacs
>> -no-comp-spawn -Q --batch --eval (setq w32-disable-abort-dialog t)
>> -l /tmp/emacs-async-comp-seq-tests-znp6r0.el
>>
>> I am not sure how to go about reproducing this problem from a
>> standing start (emacs -Q) because this seems to be part of an
>> otherwise opaque series of steps, and I'm not sure how it starts.
>>
>> Perhaps the author of seq.el can help me put together such a test.
>>
>> This is not a new problem, but I noticed that there is a plan to
>> make native-comp part of the default emacs build, to which I have
>> no objection, but feel that my experience is a data point which
>> should not be overlooked. I usually end up building a
>> non-native-comp version of emacs as a daily driver (I am lucky
>> enough to have systems powerful enough that I notice no difference
>> in performance with or without native-compilation enabled - aside
>> from the initial compilation phases which in the case of
>> native-comp, which are a minor inconvenience).
>>
>> Thanks!
>
> Hi Jon,
>
> I can reproduce on master with:
>
> ./src/emacs -batch -l comp -f batch-native-compile test/lisp/emacs-lisp/seq-tests.el
>
> I'll try to have look.
Okay after reducing it I believe it's a duplicate of 67883 so I'm
merging them.
Andrea
[-- Attachment #1: Type: text/plain, Size: 347 bytes --] Il 15/03/24 14:52, Andrea Corallo ha scritto: > kay I've installed 00553628558 into master, I believe it does what we > want and seems to fix the minimal reproducer I made from the original > example. > > Gabriele could you check it solves the issue for you? I confirm that the version compiled from master resolves my issue. Thank you! Gabriele [-- Attachment #2: Type: text/html, Size: 637 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2532 bytes --] Seems I neglected to copy the bug tracker. Here's my reply to Eli and Andrea: On Mon 2024-03-18 13:13 -0400, Jon Levin wrote: > Date: Mon, 18 Mar 2024 13:13:57 -0400 > From: Jon Levin <hi@mhcat.ca> > To: Andrea Corallo <acorallo@gnu.org>, Eli Zaretskii <eliz@gnu.org> > Subject: Re: bug#69872: 29.2; Async native compilation of seq.el test uses > up resources and hangs > > On Mon 2024-03-18 12:51 -0400, Andrea Corallo wrote: > > I can reproduce on master with: > > > > ./src/emacs -batch -l comp -f batch-native-compile test/lisp/emacs-lisp/seq-tests.el > > > > I'll try to have look. > > Thanks! > > Andrea continues: > > I'm wondering as well why seq-tests is loaded in your system as well > > being this a test file. > > On Mon 2024-03-18 18:55 +0200, Eli Zaretskii wrote: > > seq.el is preloaded, so it is native-compiled only during the build, > > and should not be compiled when you update your packages. I think > > what you see is compilation of seq-tests.el, not seq.el, and if that > > is the case, the question is: why does your Emacs decide to compile > > that file? Could you look through your installed packages and see > > which one of them loads seq-tests.el? Is it possible that you have > > seq.el as a separate package, which perhaps Emacs tries to use instead > > of the built-in one? > > That's an excellent question, one which I have asked myself too. > It's almost certain that there is another seq.el being built by my > package manager, straight.el. It appears in dependencies of other > packages, most notably magit. In fact, when I first started seeing > this problem, it was usually while straight.el was building magit - > that package names seq 2.24 as a dependency. I have not spent a lot > of time on the problem but I seem to recall that there have been > breaking changes between versions of seq.el which have taken me on > journies in the past. > > Anyway, I may look into why this happens at some point, but that is > a separate problem and not one which should really attributed to > emacs. It seems that Andrea has found a reproduction of the problem > which should help him find the problem which *is* the subject of > this bug report. > > My guess is that straight.el is being rather too thorough in doing > what it calls a "build" of packages it installs from sources. > > Thanks for the speedy responses! > > cheers > Jon -- In this world / we walk on the roof of hell / gazing at flowers - Kobayashi Issa [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --]