texts: Is it possible to define in which modes (programming languages) i want to have company activated? I want to have company in all my modes but not in lisp mode.


texts: Exporting to a Latex file only those sections which have a specific tag

texts:
I have a long org mode document, and many sections are marked with several tags like say :cricket: , :golf:, :tennis:. Is it possible to export to a latex buffer only those sections  with the tag :cricket:?

Side question: is it possible to export to a separate Emacs buffer only those sections which have a particular tag attached to them.
C-c \ and typing the tag name, still shows the entire tree, (even if in a collapsed form) with the sections with matching tag names highlighted.


texts: How to develop a package I also have installed?

texts:
When developing a package which is also installed via an online repository, there is a practical problem.

/source/my-emacs-package

git repository where I have my code.
~/.config/emacs/elpa/my-emacs-package-20200127.1052

The location the package is installed.

Currently I'm manually removing & symlinking files between these directories, however this is quite cumbersome since you need to remember to remove the *.elc files and the path name changes after each update.

How should I switch to my local git repository temporarily while developing my package?

Using a single switch for example, at the beginning of my init.el.

;; Set to t to load local packages.
(defconst use-my-local-packages nil)


texts: How to get spell suggesstion for the word that cursor is on in the minibuffer?

texts:
Example behavior:
When I am using python-mode if a cursor is on top of on a error, the error message is printed out on the minibuffer.
If I have following line import o , import keyword get bold and colored red. When I move cursor on top of it, F401 'o' imported but unused is showned on the minibuffer.

Can I have similiar behavior for wrongly typed words in LaTeX file?
Lets say I typed lif, emacs makes it bold and color in red since it is misspelled. When I move cursor on top of it, I want emacs to show automatically suggested words for correction in the mini-buffer.


texts: How to get the (localized) day of the week lowercased in time-stamp-format?

texts:
The %:a allows to get the full weekday in the Time-stamp. My system-time-locale is fr_FR.UTF-8. I am using the Time-stamp in a Markdown file, inside a pandoc title block, which I export to html, so I can then use the so created pandoc date variable in suitable html template.

I use a prefix  dernière mise à jour le, (meaning last update on), hence according to French orthographic rules I need for example lundi, not Lundi.

Is there anyway to set-up time-stamp-format to produce a lowercase full week of the day? I see only %:a which however produces like in English week days with first letter uppercased.


texts: How do I teach edebug to only evaluate some macro arguments?

texts:
Currently, edebug doesn't understand the ->> macro in dash.el.

(defun foo ()
  (->> (+ 1 1)
       (+ 2)
       (* 3)
       (format "%s")))

C-u M-x edebug-eval-defun followed by M-: (foo) does not step through the forms inside ->>. It just shows the value of the whole (->> ...) expression.

Looking at the docs for declare, I don't think I can teach edebug about all the arguments to ->>. However, the first argument is a form, so I would like to edebug to step through that. I tried this:

(defmacro ->> (x &optional form &rest more)
  "Thread the expr through the forms. ..."
  (declare (debug (form &rest 0)))
   ...)

However, this gives me "edebug-match-specs: Too deep - perhaps infinite loop in spec?" when I try to call edebug-eval-defun on foo afterwards.

Can I annotate a macro so that the first argument is a form, but edebug skips the rest?


texts:
Background

I am using Emacsclient to open files in a Emacs server. The server configuration depends on the content of a JSON configuration file. A Perl script can read the config file and write a suitable Emacs Lisp hashtable load file, which the server can read to update its configuration.

I would like to avoid running the Perl script when there has been no modification to the JSON file. So I am thinking about setting a global variable my-config-last-mod in the server, and check that against the current last-modification time of the JSON file. If there is a difference, the Perl script should run to update the server config.

Question

How to compare file modification timestamps in Emacs?

Here is what I have in mind:

(defvar my-config-last-mod nil)
(defun my-update-config ()
  (let* ((config-fn "myconfig.json")
         (last-mod (shell-command-to-string (concat "stat -c %y " config-fn)))
         (fixed-case t)
         (literal t)
         (reload-config t))
    ;; trim space at end
    (when (string-match "\\([[:space:]]\\|\n\\)*\\'" last-mod)
      (setq last-mod (replace-match "" fixed-case literal last-mod)))
    (when my-config-last-mod
      (when (my-compare-time-stamps my-config-last-mod last-mod)
        (setq reload-config nil)))
    (when reload-config
      (setq my-config-last-mod last-mod)
      (shell-command-to-string "my_update_config"))))

Is it possible to write my-compare-time-stamps in pure Lisp, or would I have to use an external program?


texts: authinfo.gpg but still promted for smtpmail credentials

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

(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it
     smtpmail-stream-type 'starttls
     smtpmail-default-smtp-server "smtp.gmail.com"
     smtpmail-auth-credentials (expand-file-name "~/.authinfo.gpg")
     smtpmail-smtp-server "smtp.gmail.com"
     smtpmail-smtp-service 587)

.authinfo decrypts fine and contains:

machine smtp.gmail.com login ***1 password ***2 port 465

Where ***1 and ***2 are my username and password respectively.

But upon sending mail from mu4e I am still prompted for credentials.

If I enter the credentials at the prompt sending works.

What am I missing?


texts: `org-sbe` in block A cannot find block B defined in the same file if A is called externally

texts:
Calling uutil.org:summarize-files() in the other file prj_sum.org triggers (error "Reference ‘list-files’ not found in this buffer"), even though both summarize-files and list-files reside in the same uutil.org. Could you suggest how to solve this problem ?
───────┬─────────────────
       │ File: uutil.org
───────┼─────────────────
   1   │
   2   │ #+NAME: list-files
   3   │ #+BEGIN_SRC sh   :results table
   4   │    ls
   5   │ #+END_SRC
   6   │
   7   │
   8   │ #+NAME: summarize-files
   9   │ #+BEGIN_SRC emacs-lisp
  10   │    (org-sbe list-files)
  11   │ #+END_SRC
───────┴─────────────────
───────┬─────────────────
       │ File: prj_sum.org
───────┼─────────────────
   1   │
   2   │ #+CALL: uutil.org:summarize-files()
───────┴─────────────────


texts:
When I do l (vc-print-log) in the *vc-dir* buffer, I get the *vc-change-log* buffer with a single line per commit.

Even when I can hit RET (log-view-toggle-entry-display) there to get the details, I still don't see the list of files touched by the commit.

How do I get the detailed list of all commits in the tree, including the full message and the list of files touched?


texts: Face setting doesn't work for client sessions

texts:
I wanted to change the colours of Anzu's counter, taking the foreground from the Isearch match background and the background from the fringes, like this

