diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-07-11 18:10:53 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-07-11 18:10:53 +0200 |
| commit | 8cfe656fbb312398244d6f0e820d4f179db3cfc7 (patch) | |
| tree | 31102175eb71b82eece64ba62cf494e1014b0fc9 /personal/itches/emacs | |
| parent | 66d44f9dbb1f6a6e8af5d51677ee39c496c46caa (diff) | |
| download | memory-leaks-8cfe656fbb312398244d6f0e820d4f179db3cfc7.tar.xz | |
Move some things around
Diffstat (limited to 'personal/itches/emacs')
| -rw-r--r-- | personal/itches/emacs/bulk.md | 273 | ||||
| -rw-r--r-- | personal/itches/emacs/emoji.org | 26 | ||||
| -rw-r--r-- | personal/itches/emacs/form-feed.md | 56 | ||||
| -rw-r--r-- | personal/itches/emacs/language-support.org | 59 | ||||
| -rw-r--r-- | personal/itches/emacs/narrow-lighter.md | 209 | ||||
| -rw-r--r-- | personal/itches/emacs/unfiltered.org | 8 |
6 files changed, 0 insertions, 631 deletions
diff --git a/personal/itches/emacs/bulk.md b/personal/itches/emacs/bulk.md deleted file mode 100644 index 2de60f4..0000000 --- a/personal/itches/emacs/bulk.md +++ /dev/null @@ -1,273 +0,0 @@ -# Emacs - -- center/top point when - - moving to text/tag search hit - - going to man page section - - opening eww on an anchor - - visiting a function from its Help buffer -- make font-lock stop background at fill-column or max(len(line) for - line in paragraph) rather than window-width when text spans >1 lines -- shell-mode - - add faces instead of reusing font-lock-{comment,string} - - understand `autocd` and `cd !$` - - use Bash completions (e.g. `ls TAB` in a folder with one file) -- [.dir-locals changed priorities][bug#30008] between subfolder and - major mode from 25 to 26 -- eshell: `ls --group-directories-first` does not color folders -- eww, gnus-article: adapt filling to window width changes -- scroll-lock-mode - - cursor stuck on lines wrapped by visual-line-mode - - cursor stuck on lines with 😛 - - scroll when going down newline with forward-… -- matching-paren analysis fails: `;; (here is\n;; a comment)` -- some modes redefine C-M-h, which makes this binding hard to - override; could mark-defun consult functions/values exposed by major - modes instead? -- Man-mode: make isearch skip end-of-line hyphens -- when opening `.gpg` files in a TTY, some characters (e.g. TAB) are - swallowed by Emacs instead of being forwarded to the gpg prompt; - these characters are then inserted in the decrypted file's buffer - (see `epa-file-insert-file-contents`) -- let TRAMP fetch Google Drive credentials from .authinfo.gpg -- icomplete's C-j does not choose the first completion as advertised - on empty input; it chooses ".", which AFAICT comes from the fact - that icomplete-exhibit calls completion-pcm--filename-try-filter - while icomplete-force-complete-and-exit simply calls - minibuffer-force-complete-and-exit - - likewise, if a folder contains foo.c and foo.o, "C-x C-f foo" - hides foo.o, yet C-j completes to foo.o -- calendar uses default X resources when run in its own frame; see - `calendar-frame-parameters`, `x-handle-named-frame-geometry`, - `(make-frame '((name . "")))` vs `(make-frame '((title . "")))` -- use compilation-mode-line-… faces for compilation-num-… indicators -- "é" is not erased with a single DEL stroke, despite [Unicode - conventions] -- sort tar archive members by name; serving suggestion: - - ``` elisp - (defun my/tar-sort (info) - (sort info (lambda (a b) (string< (tar-header-name a) (tar-header-name b))))) - ;; Apply to tar-parse-info in tar-summarize-buffer. - ``` - -- add a command or minor mode to highlight marks; serving suggestion: - - ``` elisp - (save-excursion - (dolist (m mark-ring) - (goto-char (marker-position m)) - (pulse-momentary-highlight-region (point) (point-at-eol)) - (sit-for 0.1))) - ``` - -- StackOverflow-like suggestions when reporting bugs -- match data vs. `:eval` during redisplay: cf. [bug#31586] -- make vc honour `.gitignore` so that `project-find-file` completion - is not cluttered with ignored files -- in a folder with a .git folder and a .gitignore file, - - `C-x C-f .gi TAB` completes to .gitignore - - `C-x C-f .git TAB` says "not unique" -- add some Custom machinery to save additions/removals to list - variables; as things stand, once I add/remove items and save the - variable, I miss out on changes to the variable's default value: - e.g. `git-commit-setup-hook` recently added `bug-reference-mode`, - but I never realized it because I customized the hook to add some - personal functions -- completions in python.el's comint buffer get confused when - readline's completion-prefix-display-length is set: candidates - become elided, maybe python-shell-completion-native-get-completions - is not ready for that? -- some bindings advertised by `describe-mode` in texinfo-mode are - invalid: - - `C-c C-s` runs `Texinfo-insert-node` instead of - `texinfo-show-structure` - - `C-c C-e` runs `Texinfo-environment` instead of being a prefix - command for `texinfo-format-{buffer,region}` -- [bug#31666]: visual-line-mode adds newlines before words that end up - being split anyway -- `gnus-group-make-group` uses `message-y-or-n-p`, which relies on - `message-talkative-question`; the message might be too wide for the - temporary buffer where it is displayed, and `y-or-n-p` prevents the - user from moving to the buffer and looking at the rest of the - message. - -[bug#30008]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30008 -[bug#31586]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31586 -[bug#31666]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31666 -[Unicode conventions]: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00961.html - -## Dired - -- allow "columns" to be toggled; more specifically, make it possible - to hide ownership, permissions, number of hard links… - -- make the filename stand out - -- `% r` does not support some `\` constructs (`\#`, `\,`) - -- add a face for broken symbolic links - -## ERC - -- move timestamp to a better position (see `stamp` module) -- play well with whitespace-mode - -## Org - -- dissociate sub- and super-script fontification from everything else - in org-toggle-pretty-entities - -- org-clocktable trips on DST: - - ``` org - #+BEGIN: clocktable :scope file :maxlevel 2 :step day :stepskip0 t :tstart "[2018-10-15]" :tend "[2018-11-15]" - #+END: - - * foo - :LOGBOOK: - CLOCK: [2018-10-26 Fri 08:00]--[2018-10-26 Fri 17:00] => 9:00 - :END: - - * bar - :LOGBOOK: - CLOCK: [2018-10-29 Mon 08:00]--[2018-10-29 Mon 17:00] => 9:00 - :END: - ``` - -- make org-ctrl-c-ctrl-c call `(org-clock-update-mode-line t)` when - point is on the clocked-in heading - -- new command `org-clock-in-late` to clock out x minutes ago from - previous task, and clock in x ago on task at point - -## read-passwd - -- prevent kills from ending up in the clipboard -- add command to temporarily reveal password - -## whitespace-mode - -- skip line/wrap-prefix variables and properties - -- highlights the adaptive-wrap prefix, although weirdly enough the - whitespace *faces* are not applied - -- in org-indent-mode, adds a spurious (unfaced) space marker before - paragraphs; somehow transient-mark-mode knows not to highlight this - space, maybe the answer lies there - -## Ellipses customization - -Make ellipses for "invisible" text easily customizable (src/xdisp.c). -Make them default to "…" when `(char-displayable-p ?…)`. - -Use-cases: - -- ibuffer truncation -- hideshow -- outline (org) -- rgrep -- magit-process - -## xref - -- search gz-compressed Elisp files when calling `xref-find-references` - from an Elisp buffer: from a user perspective, if - `xref-find-definitions` can visit those files, - `xref-find-references` should work too (even though technically they - don't rely on the same mechanisms) - -- defun-building macros seem hard to understand for xref: e.g. `M-.` - on `rg` does not jump to `rg-define-search rg` - -## External libraries - -### adaptive-wrap - -- a commented-out line with no space between the comment delimiter and - its text will get padded with the comment delimiter: - - ;(some very long line) - ;; ⇒ wrapped with adaptive-wrap-extra-indent set to 4: - ;(some very - ;;;;;long line) - -### debbugs - -- asynchronous bug fetching - -### magit - -- customize current-tag function so that one can add `--first-parent` -- prevent section highlight overlay from hiding tag face background -- when quitting ediff conflict resolution, the "save buffer" prompt is - out of focus, one must ALT-TAB out of the ediff control panel first - (noticed in Emacs 27; 25.1 works fine); possible culprits: - - magit - - ediff - - smerge - - yes-or-no-p - - read-answer -- make status buffer understand and display `typechange` e.g. when - replacing a replacing a regular file with a symlink -- when ignoring a file in a subdirectory, magit attempts to - `git add .gitignore` (i.e. toplevel `.gitignore`), which fails -- if the `-n` log option is set in the status buffer, the "unpulled - from origin/…" section shows an invalid commit count if the `-n` - limit is lower than the actual number of commits -- for repos with dozens of old branches, it would be nice to have a - way to hide or distinguish "stale" branches from active ones, a la - <https://emba.gnu.org/emacs/emacs/branches> - -#### transient - -- cannot use the full domain of `--find-renames` (e.g. 1%) -- cannot call transient-save for all transients (e.g. would like to - always `fetch --prune`) - -### markdown-mode - -- support [shortcut reference links] -- move point past header after C-c C-t !/@ -- update sub-superscript regex to allow L~i+1~ -- make justification work with indented blockquotes -- add "ini ↦ conf-mode" to markdown-code-lang-modes - -[shortcut reference links]: http://spec.commonmark.org/0.27/#shortcut-reference-link - -### rg-mode - -- make -project DTRT in dired - -### page-break-lines - -- borked in magit-diff - -### diff-hl - -- colored fringe line is discontinued on lines featuring faces with - heights greater than 1 - - ``` shell - $ git init - $ echo "* foo" > README.org - $ git add README.org ; git commit -m README.org README.org - $ echo "* bar" >> README.org - $ echo "* baz" >> README.org - ``` - - ``` elisp - (load-file "…/diff-hl.el") - (global-diff-hl-mode) - (set-face-attribute 'org-level-1 nil :height 1.2) - (find-file "README.org") - ``` - -- in Org buffers with org-indent-mode, lines before point will "dance" - around while editing, i.e. while I type, they stick to the left - margin, then when I stop typing, they become indented again. - -### wgrep - -`C-c C-d` (`wgrep-mark-deletion`) could move to the next line, just -like `d` moves to the next line in Dired buffers. diff --git a/personal/itches/emacs/emoji.org b/personal/itches/emacs/emoji.org deleted file mode 100644 index a66ec87..0000000 --- a/personal/itches/emacs/emoji.org +++ /dev/null @@ -1,26 +0,0 @@ -Support for color fonts [[https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00996.html][has landed]] on version 27.0 (master). -Remaining issues: - -* DONE Fix font-hinting =--with-cairo= - -Bug#35781 fixed by Yamamoto Mitsuharu. - -* TODO Check whether combining sequences work - -For example:, regional flags, ZWJ sequences from - -- ZWJ sequences from - <https://unicode.org/emoji/charts/emoji-zwj-sequences.html>: - - 🧟♂️, 🧟♀️ - - 🐕🦺 -- regional indicators: 🇪🇺, 🇫🇷 - -* TODO Add a convenient way to set a font for all emojis - -AFAICT there is no convenient way to =set-fontset-font= e.g. Noto - Color Emoji for "all emojis"; valid TARGETs for this function are - - single characters - - character ranges - - scripts, as defined in =script-representative-chars= - - charsets - - nil = any character not already covered by another font-spec diff --git a/personal/itches/emacs/form-feed.md b/personal/itches/emacs/form-feed.md deleted file mode 100644 index 61fd48b..0000000 --- a/personal/itches/emacs/form-feed.md +++ /dev/null @@ -1,56 +0,0 @@ -# Better out-of-the-box display for FORM FEED - -By default, FORM FEED is displayed as a dumb `^L` glyph. This is -surprising considering it shows up in so many places: - -- Emacs source files (C and Elisp), -- help buffers: - - `describe-mode`, - - `describe-bindings`, - - `view-emacs-news`, -- log buffers: - - `*Compile-Log*`, - - `*Dired log*`, -- … - -You can even see it in source files of other GNU projects, like GCC. - -"Pages" are important enough to have their own navigation and -narrowing commands, yet their default delimiter is displayed as an -unassuming control character. - -I like the way form feeds are displayed with [`page-break-lines`]; -magit's `show-lines` blaming style achieves a similar look. - -Having this kind of display by default would make it more obvious that -this character has actual navigation semantics; as it stands, it looks -no different from some stray CARRIAGE RETURN. - -This hypothetical thin-line display could be re-used by e.g.: - -- `describe-symbol`, which uses the following method to visually break - up multiple symbol definitions: - - ``` lisp - (insert "\n\n" - (eval-when-compile - (propertize "\n" 'face '(:height 0.1 :inverse-video t))) - "\n") - ``` - -- Custom buffers, where sections are delimited visually with a - 999-character wide underlined space. - -(See [emacs-devel][emacs-devel-thin-line] for a use-case recap.) - -Full disclosure -: This reflection started because moving over this underlined space - with `truncate-lines` on causes the screen to jump horizontally. - This specific problem should be fixable without dragging FORM FEED - display into the discussion, but I feel like the latter is the - more interesting issue ([who on Earth] enables `truncate-lines` by - default anyway). - -[`page-break-lines`]: https://github.com/purcell/page-break-lines -[emacs-devel-thin-line]: https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00268.html -[who on Earth]: https://gitlab.com/peniblec/dotfiles/blob/master/.emacs-custom.el diff --git a/personal/itches/emacs/language-support.org b/personal/itches/emacs/language-support.org deleted file mode 100644 index 8d007d3..0000000 --- a/personal/itches/emacs/language-support.org +++ /dev/null @@ -1,59 +0,0 @@ -* Python -** Fix builtin/keyword fontification for Python 3 -E.g. =print= became a builtin. -*** TODO add fontification tests -*** TODO have dedicated font-lock styles for Python 2, 3 and "mixed" -Default to "mixed" (rely on tests to ensure user-visible change). -**** TODO create font-lock styles -**** TODO create variable to choose style -Users could customize it or set it wiht directory-local variables. -*** TODO add heuristic to pick the "right" style -** Fontify f-strings -E.g. =f'an {expression} that should be highlighted'=. - - -* Shell scripts -** Fix builtin/keyword fontification -- =continue= and =break= are /builtins/. -** Fontify variables within strings -E.g. ="an ${expression} that should be highlighted"=. -** Do not highlight single-quoted command substitutions -E.g. ='this $(call) should not be highlighted'=. -** Fix indentation on continuation lines -#+BEGIN_SRC shell -# cf -# - electric-indent-post-self-insert-function -# - indent-according-to-mode -# - indent-line-function => smie-indent-line -# - smie-indent-functions -# - smie-indent-exps -# => calls smie-backward-sexp, which does not skip over ${foo} -foobar \ - indentis4 -foo_bar \ - indentisstill4 -${foo}bar \ - indentisfoobar -#+END_SRC - - -* Makefile -** Recognize [[http://austingroupbugs.net/view.php?id=330][POSIX "immediate-expansion"]] operator ~::=~ - - -* Assembly -** =C-o= inserts a tab despite =indent-tabs-mode= being nil -This seems to come from the mode setting =fill-prefix=. The mode also -does not adhere to the "~RET~ = smart newline, ~C-j~ = dumb linefeed" -convention for no good reason AFAICT. - - -* TeX -** electric-pair-mode and $inline math$ -e-p-m inserts a closing $ after point, but inserts a new pair instead -of overwriting when pressing $ again. -** AUCTeX -*** electric-pair-mode does not work -**** pressing ="= on active region does not surround it with quotes even with electric-pair-mode -TeX-insert-quote erases the region and inserts =``= instead. -**** pressing =$= inserts a single $ diff --git a/personal/itches/emacs/narrow-lighter.md b/personal/itches/emacs/narrow-lighter.md deleted file mode 100644 index e5987b8..0000000 --- a/personal/itches/emacs/narrow-lighter.md +++ /dev/null @@ -1,209 +0,0 @@ -# Make " Narrow" lighter customizable - -The " Narrow" string comes from `src/xdisp.c:decode_mode_spec`: - -``` c -case 'n': - if (BUF_BEGV (b) > BUF_BEG (b) || BUF_ZV (b) < BUF_Z (b)) - return " Narrow"; -``` - -This is probably just a matter of returning the contents of a Lisp -variable instead of this constant string. - -TODO: - -1. get the string value of a variable in C -2. define a customizable string variable -3. write a news entry -4. write a patch -5. extra credits: display string properties - -## Get the string value of a variable in C - -`decode_mode_spec` has some relevant snippets: - -- Given a `Lisp_Object obj`, `SSDATA(obj)` gives the string value as a - `char*`. - -- How to get a variable's `Lisp_Object`? - - `BVAR` works for buffer-local variables - - `V${lispname//-/_}` - -## Define a customizable string variable - -### Defining variables visible to C code - -The C macro `DEFVAR_LISP(string-name, field-name)` does the following: - - define a static `Lisp_Objfwd` variable v - get the address of globals._f##field-name &f - - defvar_lisp(v, string-name, &f) - -As explained in the comments above `DEFVAR_LISP`, `globals` is a -global variable defined in `globals.h`, which is "auto-generated by -make-docfile" and exposes fields, `#define`s and `Lisp_Object`s for -every global variable. - -make-docfile (`lib-src/make-docfile.c`) takes C files as input and -searches all occurences of `^ +DEFSYM[ \t(]`, `^ +DEFVAR_[ILB]` or -`^DEFU`, analyses what comes after and generates appropriate -definitions for `globals.h`. - -`defvar_lisp` allocates a symbol using `Fmake_symbol`. - -### Making it customizable - -`lisp/cus-start.el` defines customizable properties of symbols defined -by C code. - -AFAICT, there is no need to assign the default value right after -defining the variable with `DEFVAR_LISP`: e.g. `shell-file-name` is -`DEFVAR_LISP`ed in `src/callproc.c` and its default value is set in… -Mmm. Not in `cus-start.el`. There is this snippet in -`callproc.c:init_callproc`: - - ``` c -sh = getenv ("SHELL"); -Vshell_file_name = build_string (sh ? sh : "/bin/sh"); - ``` - -But when starting with `SHELL=rofl emacs -Q`, Custom says that the -value "has been changed outside Customize". Changed from what to -what? - -`cus-start.el` may contain a hint: - -``` elisp -;; Elements of this list have the form: -;; … -;; REST is a set of :KEYWORD VALUE pairs. Accepted :KEYWORDs are: -;; :standard - standard value for SYMBOL (else use current value) -;; … -``` - -Except that nope, this does not work. Giving `:standard " Narrow"` -and looking at the variable in Custom yields - - narrow-lighter: nil - [State]: CHANGED outside Customize. (mismatch) - -A better example might be `overlay-arrow-string`, whose default value -is set right after `DEFVAR_LISP` by calling `build_pure_c_string`. - -Why `build_pure_c_string` and not `build_string`? From "(elisp) Pure -Storage": - -> Emacs Lisp uses two kinds of storage for user-created Lisp objects: -> “normal storage” and “pure storage”. Normal storage is where all -> the new data created during an Emacs session are kept (see Garbage -> Collection). Pure storage is used for certain data in the preloaded -> standard Lisp files—data that should never change during actual use -> of Emacs. -> -> Pure storage is allocated only while ‘temacs’ is loading the -> standard preloaded Lisp libraries. In the file ‘emacs’, it is -> marked as read-only (on operating systems that permit this), so that -> the memory space can be shared by all the Emacs jobs running on the -> machine at once. - -"(elisp) Building Emacs" explains that "temacs" is the minimal Elisp -interpreter built by compiling all C files in `src/`; temacs then -loads Elisp sources and creates the "emacs" executable by dumping its -current state into a file. - -## Debug stuff - -### Unicode characters represented as octal sequences - -Trying to customize the new variable to any string with non-ASCII -characters fails: they show up as sequences of backslash-octal codes. -For some reason they show up fine in the Help and Custom buffers. - -Things to investigate: - -1. Should the `Lisp_Object` be created with something other than - `build_pure_c_string`? 🙅 -2. What does the code calling `decode_mode_spec` do with the returned - string? **🎉** -3. (Does `SSDATA` make some transformation before returning the - string? 🤷) -4. (Should a specialized Custom setter be defined? 🤷) - -#### Should the `Lisp_Object` be created with something other than `build_pure_c_string`? - -Maybe this would work? - -``` c -Vnarrow_lighter = make_multibyte_string(" Narrow", strlen(" Narrow"), - strlen(" Narrow)"); -``` - -That looks too ugly though, let's try something else. - -Maybe `STRING_SET_MULTIBYTE(Vnarrow_lighter)` would help? - -*compiles and tries* - -… Nope, it does not. - -#### What does the code calling `decode_mode_spec` do with the returned string? - -``` c -spec = decode_mode_spec (it->w, c, field, &string); -multibyte = STRINGP (string) && STRING_MULTIBYTE (string); -``` - -*slowly turns around* - -*finds `string` standing right there with a blank stare* - -Gah! How long have you been there? - -``` c -/* Return a string for the output of a mode line %-spec for window W, - generated by character C. […] Return a Lisp string in - *STRING if the resulting string is taken from that Lisp string. - […] */ -static const char * -decode_mode_spec (struct window *w, register int c, int field_width, - Lisp_Object *string) -{ - Lisp_Object obj; - /* … */ - obj = Qnil; - *string = Qnil; - - switch (c) - { - /* … */ - } - - if (STRINGP (obj)) - { - *string = obj; - return SSDATA (obj); - } - else - return ""; -} -``` - -Alright then: - -``` c -case 'n': - if (BUF_BEGV (b) > BUF_BEG (b) || BUF_ZV (b) < BUF_Z (b)) - obj = Vnarrow_lighter; - break; -``` - -### Why do string properties not show up? - -🤷 - -## Extra credit - -Maybe it would be simpler to have the narrowing lighter work like the -" Compiling" lighter (cf. `compilation-in-progress` variable), i.e. adding an entry to `minor-mode-alist`. diff --git a/personal/itches/emacs/unfiltered.org b/personal/itches/emacs/unfiltered.org deleted file mode 100644 index 8bc9b52..0000000 --- a/personal/itches/emacs/unfiltered.org +++ /dev/null @@ -1,8 +0,0 @@ -* eglot + pyls: how to add myproject/src to path so that definition/completion works? -* rg/deadgrep: add user-customizable predicate to control default ---no-ignore (eg nil by default = don't add the flag; or user-function -to add it whenever project-root is ~) -* add "fr10x" to quail-keyboard-layout-alist -then try to figure out how to input dot and comma with russian-computer input method (with describe-input-method) - - |
