texts: Magit WIP mode: how to suppress prompt about saving ~/.abbrevs?

texts:
I recently started using magit-wip-mode, but it's got a feature that I'm finding very disruptive to my workflow: if I have defined an abbrev, which I do frequently, then saving any file with C-x C-s (save-buffer) interrupts me with a prompt asking if I want to save ~/.abbrevs.  This interruption is making me crazy, to the point where I'm tempted just to turn off magit-wip-mode.

There must be a better way.  How can I tell magit-wip-mode not to ask about saving all modified buffers, or at least not to ask about saving this particular buffer?  (I suppose I could also think about modifying save-some-buffers, but I'm a little less easy in my mind about that.)

I'm happy to dive into the elisp code.  But where should I start?


texts:
I have a yasnippet that is intended to create a footnote in org-mode format and automatically insert the contents of the clipboard.

# -*- mode: snippet -*-
# name: footnote
# key: fn
# --
[fn:: `(clipboard-yank)`]

This worked correctly until this week. Desired output is this:

[fn:: foo]

But now when I do it, it truncates the contents and adds a Y, such that when the clipboard contains foo, entering fn <TAB> results in this output:

[fn:: ooY]

UPDATE/CLARIFICATION

My yasnippet for org-mode footnotes actually uses not clipboard-yank but my own custom function pasteboard-paste-no-spaces.

# -*- mode: snippet -*-
# name: footnote
# key: fn
# --
[fn:: `(pasteboard-paste-no-spaces)`]

For simplicity, I mentioned clipboard-yank since I tested it and it has the same problem. But since I use a custom function, switching to current-kill won't work for me.

Here's pasteboard-paste-no-spaces:

(defun pasteboard-paste-no-spaces ()
  "Paste from OS X system pasteboard via `pbpaste' to point."
  (interactive)
  (let ((start (point))
    (end (if mark-active
         (mark)
           (point))))
    (shell-command-on-region start end
                 "pbpaste | perl -p -e 's/\r$//' | tr '\r' '\n'"
                 nil t)
    (save-excursion
      )))

UPDATE #2

Thanks for all the help. I'm having the same problem with tiny-expand. I tried using the (with-temp-buffer) approach you suggested to create a new function yas/tiny-expand, but it doesn't work:

(defun yas/tiny-expand (&rest args)
 "Return the string that `tiny-expand' would insert."
 (with-temp-buffer
 (apply #'tiny-expand args)
 (buffer-string)))

Here is the relevant yasnippet where I tried to use (with-temp-buffer): https://gist.github.com/5a799834ddf948ce65a7def95a834401

Here's the original version:
https://gist.github.com/1c947de20a1b7790d04d69ac39884f22


texts:
There is a key on my keyboard which I do not want to do anything. By default when I press it I get a message in my mini-buffer reading <cancel> is not defined. I want to silence that message.

I successfully achieved that with:

(define-key global-map (kbd "<cancel>") (lambda () (interactive)))

But wanted to know if there is a more semantic way of achieving this.


texts: How bind keys to a specific snippet in yasnippet folder?

texts:
Let's say I have a yasnippet snippet called foobar and I have configured it to work it with company-mode (which is not relevant here). Now each time I needed to type foobar I would select it from completion popup to expand yasnippet.

But now I would like to bind this yasnippet insertion action to a key.

I found the yas/insert-snippet function. But then I need to select the corresponding snippet.

I'm looking for a configuration like below to insert the foobar snippet.

(global-set-key "C-b" yas/insert-snippet "foobar") ;; PSEUDO CODE

Any suggestions? It would be really appreciated.


texts: Can I show another commit in a second magit-revision buffer?

texts:
Is there a way to have magit show two commits in two different buffers?

I want to visually look at two commits at the same time. Using magit-show-commit opens a magit-revision buffer. Doing another magit-show-commit in another buffer or frame or window reuses the original magit-revision buffer and overwrites its contents.

Can I somehow force emacs or magit two open a second independent magit-revision buffer?


texts: Synonyms in Emacs: thesaurus and synonyms modes

texts:
I'm trying to use a mode in emacs 24.4.1 for synonyms propositions. I saw those three modes: synonymous, thesaurus and synonyms.

My problems are:

synonymous is apparently not working in emacs without X (i.e. using emacs -nw). The menu is correctly shown using X, but I use emacs in the terminal.
thesaurus is not a fully free solution (you have to use apparently a thesaurus from http://words.bighugelabs.com, which is limited in the number of queries per day through the API)
synonyms needs a synonym library at ftp://ibiblio.org/pub/docs/books/gutenberg/etext02/mthes10.zip
which visibly is not available anymore.

How could I obtain a mode for synonyms lookup and replace in Emacs?


texts: Possible to smooth scroll using pixel and line offsets?

texts:
I'm running into an odd problem scrolling by pixels, it seems calling scroll-up doesn't properly handle pixel scrolling (set-window-vscroll).

This is a simple test that attempts to scroll up by pixels in a timer.

When the entire line is scrolled, the view flickers.

(setq pixel-counter 0)
(defun scroll-down-by-pixels ()
  (setq pixel-counter (+ pixel-counter 1))
  (if (= pixel-counter (frame-char-height))
    (progn
      (set-window-vscroll nil 0 t)
      (scroll-down 1)
      (setq pixel-counter 0))
    (set-window-vscroll nil (- (frame-char-height) pixel-counter) t)))

(defun test-me ()
  (interactive)
  (end-of-buffer) ;; for testing convenience.
  (run-with-timer 0.0 0.01 'scroll-down-by-pixels))
;; Map to any key
(global-set-key (kbd "<f7>") 'test-me)

Oddly enough the reverse direction doesn't suffer from this problem.

(setq pixel-counter 0)
(defun scroll-up-by-pixels ()
  (setq pixel-counter (+ pixel-counter 1))
  (if (= pixel-counter (frame-char-height))
    (progn
      (set-window-vscroll nil 0 t)
      (scroll-up 1)
      (setq pixel-counter 0))
    (set-window-vscroll nil pixel-counter t)))

(defun test-me ()
  (interactive)
  (beginning-of-buffer) ;; for testing convenience.
  (run-with-timer 0.0 0.01 'scroll-up-by-pixels))
;; Map to any key
(global-set-key (kbd "<f7>") 'test-me)

Is this a known issue or is there some way to avoid it?


texts:
I'd like to treat underscores (_) as word characters everywhere (prog-mode, text, comments, etc.). I'm currently doing so in specific modes, like this:

(add-hook ruby-mode-hook #'ivan-treat-underscore-as-word-char)
(defun ivan-treat-underscore-as-word-char () (modify-syntax-entry ?_ "w"))

But I'm not sure how to do the equivalent across the board. Even in ruby-mode, I find that underscores don't behave like word-characters inside strings.


texts: call interactive function from elisp code without worrying about arguments

texts:
So, I want to do (ispell-change-dictionary) inside a function I'm writing, but doing a test throws this error:

(wrong-number-of-arguments #[(dict &optional arg)

I was told that M-x calls the function without arguments. Well, I did the same but for me an error happens. Weird.

I just want to allow the user to select a dictionary without hard-coding the list of dictionaries, showing what's available just as M-x ispell-change-dictionary RET does.


texts: How can I find the date ten business days into the past from today?

texts:
I'm open to suggestions relating to:

org-mode
calendar
calc

I recently learned that the calculator seems to have a basic way of doing it with a list of excluded days (by default Saturday and Sunday), but I don't know how to connect the pieces.

The holiday list I'd be using is the generic US holiday list.


texts:
I'm using windows 10 and emacs 26.1.

In org mode if I want to sort by one column I use

org-sort

It's sort by text, time, function.

Nice.

But what about sorting by two or more columns?


texts:
I recently uninstalled emacs 24.3 and then installed 24.5.1, because I was not able to update Spacemacs in 24.3.

Now .png images are not displaying, including the spacemacs logo that should appear on the homepage, as well as images in .org files.

Is there a library I am missing?  I am on Ubuntu.


texts:
I just installed debian 8 and emacs24. I noticed a new feature! you now can push F11 to enter fullscreen mode. I wanted to put emacs on fullscreen mode at startup, but couldn't find the command... and then I though that it would be easier tell emacs just to "push" F11 on my .emacs

Is there any command I can use so emacs will press a given sequence of keystrokes? something like

(just-push-it "\C-x" "3" "\C-x" "\C-o" "\M-x ansi-term")


texts:
I am using Emacs (GNU Emacs 24.5.1, which is admittedly old, but the problem also exists on a newer (25 something) Emacs on a different machine) and sage-shell-mode to work with the computer algebra system SageMath.

Unfortunately, Unicode output is garbled.

Here is a picture of how output looks:

and here is a picture of how it should look:

I do not know what other information might be useful.
buffer-file-coding-system is utf-8-unix


texts:
I wish to play certain music files, but from certain time. I find the seek forward/backward functions not the ones I need since they require me to fast forward/backward until I arrive at certain time.

What's the correct way of navigating through the music file to certain time from where I wish to play it?


texts: How to add a syntax checker to a major mode for flycheck?

texts:
I have the following flycheck setup in my init.el

(use-package flycheck
      :after web-mode
      :config
      (global-flycheck-mode)
      (flycheck-add-mode 'javascript-eslint 'web-mode)
      :diminish flycheck-mode)

Now, I expect the line (flycheck-add-mode 'javascript-eslint 'web-mode) to add javascript-eslint as a linter whenever I have a buffer running web-mode. However,
when inside a buffer using web-mode I get the following setup:

Syntax checkers for buffer .eslintrc.js in web-mode:

No checker to run in this buffer.

Checkers that are compatible with this mode, but will not run until properly configured:

  handlebars (disabled)
    - may enable: Automatically disabled!
    - predicate:  nil
    - executable: Not found

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20191108.2129)
Emacs version:    25.2.2
System:           x86_64-pc-linux-gnu
Window system:    x

And if I try to manually select the syntax checker, I get:

Syntax checker in buffer .eslintrc.js in web-mode:

  javascript-eslint
    - major mode:  `web-mode' not supported
    - may enable:  yes
    - executable:  Found at /home/mfb/src/MyFantasyBasketball/frontend/mfb-spa/node_modules/eslint/bin/eslint.js
    - config file: found

Flycheck cannot use this syntax checker for this buffer.

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20191108.2129)
Emacs version:    25.2.2
System:           x86_64-pc-linux-gnu
Window system:    x

Anyone have an idea what I'm missing?

P.S. For some reason my :diminish flycheck-mode line also doesn't work...

Edit: expanded use-package command

(progn
  (use-package-ensure-elpa 'flycheck
                           '(t)
                           'nil)
  (defvar use-package--warning313
    #'(lambda
        (keyword err)
        (let
            ((msg
              (format "%s/%s: %s" 'flycheck keyword
                      (error-message-string err))))
          (display-warning 'use-package msg :error))))
  (condition-case-unless-debug err
      (eval-after-load 'web-mode
        '(if
             (not
              (require 'flycheck nil t))
             (display-warning 'use-package
                              (format "Cannot load %s" 'flycheck)
                              :error)
           (condition-case-unless-debug err
               (progn
                 (global-flycheck-mode)
                 (flycheck-add-mode 'javascript-eslint 'web-mode)
                 (if
                     (fboundp 'diminish)
                     (diminish 'flycheck-mode))
                 t)
             (error
              (funcall use-package--warning313 :config err)))))
    (error
     (funcall use-package--warning313 :catch err))))

Also, I noticed it will work if I add the single line (flycheck-add-mode 'javascript-eslint 'web-mode) to my init.el. I just can't get it to work with use-package for some reason

Edit 2: flychecker-describe-checker output

javascript-eslint is a Flycheck syntax checker in `flycheck.el'.

  This syntax checker checks syntax in the major mode(s) `web-mode', `js-mode',
  `js-jsx-mode', `js2-mode', `js2-jsx-mode', `js3-mode', `rjsx-mode',
  `typescript-mode'.

  This syntax checker executes "eslint". The executable can be overridden with
  `flycheck-javascript-eslint-executable'.

  This syntax checker can be configured with these options:

     * `flycheck-eslint-args'
     * `flycheck-eslint-rules-directories'

Documentation:
A Javascript syntax and style checker using eslint.

See URL `https://eslint.org/'.

[back]


texts: TRAMP doesn't know some of the remote commands

texts:
I'm using my local emacs to edit files on a remote cluster. Therefore I added:

[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return

to my remote .zshrc and I can edit and browse files without any problems. I can even compile (M-x compile) file using:

gcc test.c -o test

I checked: It runs on the cluster and not my local machine, however if I run:

mpicc -std=c99 -Wall -o exec heat.c
/bin/sh: line 2: mpicc: command not found

If I do the same in a regular SSH-Session it works without any problems.

How can I use mpicc on the cluster from emacs?

emacs -Q doesn't help.


texts: Cannot upgrade packages when adding melpa to the package-archives

texts:
I have problems upgrading packages coming from melpa:
When executing list-package with "https://melpa.org/packages/" in the package-archives I get the following in the *Messages* buffer:
Using a proxy for https...
gnutls.c: [0] (Emacs) Received alert:  Handshake failed
gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname melpa.org :loglevel 0 :min-prime-bits nil :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil)
error in process filter: End of file during parsing

I guess this is an SSL/TLS issue, so I checked:

I had Emacs compile with the default gnutls support.
I have set (setq package-check-signature nil) before (package-initialize)

Does Emacs needs to know some certificates for melpa?
More environment info:

Emacs is 27.1 compiled from source.
OS is CentOS 6. (Cannot change the OS.)
Connection is via a local proxy (which does not need any authentication).


texts: How to set magit remember git passphrase on Windows?

texts:
I run magit on Linux and it works very well. On Windows, it works almost the same except the push process:

Git Bash would ask me to enter passphrase to continue, while magit just hangs.

I set ssh-agent to remember passphrase on git bash. But it has no effect on magit.

Is there a way to let magit remember passphrase?

Edit

I use SSH, not HTTPS. So the github credential helper won't work.


texts:
I've got a couple dozen org files that I'd like to have loaded at once.  They're in a directory structure something like this:

org/dev
org/dev/python.org
org/dev/emacs.org
...
org/dev/ios
org/dev/ios/swift.org
...
org/dev/android
org/dev/android/android.org
org/ergo
org/ergo/programming_by_voice.org
...

What's the best way to load all these files at once so that I can have the buffers in memory when I'm working on my notes?  It's nice to be able to type C-x b and have my buffers listed for autocomplete with ido, rather than navigating the directory tree.


texts: ELPA archives directory contents: the data structure used?

texts:
I just stumbled across the archives directory of my .emacs.d/archives/ . Here's the beginning of .../archives/gnu/archive-contents

(1
 (ace-window .
         [(0 9 0)
          ((avy
        (0 2 0)))
          "Quickly switch windows." single
          ((:url . "https://github.com/abo-abo/ace-window")
           (:keywords "window" "location"))])
 (ack .
      [(1 5)
       nil "interface to ack-like tools" tar
       ((:keywords "tools" "processes" "convenience")
    (:url . "https://github.com/leoliu/ack-el"))]) ...

Can someone "deep in the lore" enlighten me to what this is about, specifically, how this s-expression AST(?) is built, on what criteria. What is the data schema used here, et cetera....


texts:
I'm using tramp to access files in remote via Bastion server using following tramp syntax:

    /ssh:root@BASTION-HOST#BASTION-PORT|root@REAL-HOST#REAL-PORT:

The problem is, whenever I access REAL-HOST, $HOME/.ssh/known_hosts in BASTION-HOST is updated.  Since most hosts behind the BASTION-HOST are ephemeral, I don't want TRAMP update known_hosts file.

After looking at tramp-methods, TRAMP does uses -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no on the first host (which is BASTION in this case), but it looks like these options do not propagates to multi-hops.

I'm using Emacs 25.1.1 (Mac)

Any idea?


texts: Hard return to soft return of a .tex file

texts:
I have tons of LaTeX files with hard returns at column 80 like the test file below:

\documentclass{article}

\begin{document}

Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo
bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
foobar Foo bar foobar:
\begin{equation}
  x^2 + x + 1 = 0.
\end{equation}
% Foo
% Bar
\begin{itemize}
\item Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar.
\item Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo
  bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar
  Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar
  Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo
  bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar
  foobar Foo bar foobar Foo bar foobar.
\end{itemize}

\end{document}

Now, I use soft wrap with visual-line-mode. If I were to type the same file now, I would get something like this:

\documentclass{article}

\begin{document}

Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar:
\begin{equation}
  x^2 + x + 1 = 0.
\end{equation}
% Foo
% Bar
\begin{itemize}
\item Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar.
\item Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar Foo bar foobar.
\end{itemize}

\end{document}

Is there a way to tell emacs to do the conversion while preserving the environments and comments lines.

Note: I use auctex if it matters.


texts:
The cedet info I am using with emacs 23.4.1

ECB 2.40 uses CEDET 1.0 (contains semantic 2.0, eieio 1.3, speedbar <unknown version>).

I am trying to create a cpp-root-project for out-of-source-tree building, however, when I try to create a project definition using

(ede-cpp-root-project "project-root"
                      :file "~/dev/gorgon/build/dummy-makefile"
                      :include-path '("/Source")
                      ;:system-include-path '("~/linux")
)

by requiring the file containing above code to load with

(require 'projects)

it gives following error

Symbol's function definition is void : ede-cpp-root-project

at first I thought maybe this "feature" is lacking so I tried to list available projects from ede projects and it listed

Automake
make

My question is does this functionality supported in CEDET 1.0 or am I doing something wrong?

the codes related to ede in my init.el file

(global-ede-mode 1)
(semantic-mode 1)
(ede-enable-generic-projects)
(global-semantic-idle-scheduler-mode)
(global-semantic-idle-completions-mode)
(global-semantic-decoration-mode)
(global-semantic-highlight-func-mode)
(global-semantic-show-unmatched-syntax-mode)


texts: Why does thing-at-point not consider plus as a filename character?

texts:
Why does thing-at-point not consider + as a filename character?

For example:

(defun my-get-filename-at-point ()
  (interactive)
  (message (thing-at-point 'filename t)))

and consider the cursor positioned at the filename
bookmark+-1.el in the buffer. Running M-: (my-get-filename-at-point) will either return "bookmark" or "-1.el".


texts: Adding day to %t in orgmode capture template

texts:
Complete novice here to Emacs and OrgMode. I've created a capture template (.txt file) that takes 1 task and returns a list of 3 subtasks that need to be completed. I have been able to get the template to request a schedule date for the subtask 1 using %^t.

Subtask 2 should be scheduled for the day following the first subtask. Is there a way of doing this simply in the .txt file? I've scoured the internet and tried various tricks but to no avail. I haven't yet figured out a way of making the date a variable and then modifying it in the .txt file. Here is the code currently in the .txt file:

* TODO %^{Task Name?}
** TODO SubTask 1
   SCHEDULED: %^{When schedule Subtask 1?}t
** TODO SubTask 2
   SCHEDULED: ;;would like this to be subtask1 date + 1 d;;
** TODO SubTask 3

Any help would be much appreciated - Thanks in advance!


texts: Retrieve alist from list of alists by value of specific key inside of it

texts:
I'm probably missing something simple here but... I've got a list of alists parsed from JSON using json-parse-string. The list of alists is like the following (details omitted for brevity):
( ((id . 1) (url . "http://gnu.org") (description . "GNU Operating System"))
  ((id . 2) (url . "http://fsf.org") (description . "Free Software Foundation")) ... )

I'm trying to retrieve an alist from the list by the value associated to id in the alist.
E.g. (function 2 list) would return ((id . 2) (url . "http://fsf.org") (description . "Free Software Foundation"))
Obviously I could while or cl-loop over the list to find this out, but what is more a Lispy way of doing this?


texts: How can I startup Spacemacs with term shell opened?

texts: I'd like to have a term shell opened after startup of Spacemacs. How do I have to configure .spacemacs?


texts: Why does Emacs org-mode ask for master file?

texts:
When opening .org files, Emacs asks for a master file.

Why is that and how can I disable this feature?

I guess it is because of using latex-related packages like ox-latex and ox-beamer.

Is there a way to make the master file for .org files latex mode-specific or switch it off completely?

Thanks.


texts: fix or workaround: "Terminal is not fully functional"

texts:
What can I do about this issue? I'm using

psql, inside a ssh tunnel to ubuntu, inside a M-x shell, inside a emacsclient -nw


texts:
I'd like to find a way to organize and access my (Latex) templates within Emacs and so far, I didn't find a satisfying solution. (This post is related, but doesn't solve my question.)

Let's say that I want to typeset some article. Optimally, I would be able to create a template for a folder that contains several relevant files (and folders) and specify which of them should be opened in new buffers once I create a new project from this template. It might also be desirable that the generated file names follow a specified naming scheme relative to my project name (e.g. creating a project "x" should result in a new folder "x" containing files "x_main.tex", "x_coverpage.tex", "x_options.tex", ... and folders "images/", ... ).

Is there any plugin that suits my purposes? What about other solutions?


texts: Make fill-paragraph in python docstring leave the triple-quotes on separate line

texts:
I type a python docstring all on one line like this:

"""
This is a long docstring. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis.
"""

and then I hit M-q (fill-paragraph), and I get this:

"""This is a long docstring. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Donec a diam lectus. Sed sit amet ipsum
mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas
mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem
lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non
tortor. Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed,
adipiscing id dolor. Pellentesque auctor nisi id magna consequat
sagittis.

"""

I have two problems with this:

The docstring starts on the same line as the """ -- I'd prefer to have the triple-quote stay on its own line.
(Much lower priority.) The docstring ends with a blank line.

The example above is contrived, but I run into this frequently especially when editing existing docstrings where I'd like to simply M-q and have the whole para reflowed.


texts: Derived mode from CC Mode: how do I write one?

texts:
Where is the definitive, up-to-date guide on how to write a derived mode from CC Mode.  I have a mode that's malfunctioning and thought I might just rewrite it, but information I find is spotty and inconsistent.  The example mode reference in the code is

http://cc-mode.sourceforge.net/derived-mode-ex.el

and it doesn't look much like the mode I want to rewrite.  I wonder if maybe things have changed since this example was written in 2002.


texts: Is there a way to attach hidden/invisible data to a place in text?

texts:
I want to keep track of some stuff happening in the buffer, with elisp, and display indicators depending on that stuff. To that end, I need to cache calculated data for different parts of the file, and then quickly access and update that data. Specifically, this will be going on in Org-mode, and my data is associated with individual headings.
The conundrum here is, how do I best store this data, in memory, so it's associated with headings but not visible and not written to the file? I.e. when I insert or remove text in one place, points later in the file need to keep data associated with them—I can't just use text positions as keys in a dictionary (not without lots of hassle). It's also preferable that hidden data is not copied around together with yanked text.
To clarify, I'm aware that I can add properties on Org headings, or create IDs and associate my data with them—but I want to do this without any changes to the content.
So far it seems that ‘text properties’ might vaguely be what I want—if I can add my own custom fields in properties on headings. Elisp documentation notes that these properties are copied when text is yanked, and suggests putting them on an overlay instead. I'm rather hazy yet on how overlays function at all (though will probably need them for the indicators). Is this the best route, or maybe I'm looking in an entirely wrong place? Any nice rakes here for me to step on or shoot my feet?
Meanwhile, ‘invisible text’, popular in web search results, is not the thing I need—as afaict it's written to the file.


texts: Weird behaviour of M-; (`comment-dwim`) in Autoconf-mode

texts:
When editing an Autoconf (configure.ac) file I observe strange behaviour when using M-; (comment-dwim) to uncomment a selected region. When a region with comments is selected comment-dwim calls uncomment-region, so maybe the problem is in that function.

Commenting a region works as expected:

# ACML
AC_SEARCH_LIBS(dgemm, acml_mp,
   [found_blas=1 AM_CPPFLAGS="-D_acml_ $AM_CPPFLAGS"],
   [AC_MSG_NOTICE([NOT using AMD the ACML library])],
   [-lgfortran]
)

becomes:

dnl # ACML
dnl AC_SEARCH_LIBS(dgemm, acml_mp,
dnl    [found_blas=1 AM_CPPFLAGS="-D_acml_ $AM_CPPFLAGS"],
dnl    [AC_MSG_NOTICE([NOT using AMD the ACML library])],
dnl    [-lgfortran]
dnl )

However, when trying to uncomment the region, the result is:

dnl ACML
dnl AC_SEARCH_LIBS(dgemm, acml_mp,
   [found_blas=1 AM_CPPFLAGS="-D_acml_ $AM_CPPFLAGS"],
dnl    [AC_MSG_NOTICE([NOT using AMD the ACML library])],
   [-lgfortran]
dnl )

Did I miss something or have I hit a bug?


texts: What I want is basically a programmatic version of org-refile, where I can pass in a string as input. Currently, org-refile doesn't provide this functionality.


texts:
Emacs is freezing when running the following custom find-function and I'm looking for some assistance, please, to debug it.

I'd like the prefix argument C-u to make the difference between switch-to-buffer-other-window or switch-to-buffer.  By removing find-function-read from the interactive statement, that function no longer returns a symbol -- so that is why I am using make-symbol.  I did not see an example by Googling that shows how to use an interactive command of "P" and another function such as find-function-read all in the same interactive statement.

(defun my-find-function (arg)
  "Find, in another window, the definition of FUNCTION near point.
See `find-function' for more details."
  (interactive "P")
  (let ((function (make-symbol (format "%s" (car (find-function-read))))))
    (if (eq arg '(4))
      (find-function-do-it function nil 'switch-to-buffer-other-window)
      (find-function-do-it function nil 'switch-to-buffer))))


texts: Can I take vector (SVG) screenshots of Emacs?

texts:
The gtk-vector-screenshot program can be used to take vector screenshots of Gtk-3 applications. It seems to work by asking the application to redraw itself onto an SVG canvas.

Emacs on GNU/Linux can be built with Gtk+, but trying to use the aforementioned application on an Emacs window results in a screenshot that only contains GUI elements such as the menu bar; buffers are not rendered (I tried with and without Cairo). This is not too surprising, given that Emacs' buffer rendering happens at a pretty low level.

Still, is there a way to take scalable vector screenshots of Emacs?


texts: Imenu is missing multi-line golang function signatures

texts:
When a golang function signature is split with a linebreak it does not appear in imenu nor helm-imenu. I would like to jump between functions using helm-imenu, but this issue is in my way. Not hard-wrapping the function signatures is not a solution because others on my team have other preferences.

For example:

// This function does _not_ appear in imenu.
func (b *Foo) LongFunction(ctx context.Context, a A,
    b B, c C) foobar.Bazzybaz {
...
}

// But this one does!
func (b *Foo) ShortFunction(ctx context.Context, d D) foobar.Wazoo {
...
}

Short of fixing the problem for me, it would be super helpful if you could point me towards where helm-menu/imenu gets its symbol list in the first place. Or another package suggestion for fuzzy-searching the file's function list.

emacs 24.5 (9.0)
osx 10.12.3


texts: Opening a .tex file on Windows emacs 25.1

texts:
When I try and open a .tex file on emacs 25.1 under Windows I now get this error:

File mode specification error: (dbus-error No connection to bus :session)

And cannot typeset anything using the usual C-c C-c command.

I think it may be something to with trying to load auctex because if I start emacs with -Q and open a tex file it opens OK.

Does anyone have a clue how to fix that?  It works fine on emacs 24.5.1


texts: replacement for `emacs -xrm Xft.embolden:true -fn Hack-13` for emacs 27.1

texts:
For last 2 years (2018-) I've been using
emacs -xrm Xft.embolden:true -fn Hack-13
to start emacs w/ suitable sized and 'brightness'ed fonts for me in my systems.
What that does gives extra boldness to font glyphs in every weights used.
That has worked fine with emacs 25 and 26 (and could work w/ emacs 24, too...)
Now since I upgraded to emacs 27.1 (in 3 fedora systems I have) the extra bolding supposed be given by that
embolden does not have any effect anymore...
probably due to the great technology called HarfBuzz(?)
[[edit 2020-09-17 -- use of Cairo instead of HarfBuzz is more probable cause for this, thanks for comment for me to think outside of this -- compared output of (emacs-version) in versions 26.3 and 27.1 of emacs and latter mentioned "cairo"]]
For urxvt I use -fn xft:Hack-13:embolden -> emacs -fn Hack-13:embolden makes no difference.
emacs -fn Hack-13:weight=bold does bold the "regular" weighted fonts but does not make "bold" fonts any bolder (like Xft.embolden:true does).
What are my options? I hope I don't have to resort to recompile Hack fonts with extra boldness to begin with ;/


texts:
I'm using the following config for my most used agenda view:

    ("c" "Daily plan"
     ((agenda ""((org-agenda-ndays 1)
         (org-agenda-category-filter '("+life"))
         (org-agenda-sorting-strategy
          (quote ((agenda time-up priority-down tag-up))))
         (org-deadline-warning-days 14)))
     (todo "TODO")
     (todo "NEXT"
    ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'deadline))))
     (todo "WAIT"))
    ((org-agenda-tag-filter-preset '("-chores"))))

Additionally I have only two main org-mode files: life and work, what I'd like to do is to set my emacs so that when I start it at work agenda shows  entries filtered by default to work only (same as navigating to a work entry in agenda and pressing '<'). It's not much typing but being unable to automate this irritates me a lot.

As you can see in line 3 I've tried to specify that life is always the default filter but it did not work. Any ideas of how this can be done?


texts: Matching a literal asterisk (*) in a regexp

texts:
I am trying to write a regexp to mean:

At least one of a few punctuation marks followed by any number of blank spaces followed by a literal star is to be replaced by all those punctuation marks followed by a literal star.

So, when doing interactively,

\([.,?!:;]+\)[[:blank:]]*\* is replaced by \1*

But in elisp, I am not able to get the literal star. I tried:

\\(\[\.,;:?।\]\+\\)\[\[:blank:\]\]\*\\* to be replaced by \\1\\*

But it does not work.

Will you please point what is wrong? I think I am not escaping the literal star correctly. But I am not able to see what is the correct method.


texts: How can I enter visual mode by holding shift in normal mode in evil?

texts:
If I press shift in insert mode, I can select text using the arrow keys. I want to be able to do the same in normal mode. This is what I got so far:

(define-key evil-normal-state-map (kbd "S-<left>") (lambda () (interactive) (evil-visual-char) (backward-char)))
(define-key evil-normal-state-map (kbd "S-<right>") (lambda () (interactive) (evil-visual-char) (forward-char)))

It works well, except S-<left> behaves weirdly since pressing it continuously it also extends the selection on the right side, even though the key-binding is only set for the normal mode.


texts: is there a way to kill buffers when using the `switch-to-buffer` view

texts: when using C-x b followed by TAB, a list of buffers are brought up. Is there a way to quickly kill the buffers that are not needed (by pressing <delete> or d) on the selected buffer?


texts: When I compile a file with pdflatex from Auctex one of the buffers that I have opened shows the output of this operation. How to stop this behavior and keep the previously opened buffers?


texts: Emacs-native solution to searching files

texts: When I use Emacs on a Linux OS, I search through files with rgrep. On Windows machine this takes some additional setup. Is there an Emacs-powered solution for searching through multiple files that does not depend on external utilities?


texts:
I'm on a Mac and am having problems with Emacs and libmagick.

Right now, Emacs exits and prints:

  Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib
  Referenced from: /usr/local/Cellar/emacs-plus/24.5/Emacs.app/Contents/MacOS/Emacs
  reason: image not found

But, that file does exist.

[I] bheesham.persaud $ file /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib
/usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64

A similar error pops up in the macOS Report Problem dialog when trying to launch an Emacs GUI.

What do I need to do to get Emacs to recognize the imagemagick library?

Additional information:

Process:               Emacs [96152]
Path:                  /usr/local/Cellar/emacs-plus/24.5/Emacs.app/Contents/MacOS/Emacs
Identifier:            org.gnu.Emacs
Version:               Version 24.5 (9.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Emacs [96152]


texts: Can't choose citation types using org-ref

texts:
I am very new to Emacs and I am trying to figure out how to use org-mode and org-ref to write academic papers.

Following the instruction of org-ref setup, I was able to export org file to tex and pdf. However, the default citation type is not really for the journals in my research area (I believe it's just \cite{} in Tex and basically a number in [ ] in pdf). The author of org-ref package has kindly offered a way in the manual to change the default citation type to a couple of other types by pressing C-u in the helm citation selection buffer (to enter this selection buffer, it's C-c ] or SPC m i c in spacemacs) before actually inserting the citation into the org file. Another window of different types is expected to appear and allows users to choose what they want, such as citet, citep.

I noticed that C-u runs evil-scroll-up in spacemacs, which is very handy. This might cause the issue of not being able to choose citation types, or not (tried other distribution somehow still not working).

Would it be possible to help me with this? Many thanks.


texts: Replace a character with a string as it is typed

texts:
I would like to do the following: activate some mode so that whenener I type the $ character in my buffer, it immediately gets replaced by <m>.
Even better: when I type $ it puts <m></m> and places the cursor between the matching tag pair.
I have no problem with the solution being quick and dirty, but I would need to be able to turn it on and off.
Context: I've started using PreTeXt, which is basically "laTeX meets xml", to write a math text. It works very well, but having to type <m> all the time is damaging my productivity (I'm already enjoying c-C ] to close the tags.)


texts:
When I run package-install in windows with Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 I got error error in process filter: could not create connection to marmalade-repo.org:433

According to the web site of marmalade, that happens because they changed http to https and to avoid the error I followed the instruction.

But by M-x package-refresh-contents I got the same error error in process filter: could not create connection to marmalade-repo.org:433.
What can I do to avoid the error?


texts: org schedule entry when another transitions to DONE

texts:
Is there a mechanism to specify that a todo entry should be scheduled after some other Todo entry transitions to DONE? something like schedule 2d after completion of some other TODO entry or event. this is much like how repeated tasks can be automatically rescheduled after transitioning to Done state.

I believe this can be implemented by keeping (id and schedule metadata) pair for each task of interest in the master task. the master task would be the task whose transition to the DONE state is going to be used as a hook to schedule tasks. Then on the hook of when the master task transitions to the Done state, schedule appropriately. It would be nice if this info can also be kept track of in the target tasks that are to be scheduled.


texts: Examine function arguments after debug-on-error

texts:
Here's a common debugging scenario: I am investigating a failure and for whatever reason I cannot instrument the relevant code with edebug. I can, however, in most cases get a backtrace via toggle-debug-on-error, or debug-on-entry. In the backtrace, I can jump to code along the call stack, but how does one get the values or arguments  or variables?  Here's an simple example:
(define-error 'test-signal
  "Test signal" 'error)

(setq myvar 42)
(defun foo (arg)
  (signal 'test-signal '(1 2 3)))

(provide 'foo)

Now Imagine I have debug-on-error turned on, and do M-x eval (foo 123).
Once I'm in the debugger, what commands do I need to issue to see that the value of arg is 123 and of myvar is 42? debugger-eval-expression always seems to return "Symbol's value as variable is void".


texts: How to clear a cell in an org-mode table?

texts:
Is there a built-in command to delete the contents of a cell in a single keystroke within an org-mode table? Note, I don't want to delete the row, just the cell contents.

 | some text |  ==> |             |

If not, how would you write this?


texts: Emacs Latex/Auctex: Error message about using `Tex-command-list` command to set `Make` as a compile option

texts:
I have a setting in my Spacemacs dotfile that adds Make as a compile option for a latex document. The actual command is below.

(add-to-list 'TeX-command-list
            '("Make" "make" TeX-run-compile nil t))

For some reason this command seems to generate a error. The specific message is:

 (Spacemacs) Error in dotspacemacs/user-config: Symbol’s value as variable is void: TeX-command-list

Is there a better way to write this command, or has the api for the Tex-command-list command, etc?


texts:
I use the Misc-Fixed fonts because I enjoy non-antialiased fonts.  They are designed per height, and tolerate shrinking badly.  For instance, in the following example, the default font is set to 9x15 and the face used for the sub and superscript just indicates (:height 0.8):

—To be honest, I'm not even sure what Emacs is doing here, as it ends up using a serifed font.

Question: How can I make my fonts great again?  Many other faces are defined using an height setting; I'd like to map, e.g., an height of 0.8 to the font 8x13, an height of 0.6 to 7x13, etc…

(On GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-09-18)


texts: elisp replace float number with half value

texts:
I need to replace below string:

(24.0000,28.0000) .. controls (27.3100,28.0000) and (29.9800,25.3100) .. (29.9800,22.0000)

to:

(12,14) .. controls (13.655,14) and (14.99,12.655) .. (14.99,11)

The rule is:

coordinate x and y divided by 2.
remove trailing zeros.
other parts keep it as is.

I wish to do it in elisp:

#+BEGIN_SRC elisp :results output
  (let (str x y (i 0))
    (setq str "
  (24.0000,28.0000) .. controls (27.3100,28.0000) and (29.9800,25.3100) .. (29.9800,22.0000)
  ")
      (while (string-match "(\\([0-9.]+\\),\\([0-9.]+\\))"  str i)
        (setq i (match-end 0))
        (setq x (/ (string-to-number (match-string 1 str) 10) 2))
        (setq y (/ (string-to-number (match-string 2 str) 10) 2))
        (print (format "%f,%f" x  y))
        ))
#+END_SRC

#+RESULTS:
:
: "12.000000,14.000000"
:
: "13.655000,14.000000"
:
: "14.990000,12.655000"
:
: "14.990000,11.000000"

It can extract the numbers and do match on it, but how can I replace it within original string?

I am thinking about replace-regexp-in-string but it not good to do match on it.


texts: How to alphabetize strings with diacritics?

texts:
Q: how do I alphabetize strings with diacritics?

Problem

I have a long list of author names, some of whom have letters with
diacritics in their names (e.g., "á" or "é").  I want to sort this
list alphabetically.

The problem: sorting the list with string-lessp does not sort them alphabetically.

According to the accepted answer
in
this post from a sister site,
English ignores the diacritics in sorting except to break ties.
(Other languages do it differently.)

Toy Example

Here's a toy example.  The list of letters that I start with is
already ordered alphabetically.  When I sort this list with
string-lessp, however, it sorts them in what I presume is
unicode point order rather than alphabetical order:

(let ((letters '("a" "à" "á" "â" "b" "c" "e" "é" "ê")))
  (sort letters #'string-lessp))
;; => ("a" "b" "c" "e" "à" "á" "â" "é" "ê")

What Do I Do?

How can I alphabetize strings with diacritics in them?

At a minimum, I'd like to respect the "ignore diacritics except to
break ties" rule described above.  Ideally, I'd like to be able to
alphabetize according to an arbitrarily defined language, but I'll
happily settle for English.


texts: How to turn off line wrap when opening from terminal

texts:
I'm trying to open a file from terminal and ensure that line-wrap will be off. I'm trying the following code, but it won't work

emacs --no-window-system --eval '(setq truncate-lines 1)' file

I don't want to set it as default or to change init. Just to open this specific file without wraping lines.


texts:
In Firefox I can hit Ctrl-f to start a search and Ctrl-g to search the next occurence of the string searched. If I would like to search for a different term, I simply hit Ctrl-f again and type in the new search term right away.
In emacs I hit Ctrl-s to search but if I don't find, what I was looking for (after multiple Ctrl-s) I have to hit Ctrl-g and then Ctrl-s again. Or I hit backspace multiple times to go back through the matches and finally delete character by character.
I thought about assigning isearch-forward to a different key to be able to restart the search dialog quickly.
Is there a more elegant way to do this?


texts: Dired+. Is it possible to change color of recent created/edit files/folders?

texts:
Windows 10, Emacs 25.1, Dired+

I use file manager Total Commander. And I set them to show different color (blue) for recent(e.g 1 hour) created/edited files/folder. It's very comfortably.

Here example:

Is it possible in Emacs in Dired+ mode?


texts: How do I display line numbers in emacs (not in the mode line)?

texts: I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text editors. How do I do this for emacs?


texts: Replace a match only till some other match is found

texts:
Aiming to convert first row of a html table from  to  tags.

So, I wrote the following code.

(defun tdtoth ()
  (if (search-forward "
" nil t)
      (while (search-forward "td" nil t)
        (replace-match "th" 1))))

And executed it while I was on  in the following text:

   Some text
   Another thing

The idea being search for
 only once and while that is not happening, replace every td with th

But that code does not work. What is wrong and how do I set it right?


texts:
I currently try to figure out, how I can handle some lines specifically without messing up the indentation of the rest of the buffer. Consider the following function MyFunc as an example:

void MyFunc()
{
  unsigned y = 0;

DONOTINDENT;

  unsigned int x = 5 + 2;
  return x + 12;
}

Here, I want the line DONOTINDENT; to be indented to column 0, whereas the rest of the function should be indented normally. I tried to solve this using the following custom c-special-indent-hook:

(defun my-c-mode-indent-hook ()
  (let (p1 p2 myline)
    (setq p1 (line-beginning-position))
    (setq p2 (line-end-position))
    (setq myLine (buffer-substring-no-properties p1 p2))

    (if (string-match-p "DONOTINDENT" myLine)
        (save-excursion
          (indent-line-to 0))
      )
    )
  )

(defun my-c-mode-common-hook ()
  ;; my customizations for all of c-mode and related modes
  (setq c-special-indent-hook 'my-c-mode-indent-hook)
  )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

OK, this works quite fine for the line DONOTINDENT;, however it does not work for all the subsequent lines, as these are indented relative to DONOTINDENT;. So, if DONOTINDENT; is indented to column 0, unsigned int x = 5 + 2; will be indented to column 0, too, but it should be indented to column c-basic-offset.

How can I fix up the indentation for the following lines? Is there some internal variable that I can use to influence the computation of the indent-level of the subsequent lines, or is this computation purely based on the preceding indentation. I think, it should be possible to somehow accomplish this as labels in switch-case-statements are indented in a similar way, but I struggled to figure this out when digging into the cc-mode code.

Thanks in advance!

Best regards,
Fabian


texts: Setting up Emacs as an external editor on windows 10

texts:
Apologies if this has been asked multiple times already, haven't found a useful answer.
I am trying to use Emacs as an external editor on two separate applications in windows 10, one is a notes app (Joplin), the other is a 3D software, by typing the path to the file.exe of that editor. Both allow you to set up the external editor of your choice. If I use Sublime Text it works straight off the bat, whereby I:

open what I need to modify in the application

use Sublime to modify that text, save when I'm done, close, and the text gets updated in the application.

I can't get this to happen with Emacs. I am assuming that Emacs is not overwriting the temp file it is editing, somehow. What am I doing wrong, is it possible to use Emacs as an external editor for other applications?


texts: Autocompletion of a variable name while Python debugging

texts: Suppose I want to debug Python script in Emacs. M-x pdb run pdb like this pdb script name.py. Next I'd like to examine a variable. I type p and first letters of a variable name, then press Tab and instead of completion of the variable name cursor moves right. Ho to achieve completion of a variable name on Tab press while debugging Pyhon in Emacs?


texts: Suddenly incorrect fontification of newlines

texts:
When a font style is applied to the newline character, certain styles - such as background colors - normally are extended to the end of the visual line. Suddenly this has changed for me, and the fonts make it look like the newline character is a trailing space.

What can cause this?
I am running Emacs 27.2 on Open Suse 15.1 64 bit. I recently performed a major update of packages, after the updater had been stuck for a while, so I suspect something in there might be causing the change.


texts: Which, if any, of the emacs email programs is written exclusively in elisp?

texts: I am looking for a pure elisp email program to examine and potentially modify.


texts: Adding `**` to head of lines with numbers in the beginning

texts:
I have the following contexts:

4. Pattern-Matching Conditional: How to use pcase and friends.
5. Iteration: while loops.
6. Generators: Generic sequences and coroutines.

and intent add ** to the head of each lines thus try replace-regexp
^\([::digit::]\) → ** \1
However, nothing happened.

What's the problem with my solution?


texts: Open ibuffer selected buffers in the same window

texts: Is it possible to tell ibuffer to visit selected buffer in the same window where ibuffer was shown? In my case it always tries to visit buffer in the other window if there are several windows available.


texts: Adding to kill-buffer-hook results in "setq: Wrong type argument"

texts:
Subtract a buffer's (the file's) size from a variable before killing it. Emacs 26.

(defvar cumulative-open-bytes '0 )

(defun buffer-settings-calc-bytes ()
  (interactive)
  (let ((current-open-file-size (file-attribute-size (file-attributes buffer-file-name))))
    (setq cumulative-open-bytes (- current-open-file-size cumulative-open-bytes))
    (message (propertize (format "Cumulative Open Bytes: (%d) after closing %s (%d bytes)."
                                  cumulative-open-bytes buffer-file-name current-open-file-size)
                         'face 'warning))))

(add-hook 'kill-buffer-hook 'buffer-settings-calc-bytes)

Results in the following message:setq: Wrong type argument: number-or-marker-p, nilThis appears just after the string message from the function.

I have tried setq in place of the let, and removing interactive.
Emacs will not load with the above, and evaluating it in place breaks
most navigation and buffer features.

Notably toggle-debug-on-error.

The following also appears invoking arbitrary commands in addition to the above:
Error running timer: (wrong-type-argument number-or-marker-p nil)

Is this a local binding issue? How should this hook be set?


texts: Crash when opening a file with non-ascii characters - how to diagnose?

texts:
Running MacOSX GUI emacs installed via homebrew.

Whenever I open a regular text file that contains non-ASCII characters, Emacs immediately crashes. These files have no header lines specifying encoding or other settings.

Works fine in terminal-mode emacs.

I'd like to understand the cause of the crash, not just make it go away. Emacs leaves no core file or other debris.


texts: Is it possible to insert word at point in swiper?

texts:
I'm using swiper for searching, one thing i very much miss compared to isearch is to insert the word at point into swiper. I have icicles installed, but M-., which i usally use to insert word at point into the current minifbuffer, doesn't seem to work.

I found some code in the emacs wiki

(define-key swiper-map (kbd "M-.")
  (lambda () (interactive) (insert (format "\\<%s\\>" (with-ivy-window (thing-at-point 'word))))))

That seemed to basically do what I want, except it doesn't really work. It inserts the text with <> surrounded (ok, i could fix that) and multiple calls to M-. don't continue inserting the next word(s) into swiper.

Therefore I wonder if there is any canonical solution to this, if swiper already provides the functionality to insert word at point into the search, then I didn't find it in the documentation.


texts: I have a number of org-mode/text documents that contain English and Hebrew text. They are scholarly papers. However, the Hebrew text in Emacs is not displayed correctly. I am using Dejavu Sans Mono as my font. The problem is that vowels are displayed next to the consonants rather than beneath them. There are a few other anomalies too. If I export the documents in org mode to html or odf then the Hebrew is displayed correctly. I have tried changing the font, installing "unicode-fonts" and a host of other solutions. I have tried using different versions of Emacs. I use utf-8 as my default encoding system. Nothing seems to work. If I open the same text document in LibreOffice, again, the text is displayed correctly. If I strip the Hebrew text of vowels, using an online program (like https://www.miniwebtool.com/) then the consonants appear correctly in Emacs when pasted back. The problem is that I need the vowels too. I also have other academic papers with Greek, and these display correctly without any problems. I would appreciate any help with this problem.


texts: org collapses with three dots ... after helm-org-in-buffer-headings jump

texts:
I use helm-org-in-buffer-headings.  You can see the three dots ... in the picture.

The desired result is:

The three dots part is expanded.


texts: Jumping to a temp buffer, prompting for save and restoring layout

texts:
I'm trying to write a function to do the following tasks:

Extract a piece of text from the current buffer (specifically, a diff)
Switch to a temporary buffer in another window, and insert this text into that buffer.
Set the temporary buffer's major mode (to diff-mode).
Prompt the user to save that buffer to a file.
Kill the buffer, and restore the window layout if necessary.

The rough skeleton of the function is as follows:

(defun extract-and-save ()
  (interactive)
  (let ((text-to-save (get-text-to-save)))
    (with-temp-buffer?
      (insert text-to-save)
      (diff-mode)
      (save-buffer))))

I'm not able to get the with-temp-buffer invocation right -- I either end up saving the buffer before it's visible and not killing it afterwards, or mess up the major mode of the previous buffer before switching.

I've tried using with-temp-buffer-window and variants, but I don't understand them well enough/they don't work.

Any pointers?


texts:
As a new Emacs user, I decided to start using Gnus. I achieved to configure it, but I didn't manage to send mail properly. Indeed, when I use either C-c C-c or M-x message-send-and-exit, it loads KMail (my default mail reader on Fedora 23 KDE) fulfilled with my mail specificities. Is there a way so I could send mail from Emacs itself?

=========================================================================

I fixed it using another emacs configuration on github (https://github.com/eschulte/emacs24-starter-kit/). I guess it's too soon for me to make my own configuration :)


texts:
I use flycheck for Python with pylint, pep8 and other built-in checkers, but also I will use pep257 to highlight doc-comments formatting errors. I read official documentation, but not understand, who I must write in my .emacs for connecting pep257 to flycheck.

How to add pep257 to flycheck without opening issue on GutHub?


texts: How to evaluate the variables before adding them to a list?

texts:
The below obviously doesn't work and hence this question.

How do I correct the below code so that the value of somelist becomes '(("abc" . 123)) ?

(setq x "abc")
(setq y 123)
(setq somelist nil)
(add-to-list 'somelist '(x . y))


texts: Modifying the insertion type of overlay markers after creation

texts:
On creation of an overlay it's possible to specify the "insertion type" / advance behavior of the beginning and end markers:

  (make-overlay BEG END &optional BUFFER FRONT-ADVANCE REAR-ADVANCE)

It's possible to change the insertion behavior for markers directly:

  (set-marker-insertion-type MARKER TYPE)

  Set the insertion-type of MARKER to TYPE.
  If TYPE is t, it means the marker advances when you insert text at it.
  If TYPE is nil, it means the marker stays behind when you insert text at it.

From Managing Overlays:

  "Do not try modifying the markers in the overlay by hand, as that fails to update other vital data structures and can cause some overlays to be lost."

I get that markers are not easily accessible for the purposes of encapsulation, but I really want to temporarily change the insertion behavior temporarily! :-)  I suppose that I can destructively re-create the overlay twice, but that involves copying properties and any costs associated with underlying overlay data structures.

Q: How can I efficiently modify overlay marker insertion types?

If I were to circumvent the intended information-hiding and obtained a reference to individual markers, would modifying the insertion type temporarily (and inserting text) violate an essential invariant for overlay data structures?


texts: Find All Dependencies Necessary for an Emacs Install Without X

texts:
I'm building a script to install a version of emacs (24.5 in this case) on a small server running on a raspberry pi. Since this will be in headless mode, I have no need for a GUI/X windows based installation and will run the configuration with the --without-x flag.

That being said, how can I find all the dependencies needed by emacs24.5 (or in general) so that I can build a list for installation?

Further context:

Using Raspbian OS, I do not know how to get sudo apt-get build-dep emacs24 to work as a command, so that is why I am asking for a list of these dependencies.
the recommendation from this SX answer seems to be the closest to this, but apt-cache depends emacs24-nox seems to give a shallow answer in terms of dependencies. Is this all I really would need to put?


texts: Save Nano File on Terminal through 'ssh'

texts:
I've accessed a server through the ssh mode in Emacs. I need to create and save a file on the server.  I can open a file through nano <filename> and start to type. However, I'm unable to close & save the file.  Nano states that I should use C-x to close but that key sequence is interrupted by Emacs which waits for a further command & I can't find anyway to enter C-x as an alternative.

Is there a way to do this?


texts: Make gnus display inline html images by default

texts:
How can I make gnus display inline images from html articles by default?

A command exists to display them on a per-article basis:
gnus-article-show-images

however I would like this behavior automatically.

Google searches turn up articles dating all the way back to 2002, utilizing out-dated since removed variables. I've also found forum posts and gits with dotfiles only as old as 2015 with the out-dated variable:
mm-inline-text-html-with-images

I cannot find this in any documentation, nor have I successfully found an exhaustive changelog (or any real changelog, for that matter) of emacs or gnus, that I can find when this variable was removed, or canonical evidence it ever existed, as emacs/gnus does not recognize this variable.

Both inhibit images variables are nil

Emacs Version: 25.3.1
Gnus Version: 5.13


texts: Is there an auto-align package or mode for Emacs?

texts:
There are times when I'm editing files (Puppet manifests, for example) where I want to align buffer contents on the fly.  For example, I know that I can use align-regexp or align to align code like this, as long as I have it selected:

# M-x align-regexp "=>" will line everything up nicely
file { "/etc/foo":
  ensure => present,
  mode => "0666",
  source => "puppet:///modules/example/foo",
}

But what I really want is to have this happen on the fly -- without having to select a region or the whole buffer.  Is there a package or mode that will do this, or is this something that would have to be built in to the mode I'm interested in?

Edit: I asked about Puppet and CFEngine, since that's what I code in most these days and I have a strong preference for aligned text.  However,  I was also curious (and did not express this well) to know if on-the-fly alignment is a feature that's common in Emacs modes (mainly in modes for programming languages), or if most people align when saving or at some other point.


texts: Automatically move installed packages to site-lisp to benefit all user accounts

texts:
I have scripts to setup virtual machine images, where emacs packages are installed for the root account. Currently, I manually copy them to the appropriate site-lisp directory, i.e. one of those defined by package-directory-list --  either /usr/share/emacs/24.3/site-lisp/elpa or /usr/share/emacs/site-lisp/elpa.

While the above approach works for making installed packages accessible to normal user account, I would prefer to avoid hand editing the packages directory.

Is there a way to automate this process in package.el itself ?


texts:
I would like to do the following: load some theme when working on a particular kind of source file (say, Haskell), but elsewhere use a different "default" theme.

I naively imagine that this is achievable by loading the the default theme when exiting haskell-mode, but I don't know how to do things on exiting modes. Is this possible, or is there some better way to achieve what I want?


texts: No tty in shell buffers in Carbon Emacs on High Sierra

texts:
I've been using the Carbon Emacs port of Emacs, which is based on Emacs 22, for many years. I know it's way out of date and unmaintained, but I have a huge collection of home-grown extensions that I took with me when I left a job two decades ago, and some of them aren't compatible with modern Emacses.

Last week I upgraded my MacBook from El Capitan to High Sierra. Emacs is still working fine except for one thing: shell buffers no longer have a tty. I guess something changed in the way that applications get a pseudo-tty, and Emacs doesn't know how to do it.

I generally do all my command-line work in shell buffers rather than Terminal windows (which I just use for logging into Linux servers for work), so this is really annoying. I can't use sudo since it requires a tty to ask for the password, and many applications change their behavior depending on whether stdin/stdout is a tty (e.g. ls doesn't show its output in columns, python doesn't show interactive prompts).

I know I'm going to have to bite the bullet one of these days and upgrade to a recent Emacs version (Carbon Emacs is 32-bit, and Apple has announced that these will no longer be supported in an upcoming release). But I was wondering if someone knows a quick fix I can use to remedy this one thing while I work on switching.


texts: Where can I read the bidi algorithm implementation?

texts:
I'm interested in reading the part of the Emacs source code where the bidi (bidirectionality) algorithm is implemented. Where is it?

P.S. I've never looked at the Emacs source code before, and I'm a rather amateur programmer.


texts: Expand yasnippet only when it's at beginning of the line

texts: How to write snippet condition to expand it only when it's positioned at the beginning of the line?


texts: How to match the function name in a function call?

texts:
I am trying to extract the function name from a function call. For example:

(let ((str "(test-func"))
  (if (string-match "^(\\s_+" str)
      (message "ok")
    (message "no match")))

But this gives "no match".. (For simplicity I reduced str to the start of the real string. A real string could be for example "(test-func a b)"

I think the problem is the \s_   symbol constituent regex..


texts: (set-charset-priority 'unicode) ; should I do it?

texts:
I've seen the following in some init files,

(set-charset-priority 'unicode)

but after reading the documentation, I can't really say I understand the  implications of this. In general I'm inclined to go Unicode and UTF-8 all the way, this being 2017, but would setting unicode as the highest priority charset have performance implications?

I know that a charset is distinct from an encoding scheme (e.g. UTF-8), but I don't think I understand Emac's handling of charsets well enough to understand the effect this setting has.

Currently, running charset-priority-list in my current Emacs returns a list of 170 charsets, beginning with:

(ascii
iso-8859-1
unicode
latin-iso8859-1
...


texts: How to see manual for god-mode and other packages?

texts: I installed god-mode and I can't see any manuals to learn how to use it. Also how do I enter insert mode? god-mode is unusable without it


texts:
In my mode-line there's a cryptic set of characters like -UUU:@%*--F32

I know I could read through the documentation to figure out what they all mean, but I'd rather just hit a key and have a window pop up with a human-readable expansion of each of those mode-line characters that are showing up in my currently active buffer.

Is there a package that does this?


texts:
If I have outline structure like this:

* Tasks
** First
** Second
** Third
** etc

is there a simple way to turn all tasks into TODO items or checkboxes? I can of course use replace-string but maybe there's already a keybinding, since maybe it's seems to be done quite often?


texts: Emacs converting spaces to tabs when using X11 primary selection in a terminal window

texts:
When I use emacs in a terminal window on linux, I am often getting spaces unexpectedly converted to tabs when I cut and paste using the X11 primary selection. What reproduces the problem for me is the following:
Open a terminal window. (I tested using both lxterminal and aterm.) Start emacs with the -nw option. Type the following text character by character on the keyboard:
1234567 1234567

(If you copy and paste it from the stackexchange question, it won't reproduce the problem.) Triple-click on this line of text to copy it to the X11 primary selection. Open a new terminal window, and in that window do od -a. Click the middle mouse button to paste the text into the terminal. This is echoed by the od command with an ht rather than an sp.
I'm pretty sure this is emacs doing this, because if I use the lightweight editor mg instead, it doesn't happen. I've also tested that this still happens if I hide my .emacs file, so that it's not resulting from any customizations that I've done there.
Can anyone explain how to get rid of this behavior?
Update: Gilles' comment shows that this happens at line 265 of this file https://github.com/emacs-mirror/emacs/blob/master/src/cm.c , which has the following code: if (tabcost < (deltax * tty->Wcm->cc_right)) { . I would like to find a solution for this problem that doesn't involve my having to make my own private fork of emacs. I would be happy to see an answer that would suggest an approach to doing this by submitting a patch to emacs. Perhaps this behavior could be turned off by setting a certain flag in lisp. If that seems like a reasonable approach, then it would be great to see an answer saying so, and maybe pointing to an example of how well-behaved emacs C code would access such a flag. If I was an emacs maintainer, I would just rip all the code out, because I just don't think this is reasonable behavior for a terminal-based application in the year 2020, but possibly some people depend on this behavior and it would cause problems if it were simply removed.


texts: Evil-Mode: Problem "interactive" buffers with letters defined, like q to close popups

texts:
In Evil-Mode, when there is an buffer with alphabet keys bound, such as a help buffer (binding q) or a magit-popup buffer (strangely not a magit status buffer), I need to enter into insert mode in order to reach these bindings.

How can I make these buffers work without having to enter into insert mode?

I have currently unbound and sacrificed q which saves me a lot of trouble, but I am looking for a more general solution.


texts: Are there any libraries for input fields in Emacs?

texts:
Quite a few Emacs modes use (something like) forms: the customization interface is one of them, the Message mode (read: its header part) is another one; there are more of them, unfortunately not always very similar.  By a "form" I mean here a buffer with read-only parts and places designated to enter text; it may or may not contain buttons (it probably should accept C-c C-c as the confirmation/committing key, irrespective of the presence of an OK button).

I am particularly interested in auto-completion in the fields (and in particular, enabling fields with lists of values from some designated set, say, comma-separated).  My question is: is there any Emacs library enabling easy (by "easy", I mean not reinventing the wheel) creation of such forms, or should I code everything myself?

(I imagine that what I should do in the latter case would be (1) set some parts of the buffer read-only, (2) prepare a special major mode, so that e.g. TAB and S-TAB switch between "fields", and (3) maybe use something like Icicles or Helm for autocompletion.)


texts: Ignore org mark-up line-by-line, when responding using org-mime

texts:
I'm using org-mime to send e-mails inside mu4e - the exact details are outlined in the reference here.  I will cover the specifics of this problem below.

This works well, however when replying I note that the reply is also passed to org-mime-htmlize and as such it is treated as org mark-up.

Here's my reply message

Foo Bar writes:

> Here is an example of what it looks like in the edit buffer before I send the message
> He's another line
> And another

__

Here's my signature

This causes incorrect formatting when characters in the original message coincidentally represent org mark-up.

The most obvious problem is that each original line is by default prefixed with a ">", and org is interpretting every other line as what looks like a column divider in a table.

This is configurable using message-yank-empty-prefix, message-yank-cited-prefix, and message-yank-prefix.

What I need is a string-prefix to each line such that org will interpret it as "treat the whole of this line as plain text".  This would nicely fix the specific example above, but also any other mark-up issues on the lines.

The documentation doesn't really suggest a method for doing this (there is a footnote that suggests using a comma as the first character, but this doesn't seem to work, and the comma is rendered in the HTML reply too).

There are other possible options but they are more complex and clunky - I'll share these below:

For example I have considered customizing message-citation-line-format and mu4e-compose-signature to effectively wrap the text in between in a #+BEGIN_EXAMPLE and #+END_EXAMPLE block.  That works, kinda, but obviously the #+END_EXAMPLE also exists when Composing a completely new message.

It may also be possible to escape all the characters in the original message before passing it org-mime-htmlize - I haven't been able to work out a way of doing this tho.

Lastly I'm wondering if I can mark the region somehow before calling org-mime-htmlize - my problem here is that both my response and signature are in org mark-up, so I'd need to mark both regions.  It's not clear to me what happens to the text that isn't marked, is it discarded or included as plain text?

I'm hoping this problem has come-up before - does anyone have any pointers on how make sure original messages are properly rendered in replies?

Update

A clue from stackoverflow gave me the right teminology to use!

From the manual here I note that the correct terminology is emphasis in org-mode.

So I should be surrounding lines in "=" for verbatim or "~" for code.

Strange thing is I do this then the whole line disappears from the resulting e-mail!

This doesn't happen if I use #+BEGIN_EXAMPLE. or #+BEGIN_SRC.

I'm assuming org-mime is simply discounting any plain text in the message?

I can also confirm that if you highlight a region within an e-mail, anything outside that region is completed discounted by org-mime-htmlize - that is, not only is it not processed as org mark-up, it is completely excluded from the final message.  So this method isn't going to work.


texts:
When inserting a reference in a LaTeX document (using Auctex) I normally type:

\cite{joebob_2010}

where "\cite" shows up in blue font, while "joebob_2010" shows up reddish/purple.  I like this coloring.  However, when I use

\citep{joebob_2010}

all text shows up white.

In my .emacs file I put:

(add-hook 'LaTeX-mode-hook
    (lambda ()
      (font-lock-add-keywords nil   '(("\\(\\\\citep\\)\\s-*{" 1 font-lock-keyword-face t)))
      (font-lock-add-keywords nil   '(("\\(\\\\citet\\)\\s-*{" 1 font-lock-keyword-face t)))
      ))

This changed the color of "\citep" to blue, but the reference to "joebob_2010" remains white.  Can I modify this to have the same coloring as "\cite{joebob_2010}"?

EDIT/SOLUTION

I posted a bug report to the gnu group for Auctex and found out there was no bug after all.  The following solution works.  In the .emacs file, put:

;; set special font highlighting for \cite* commands
(add-hook 'LaTeX-mode-hook
     (lambda ()
       (font-lock-add-keywords nil  '(("\\(\\\\citep\\)\\s-*{" 1 font-lock-keyword-face t)))
       (font-lock-add-keywords nil  '(("\\(\\\\citet\\)\\s-*{" 1 font-lock-keyword-face t)))
       (font-latex-add-keywords '(("citep" "*[[{")) 'reference)
       (font-latex-add-keywords '(("citet" "*[[{")) 'reference)
       ))

Adding the keywords at the end is the key.


texts: Passing Alt+letter keybindings through to OSX?

texts:
Is there a way to tell Emacs to ignore a certain key binding and pass it to the OS unmodified? Eg. I am typing German from time to time and use Alt+u o to type ö in OS X apps.

With Alt set to Meta I would like to tell emacs to ignore the M-u binding, so that I can use M-u o to enter ö as in other applications. (global-unset-key (kbd "M-u")) does remove the binding from emacs, but pressing M-u does nothing, instead of adding an umlaut to the next pressed character.


texts:
Yesterday I started getting this popup in Emacs:

Emacs-x86_64-10_10

Fix continuation lines?

It happens after I write an email in mu4e and send with delay (Github repo). If I click Yes or No, the popup appears again, and then I get a message in the mini-buffer, "Blocking call with quit-process inhibited" (or something like that).

How can I fix it?


texts:
I am using emacs with org mode.

Question 1:

I want to number a column in a table in hex.
E.g.

| 0x00 | xyz | .. |
| 0x01 | abc | .. |

I want to auto generate first column.
Any ideas how to do this in org mode?

Question 2:

How to generate a list of numbers/alphabets etc. (in hex, decimal) in emacs (need not be org mode)?

PS: Please let me know if there are any linux/bash tricks to do this.


texts: Charset and fonts shown by `describe-char`

texts:
I have some questions about emacs internal actions related to charset and fonts shown by describe-char.

Now I use utf-8 as character encording scheme (CES) on emacs, so charsets shown by describe-char are supposed to "unicode". But since I often use Japanese kanji, the following configuration

(set-language-environment "Japanese")

is added. Then charset of kanjis is changed to "japanese-jisx0208" keeping CES to be utf-8 like the below (ex.kanji "字").

             position: 813 of 2102 (39%), column: 51
            character: 字 (displayed as 字) (codepoint 23383, #o55527, #x5b57)
    preferred charset: japanese-jisx0208 (JISX0208.1983/1990 Japanese Kanji: ISO-IR-87)
code point in charset: 0x3B7A
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 5b57"
          buffer code: #xE5 #xAD #x97
            file code: #xE5 #xAD #x97 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-VL  -VL Gothic-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1 (#x15A9)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-5B57
  general-category: Lo (Letter, Other)
  decomposition: (23383) ('字')

I considered utf-8 transforms characters of Unicode to byte codes not "japanese-jisx0208", but the shown charset is "japanese-jisx0208". So I have following two questions.

Setting language environment of emacs "Japanese", is the encording with utf-8 executed after the shwon charset "japanese-jisx0208" is transformed to "unicode" inside emacs?
Depending on my first question, why the font of unicode (-VL Gothic-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1) is applied?


texts: html mail background has same color as text

texts:
I'm using the material theme an mu4e. When opening some not all html mails, the background color of the mail becomes grey and the text becomes the same color, which leads to a blank "grey" page. Only selecting the text makes it visible.

How do I get rid of this?


texts: Is there a way I can open emacs (spacemacs) recent files from rofi?

texts:
I know Spacemacs keeps track of my recently-edited files. But I can't find a function that will allow me to see these from the command line.

Ideally I'd like to find a way to run Rofi and see a list of recent files, and open them in emacs.

I know there's a helm function for this, I just think it'd be cool to do with Rofi.


texts: Using thing-at-point as initial input for bookmark-jump with bookmark+ and helm mode

texts:
I am using bookmark+ and helm mode.

Debugging a large Fortran code base, I have created some bookmarks that has the same name as some of the Fortran subroutines. Now, I would like to put the cursor on the subroutine name and press C-x r b to run bookmark-jump to the given function (given at point). As it works now, a Helm buffer with name "bookmark-jump" is shown, and the minibuffer prompt is shown as "Jump to bookmark:".

I would like to have the thing-at-point filled in as initial input after the minibuffer prompt. How can this be done?

Note: I have looked at the bookmark+-1.el source code and found a variable bmkp-default-bookmark-name, but that does not allow the initial input to be set as far as I can see.


texts:
Emacs has the scroll-all-mode, which scrolls two buffers synchronously.

I would like to edit about 8 files on 8 different hosts synchronously.  This can be achieved by running vi in cssh.  Is the same possible with Emacs using Tramp?

By editing files synchronously I mean that I type one word and the word gets inserted in 8 different files opened in 8 different buffers. And when I move the cursor, the point in 8 different buffers are moved. And when I mark a word, 8 words in 8 buffers are marked. And when I kill a region, 8 regions in 8 different buffers are killed. And when I save one buffer all 8 buffers are saved.

I know that I can copy the files with scp, but the files are not identical. Just some parts at different positions are equal.


texts:
Org-ref works quite nicely with acronyms in latex export and offer some niceties such as showing expansion on mouse hover and jump to the acronym on click. But it does not seem to export to html at all. It just make whatever was used as label for the acronym to upper case. For instance, the document below
#+LATEX_HEADER: \usepackage{glossaries}
#+latex_header_extra: \newacronym{aaa}{PC}{personal computer}
#+OPTIONS: toc:nil

Some text using ac:aaa.

exports to

Some text using personal computer (PC).

in PDF (with latex), but to

Some text using AAA.

in HTML, which is just

Some text using AAA.

It would be nice if org-ref (or org-mode, since I'm not sure where the export code handling the ac: link is) exported the acronym using the actual short acronym, instead of the label, and respected the capitalization of the acronym (not just put everything uppercase). Even better if it could export as something like

    Some text using PC.

Note: The newacronym command arguments are the label, the short acronym, and the long acronym.


texts: org-agenda week view right-to-left Hebrew support (S-F-R-W-T-M-Sun) ordering

texts:
How can I view my week in org-agenda with the Days Backwards (Hebrew style)

| March
| 7         | 6         | 5         | 4             | 3         | 2         | 1     |
| Shabbat   | Friday    | Thursday  | Wednesday     | Tuesday   | Monday    | Sunday    |


texts:
From the docstring:

  Execute BODY only as long as there's no pending input.
  If input arrives, that ends the execution of BODY,
  and while-no-input returns t.  Quitting makes it return nil.
  If BODY finishes, while-no-input returns whatever value BODY produced.

If I understand correctly, this macro allows me to (attempt to)
perform a heavy computation without hanging the interface. That's
certainly a concept that I find attractive, but I'm left wondering
when is that useful in practice.

It seems that the computation can be interrupted at any moment, with
no information on where that happened, and no easy way of resuming it
later. Which makes me think it might not be that useful after all...

Is there a recommended way of using the while-no-input macro?
Are there any example usages of this macro in the wild?


texts:
I'm attempting to create a bookmark handler for eww so I can use Emacs's
built-in bookmarks to save and visit urls with eww.
There's an equivenant setup for w3m here: https://github.com/TotalView/dotemacs/blob/master/.emacs.d/elpa/w3m-20140330.1933/bookmark-w3m.el
From what I can gather I need to:

Create a function to actually make a properly formatted bookmark entry.
Find a way to grab all the data you need to create the bookmark from eww.
Set bookmark-make-record-function to that function.
Make a bookmark 'handler' which launches eww with the bookmark's url.

So far I've got the following setup. However, I'm getting the error oht-eww-bookmark-make-record: Symbol’s value as variable is void: oht-eww-current-title
(defun oht-eww-current-title ()
  "Returns the title of the current eww buffer"
  (plist-get eww-data :title))

(defun oht-eww-bookmark-make-record ()
  "Return a bookmark record for the current eww buffer."
  (interactive)
  `(,oht-eww-current-title
    (location . ,eww-current-url)
    (handler . ,oht-eww-bookmark-handler)))

(defun oht-eww-set-bookmark-handler ()
  "Set local variable to call function to save eww bookmark"
  (interactive)
  (set (make-local-variable 'bookmark-make-record-function)
       #'oht-eww-bookmark-make-record))

(defun oht-eww-bookmark-handler (record)
  "Jump to an eww bookmarked location."
  (eww (bookmark-prop-get record 'location)))


texts: Switch to help window and select and maximize it

texts:
How can I open a debug window and select it and make it fill the whole frame?

I tried:

(let ((help-window-select t))
  (with-help-window "*Debug*"
    (dolist (item load-path)
      (print item)))
  (delete-other-windows))

but this does not work; it seems to delete the help window itself and not the other windows.

Note:

Simply using

(with-help-window "*Debug*"
  (dolist (item load-path)
    (print item)))

will split the frame into two windows, with the "*Debug*" buffer shown in the lower window. In addition the "*Debug*" window is not selected.

Edit:

I also tried:

(let ((buf (switch-to-buffer "*Debug*")))
  (dolist (item load-path)
    (print item buf))
  (help-mode))

this creates the "*Debug*" buffer, but it does not select it (it stays hidden)


texts: Add note to clock entry when moving item to DONE

texts:
For my Org buffer, I configured #+STARTUP: lognoteclock-out for adding notes to my logbook entries when clocking out, which basically works fine.  However, when the clock is stopped due to the item being marked as DONE (since org-clock-out-when-done is enabled as well), I am not asked for a log message.  Is there a way to make this happen?
Of course it would work if I clocked out first and marked the item as DONE in a separate step afterwards, but this would somewhat defeat the purpose of org-clock-out-when-done.


texts: In regular expressions, what's the difference between [:blank:], [:space:], and \s-?

texts:
I've been playing around with rx lately, and I just noticed there are (at least) 3 different ways of indicating whitespaces in regular expressions.

[:blank:]
[:space:]
\s-

What are the differences between each of them? Does it depend on the major-mode?


texts:
I have installed org-journal and it seems to work well to create entries. However, I can't find and view them again. The documentation on EmacsWiki says to view the entry:

In calendar view:

j to view an entry

I'm not sure what is meant by "calendar view". I exececute M-x calendar and the bottom of the screen has a 3-month calendar and the days that have journal entries are highlighted. I move the cursor over one of the highlighted dates and press j. I get an error about undefined key.
So, what exactly is meant by "calendar view"? Does org-mode have its own calendar view?
Any advice appreciated.


texts: How to use vterm in emacs to edit a file and close it normally?

texts:
When use emacs to open a new buffer for vterm, do some terminal operation as edit an ansible-vault file
ansible-vault edit foo.yml

It maybe use vim by default.

When switch to an another buffer then back to this one, can't save the file or quit successfully. The :q option seems the emacs' command but the opened vim file.

Then how to operate the file in this case?


texts: Start an org file with all headers collapsed

texts:
Whenever I open an org file, I want to see only the outline, so I want to have all the headers collapsed. I'm using doom emacs, this is what I have in my config.org file:
(setq org-startup-folded "overview")

I also tried it like this:
(after! org
(setq org-startup-folded "overview"))

Both of these do not work.
When I put this in the org file, it does work:
#+STARTUP: overview

However, I want this setting to be global and not file specific.


texts:
I have installed matlab-mode from the melpa repository. However when I do
M-x: matlab-shell [RET]

It gives me the following error.
objc[4164]: Class JavaLaunchHelper is implemented in both

/Applications/MATLAB_R2016b.app/sys/java/jre/maci64/jre/bin/java and
/Applications/MATLAB_R2016b.app/sys/java/jre/maci64/jre/lib/jli/libjli.dylib. One of the two will be used. Which one is undefined
M-shell segmentation fault 11

Can anyone help me with this?.


texts:
I still feel a strong disturbance when it comes to auto-complete in emacs.
From what I have read in the docs, you can easily extend auto-complete by any syntax you like. Looking through (M)ELPA there are many packages named ac-[...], like ac-html-bootstrap.

After installing some of these packages, I am not sure if there is any difference, since auto-complete already shifts with various syntax.

General Question:
What is the general cookbook recipe for installing 3rd party syntax packages for auto-compete?

In more details:
(i) How does auto-complete get notified about 3rd party syntax packages in general? Does it scan the directory or do I need to specify it in my .emacs file?
(ii) How is it hooked to a certain mode or file extension? Is this provided by the syntax package itself or do I have to specify it?
(iii) How do I make sure, a package is correctly working? How do I tell the difference between the state without and with the package?


texts:
I like to use the xclip utility to capture the output of commands on the clipboard. However, when I try to use it with shell-command it seems to hang.

In a "normal" shell I can run a command such as echo "hello world" | xclip -selection clipboard and it will return almost immediately and copy hello world to the clipboard. When I try to run the same command from shell-command the command seems to "hang": the focus stays in the minibuffer and I can't do anything until I cancel the command with C-g. After cancelling the command the text has been copied to the clipboard though.

I'm running emacs 24.4.1 on Debian 8.6

Any idea why the xclip command hangs?


texts: Excessive line spacing with certain fonts

texts:
For a long time I've been using DejaVu Sans Mono as my programming font.  I've yet to find a better font.

But a little while ago I discovered Mozilla's Fira, which looks very nice for code.  So I decided to give it a try in Emacs.

Unfortunately, when I use it in Emacs, the line spacing blows up and reduces the number of lines I can see by about 10.

I've tried (setq line-spacing 0) and different combinations of things like (set-frame-font (font-spec :name "Fira Mono" :width 'normal :height 100)), but no matter what I do, the excessive line spacing remains.  (It's not possible to use negative line-spacing values in Emacs, unfortunately, which would seem like the obvious solution.)

It doesn't seem to be a bug in the font though, because when I use Fira Mono in Kate at the same size, the line spacing is what I would consider normal, and apparently about the same as the Emacs line spacing with DejaVu Sans.

Is this a bug in Emacs?  Is there any way to fix this?

Thanks for any advice.

Left: Emacs Fira Mono  Right: Emacs DejaVu Sans Mono

Left: Emacs Fira Mono  Right: Kate Fira Mono


texts: I am using Python with elpy. I am trying to use a Python shell opened on the remote computer using a shell buffer. I can cheat elpy by renaming the shell buffer with Python running in it to *Python*. It works, but it takes a while for elpy to send the code to the *Python* buffer. In ESS, there is a cool feature ess-remote that converts an R instance opened in shell buffer into an inferior ESS buffer. I wonder, whether there is en efficient way of doing the same with elpy.


texts: Pass org-babel header arguments to elisp function

texts:
I have an org-babel code block like so:

#+BEGIN_SRC R :var a=~/path/to/project

Do something here

#+END_SRC

How can I reference variable a without having to evaluate the block?


texts: Keeping org-mode outline after reverting buffer

texts:
Is there any option or other customization to keep the outline of an org-mode buffer (uncollapsed parts of the tree) after the buffer has been
reverted (org-mode 9.0.1, emacs 25.3.2)? In my case only the top
headings are displayed after reverting. This is quite annoying and
time-consuming in a setup, where one constantly switches between git
branches e.g.


texts: What is the function `purecopy` needed for?

texts:
I was browing through compile.el and I noticed this construction:

(defcustom compile-command (purecopy "make -k "))

The purecopy docs state:

  purecopy is a built-in function in `C source code'.

  (purecopy OBJ)

  Make a copy of object OBJ in pure storage. Recursively copies contents
  of vectors and cons cells. Does not copy symbols.  Copies strings
  without text properties.

So I think I understand why it might be necessary if it was expected that compile-command contained a complex alist that might require modification at a later date. However its just a simple string, so why is purecopy necessary? More generally, when is purecopy needed?


texts: Running elisp conversion function in an Org table returns an error


texts: Emacs 26.1 configure script doesn't like the gnutls version on a RedHat sytem

texts:
Even though gnutls-devel.x86_64 is installed on my RedHat 6.6 system.  How do I guide the configure script to the required libraries?

[update 2018-06-03 after hint from Ian]
In fact configure found the libraries but in config.log it says that the library is too old.

Now I'm trying to compile GnuTLS 3.5.18. but it's configure script says that it requires Libnettle 3.1. (whatever this is).

So I'm trying to compile a package called nettle 3.4. which is supposed to include libnettle libs. This configure script runs through but when I'm doing make it says: cd: tools: No such file or directory!

Basically I'm stuck at this stage, what can I do to investigate this mess further?


texts: Restoring position in window after narrowing

texts:
C-x n w (widen) does not restore the position of a formerly narrowed region in relation to the window, as it was before calling C-x n n (narrow-to-region).  Is it possible to have such behaviour?

EDIT: The effect should be as if C-x n n and C-x n w were wrapped into a save-excursion form, I guess.  If the first line of the region was the nth line of the window then, after widening, it should return to be the nth line of the window.  Point should keep its position relative to the formerly narrowed region.


texts: Wrong type argument: number-or-marker-p error with package theme-changer

texts:
I encountered the error "Wrong type argument: number-or-marker-p" with theme-changer in a fresh Emacs 24.5 install on Windows 8.1 64-bit. I found no information about this error when searching, but reading through the issue log I found the following:

  The solar package seems to get my system time/timezone which was out of sync with the location I specified in my config. Changing my timezone in ubuntu resolved it.

Basically the OS timezone and the Emacs calendar setup need to match. As my home is Detroit but I'm traveling in Europe, mine weren't even close. (By the way, 'solar.el' is included in Emacs by default in recent versions.)


texts: Insert and expand snippet when committing with Magit

texts:
I use a template with Git for keeping my commits messages neat and professional, as explained here.

However, since I use Magit, I would like to insert and expand a snippet with Yasnippets because Yasnippet is more dynamic than a static template.

I would like to know how to trigger the insertion and expansion of a snippet when the buffer for writing the commit message opens in Magit.


texts: Eclim problems not being highlighted/problems not being shown in minibuffer

texts:
I know I have eclim setup correctly because everything else works, I.E I can do autocomplete, jump to definition etc. I can even see problems with eclim-problems. However, when I make a syntax error, the error is not being highlighted with a red line like I thought it should do. Is there anything I have to turn on?

I even checked my faces and found eclim-problems-highlight-error-face and it has a nice red underline like it should. Everything works except for the highlighting itself.

Edit: O.K weirdly the problem seems to have half fixed itself. It must have been hung or something. However, there is now a new problem. When I mouse over the problems highlighted, it doesn't tell me what the problem is in the minibuffer like I would expect


texts: Is it possible to suppress `Fill column set to 80 (was 80)` message in the echo area?

texts:
When I open a Python file I keep seeing Fill column set to 80 (was 80) message in the echo area. I know I have set it this limit , but I don't want to be keep reminded about it.
Is it possible to suppress this message?
my setup:
(add-hook 'python-mode-hook
  (lambda ()
    (setq indent-tabs-mode nil)
    (setq python-indent 4)
    (set-fill-column 80)
    (setq tab-width 4)))


texts: Sum columns duration/days and duration/hours