So I evaluated
(face-spec-set 'anzu-mode-line `((t :foreground ,(face-attribute 'isearch :background)
                                    :background ,(face-attribute 'fringe :background)))
               'face-defface-spec)

and it worked. I added it to my init.el, restarted the emacs server... and then it looked like this:

How do I fix that?

PS If I launch Emacs from the command line instead of opening a client frame, then the faces get the right colours. It also works if I put strings in place of the face-attribute forms:
(face-spec-set 'anzu-mode-line '((t :foreground "magenta3"
                                    :background "grey95"))
               'face-defface-spec)


texts: eww cannot follow links displayed after keyword search

texts:
I have emacs 25.1.1 on Ubuntu 16.04 and have been trying to browse with its built in eww browser.

I start with M-x eww.

Then I type in my search keyword. DuckDuckgo displays a list of search results as expected. However if I navigate (using C-n, C-p, C-f, and C-b) to a link and try to follow it (return) DuckDuckgo fails, displaying:

  'Oops, there was an error. Please try again.

  If it persists, please email ops@duckduckgo.com'

Any ideas as to how to diagnose this problem? Essentially I cannot browse with eww, although firefox and google-chrome work fine (whether I use DuckDuckgo or google search).


texts: Confusion about space and tab characters in Emacs

texts:
I am confused by space (SPC) and TAB characters in Emacs.

I am often using the default fundamental mode.

When I select a region and indent the lines in the region by C-u 9 C-x TAB, I intend to indent the lines by 9 SPC characters.

But after I perform the operation, when I place my cursor at the beginning at such a line, and type right arrow key, it jumps to the 8th position with the 9th position also blank, as if there were a TAB character followed by a SPC character.  This is contrary to my intention to indent the lines by 9 SPC characters.

I was wondering how to understand the uses and display of SPC and TAB characters in Emacs? Is there some general principles that I can follow to understand?

Btw, I may have asked similar question about the confusion between SPC and TAB characters in Emacs before, either here or Unix.SE or SO. But I can't find it.


texts: utf-8 characters with eshell, eshell-visual-subcommands, and git

texts:
Using the configuration

(eval-after-load "em-term"
  '(progn
     (add-to-list 'eshell-visual-subcommands '("git" "diff" "help" "log" "show"))
     (add-to-list 'eshell-visual-options '("git" "--help" "--paginate"))))

eshell opens git help diff in a term-mode buffer. The buffer file coding system of this buffer is set to utf-8.

Even so utf-8 characters in the output of git help diff are shown as octal codes (see doesn't in the last line):

--full-diff
    Without this flag, git log -p <path>...  shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the
    specified paths; this means that "<path>..." limits only commits, and doesn\342\200\231t limit diff for those commits.

I assume that the problem is connected to the following section of the function term-exec-1:

;; The process's output contains not just chars but also binary
;; escape codes, so we need to see the raw output.  We will have to
;; do the decoding by hand on the parts that are made of chars.
(coding-system-for-read 'binary)

Is there a workaround?

I 've tried the method described in "Unicode characters in emacs term-mode". They don't work.


texts: I want to be able to use emacs to view log files. There are chunks in the log files that are nicely formatted text, and chunks that are formatted in XML. Is there a way of getting emacs to format and colour the XML sections as if it were in XML mode and then the rest of the file in a different mode?


texts: I understand that the way to rebind the "escape" function while using the eVil mode is something on the lines of (setq-default evil-escape-key-sequence "jj"). But I want to set my "escape" to Ctrl+K. Using something like (setq-default evil-escape-key-sequence (kbd "C-k")) doesn't work (gives evil-escape arg out of range). What is the proper way to do this?


texts: How to subtract 1 from the nth element of a list of numbers?

texts:
How do I subtract 1 from the second element of the list (3 6)?

(setq x '(3 6))
(- (nth 1 x) 1)

The above quote does the math but does not return a modified list.


texts: storing string in variable fails to work in `early-init.el`

texts:
Putting the following code in my early-init.el causes my emacs not to startup.
(require 'cl-lib)

(defvar void-initial-frame-font
  (cl-find-if (lambda (font) (find-font (font-spec :name font)))
          (list "Victor Mono-19" "Anonymous-Pro-19"))
  "Font for initial frame.")

(push (cons 'font void-initial-frame-font) default-frame-alist)

The form (cl-find-if ...) evaluates to "Victor Mono-19". Thus void-initial-frame-font is "Victor Mono-19".
When I replace the variable void-initial-frame-font in the push form with what it should evaluate to, my emacs config starts up successfully with the frame font being "Victor Mono-19" as I would expect.
(require 'cl-lib)

(defvar void-initial-frame-font
  (cl-find-if (lambda (font) (find-font (font-spec :name font)))
          (list "Victor Mono-19" "Anonymous-Pro-19"))
  "Font for initial frame.")

;; replaced `void-initial-frame-font` with what it should evaluate to
(push (cons 'font "Victor Mono-19") default-frame-alist)

For fun, I tried to see if let binding the variable font would work, but it did not. The following form also causes my emacs to fail to start.
(require 'cl-lib)

(let ((font (cl-find-if (lambda (font) (find-font (font-spec :name font)))
            (list "Victor Mono-19" "Anonymous-Pro-19"))))
  (push (cons 'font font) default-frame-alist))

Why can't I store the result of evaluating the (cl-find-if ...) form early-init.el?


texts: With command line git you can use git format-patch [commit_hash] [file] to generate a patch for a single file. Is there a way to generate a patch in magit for only a single file? I tried marking the files like I would when staging multiple files, but it still created a patch for the whole commit.


texts:
When try to print timedelta as below:

#+BEGIN_SRC elisp :results output
(print (time-subtract
    (parse-time-string "2018-10-20 08:50:36.343")
    (parse-time-string "2018-10-20 08:47:43.029")))
#+END_SRC

#+RESULTS:
:
: (-7 3 0 0)

The output format looks wired:

The seconds is negative.
Output format not readable, I wish it's "00:02:53.314".


texts: Tramp: SSH login does not prompt for password

texts:
I am trying to use Tramp to log into a server that has no SSH keys, just a password. Unfortunately, upon execution of my /ssh:root@111.111.111.111:~/ command, there is no password prompt and the minibuffer says Sending password, and fails to login. How can I get Tramp to prompt me for a password? Or, how can I configure Tramp to log into this server that has no SSH keys and just a password?

I can SSH into the server via terminal just fine with ssh root@111.111.111.111, where the password prompt is:

root@111.111.111.111's password:

Unless I enter my password, there is no other output in the terminal.

Here is the output in my *Messages* buffer:

Tramp: Opening connection for root@111.111.111.111 using ssh...
Tramp: Sending command `exec ssh -l root  -e none 111.111.111.111'

Tramp: Waiting for prompts from remote shell
Tramp: Sending password
Tramp: Sending command `exec ssh -l root  -e none 111.111.111.111'
Tramp: Opening connection for root@111.111.111.111 using ssh...done
Quit

and after setting a verbose output using (setq tramp-verbose 10), here is the output into my *debug tramp/ssh root@111.111.111.111* buffer:

http://pastebin.com/UKJnzP66

Note that I get the same results when using emacs -q.

My M-x tramp-version is 2.2.6-24.3, running on Ubuntu 14.04.

Any help would be appreciated, or even a description of the logs. I am confused because Tramp seems to be sending some kind of default password without prompting me, even when run with emacs -q.

Update

I tried setting tramp-password-prompt-regexp with the following:

  (setq
    tramp-password-prompt-regexp
      (concat
        "^.*"
        (regexp-opt
          '("passphrase" "Passphrase"
            ;; English
            "password" "Password"
            ;; Deutsch
            "passwort" "Passwort"
            ;; Français
            "mot de passe" "Mot de passe") t)
        ".*:\0? *"))

which is ^.*\(Mot de passe\|Pass\(?:phrase\|wor[dt]\)\|mot de passe\|pass\(?:phrase\|wor[dt]\)\).*:^@ when evaluated with (message tramp-password-prompt-regexp).

and here is the updated output from *debug tramp/ssh root@111.111.111.111*:

(lines 1-44)
http://pastebin.com/99w6LbyX
(lines 45-88)
http://pastebin.com/2LrDYzNk


texts: default of "calling" when run counsel-git-grep

texts:
counsel-git-grep is nice to search git repository, but by default it can't show the candidate lively. Meaning if I use down arrow to select the next candidate, the buffer doesn't change, and one solution is to use the hydra C-o and then press C to toggle "calling" from off to on. But looks like the default one is off, so every time I use this command, I have to do the same toggle again and again. Is there a way to set the default value of "calling" to on?

Update

Looks like the default value shouldn't change, otherwise other ivy commands don't work as well, so I am using

(defun my-counsel-git-grep ()
  (interactive)
  (let ((ivy-calling t))
    (counsel-git-grep)))


texts: org-reveal - auto split long output from babel block to left side


texts: Emacs incorrectly indenting C code when auto-fill-mode is enabled

texts:
I have this single line in my ~/.emacs:
(add-hook 'prog-mode-hook 'auto-fill-mode)

Now I open a foo.c with Emacs and type this code. I only type the code
and enter. I do not type any tab. This is the indentation I get:
int main()
{
  for (;;) {
    printf("hello, world\n");
}
}

Why did Emacs indent my code like this?


texts: How to access os clipboard using Emacs + Evil

texts:
How can i yank to/from windows clipboard when using:

Windows 7 (x64)
GNU Emacs 24.4.1 (x64)
Evil 1.0.9
and having (setq x-select-enable-clipboard nil) in my .emacs? (I put this line there because i didn't want vim changes (x, d, etc) to clobber my os clipboard.

I tried "+p, "*p, "+y, "*y, CTRL+Y but it doesn't work. When i run :registers it doesn't even show + or * registers.

To clarify: I want Emacs to behave like Vim when copying/yanking to/from different registers, without clobbering os clipboard with every text changing command. In particular:

yy - should NOT yank text to os clipboard (only to 0 register)
"+yy - should yank text to os clipboard
dd - should NOT clobber os clipboard
cw - shold NOT clobber os clipboard
etc.


texts: How to sustain shift-selection with my custom scroll function

texts:
I have made two custom scroll functions (that scroll up and down a page respectively)

(defun jd:scroll-up ()
  (interactive)
  (scroll-down-command)
  (move-to-window-line nil))

(defun jd:scroll-down ()
  (interactive)
  (scroll-up-command)
  (move-to-window-line nil))

I have these functions bound to the keys: C-j and C-l respectively.

However, when I hold shift and call these functions the lines do not get highlighted.

This is because of the call to (move-to-window-line nil) immediately after.

I'm not quite sure how to go about solving this problem in Elisp.

So is there a way to sustain the shift-selection of text when using this function?

Like is there something I can add to the function to get around this?


texts: How can I suppress certain messages from being echoed in the echo-area?

texts:
Is there a way to filter out certain messages from being echoed in the echo-area while still being logged in to the Messages buffer ?

Use case scenario being an aggressive backward delete in the minibuffer yields a Text is read-only message when the point hits the prompt. I find this highly distracting.


texts:
I'm struggling to get type checking working in spacemacs, and I would appreciate any help. I've installed MyPy properly on my system (I can run it from terminal) and added python-mypy to dotspacemacs-additional-packages, and if I run flycheck-verify-setup (M-m e v) python-mypy is listed there with the correct path to the executable (it's not disabled either). However, I still don't get an error even if running mypy from the terminal does produce an "incompatible type" error.

Any hints as to what I'm missing?


texts: Are comment style flags insufficient to separate SQL comments?

texts:
I am trying to understand why SQL mode accepts -* as a comment block start.

In sql.el, I read:

(defvar sql-mode-syntax-table
  (let ((table (make-syntax-table)))
    ;; C-style comments /**/ ...
    (modify-syntax-entry ?/ ". 14" table)
    (modify-syntax-entry ?* ". 23" table)
    ;; double-dash starts comments
    (modify-syntax-entry ?- ". 12b" table)
    ;;...
    table) "...")

Elisp manual "Syntax Flags" describes the flags for comment sequences. The digits indeed say -* is a two-character comment-start sequence: 1 makes - the start and 2 makes * the second character.

But b is a comment style flag, separating -- from /* and */, which have the default (a) style. This sounds like -* should not count as a comment-start:

  ‘b’ means that ‘-’ as a comment delimiter belongs to the alternative
  “b” comment style.  For a two-character comment starter, this flag is
  only significant on the second char, and for a 2-character comment
  ender it is only significant on the first char.

However:

  Each comment delimiter has a style and only matches comment delimiters
  of the same style.  Thus if a comment starts with the comment-start
  sequence of style “b”, it will extend until the next matching
  comment-end sequence of style “b”.

So it turns out that the style flag only regulates which characters will end the comment block. Not which characters can be used together in a two-character comment sequence!

Am I right that this is why -* starts a comment block?


texts: Make ido-completing-map override minibuffer-inactive-mode-map

texts: I'm trying to bind a key in ido-completing-map, and I want it to override the key-binding with the same key from minibuffer-inactive-mode-map. But the latter seems to take precedence. How can I remedy this ?


texts: init error: file missing - cl-generic after any time I edit settings.org file

texts:
I am using org mode to organize my various Emacs settings. Within my init.el file I just have (taking out initial comments):

;;; Code:
(package-initialize)
(eval-when-compile
  (require 'use-package))
(org-babel-load-file
 (expand-file-name "settings.org"
           user-emacs-directory))

My settings.org file is too long to post here, but if the details of it are pertinent I put the whole thing into a pastebin: http://pastebin.com/STkz1ADQ
(The section about ein is at the bottom)

Recently (I don't know when this issue cropped up, I hadn't touched my settings.org in a while), any time I edit my settings.org file I get the following error message upon re-loading Emacs:

Warning (initialization): An error occurred while loading `/home/dan/.emacs.d/init.el':

File error: Cannot open load file, no such file or directory, cl-generic

The full debug message:

Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory" "cl-generic")
  require(cl-generic)
  eval-buffer(#<buffer  *load*-973163> nil "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el" nil t)  ; Reading at buffer position 1010
  load-with-code-conversion("/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el" "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el" nil t)
  require(ein-cell-output)
  eval-buffer(#<buffer  *load*-288601> nil "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el" nil t)  ; Reading at buffer position 1628
  load-with-code-conversion("/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el" "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el" nil t)
  require(ein-notebook)
  eval-buffer(#<buffer  *load*-347368> nil "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el" nil t)  ; Reading at buffer position 1026
  load-with-code-conversion("/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el" "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el" nil t)
  require(ein-notebooklist)
  eval-buffer(#<buffer  *load*-648891> nil "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el" nil t)  ; Reading at buffer position 896
  load-with-code-conversion("/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el" "/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el" nil t)
  ein:org-store-link()
  #[(f) "\302   \205\f

Reading through this the issue seemed to be that something weird was going on with EIN (Emacs Ipython Notebook). So I removed ein, and reinstalled it, and the issue went away.

I have to do this (remove ein, re-install ein) any time I edit settings.org.

I have no idea why this is happening - whether it's something with my setup, or with ein, or what. What is cl-generic (brief googling hasn't turned up much information)?

The compile log for ein also makes mention of cl-generic: http://pastebin.com/1zgQXvsx

Any light anyone can shed on this would be appreciated.


texts:
I am keeping a common init.el for work and private on separate machines. So dependent on my machine I have common settings and machine dependent settings.

How do I get to add an element to the org-refile-targets variable?

This works well:

(setq org-refile-targets '(("~/sync/common.org"  :maxlevel . 2)
                           ("~/org/machine1.org" :maxlevel . 2)))

How can I separate this variable definition?

Not working:

 (add-to-list 'org-refile-targets ("~/sync/common.org"  :maxlevel . 2))
[...]
 (add-to-list 'org-refile-targets ("~/org/machine1.org" :maxlevel . 2))

Testing results in an error of:

*** Eval error ***  Invalid function: "~/org/machine1.org"


texts: `org-mode` doesn't align column bars properly

texts: When I make tables in org-mode, if the column value in the next row is longer, after pressing TAB, the new vertical alignment of "|" gets a bit distorted. This used to work fine before, it also works fine when I launch Emacs with emacs -q. Not sure what caused the problem, but I installed avy, swiper, swiper-helm and I've updated the system (I am on Fedora 27), but something messed things up. I've tried moving .emacs.d and to another folder leaving it empty, clearing .emacs and re-installing Emacs and org-mode only, it didn't help. Anyone had a similar problem? I saw some posts about the font type, but I am using the same font as before.


texts: Portability of bytecode between Emacs versions

texts:
I sometimes run multiple versions of Emacs from the same home directory. I have a number of byte-compiled files. Bytecode is not compatible across all Emacs versions, so I maintain separate directories for .elc files for each version range.

What are the version ranges for which the bytecode is compatible? I currently have

gnu-19.29
gnu-20
gnu-21
gnu-22
gnu-23
gnu-24
source
x-19
x-20
x-21

i.e. directories for each major release, with an additional separation at 19.29 (I've never used an older version on this machine, otherwise there'd be gnu-19), and separate directories for GNU Emacs and XEmacs. I'm probably overly cautious, though.

What is the official policy regarding bytecode compatibility across Emacs versions? Can I confidently keep using the major version? Can I merge some versions? Is there a bytecode version indication or checksum that I could query when compiling to create the directory name instead of relying on the Emacs version?

Note that I'm primarily interested in full compatibility, not just backward compatibility. I might run Emacs 27.3 and byte-compile some files, and then later Emacs 27.2 with the same home directory.


texts: org-mode only highlights some source blocks, not all

texts:
I write my emacs configuration file in org mode, which works fine, only that org-mode does not highlight some source blocks.

I set (setq org-src-fontify-natively t), but this only seems to take effect for some blocks, while others are not highlighted.

Anyone has an idea what might cause this?


texts: smtpmail + protonmail bridge connectivity

texts:
I'm trying to send mail using smtpmail through the protonmail bridge app.
The protonmail-brdige runs a local smtp server with parameters:

127.0.0.1
1025
email
password
STARTTLS

The snippet I have in my smtpmail-multi-accounts
(protonmail . ("email@protonmail.com"
                        "127.0.0.1"
                        1025
                        "email@protonmail.com"
                        starttls
                        nil nil nil)

When trying to send the mail I got a popup stating that the ssl certificat offered by the host didn't match the hostname, which makes sense.
But after this I only get the following errors:
Sending...
Sending via mail...
Trying protonmail account...
502 5.7.0 anonymous login not supported
221 2.0.0 Goodnight and good luck
Failed to send mail via protonmail account
smtpmail-multi-send-it: Mail not sent

I thought that the problem may be ssl. for offlineimap I had disabled ssl and this worked for mail retrieval. But I can't figure it out for sending.
Is there a way to disable ssl in smtpmail?
Or is the problem something else entirely?
Also where did the state of the authentication get saved ? as in I'm no longer receiving the ssl warning, but I'd like to reset things so I can look closer.
Thanks for any help!


texts: Emacs frames can't cover the screen's height

texts:
I am using these commands in order to customize the height and the width of the Emacs frames when it starts:

(add-to-list 'default-frame-alist '(height . 50))
(add-to-list 'default-frame-alist '(width . 120))

My goal was to have Emacs use all the available height of my screen. The problem is that up to height 50 (circa) the frame is getting bigger as expected but from that point on it stops, although its height hasn't reached the maximum, as you can see in the image below:

After the start-up I can maximize it with the mouse. Why is that happening and after a number the frames can't even reach their maximum? How can I make it cover the whole screen's height?


texts: Links in Tables - fonts mess up table alignment

texts:
I would like to use links in a table to explain certain entries more in depth.
| Some | random | table | entries |
| More | data   | and   | LINK      |  <- misaligned

* LINK target with
 - more info about this line
 - explained in more details

But when I use links inside of a table, the fontsizes dont match and the table misaligns. Characters are either org-table or org-link formatted and both faces have different font sizes.
How could I solve this?
I don't see a way to define a special org-link face inside of org-table.


texts: Unable to supply macro name to edit-kbd-macro when M-x is bound to smex

texts:
When I M-x edit-kbd-macro, it prompts saying:

  Keyboard macro to edit (C-x e, M-x, C-h l, or keys):

Here, I would hit M-x. It will then allow me to enter the name of the macro. I have several named macros (fset 'macro-name ...) entries in my ~/.emacs file and I can select the one I want to edit.

But when I have:

(global-set-key (kbd "M-x") 'smex)

in my ~/.emacs, when I do M-x edit-kbd-macro and hit M-x to start selecting a name, it produces an error.

How do I resolve the conflict?


texts: el-get Basic Setup (https://github.com/dimitri/el-get) : error: Unable to find 'git'

texts:
Start Emacs from gitbash (MINGW64)

Snippet below is loaded automatically:

; add el-get to the load path, and install it if it doesn't exist
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

Error:

Warning (initialization): An error occurred while loading 'c:/Users/user/.emacs':
error: Unable to find 'git'

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the '--debug-init' option to view a complete error backtrace.

; add el-get to the load path, and install it if it doesn't exist
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

Environments and settings:

Windows 10
Git installed (git version 2.14.1.windows.1)
Git installation path(C:\Program Files\Git\cmb) is added to Environment path variable.
HOMEPATH: c:/Users/user
emacs version: GNU Emacs 26.1 (build 1, x86 64-w64-mingw32) of 2018-05-30

git can not be found even though it's installed. How can I configure Git set-up properly?


texts: Evaluating conditional expression in flycheck syntax checker command

texts:
I'd like the :command of a flycheck checker to depend on the file extension of the input.

For example:

for .tex files run the command foo --format latex file.tex
for any other file extension run the command foo --format text file.txt

I've tried:

:command ("foo" "--format"
    `(if (string= "tex" (file-name-extension source-inplace))
        "latex"
        "text")
    source-inplace)

Which returns:

flycheck-define-command-checker: Invalid command argument (\‘ (if (string= "tex" (file-name-extension source-inplace)) "latex" "text")) in syntax checker textlint

Which is thrown from flycheck when executing flycheck-command-argument-p.

Is it possible to achieve what I'm attempting? i.e the command string passed to :command being determined by the file extension of the file being checked by flycheck?

For context, the solution was required for implementing a textlint flycheck checker: https://www.macs.hw.ac.uk/~rs46/posts/2018-12-29-textlint-flycheck.html


texts: Hook that fires when `*Messages*` is updated

texts:
Emacs manual §31.28 says this about before-change-functions and after-change-functions:

  These hook variables let you arrange to take notice of all changes in all buffers (or in a particular buffer, if you make them buffer-local).

That sounds like exactly what I need to monitor the status of the *Messages* buffer, but there is a note in the manual that says

  Output of messages into the *Messages* buffer does not call these functions.

What is the significance of this message, and how can I set up functions that run every time the *Messages* buffer is modified?


texts:
I understand what autoload does for functions (register file to load when
such function is called or its documentation string is retrieved). However,
it's not clear how to use autoload facility in conjunction with variables
and macros.

I have two questions:

What happens when package has parameter, implemented as a variable that
user can set, but it's not autoloaded? Should such variables be
autoloaded? If not, it turns out that such variables do not exist, Lisp
environment knows nothing about them, including their default values,
until some autoloaded function from the package is used (typically after
loading of configuration files), then if user sets them in his/her
configuration file, it's like setting non-existing variable. If value of
the variable is a non-empty list and user uses push or add-to-list to
change its value, what exactly happens? Are default values lost?
What happens when a macro is autoloaded? When should we autoload a macro?


texts: Turn a list or data structure into an org document

texts:
I'm writting a package which dowloads a list of healines, contents,
and some other properties, which are to be displayed to the user. For
the moment, an org-mode buffer seems like a good way of displaying
these headlines.

Below is an example of how this list might be structured. It is merely
illustrative, I can easily convert it to any other structure as
necessary.

'(("One headline" "Some much longer content."
   (property1 . value)
   (property2 . value))
  ("Second headline" "More much longer content."
   (property1 . value)
   (property2 . value)))

Is there a function or package which prints such a list into an org-mode buffer?

Here's the desired output.

* One headline
  :PROPERTIES:
  :property1: value
  :property2: value
  :END:
Some much longer content.

* Second headline
  :PROPERTIES:
  :property1: value
  :property2: value
  :END:
More much longer content.

I could do this manually, I'm just wondering if there might be
something out there.


texts:
When accessing remote ftp server with tramp

C-x C-f /ftp:user@host#port/

tramp asks me for password. I also use auth-password-store to store passwords in a pass-compatibale fashion, that is, host is specified in a filename of a gpg-encrypted file containing password on its first line. However, tramp (or maybe it's AngeFtp?) keeps asking for password, even though I've created a host.gpg file in my password store.

I tried symlinking ftp:user@host.gpg to the password file.
I tried symlinking host#port.gpg as well as ftp:user@host.gpg and ftp:user@host#port.gpg
auth-password-store and tramp work fine together for C-x C-f /sudo::/ command, that is, it does find the appropriate file in my password-store and requests my gpg password then
auth-password-store works fine with symlinks to genuine password files (which is to be expected, I guess?)
I tried adding protocol: ftp record to password file

How do I make tramp recognise my password-store password? Should I file an issue to tramp, or maybe to AngeFtp developers?


texts: Org mode: Using todo-items or checkboxes in tables

texts:
I have several items that I need to perform the same tasks on. To get an overview, I wanted to use a table, where the columns would show me how many are done, something like this:

+------+--------------+--------------+--------------+
| Item | Task 1 [2/2] | Task 2 [1/2] | Task 3 [0/2] |
+------+--------------+--------------+--------------+
| I 1  | DONE         | DONE         | TODO         |
| I 2  | DONE         | TODO         | TODO         |
+------+--------------+--------------+--------------+

Can this be done, and if yes, how?


texts:
I recently started using emacs and mu/mu4e. And I like it!
Using mu4e 1.4.13.
When I started using contexts for my 2 mail accounts it introduces a couple of new problems:

First of all when I start mu4e it does not start, but gives this message:
mu4e-error: [mu4e] root maildir unknown; did you start mu4e?

However, loading mu4e the second time, it seems to start as normal.
I use M-x mu4e to start mu4e, and I start it right after starting emacs.

If I switch from mu4e main view to another buffer, I can't switch back to the mu4e main view buffer. It is not showing in the buffer list anymore.

My mu4e-config looks very close to the example provided in the documentation.
Any ideas?


texts: Making terminal Emacs treat APPS (aka MENU) key as super modifier

texts:
I am working with Emacs on Cygwin, which actually has 3 types of Emacsen:

Win32 Emacs, which is a graphical Emacs compiled to use native Windows GUI (so no X windows is required)
Terminal Emacs, which displays in the mintty terminal by default
X Windows Emacs (requires X, and not relevant to this question)

I am trying to bind the APPS key (the one with the little menu on it, usually to the right of the right-hand Windows key, I think it is properly known as the MENU key, https://en.wikipedia.org/wiki/Menu_key) to the "super" modifier (gotta love those short key sequences). In Win32 Emacs this is pretty easy:

(when (equal window-system 'w32)
    (setq w32-pass-apps-to-system nil
          w32-apps-modifier 'super))

This makes Emacs treat APPS as super and stops it passing it onto the OS. It then becomes trivial to make bindings such as

(define-key global-map (kbd "s-r") 'recentf-open-files)

Problem

How to make terminal mode Emacs also treat APPS as super? Firstly it was necessary to have mintty changed to pass through the APPS key to Emacs; this has been done already by the maintainer (see https://github.com/mintty/mintty/issues/494) and we can now configure mintty to send any escape sequence we want through to Emacs.

As I said in the issue, the initial suggestion of Key_Menu=29 (which results in ESC [ 2 9 ~ appearing in the view-lossage log), appears to be interpreted by Emacs as the "<print>" key, so that I can succesfully bind using

(global-set-key (kbd "<print> r") 'recentf-open-files)

The above, while it is a great advance, is not ideal because 2 sets of bindings would be required, one for terminal mode and one for graphical windowed mode.

Things that I don't know

How does Emacs translate a sequence of input characters into a logical key?
Why does terminal Emacs think the ESC 29 sequence is the print key?
Does terminal Emacs even know about the APPS key?

Question

How can I configure W32 Emacs and terminal Emacs so that they both treat APPS/MENU as the super modifier, thus enabling a single set of keybindings to be used in both cases?


texts: encrypted password file with emacs & gpg

texts:
I want to keep all my passwords and logins in a gpg-encrypted file, that I want to access using emacs in the terminal on ubuntu.
I want to be prompted for the 'master' password when opening the file, but not when saving it. I don't want to use anything like a 'keyring'.
I managed to almost achieve my desired setup by following the instructions here, the only problem being that I have to enter the password twice when saving the file. The problem is that I fear that when accidentally entering the password incorrectly twice, I could lock myself out of my password file forever.
Is there a way not to be prompted for the password when saving, or alternatively for the save-password to be rejected when its hash doesn't match the password that I opened the file with?


texts: I recently moved to mu4e for my email and it works great except that the way my university formats emails makes them look really weird in emacs (light grey background, white foreground). I was advised that pressing 'h' can toggle off html but this didn't change anything. I then used html2text and now I have some markdown in the email buffer, this is at least legible but not ideal. Is there any way I can render the markdown thats in the email?


texts:
I've created the following LaTeX file:

\documentclass[10pt]{book}
\usepackage{subfiles}
\usepackage{mystyle}
\begin{document}
\subfile{./tex/title.tex}
\subfile{./tex/intro.tex} %warning here says: User Regex: /intro.. [44]
\subfile{./tex/dynamic.tex}
\subfile{./tex/tournament.tex}
\subfile{./tex/ltt.tex}
\subfile{./tex/experiments.tex}
\subfile{./tex/conclusion.tex}
\subfile{./tex/references.tex}
\end{document}

Why is that warning being displayed there, and what exactly does it mean? Should I be concerned, and how do I make it go away?


texts: Query replace a copied string by another copied one

texts:
Use case: I want to:

copy a (long, not handy to manually type) newstring,
replace all occurrences of another (long, not handy to manually type)
string by newstring.

Current process (not handy):

Copy (mark + M-w) string in the (main) buffer.
Start the query replace process, using copied string (M-% C-y <RET>).
Select another window (C-x o) to switch from the minibuffer to the main
one.
In the (main) buffer, (optional: search (C-s) for newstring and) copy
(mark + M-w) newstring.
Select another window (C-x o) to switch from the main buffer to the
minibuffer.
Paste (C-y) newstring and continue the query replace process (<RET>).

Possible start of track: This answer provides the a nice way (C-s C-w) to search for the word after the current mark.

Question: I wonder if:

the previous track could be extended to replace for the word after the
current mark,
or if there is another, better, track for my use case.


texts: elisp - construct a quasi-alist from variable

texts:
To construct a quasi-alist, case 1 is using hardcode string; case 2 is using a variable filename to replace the hadcode string. but case 2 doesn't work as expected (should the same as case 1).

#+BEGIN_SRC elisp :results output
;; case 1
(setq alist '((:file . "test.txt")))
(print alist)

;;case 2
(setq filename "test.txt")
(setq alist '((:file . filename)))
(print alist)
#+END_SRC

#+RESULTS:
:
: ((:file . "test.txt"))
:
: ((:file . filename))

What's the right way to use a variable to construct a quasi-alist?


texts: How do I change portions of a custom theme?

texts:
I'm using one of the pre-defined custom themes that come bundled with Spacemacs (zenburn).

How can I modify specific portions of the theme, for example just change the font color used for comments ?


texts: How to export headlines, including subheadings, without other contents in org-mode?

texts:
In the org-mode documentation regarding export settings, it describes arch as follows.

  Configure export of archived trees. Can be set to headline to only process the headline, skipping its contents (org-export-with-archived-trees).

That's almost what I want, but it skips all the contents, including the subheadings. I want those subheadings too (without their contents). Take this example:

#+OPTIONS: arch:headline

* I want to see this :ARCHIVE:
But not this.
** and also this.
And definitely not this.

If I export this file, I want to see this is the only thing that comes through. But I was expecting/hoping and also this to be exported underneath it as well.

How do I make that happen? I tried adding an extra :ARCHIVE: tag to the second level heading, but that does nothing.


texts:
I would like to unit test my font-face keyword rules against some source code data sets.

It sounds like it should be quite easy: open the source file, enable the mode, force fontification, dump out the properties to a file and then compare. However, it is only possible (AFAICT) to font-lock-fontify-buffer which has an ambiguous region... it may just be the visible region.

Is there a way to force fontification of every single character in the buffer, even when it is too large to view? Or are the docs just ambiguous, but it actually does what I want?

The ideal situation would be if somebody has already written a test framework for this, in which case, please let me know!

Maybe I could hack it with a custom font-lock-mark-block-function or font-lock-fontify-region-function to select the entire buffer just for the test, but that limits my ability to test user interactions.


texts: helm-ag (or similar) find in javascript files only

texts:
I'd like to restrict find/grep to (say) only javascript files (mainly because that's what i do in "another editor").

Javascript files in my legacy Ruby-on-Rails project have one of these file extensions:-

.js, .js.erb, .coffee, .js.coffee, .js.coffee.erb, .jsx, .js.jsx, .js.jsx.erb (and maybe more)

If i could, i would restrict find to files with these file extensions, and pre-define this list so i don't have to type it each time.

I think i need to write a custom function, if there is a way to specify filetype, but I'm struggling to discover how to do this.. and maybe I've just picked up a weird workflow from my old editor?

EDIT: sorry the question wasn't clear.. i don't want to fix it so that emacs always searches in Javascript files.. when i want to search in Javascript files, i want to search only files with those extensions.. when i want to search in html files i want to only search in files with extensions .html, .html.erb, .html.haml, .haml, etc.


texts:
It is possible to change the figure options for a latex figure in org-mode?
Currently I'm using the following to insert a figure in my org document.

#+CAPTION: awesome figure
#+NAME: fig:my-figure
[[file:awesome-figure.png]]

This is exported to

\begin{figure}[htb]
\centering
\includegraphics[ ... ]{awesome-figure.png}
\caption{\label{fig:my-figure}awesome-figure}
\end{figure}

This is already quite good, but it tells latex not to try and enforce the [htb] hints. How can I change it so that latex figures are exported as follows?

\begin{figure}[!htb]
\centering
\inclduegraphics[ ... ]{awesome-figure.png}
\caption{\label{fig:my-figure}awesome-figure}
\end{figure}

The exclamation mark for the figure options is important since it tells latex it should enforce the figure placement.


texts: How do I prevent Org Mode from including MathJax when exporting as html?


texts: how to get reference to other tables working with field references?

texts:
I'd like to create a summary table for tables of months (months are just one possible use of the summary table).
The months have some informations and a count column.
The summary count of every month should appear in the SUM-table.
Like it is working in the following example.

#+TBLNAME: SUM
| Month   | count | other values | notes |
|---------+-------+--------------+-------|
| Jan     |     6 |           33 | blah  |
| Feb     |    15 |           44 | blah  |
|---------+-------+--------------+-------|
| Summary |    21 |              |       |
#+TBLFM: @2$2=remote(Jan,@>$3)::@3$2=remote(Feb,@>$3)
#+TBLFM: @>$2=vsum(@I$2..@II$2)

#+TBLNAME: Jan
| some info | more info | count | notes |
|-----------+-----------+-------+-------|
| foo       | xx        |     1 | blah  |
| bar       | yy        |     2 | blah  |
| baz       | zz        |     3 | blah  |
|-----------+-----------+-------+-------|
| summary   |           |     6 |       |
#+TBLFM: @>$3=vsum(@I$3..@II$3)

#+TBLNAME: Feb
| some info | more info | count | notes |
|-----------+-----------+-------+-------|
| qux       | xx        |     4 | blah  |
| ber       | yy        |     5 | blah  |
| bez       | zz        |     6 | blah  |
|-----------+-----------+-------+-------|
| summary   |           |    15 |       |
#+TBLFM: @>$3=vsum(@I$3..@II$3)

... more months here

Now make the SUM-table more flexible and the table formula better editable. Because doing this: @2$2=remote(Jan,@>$3) for 12 months gets pretty repititive and hard to maintain. So I'd like to replace the part of the SUM-table formula.

I thought about using this SUM-table formula: #+TBLFM: @<<$2..@>>$2=remote($1,@>$3)
but that gets me: just an ERROR.

Doing this #+TBLFM: @<<$2..@>>$2=remote($1,$3) gets me the following result in the SUM table:

| Jan     | remote(Jan, 33) |           33 | blah  |
| Feb     | remote(Feb, 44) |           44 | blah  |

This is not what I intended, it should look like this:.

| Jan     |     6 |           33 | blah  |
| Feb     |    15 |           44 | blah  |

How to get remote() properly working?


texts: Enter a string interactively on specific keyboard shortcut

texts:
I'm new to this kind of Q&A site. Now I'm writing some article using Sphinx (reStructured text). Writing an equation (like E = mc^{2}) in Sphinx is a little bit demanding, because you have to decorate it as follows.

:math:`E=mc^{2}`

So I wrote a function like the following.

(add-hook 'rst-mode-hook
          '(lambda ()
            (local-set-key (kbd "C-m") '(lambda (eq)
                                         (interactive "sEnter LaTeX Equation.")
                                         (insert (concat " :math:`" eq "` "))))))

It works

C-m
You are prompted to enter an equation like E = mc^{2}
Then :math:`E=mc^{2}` is automatically inserted.

However, very strangely, when I feed Enter key, I am again prompted to Enter LaTeX Equation, which is not a desired (just entering Enter key!!!). How can I avoid this?


texts: How to use use-package's :bind to bind key-chords

texts:
(use-package whatever :bind (("C-a b" . aabb)))

can be used to replace

(global-set-key (kbd "C-a b" 'aabb))

Can use-package's :bind be used to replace

(key-chord-define-global "ab" 'aabb)

?


texts:
No matter what I do, the customizations I apply to js2-mode are not going into effect. The mode is on and working, but with default settings. I've tried changing the default-tab-width to 2 and changing the indent behavior for switch blocks (indented case lines are turned off by default). I'm using Emacs 24.4.1.

Here are the relevant parts from my .emacs:

(add-hook 'js-mode-hook 'js2-minor-mode)
(add-hook 'js2-mode-hook 'ac-js2-mode) ;; add auto-complete suggestions

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(js2-basic-offset 2)
  '(js2-indent-switch-body t))


texts:
When I do s-left-mouse-click, and select "Change Buffer font...", I get a pretty display of sample text showing me what the various fonts look like.  I'd like to reproduce similar behavior in a buffer.

I'd like to iterate over the values given by (font-family-list), print the name of the font-family, and a sample text with that family applied.

I got this far:

(dolist (curfam (font-family-list))
  (print curfam (current-buffer))
  )

which gives me the desired list of family names.  Now I'm looking into customizing faces, and I'm starting to think what I want to do is really kinda tricky.  Maybe that's why I only find what I'm looking for in a gtk box.

While I have some thoughts how to accomplish this, they seem pretty complicated -- creating a custom face for each family, setting those face properties, and setting the face for the current line somehow.

Here's my plan:

For each family, create a face, with correct font-family.
Insert the desired text.
Apply the face to the desired text.

Here are my questions:

Is this the right approach?  Is there a simpler way?
How do I apply the face to the desired text.  Can I apply a face line by line, or do I have to make some kind of font lock mode?


texts: How to specify default header arguments in orgmode code blocks

texts:
I'm tying to set default header arguments to the code blocks within my org file, like this:

#+PROPERTY: header-args  :session *my_python_session*
#+PROPERTY: header-args  :results silent
#+PROPERTY: header-args  :tangle yes

My code blocks look like this:

#+BEGIN_SRC python
  import pandas as pd
#+END_SRC

However, when I call org-babel-tangle from this buffer, I get Tangled 0 code blocks from filename.org.  When I add :tangle yes to the end of the #+BEGIN_SRC line, the code block is exported when I call org-babel-tangle.

I would expect that I don't need to set :tangle yes on each code block.  What am I doing wrong?


texts: Disable and / or keywords substitution in Python mode in Emacs 25.1

texts:
How can I disable and / or keywords substitution in Python mode in Emacs 25.1?

Cygwin emacs-w32 can't find appropriate fonts in Windows (for ∧ and ∨)...


texts: Find dirrectories paths from a list of names via tramp session

texts:
I have a remote host accessing via tramp there is a list of directori names I'd like to find on that host.

What I do now - connect to remote server and

while read -r name; do find / -type d -name "$name"; done < dir_names | tee dir_paths


texts: Best way to disable flycheck checkdoc warnings on specific elisp directory?

texts:
I use flycheck with flycheck-elisp-checkdoc checker active and find them fairly useful.

Still, I find it irritating to be nagged about missing (provide), section headers (;;; Code, ...), package metadata and similar things while I am editing my ~/emacs/etc (that's ~/.emacs split into smaller pieces). Those files are short configuration snippets and adding those comments would only make them longer and less readable.

So, what is the best way to disable those warnings in this very place (but only there, the same reminders are very useful once I edit my true lisp modules...)?

I do not really mind whether it would mean disabling flycheck-elisp-checkdoc checker for flycheck in this very dir, or reconfiguring checkdoc in this ery place, or something in-between – although the latter case would also handle other ways of spawning checkdoc…


texts: Lock tab. Not change content of tab until unlock it

texts:
Linux Mint 21, Emacs 27.2
Suppose I create new tab (M-x tab-new) in folder Temp. The title of tab is Temp Here result:

Nice.
But if I open another folder (myFolder) then title of tab is change to myFolder.

The question is.
Is it possible to lock the tab with title Temp?
So as result, e.g. when I open another folder (myFolder) then AUTO create new tab with name myFolder.
Smt like this.

Or e.g. change buffer with another buffer. Then auto create new tab. Content of tab Temp is NEVER change. Until I unlock it.

Is it possible?


texts: how to insert leaders with periods around dot?

texts:
(This is not about org-mode.)
Assume point is between "left" and "right" below
    left       right
Is there a command that will change that to, for example,
    left . . . right
and leaves point at the same position?  There should be a minimum of left-space spaces before the first ., dots should be on columns evenly divisible by column-spacing (first column is number 1),  there should be a minimum of right-space spaces after the last dot, and char-to-use is normally a period but can be set to, for example, "_" if wanted.


texts: How to create a short name for tramp multihop path?

texts:
I connect to various locations, for example:

/ssh:hostname|sudo:hostname:/
/ssh:hostname|sudo:hostname|docker:container:/

and want to have some kind of short aliases for these long paths.
Something like this:

/su-hn:/
/dk-hn:/

How can I get it?


texts: Org Mode - Use remote table reference in constants

texts:
In https://orgmode.org/manual/References.html remote references are mentioned. Also there are constants for a local environment of a table. I would like to retrieve the value for a constant from the calculations of another table. In a sense it would not be a constant any longer, but in the scope of the table, it would still be a constant.

Is such a thing possible?

I tried:

#+CONSTANTS: hours=remote(other-table-name, @>$5)

But it does not seem to work and gives an error in the cell, where I use the constant.


texts: Issue binding space as leader with evil-mode and general mode

texts:
I am currently trying to set up my config so that I can use evil-mode while also using the space key as a local leader for some command while mapping my keys with general.el package.

;; hide tool bar
(tool-bar-mode -1)

(setq-default tab-width 4)

;; add melpa
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

(use-package evil
         :ensure t
         :config
         (progn
           (evil-mode 1)
           ;(use-package evil-leader
           ;     :ensure t
           ;     :config
           ;     (global-evil-leader-mode))
           (require 'evil-leader)
           (setq evil-default-cursor t)))

;; for providing wrappers for defining keybindings
(use-package general
         :ensure t)

;; for telling me which key does what
(use-package which-key
         :ensure t
         :config
         (progn
           (setq which-key-idle-delay 0.5)
           (which-key-mode +1)))

(general-define-key
 :state 'normal
 :prefix "SPC"
 "w/" 'split-window-right)

But when I run the config I get the following error

error: Key sequence SPC w / starts with non-prefix key SPC

I have tried unbinding the space key but even when I do so my keybinding doesn't work and the space key just works as it normally does in normal mode. What am I missing here, is it some kind of conflict between general and evil-leader or am I just missing something?


texts: mu-query for finding mails with a single and specific recipient (mu4e)

texts:
Using mu4e, I'm looking for the regex to display mails that have been sent to one specific recipient, and only one recipient (i.e. no cc:, no other name in the to: field). For example, if I use mu4e search and type to:john@doe.com as a regex, mu4e will display all mails addressed to john@doe.com but also mails addressed to both john@doe.com and jane@doe.com (jane might be in the to: or cc: field in some mails). I would like instead to find mails that are only addressed to john@doe.com.

What would be the right regex for such query using mu4e?


texts:
This is the block of text that I intend to copy as rectangle (without the line numbers).

   1. ALM_KRmet_DCDO_RPMP_START
   2. ALM_KRmet_DCDO_RPMP_STOP
   3. ALM_KRmet_DIDC_RPMP_TRIP
   4. ALM_KRmet_RPMP_J_H
   5. ALM_KRmet_DIDO_PUMPOUT
   6. ALM_KRmet_RPMP_VIBR_H

Steps:

I keep the cursor in the first line (after the 1.)
Press C-x SPC - This enables rectangle-mark-mode
I move down along the same column to the last line
When I reach the end of the text in the last row, the cursor wouldn't move further to the end of the text in the first row.

When I copy or cut, it leaves the un-highlighted portion (or unselected portion) of the text in the previous lines and copies / cuts only that is selected.

Question

What should I do, if I intend to copy the entire block of text (with the smallest length text in the last row)
 Is there a straight forward way to achieve this? Sublime text is able to do it without any issues.


texts: Is there a way of visually indicating mark and previous locations of mark in a buffer using only vanilla Emacs without any external package?


texts: How can I use the #+OPTIONS: broken-links: option to ignore broken links, in a specific way?

texts:
I have a very large orgmode document that has internal links to many different parts of the document.

If I try to export a subtree that has an internal link that points to a part of the document outside of the subtree exported, I get an error

Unable to resolve the link: "Determinism"

to get around this, I've written

#+OPTIONS: broken-links:auto

which makes it so that when I export the subtree, it can export but in the export the link's title isn't exported, it's simply a blank spot.

Basically in the original document's subtree I'll have this internal link that points to outside of the subtree like this

Philosophers love [[determinism]]

but upon export It becomes

Philosophers love

and what I want in the export is

Philosophers love determinism

I'm wondering if this is achievable.

I'm using spacemacs on MacOS, Mojave.


texts:
I use Emacs 27.1 (9.0) and mu4e 1.4.13 with multiple email accounts, and those email accounts have one main username and multiple aliases. Recently I started getting this error when replying to an email sent to an alias:
error in process filter: if: No email account found
error in process filter: No email account found

Before, I used to be able to reply to an alias and the reply would come from the main username.
How can I fix it?


texts: In Dired Query and Replace, can we substitute in the filename being visited? For example, I want to substitute "solve" in all *.mod files with the filename *.mod.


texts:
I use Gnome Tracker quite a bit and am led to wonder whether there is currently any way to use Tracker from within emacs? That is to say; searching for files indexed by Tracker, within emacs (and consequently reading them with pdf-tools or docview). It would be one less reason to fire up the Tracker Desktop Search interface.

[ https://wiki.gnome.org/Projects/Tracker ]


texts: How to syntax highlight Python f-strings so {...} uses regular code colors?

texts:
Update, Emacs 28 supports f-stings

Python 3.6 supports F strings, eg:
So:
print(f'Test {} me!'.format(2 + 2))

Can be written as:
print(f'Test {2 + 2} me!')

Which print's Test 4 me, Is there a way to adjust emacs syntax highlighting so the text between the {...} shows using regular code syntax-highlighting (instead of the same highlighting as a string).


texts: Enabling a minor mode in all but some buffers

texts:
I want to enable display-line-numbers-mode in all buffers except pdf
buffers.  Can I do that without making a list of all the major modes
except pdf-view mode?


texts: Reordering declarations with use-package: Why does this work?

texts:
I'm reorganising my init.el a bit and I've realised that it contains the following set of use-package declarations: (simplified slightly)

(use-package hasky-extensions
  :config
  (general-define-key
   :states '(normal visual insert emacs)
   :keymap 'haskell-mode-map
   :prefix "K"
   :non-normal-prefix "C-)"
   "xx" 'hasky-extensions
   "xd" 'hasky-extensions-browse-docs
   "hh"  'hoogle
   "hH"  'haskell-hoogle-lookup-from-local))

;; ...
;; then, a bit later:

(use-package general)

Arguably this shouldn't work, as general-define-key is called before general is required through the use-package declaration. However, it turns out to work just fine - I get no errors and can use all the keybindings I have defined. Why does this work?


texts: Can magit put my commit somewhere up the tree?

texts:
I have a rough part of my workflow, wondering if magit is the solution.
So when I'm working on a task, I spin off a branch like most people.

I end up putting 5 or 6 commits in a branch that's for my personal use, not to be pushed to the outside world. Ideally they should be positioned at the tip of the branch, for easy removal if needed, and also to be able to use "the semicolon technique" to push to GitHub "only up to a certain commit" of a branch.

My problem is, with this kind of practice, often these "personal" commits get sandwiched between legit commits, so I have to use magit rebase to re-move the personal commits to the tip of the branch frequently.

Does magit have a feature to overcome this? Anyone else have this problem?
I was thinking, what if there a tool that

when I do git commit -m "work" it puts the commit 5 steps up the commit tree, so the new commit appears before my "personal" commits.


texts: I develop in Unity, and have been using emacs as my text editor for development. Debugging however has always needed to be done through monodevelop (and it crashes half the time while doing this). My team finally updated our unity version and that came with an updated mono version that I was hoping could maybe allow me to hook the GUD up to the Unity Debugger? The only help I could find was this post pointing at the mono soft debugger, but its from a number of years ago and I dont know how I would hook into the running unity instance. Has anyone solved this problem before?


texts: Is there a package that can bind S-S (shift-shift) to an interactive function?

texts:
IntelliJ has a keybind on a double-tap of Shift. I'm curious if Emacs can emulate this functionality - my first thought was key-chord.el, since it allows double taps of regular keys like qq. But, reading the key-chord.el documentation, it doesn't seem like it's possible to use modifiers keys as the keybind.

Any other packages that might be able to duplicate this functionality ?


texts:
I would like to enable show-paren-mode in my configuration file init.el, which is very convenient for debugging.
As it is a minor mode as I've understood, I don't know how to proceed...Thank you very much!


texts: Org Mode - pick random task from custom agenda view

texts:
I want to select a random task from a subset of global org tasks from something like:

("d" "daily start"
 ((agenda ""
          ((org-agenda-span 'day)
           (org-agenda-skip-function
            '(org-agenda-skip-entry-if 'notregexp ":start:"))))))

I saw there's a command at https://gist.github.com/tonyday567/4343164 to pick from the global list.  Is there a way to narrow it down?


texts: magit + ido: do not offer tags in completing read?

texts:
Q: how can I get magit + ido to ignore tags when checking out a branch?

I'm using magit + ido.  When I go to check out a branch, ido
helpfully gives me the names of all existing branches, but it also
gives me the names of all tags.  Sometimes I want that, but
usually I don't.

How can I convince magit + ido not to offer tags as a completion option?


texts:
I am dealing with json files with multiple repeated blocks with just one field value(integer) changed - in fact, every changed value is just the previous corresponding value incremented. To make such files easy to read, I would like to be able to fold this entire set of repeated blocks into just one block with some indication of what the ranges of the changing value across these blocks is. Searching for code folding methods in emacs, I found hs-minor-mode and outline-mode. However, I don't see how to go from the functionality they provide to the one I desire. Could someone provide a rough overview of how I could achieve this?

EDIT : An example of what I am trying to do:

Given a json file that looks like this:

{
    "SomeArray": [
        {
        "ChangingField": 1,
        "ConstantField" : "X"
        },
        {
        "ChangingField": 2,
        "ConstantField" : "X"
        },
        {
        "ChangingField": 3,
        "ConstantField" : "X"
        },
        {
        "ChangingField": 4,
        "ConstantField" : "X"
        },
        {
        "ChangingField": 5,
        "ConstantField" : "X"
        }
    ]
}

I would like to have it displayed like this:

{
    "SomeArray": [
        {
        "ChangingField": 1...5,
        "ConstantField" : "X"
        }
    ]
}

Apologies for the very open-ended question.


texts: How can I backdate a timestamp by one day?

texts: In org mode, I'm usually lazy and forget to check off todo items on the day of. Instead, I remember the next day, and then have to mark an item as done, and then edit the timestamp so that it's for the previous day. But there must be an easier way. Is there already a function for this? If not, how would I go about writing one?


texts: How do I enable a mode, when another mode runs?

texts:
All I want to do is enable tern-mode, when I enter js-mode.  I know that a hook called js-mode is run when I open a javascript file but for some reason tern-mode is not enabled.  In my init.el file I have:

(add-hook 'js2-mode-hook (lambda () ('tern-mode)))

I also tried:

(add-hook 'js2-mode-hook (lambda () (tern-mode t)))

as well as both of those with js-mode-hook (This was mostly for fun though because it makes no difference, see the comments)

I have also tried:

(add-hook 'js-mode-hook 'tern-mode)

And this does't work.  However, tern-mode does not get enabled when I enter js2-mode.  To enable it, each time I have to press M-x tern-mode, then it works.

Is there anything I am doing wrong here?


texts: Keeping my .org files in sync across multiple computers

texts:
How can I keep my .org files up to date across several computers, perhaps across multiple platforms(linux/windows)?

I could keep all the .org files in git for example, but that would require me to remember to pull and push to keep the repo updated. Could work with a few scripts to automatically handle the files, as I don't have that many.

I could try using dropbox for this as well. I'd assume dropbox syncs the files often enough to not cause problems.

Does org-mode offer any functionality to help with synchronizing the files across multiple locations?


texts: How to navigate through bookmarked directories in helm-find-files?

texts: I have some bookmarked directories (regular Emacs bookmarks). I'd like helm-find-files to quickly navigate to the files in these directories. I've tried helm-bookmarks but it will only open the bookmarked directory in dired, not offer to open the files in the directory from the helm buffer. Is there a helm source that would do the trick ?


texts: Show only different symbols. Not entire line

texts:
windows 10, dired+

when I compare two files I get this:

The different in this file are two words:

first

second

But diff tool show me that is different ENTIRE line.
It's not very good.
Is it possible to show only exact different symbols?

smt like this:


texts:
Here is an example .org file displayed with the solarized-dark theme:

Now here's what happens when I switch the theme to leuven:

Similar things happen in some other themes (like wombat). Looking at other files, it appears that the fifth headline is printed, but it's way off to the right and takes up the entire screen.

My .spacemacs file contains no modifications apart from a few key bindings. Has anyone seen this problem before?


texts: How to leave mark region highlighted when switching windows

texts: I usually have my Emacs frame split into windows. I'll select something in one window and then switch to another buffer. When I do this Emacs removes the active-region highlghting in the original window. I'd like to keep it highlighted so I know what I was focused on while working in the other window.


texts: Different colors for questions and answers in org-mode

texts:
I'm writing questions and answers in org-mode for project purposes (like meeting notes). A sample looks like this:

1. [X] Equipment name for tags associated with pumps - Discuss
   Comment: We can just use MP-516A/T. I’ve updated your ACM names as well
2. [X] Why have the steps D12516_DirectXfer and D12516_LnClr not included in the steps? Step enable conditions to be
   added
   Comment: I bet the tool didn’t add the columns. If you manually added the columns to this tab, it will be perfectly
   fine. We can proceed with filling out the enable conditions for these columns.

The screenshot shows how I see it on the screen

Question:

I would want at least one of them (either the answer or question) to be shown in a different color.  Is that possible? or am I asking for too much?


texts: re-search-forward Regex behavior for OR boolean

texts:
We usually use \| to depict OR in Regex. Using a\|b as input to Regexp I-search and Occur both gave the desired result. But re-search-forward seems unable to recognize this notation.

  abcdcba

(re-search-forward "a\|b")

;; Search failed: "a|b"


texts: org-journal-mode new entry ignores .dir-locals.el

texts:
I am using org-journal-mode. I have created .dir-locals.el in my ~/Documents/journal directory and it gets correctly applied if I open a file the usual way. However, if I hit the C-xC-j to add a new entry and the entry is in a new day, the opened buffer does not have the modifications I apply through .dir-locals.el.

Can I make it recognize and process .dir-locals.el for new day journal entry buffers?

My .dir-locals.el:

((nil
  (fill-column . 79)
  (indent-tabs-mode)
  (show-trailing-whitespace . t)
  (whitespace-style face trailing lines-tail space-before-tab indentation empty)
  (whitespace-newline . t))
 (org-journal-mode
  (typo-language . "Czech")
  (typo-mode . t)
  (ispell-local-dictionary . "czech")
  (flyspell-mode . t)
  (whitespace-action warn-read-only auto-cleanup)))


texts: Why is org-mode always uncompressing ob-tangle.el.gz?

texts:
I recently shifted over to and wrote a literate init.el in a manner of speaking. Using this technique, I don't (require 'org-mode).

Suddenly when I open up my .org file to edit it, it consistently hangs for a second on uncompressing ob-tangle.el.gz...done.

Since I have started from scratch and had not noticed that at all over the last few days while editing it, was I just blind, or did something happen?


texts: helm: find-file it is possible to ignore `[?] ...` during iteration

texts:
I am using helm when I am using Find Files (ctrl+c ctrl+f)

(require 'helm)
(require 'helm-config)

(define-key helm-map (kbd "<tab>") 'helm-next-line) ; rebind tab to run persistent action
(define-key helm-map (kbd "C-i") 'helm-next-line) ; make TAB work in terminal

When I type and press TAB for helm-next-line, I want helm to iterate over the found files like update_repo.sh and update_local_configuration.sh on the given example. But in addition it also always iterates over [?] update_ which I do not want. Is it possible to obtain this?


texts: The question is if there's anything like a "background display mode" or maybe a package that once installed would allow a background grid to be displayed in the editor window. The Eclipse IDE for e.g. manages to display thin dotted lines to mark indentation, though I'm specifically asking for a grid. It might help keep code tidy.


texts: Specify a fallback font for runic characters in Emacs?

texts:
I want to specify a different font from my default font for runic characters in Emacs.

I tried both:

(set-fontset-font "fontset-default" '(#16a0 . #16ff) "Junicode:Regular")

and

(set-fontset-font "fontset-default" 'runic "Junicode:Regular")

and neither seemed to work.  The first reports:

 (invalid-read-syntax "#")

and the latter seems to silently fail.


texts:
When I maximise an Emacs frame, it fills almost, but not quite all the available space. I can still wiggle the frame around and a sliver of the desktop beneath is showing. Desktop environment is KDE 5.

Screenshot shows the right-most edge of the screen.


texts: Replying to all recipients with Notmuch and msmtp

texts: I have tested sending an email to multiple recipients with Notmuch through msmtp and it works. I can also copy all recipients of email to kill-ring (via notmuch-show-stash-to), no problem. However, when I reply all (with "R", actually "c R" since I am on Doom Emacs), the reply message is only addressed to one of the recipients, not all of them. Can anybody help me solve this problem?


texts: How do I configure helm-git-grep candidates limit?

texts:
I have this in my .emacs file but it still shows that the limit is 300 Candidates.

(require 'helm-git-grep) ;; Not necessary if installed by package.el

(global-set-key (kbd "C-c g") 'helm-git-grep)

(setq helm-candidate-number-limit 200)


texts: shell-mode: `C-a` moves point to beginning of line instead of after prompt

texts:
Usually C-a moves point to just after the prompt:

andreas@my-computer:~/some/folder
$ #here

but occasionally something happens and C-a starts to the beginning of line:

andreas@my-computer:~/some/folder
#here

I have no idea why this happens, and the only way I've been able to fix it is to restart Emacs. How can I revert C-a to the normal behavior of moving to the point after the prompt?


texts:
I want to add the emacs #...# files to the boring file list. I don't know how the helm regexp engine works since dots are not escaped, I have tried to manually escape them with a backslash but it doesn't work.

The standard regexp for my need would be #.+# with the sequence .+ interpreted as "any character at least one time".

If someone would like to briefly explain how the helm regexp engine works I'll be really happy!


texts:
I would like to make flycheck work with checkers installed via Bundler, and I've read that in order to do that, I have to implement the flycheck-command-wrapper-function.

What it should do is prepend command with bundle exec.

This is an implementation of such a wrapper for Haskell.

I'm a total newbie when it comes to Lisp, so I could only come up with

(setq flycheck-command-wrapper-function
      (lambda (command) (funcall "bundle exec " command))
)

which doesn't seem to work.

Any suggestions?


texts: How can I automate the editing of a source file, switching to other window, recall and exec. previous shell command and switch back to starting buffer

texts:
In this scenario

I press C-x C-s to save the file being edited in upper window
C-x o to switch focus to lower window
Alt-p to recall previous command in M-x shell buffer
Enter to execute command
# the command takes 4-5 seconds to complete, without waiting
C-x o to switch back to editing file in upper window

If I end up doing this 30 times each hour, it can become tedious.
Can emacs help automate this?

Someone (@db48x) suggested using Function keys, this is my keyboard dunno what they referred to:


texts: ispell personal dictionary for multiple languages

texts:
I use hunspell for spellchecking.  When I switch dictionaries (e.g., from en_US to hu_HU), I cannot save personal words to my personal dictionary.  Emacs complains that

  ispell-init-process: Error: Expected language "hu" but got "en".

I assume that's because the value of ispell-personal-dictionary is ~/.aspell.en.pws, and the first line of that file is personal_ws-1.1 en 46.  Maybe I should not use aspell's personal dictionary for hunspell, but when I set ispell-personal-dictionary to a new (empty) file, the message I get

  ispell-init-process: Error: The file "[filename]" is not in the proper format.

(Hunspell personal dictionaries are supposed to be simple word lists, according to the man page.)

How can I set up separate personal word lists for different languages?
What is the format for a hunspell personal dictionary?

(+1. Incidentally, to make sure I run hunspell, I added ispell-program-name (executable-find "hunspell") to my .emacs, which resulted in

  split-string: Wrong type argument: stringp, nil

hunspell does run, but only if ispell-program-name is not set.)


texts: sql-send-paragraph results in mis-aligned headers

texts:
Anyone know how to fix this? I'm connecting to Postgres, and when I use a command like sql-send-paragraph to send a SQL query to the interactive *SQL* buffer, the headers are not aligned right.  It's really hard to read.

For example a multiline query like this:

select a, b, c
from table1
where a = 1;

Will give something like this in the *SQL* buffer:

mydb=> mydb=> mydb-> mydb-> mydb->     a     |      b       |   c
----------+--------------+-------
        1 | 2015-01-05   | 59120
        7 | 2015-01-06   | 59121
        3 | 2015-01-07   | 59122
(3 rows)

It needs to put an extra newline in there so the column headers are on  their own line.


texts: How can I diff two long lines from the same buffer?

texts:
When I run tests for my projects, failing tests produce output that looks something like this:

        expected: "..."
         but got: "..."

The "..." are long lines that often only have small differences.

How can I quickly diff lines like this?

I've tired copying the lines to separate buffers and using ediff-buffers, but that had a few downsides:

the diff is line-oriented in a way that works poorly for comparing two long lines
ediff messes up my window configuration, so I either need to spawn a new frame or save my current configuration in a register—in practice, this disrupts my workflow a bit
ediff uses a separate frame for its controls, which is awkward when I'm running Emacs as a full-screen application in macOS
doing this manually is pretty laborious

I could solve the last problem by wrapping this up into an Elisp function, but the other issues would remain. Is there some way to configure ediff or use some other diff function that would work better for this usecase?


texts: Get values of an inline result in org-mode

texts:
I like the short notation of org-babel function calls. E.g. you can define a named code block like this

#+name: get_date
#+begin_src http
GET http://date.jsontest.com
#+end_src

and then hit C-c C-c in some inline call to get the results for some parameters (if it's a single line result that is):

call_get_date[:select ".date"]() {{{results(=12-06-2016=)}}}

Or you can even do the code definition inline thus getting rid of 4 more lines:

src_http[:select ".date"]{GET http://date.jsontest.com} {{{results(=12-06-2016=)}}}

I find that is pretty cool, and I would like to use it more often. But I don't see a way to set a name for the inline result to reference it for later :var assignments. Is there any? Or is there some simple elisp which could be employed here?


texts: mu4e : display inline images in html emails

texts:
I'd like to display inline images in html email in mu4e. I tried to ask to the creator of mu4e, but he told me that it's out of the scope of mu4e to do that. However, I can display for example the mail in my browser using:

(defun mu4e-my-show-in-browser ()
  "Display in browser the email"
  (interactive)
  (mu4e-action-view-in-browser (mu4e-action-view-in-browser (mu4e-message-at-point t))))

so I guess it's not a fundamental issue, and that it may be possible to use an emacs html browser to display the email... Any idea?

Thanks.

-- EDIT 1 --
I found a first solution using w3m (make sure to install it). Note that you may need to press T in w3m to toggle image display.

;; Enable images in w3m
(setq w3m-default-desplay-inline-images t)
(defun mu4e-action-view-in-w3m ()
  "View the body of the message in emacs w3m."
  (interactive)
  (w3m-browse-url (concat "file://"
              (mu4e~write-body-to-html (mu4e-message-at-point t)))))

I don't know why but the transparent images are displayed strangely (anti-aliasing maybe), but it's another problem. And also it would be nice to add a few hooks to be able to answer to the email directly from this. If you have a better solution, let me know!


texts: How to write a portion of text from current file to the beginning of another file?

texts:
I have written a function that extracts a portion of text from current file and writes it in another one:
(defun foobar ()
  (interactive)

  ;; re-search "beg" point
  ;; re-search "end" point

  ;; define markers
  (let* ((beg (copy-marker ...))
         (end (copy-marker ...)))

    (write-region beg end filename t)))

Now I would like that all the text between beg and end is added at the beginning of filename. How can I do this?


texts:
I'm working with a large codebase and often find it to be tedious and hard to understand class relationships.  I found the following wiki that describes various tools for working with OOP in C++, but they're either outdated or do not work!  What Emacs tools are available for working with large OO codebases?

Here is what I have found:

Object Oriented Browser

Hasn't been updated since 2002!  Defunct

Ebrowse

I can't even find a download link for the parser...my target would either be Windows or Mac OS X Thanks @tu-do for pointing out it's in the emacs bin directory

Emacs Code Browser

Only seems to support Etags, but not Global tags or cscope


texts: Retrieve SVG images generated by MathJax with org-mode export

texts:
I would like to export mathematical text to HTML with org-mode.
The final output should be pure HTML with equation as images, preferrably svg.
However, I would like to use MathJax instead of dvisvgm for its ability to interpret command definition such as

\(
\newcommand{\glonk}{\int f(x)^\alpha}
\)

How could I have MathJax calle by org-mode generate svg images?


texts:
I want to configure it so that bulleted lists in org mode are there own paragraphs - for example, in a org file, i have:

. foo bar baz
. baz bar bla

When I do fill-paragraph, this results in:

. foo bar baz . baz bar bla

I added a hook:

(add-hook 'org-mode-hook
          (lambda ()
            (setq paragraph-start (concat paragraph-start "\\|[ \t]*\\."))))

Which I was hoping would cause these to be recognized a different paragraphs.  This does seem to be happening - the value of paragraph-start reflects it - but M-q still does not have the behaviour I expect.  What could the problem be?


texts: texmathp in isearch-filter-predicate breaks query-replace's match highlighting

texts:
I tried to use texmathp with iserch-filter-predicate to let query-replace function skipping maths in my LaTeX code.

I wrote this code:

(defun skip-math (beg end)
  "Return nil if some text BEG to END is a LaTeX maths environment or in in-line maths."
  (require 'texmathp)
  (catch 'skip-region
    (let ((pos  beg))
      (while (< pos end)
        (when (texmathp) (throw 'skip-region nil))
        (setq pos  (1+ pos))))
    t))

(defmacro with-query-replace-skip-math (&rest body)
  "Makes search-* and query-seplace* commands in BODY skip LaTeX maths strings."
  (declare (indent 1))
  `(let ((isearch-filter-predicate 'skip-math))
     ,@body))

(defun foo-to-bar ()
  (interactive)
  (with-query-replace-skip-math
      (query-replace-regexp "foo"
                "bar" nil (point-min) (point-max))))

I tested on:

%% bar foo

foo

\begin{equation}
foo
\end{equation}

foo $ foo $

bar $$ foo $$ foo

\begin{displaymath}
foo
\end{displaymath}

%% foo

bar %% foo bar foo

It works but the query-replace match highlighting is broken:

How can I fix this?


texts: Narrow and move between latex environments

texts:
When writing LaTeX presentations with the beamer class in emacs+auctex I would like to have a function (and keybinding) that does the following three things:

narrow to the next frame environment if currently nothing is narrowed
move to the next frame environment when I'm already narrowed to some frame environment.
if there is no subsequent frame environment to narrow to, then widen.

I can do this more or less with several keybindings using the features available in the auctex and expand-region packages. But I would love to have this behaviour bound to a single keybinding.

Is this possible?


texts: How do I add custom hierarchical keybindings?

texts:
I am looking for a compact way to store a lot of shortcut keybindings. This is my current idea, for which I'm looking for help how to add this into my emacs config:

I would like to make F9 "my" key, that opens up a hierarchical menu of (global) keybindings.

When pressing F9, I'd like a submenu to open that shows e.g.:

o - org-mode submenu
a - show org-mode agenda
w - org-wiki submenu
b - org-brain submenu

If I press F9-a, I'd like to directly execute the M-x org-agenda command.

But by pressing F9-w, I get a new submenu opened that e.g. shows this:

# Org-wiki submenu
i - Show Wiki index
n - Add new Wiki page

If my final keystroke sequence is F9-w-i, I want the command M-x org-wiki-index executed.

Does something like this exist already?
Is there a better solution?
If no, how would I add something like this in my emacs config?

/Edit: I think what I want is to write my custom version of the M-x org-agenda command.


texts: Configuration of eshell. Running programs from directories in PATH env variable

texts:
How can I configure eshell to be able to run programs from directories in PATH env variable?
How can I add additional custom directories to the list?

I use Emacs 24.3.1.


texts:
I irregularly see that org-capture has led to the disappearance of a newline,
leaving me with lines like these

* meeting w/ ch.
<2017-12-01 Fri 11:00>* reading group
<2017-10-09 Mon 16:15 +2w>

Which could make me forget all about that reading group.
Is this a bug or am I doing something wrong?

(There is not so much information here, but I'm hoping someone will have had the same problem.)


texts: How can I use eww as a renderer for mu4e?

texts:
Emacs 24.4 came with native eww browser.
What is the proper way to use eww as a renderer for mu4e messages?


texts: Is it possible to run a keyboard macro in Emacs right after opening a file? For example, when I open a text file I want to get information in buffer Hello world.


texts: I am a Emacs newbie, so please forgive me if there is a obvious solution to this question. Is there a package which logs everything a user inputs into a emacs buffer? For example if I were to open a test.txt file and input this is a test could the input be logged into a seperate file with timestamps upon saving test.txt?


texts: Open the manuals in the default web browser without accessing the internet

texts:
I am talking about this to be precise.
Suppose there are an emacs installation and a web browser on an X session (desktop). I know you can open the manuals in emacs itself using M-x info, but is it possible to open the same manual in the browser (with the basic CSS, like in the website, one node per page)?
The default browser was set using XDG's mimeapps.list.
I searched emacs' package files, but there are no html files listed among them. However, there are a lot of gzipped files with "html" in their name.


texts: emacs in putty session on fedora under virtual box on windows 10 hangs on X11 paste

texts: I suffer a rangy environment where I typically will run emacs in a putty session on fedora under virtual box on windows 10. Sometimes (not all of the time), pasting into the emacs will hang the session. I've found this discussed in a lot of places, but no remedy seems to fix the problem. Does anybody out there have a good remedy?


texts:
I need to backup few files on my Mac, and it can be done inside of Emacs by calling a function. But it is a tedious task to do everyday and sometimes I forgot doing it.

I wonder if I can automate it by using the run-at-time function and make it backup at the mid night, and wonder what if

the computer is locked?
the laptop lip is closed?
the computer is inactive for a long time and in sleep mode?


texts: Make some regexps clickable (like URLs) and have them open URL

texts:
I use org-mode to manage my notes and TODOs. At work, we use Jira to track bugs and development stories and I'd like to make this a bit easier.

I'd like to make all DEV-[0-9]+, BUG-[0-9]+ and some other terms behave like a normal URL, so that they are clickable (no need to make a explicit org-mode link) and that they open a URL with the matched term appended to them.

So DEV-1234 should be recognized as a link, and when I click on it Emacs should open the URL http://jira/browse/DEV-1234.

If possible, I'd like to have other terms with other endpoints as well.


texts: Initialize ipython notebook server from .ipynb file

texts: Is it possible to open EIN notebook as file, so it automatically takes care of starting ipython notebook server?


texts: How can I as an emacs prelude (-nw) user turn off the 80 column warning highlight seen here:


texts: export custom element in html from org-mode

texts:
I'm trying to figure out the simplest possible way to export an html document from org-mode and have it include a working custom-element.
I've tried the following, but it gives me an error message in the console
#+BEGIN_EXPORT html
<script type="module" src="https://raw.githubusercontent.com/PolymerElements/paper-button/master/paper-button.js"></script>
<paper-button raised class="indigo">raised</paper-button>
#+END_EXPORT

browser error message:
Loading module from “https://raw.githubusercontent.com/PolymerElements/paper-button/master/paper-button.js” was blocked because of a disallowed MIME type (“text/plain”).

I took the component from:
https://www.webcomponents.org/introduction


texts:
I'm trying to setup the F1 key for documentation within typescript mode only. Here is what I got so far.

(use-package tide
  :init
  ;; (add-hook 'before-save-hook 'tide-format-before-save)  ;; formats the buffer before saving
  (add-hook 'js2-mode-hook #'setup-tide-mode)  ;; JS Setup
  (add-hook 'typescript-mode-hook #'setup-tide-mode)
  :defer 5
  :config
  ;; TIDE setup
  (defun setup-tide-mode ()
    (interactive)
    (tide-setup)
    (flycheck-mode +1)
    (setq flycheck-check-syntax-automatically '(save mode-enabled))
    (eldoc-mode +1)
    ;; company is an optional dependency. You have to
    ;; install it separately via package-install
    (company-mode +1)
    (local-set-key [f1] 'tide-documentation-at-point))

  ;; aligns annotation to the right hand side
  (setq company-tooltip-align-annotations t)

  ;; Set tide-tsserver
  (setq tide-tsserver-executable "node_modules/typescript/bin/tsserver")

  ;; Add node to the path
  (setenv "PATH" (concat (getenv "PATH") ":~/n/bin"))
  (setq exec-path (append exec-path '("~/n/bin")))

  ;; format options
  (setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil))
  ;; see https://github.com/Microsoft/TypeScript/blob/cc58e2d7eb144f0b2ff89e6a6685fb4deaa24fde/src/server/protocol.d.ts#L421-473 for the full list available options
  )

(use-package web-mode
  :init
  ;; TSX setup
  (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "tsx" (file-name-extension buffer-file-name))
                (setup-tide-mode))))

  ;; JSX Setup
  (add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "jsx" (file-name-extension buffer-file-name))
                (setup-tide-mode))))
  :defer 5)

If try the following in sketch it also doesn't work

(defun setup-tide-shortcuts ()
  (local-set-key [f1] 'tide-documentation-at-point))

(add-hook 'typescript-mode-hook #'setup-tide-shortcuts)

If I set the hook up using global it works

(global-set-key [f1] 'tide-documentation-at-point)

Problem here is that it is set to global so when I work on non-typescript files it asks me to start a tide server and I would like to setup F1 as the documentation key for all different languages.


texts: Export table from property drawer in org-mode

texts:
I'm learning org-mode now. I'm making a document to keep track of jobs. So each job is a top-level item, and inside it, I have a property drawer along with some other things. In the property drawer, I'm keeping things like the location, contact person and referral source.

* Some job
  :PROPERTIES:
  :Location: The Matrix
  :Source: Referral from Oracle
  [...]
  :END:
  [ ... more stuff here ... ]

I'm pretty sure that I want to keep these as properties, since I want to be able to search for entries like this:

C-c a m
Match: Source="StackOverflow"

But when I go to export this to HTML or ASCII, the properties don't end up anywhere. What I would really like is a table of key-value pairs like this:

+----------+----------------------+
| Location | The Matrix           |
+----------+----------------------+
| Source   | Referral from Oracle |
+----------+----------------------+

which would be located right after the "Some job" heading in the example above. It doesn't matter if it's actually a table; a definition list or whatever would be fine. The only thing I've really tried is

#+OPTIONS: d:t

... and that did nothing (the properties drawer doesn't count as a drawer for this option maybe?)


texts: call org-html-export-to-html from script failure

texts:
I can run org-html-export-to-html on emacs successfully. but when I try to call it in script as below:

#!/usr/bin/emacs --script
(require 'org)

(defun dired-org-to-html ()
  (let* ((org-root ".")
    (files
         (append
          (let ((default-directory org-root))
            (mapcar #'expand-file-name
                    (file-expand-wildcards "**/*.org")))
          (let ((default-directory org-root))
            (mapcar #'expand-file-name
                    (file-expand-wildcards "*.org")))
         )
         ))
    (mapc
     (lambda (f)
       (print f)
       (with-current-buffer
           (find-file-noselect f)
         (org-html-export-to-html)))
     files))
  )

(dired-org-to-html)

It always say Symbol's function definition is void: org-html-export-to-html.


texts: How can I open mutt messages in org-mode?

texts:
I'm experimenting with mutt (actually neomutt) and would like to take advantage of org-mode features while composing mail.

I have mutt configured so that I compose my messages in emacs. I'd like to open these messages in org-mode. Is this possible?

Mutt seems to open a tmp file /tmp/neomutt-whoami-xxxxxxxxxxxx. Maybe there is a way to write a hook so that files of the form /tmp/neomutt-whoami* are always opened in org-mode?


texts:
After screwing around with Magit rebasing, I ended up with a commit that includes a bunch of diff markers in a file[1]:

<<<<<<< HEAD
=======
foo

<<<<<<< variant A
>>>>>>> variant B
bar

======= end
>>>>>>> f8e1563... Stuff

Apparently this is a "nested conflict" that smerge can't resolve. Is there a way to use one of Emacs' diff tools to get rid of this, or do I just need to edit it by hand?

Fortunately, there's only a few. Nonetheless, it's unfortunate that commits are allowed to get into a "bad state" such as this.

[1]: I believe this is because I forgot to stage before continuing a rebase