texts: is there a dired-like mode that behaves like XEmacs' dired

texts:
Having mostly switched to Emacs, I still sorely miss the dired mode of XEmacs.

As far as I can tell, XEmacs' dired started from dired-x (not Emacs' dired) many years ago and then drifted away, so I guess that dired-x (that now has drifted away from the dired-x of many years ago as well) plus a number of extra packages and/or customizations may eventually lead to a partially satisfactory solution.

I hope that (a part of) all this hassle can be avoided using some ready-made fix, so my question is,

  is there a port of the Xemacs' dired, or at least a partial port, for Emacs 24.x?

Tia

PS: my question, despite the previous title that was a little misleading, does not concern customizing specific aspects of dired but is about a ready-made mode that mimics XEmacs' dired.  In this respect I don't feel like giving a detailed list of differences between the implementations, at least for now --- I may change my mind if no answers will show up...


texts: Draw a line between the header line and the text area

texts:
One of my modes uses the header line to display a progress bar/document summary, concatenating spaces with varying background colors and widths (using the display attribute). To clarify the distinction between the header line and the document, I'd like to separate them with a solid line.

How can I draw a thin solid line under the header line?

Things I tried without success:

'face (:box (:line-width -1 :color "grey")): Shows a line all around the mode line, not just under it
'face (:underline (:color "grey")): background color of header line shows below underline


texts: Elisp files in load-path are not loaded on emacs start

texts:
What failed for me?

(add-to-list 'load-path "~/.emacs.d/others")

what worked for me?

(mapc 'load (file-expand-wildcards "~/.emacs.d/others/*.el"))

Functions defined in elisp files lying @~/.emacs.d/others were not loaded in the first case.

So, is it wrong to assume that adding folder paths to load-path will load the *.el files lying underneath?


texts: Evil package/alternative for motion through CamelCase words?

texts:
Most programming languages use CamelCase
("anIdentifier") naming conventions
for identifiers. With Evil, you could navigate inside those identifiers using Evil
built-in motions is the [count]f{char} motion, i.e. f{uppercase-char} or f_,
respectively. But I would like to have this easier. I noticed there are many plugins available for Vim, which enables you to move camelCase-wise.

These packages defines motions ,w ,b and ,e (similar to w b e), which do
not move word-wise (forward/backward), but Camel-wise; i.e. to word boundaries
and uppercase letters. Outside of "words" (e.g. in non-keyword
characters like // or ;), the new motions move just like the regular motions.

For example, with the CamelCase plugin the cursor ([]) is on the following sentence:

[]AnotherExampleOfFoobar

When I type dw, it will change to the following:

[]ExampleOfFoobar.

When I googled around for an alternative package for Evil, I found no alternative package for CamelCase motion. It deletes the whole AnotherExampleOfFoobar, instead deleting Another.

So I guess there is a missing feature, that I need to implement it in some way. So have anyone any suggestion to start with it?


texts: how to highlight imported functions in python code?

texts: python-mode or elpy-mode in Emacs only highlight the basic Python library functions.  If you work a lot with other libraries like numpy and matplotlib, would be nice to have these functions and classes also highlighted. Is there a way?


texts: How to define a function that calls a console process using ansi-term?

texts:
I'm using Julia within emacs, and I've found that despite the existence of ess and julia-mode, the best way for me to do that seems to be to use ansi-term and execute:

ipython3 console --kernel=julia-0.5

This way, I get behavior identical to the IJulia console opened in a regular terminal. Compared to run-julia, I get better shell and help support and will presumably eventually include magic as IJulia matures.

To save time, I'd like to make a definition in my .emacs file so that I can write a function and bind a key that opens ansi-term and executes the command above. How would I go about doing that?

Thanks in advance.


texts: How do I turn off whitespace-mode within flycheck-mode and lsp-mode (in doom emacs)?

texts:
I've enabled whitespace-mode and I'm correctly able to see my spaces, tabs, and newlines. But the spaces also show up when I receive messages from emacs (ie when I get error messages and code action suggestions from emacs).
I've included an image of the problem below. I believe the relevant minor modes that the whitespaces' issue is occurring in are: lsp-mode (for the code actions), and flycheck-mode (for suggestions).
How can I, inside flycheck-mode and lsp-mode turn off whitespace-mode?
(and, if possible, inside any future emacs mode that'll send me messages)
The only whitespace-mode settings in my config.el are:
(global-whitespace-mode 1)
(setq whitespace-display-mappings
  '(
    (space-mark   ?\     [?·] [?.])
    (newline-mark ?\n    [?$ ?\n])
    (tab-mark     ?\t    [?\u00BB ?\t] [?\\ ?\t])
    ))
(setq whitespace-style (quote (face spaces tabs newline space-mark tab-mark newline-mark)))
(set-face-attribute 'whitespace-space nil :background nil :foreground "#2e3138")
(set-face-attribute 'whitespace-tab nil :background nil :foreground "#2e3138")
(set-face-attribute 'whitespace-newline nil :background nil :foreground "#2e3138")

ps: The code is intentionally wrong, I just wanted to demonstrate what I see


texts: fixing auto-capitalize to work with org-mode headings and lists

texts:
I want the auto-capitalize minor mode to work well with org-mode.

Currently, auto-capitalize does not capitalize the first word in headings or list items (i.e., the word after '*' or '-').  For example, the following transformations are not working:

* heading      -->   * Heading
** subheading  -->   ** Subheading
 - item        -->    - Item

Any ideas on how to fix auto-capitalize to do this?

I have tried changing the sentence-end regexp (which is used by auto-capitalize to decide what to capitalize), but it didn't work out.  I added the following without success: \\(^\\*+ \\|^ +- \\)

Many thanks!


texts: Change font size globally with a shortcut

texts:
When I need to change the font size I evaluate the following region:
  (set-frame-font "JetBrains Mono-14")

This is far from optimal since it involves a lot of typing.
I'm looking for an interactive function that would ask me for the new font size and modify the numeric value passed to set-frame-font.
As a workaround I wrote the following function:
(defun change-font-size (new-size)
  "Change the font size to the given value"
  (interactive "sNew font size: ")
  (set-frame-font (concat (face-attribute 'default :family) "-" new-size)
                  )
  )

(bind-key "C-x f" #'change-font-size)

But I wonder if there's a better way of doing this.
The best solution for me would be to change the font size of emacs based in the monitor in which it is being displayed, but I could not find any satisfactory solution. I do not want to do busy waiting on my emacs, instead I'd like emacs listening to notifications of the windows manager. However I do not know whether this is possible.
EDIT using the suggestion in one of the answers I wrote this hook to resize the window based on the display emacs is in.
(defun my/adjust-font-size-based-on-display ()
  (let ((display-width (nth 3 (assq 'geometry (frame-monitor-attributes))))
        )
    (change-font-size
     (cond ((<= display-width 1920) 18) ;; HD
           ((<= display-width 2560) 11) ;; UWHD
           ((<= display-width 4096) 14) ;; 4K
           )
     )
    )
  )

(add-hook 'window-size-change-functions (lambda (frame) (my/adjust-font-size-based-on-display)))
(add-hook 'focus-in-hook 'my/adjust-font-size-based-on-display)

Suggestions on how to improve the hook above are welcome!


texts:
I'm interested in modeling todo dependencies with the following types of structure:

A blocks B
A blocks C
B blocks D
C blocks D
D blocks E
D blocks F

Note the examples of multiple parents and multiple children - or diamonds and X's, visually. Each (A, B, etc) is a TODO heading, and A is the only TODO I'm enabled to do because the others are blocked.

This kind of graph structure isn't supported by orgmode out of the box.

So far, the only way I've found to do it is by using org-edna, which would require setting up a way to automatically assign org-ids to each TODO heading, and then automatically paste the relevant ids into each "blockee". This seems like it would be time-consuming and clunky... although a good excuse to learn some lisp.

Not having a lot of experience with emacs and orgmode yet, is there an easier way? It'd be extra cool if it could also be set to draw snippets of the graph, labeled by todo heading, with clickable nodes.


texts: How to overwrite a copied rectangle instead of inserting it (which is the default behavior of yank-rectangle)?

texts:
After copying a "rectangle" using C-x r M-w, doing C-x r y yanks or pastes the rectangle. But that inserts the copied rectangle.

How can I paste the copied rectangle so that it overwrites the text?

Example:

 a b c d e f g
 h i j k▮l m n
 o p q r s t u▮

I copied the rectangle enclosed between the cursor positions shown above using M-x copy-rectangle-as-kill or C-x r M-w.

Now when I paste it in front of the character h using M-x yank-rectangle or C-x r y, I want the result to look like

 a b c d e f g
▮l m n k l m n
 s t u r s t u

instead of

 a b c d e f g
▮l m n h i j k l m n
 s t u o p q r s t u

How can I make the yank-rectangle overwrite?


texts: Right-click to select one character under the mouse pointer?

texts:
I'm using GUI emacs 24.4.9.0, so I can click to move the cursor, and double-click to select a word under the mouse pointer as a region.

How can I configure emacs so that right-click selects a character under the mouse pointer? I know that I can assign a function by writing

(global-set-key (kbd "<mouse-3>") 'foobar)

in the init file, but when I wrote a function for this purpose a while ago, it didn't put the cursor under the place I right-clicked, it just started marking a character forward from where the mouse pointer is currently at. What kind of function I can use for placing the cursor right under the mouse pointer?


texts: Prelude: How to add smartparens key bindings to C-c prefix?

texts: I am using Emacs with Prelude. When I hit C-c prefix in a clojure buffer, I would like to show a smartparens key bindings. Like in screenshot below I would like to to add entry for smartparens key bindings, just like  C-c-, shows cider-test-command-map How can I do this ?


texts: How to see habit items along the timegrid like normal items?

texts:
I would like to know how to see habit items like normal items. Along the time-grid in their place and not at the bottom of the day. Maybe it's on the sorting algorithm ? Or there is a variable that I can customize?

Thanks!


texts:
The Qt framework has lots of camel case and pascal case keywords (e.g. textEdited or QWidget).  To avoid pressing Shift constantly, I call add-global-abbrev to add a lowercase abbrev and use abbrev-mode to automatically expand them.  I can then type in lowercase at all times.
The problem is that after an abbrev for a camel case word has been expanded once, if expanded again (as happens automatically in abbrev-mode), it switches to pascal case.
For example, if I write textEdited and no abbrev currently exists, I call C-x a g textedited to create an abbrev.  The corresponding abbrev table then looks like:
;;-*-coding: utf-8;-*-
(define-abbrev-table 'global-abbrev-table
  '(
    ("textedited" "textEdited" nil :count 0)
   ))

With abbrev-mode on, the next time I write textedited the following happens.  Lets say I forget this is a signal and not a method, so I write a left parenthesis, textedited(.  It expands to textEdited(.  That's the expansion I expect, but not the correct syntax.  So, I delete the parenthesis and put a dot.  The result is TextEdited..  The first character of the word is capitalized.
Why does deleting the left parenthesis and inserting the dot cause the t to capitalize?  Is there a way to prevent that?
I have tried setting all values of dabbrev-case-replace and case-replace, but this does not correct the behavior.  If I call write-abbrev-file, no other abbrevs are written except the global table.  I take this to mean no other tables are defined which may be causing the expansion.


texts: fresh install on raspberry pi can't download "gnu" archive

texts:
Raspberry Pi, Model 4, everything up to date with Raspberry Pi OS.
I execute the following commands:
sudo apt install emacs (verson 26.1)

mkdir .emacs.d

emacs

then
M-x package-refresh-contents
which gives the error message:
Failed to download the gnu archive
I have tried a couple of things from these links:
Failed to download 'gnu' archive
https://stackoverflow.com/questions/26108655/error-updating-emacs-packages-failed-to-download-gnu-archive
But I haven't gotten anything to succeed yet.


texts: how to rename a file in neotree without ivy select confusing?

texts:
I have this directory structure for example:

/a/a1.txt

I want rename /a/a1.txt to /a/a1, and hoping this result:

/a/a1

But when I invoke C-c C-r command at the node of /a/a1.txt and input character a1. Ivy will recommend me a1.txt.
After use enter key. neotree will give a warning a1.txt is exist, will you overwrite it? but I want use a1 as its new name.

I'm not test if not install ivy what will happen, after all, ivy as a tool used every day.

how to rename file a1.txt to a1 in neotree? Thanks a lot.


texts: Identities between let/lambda/defun expressions and simplifying nested progn

texts:
I learned that a lambda and let works as if they already include a progn in their definition. That is (let ((x 1) (y 2) (z 3)) A B C) works as if it had a progn after binding the variables: (let ((x 1) (y 2) (z 3)) (<progn> A B C)). lambda seems to have an "inherent" progn as well, such that (funcall (lambda (x y z) A B C) 1 2 3) is equivalent to (let ((x 1) (y 2) (z 3)) A B C).

My question is:
a) What are the identifies between lambda, let and progn? (i.e. how would you implement lambda and progn just using let?);
b) Is (progn (progn (A) (B) (C))) always equivalent to (progn ((A) (B) (C)))?


texts: how to change org-ellipsis foreground color?

texts:
Currently my org-ellipsis is " [+]"

(setq org-ellipsis "  [+]")

I want it to be slightly grey so that it will be less prominent but I don't want to change the foreground color of my headings.

I have gone through emacs wiki but still couldn't do it.


texts: how would I be able to get a list of files that has been worked on the longest

texts: Instead of recentf which returns a list of files that have been opened, how would I create a function that records the time (active buffer) that I've spent on a given file and returns the list (to a manager like ivy)?


texts:
When I type emacs it opens it in the terminal window.

I wish it to open in it's regular separate window (the color scheme look different in the terminal compared to the separate window).
I tried "emacs -c" and "emacsclient -c", both don't work.

How can i do that?

I am using centos 7 ( just starting to transition to linux) , there is no emacs ,so I install and the version I get is 24.3.1


texts: How to count the number of clocks of some given duration?

texts:
I want to collect statistics about some clocked events; more specifically I need to count the number of clocked events (belonging to some subtree for instance) whose duration is in some predefined range (e.g. at least 4 hours but less than 5 hours).

For instance, in the following subtree

*** Week 11 [2018-03-10 Sat] → [2018-03-16 Fri]
   :CLOCKBOOK:
    CLOCK: [2018-03-16 Fri 09:00]--[2018-03-16 Fri 13:45] =>  4:45
    CLOCK: [2018-03-15 Thu 09:00]--[2018-03-15 Thu 13:30] =>  4:30
    CLOCK: [2018-03-13 Tue 09:00]--[2018-03-13 Tue 13:45] =>  4:45
    CLOCK: [2018-03-12 Mon 09:00]--[2018-03-12 Mon 14:00] =>  5:00
    CLOCK: [2018-03-10 Sat 18:00]--[2018-03-10 Sat 21:00] =>  3:00
    :END:

The function should return 3
How could I achieve this?


texts: How can I wrap org-preview-latex-fragment to be async?

texts:
Calling org-preview-latex-fragment blocks user input for a second or two depending on the size of your fragment, and with universal args, converting all fragments in buffer can take minutes. It would be nice to have this be async, so I could continue to type while the conversion happens. I was pointed toward this package, but my elisp-fu is not up to par. What would it take to make this function work asynchronously?

(defun org-preview-latex-fragment (&optional subtree)
  "Preview the LaTeX fragment at point, or all locally or globally.
If the cursor is in a LaTeX fragment, create the image and overlay
it over the source code.  If there is no fragment at point, display
all fragments in the current text, from one headline to the next.  With
prefix SUBTREE, display all fragments in the current subtree.  With a
double prefix arg \\[universal-argument] \\[universal-argument], or when \
the cursor is before the first headline,
display all fragments in the buffer.
The images can be removed again with \\[org-ctrl-c-ctrl-c]."
  (interactive "P")
  (unless buffer-file-name
    (user-error "Can't preview LaTeX fragment in a non-file buffer"))
  (when (display-graphic-p)
    (org-remove-latex-fragment-image-overlays)
    (save-excursion
      (save-restriction
        (let (beg end at msg)
          (cond
           ((or (equal subtree '(16))
                (not (save-excursion
                       (re-search-backward org-outline-regexp-bol nil t))))
            (setq beg (point-min) end (point-max)
                  msg "Creating images for buffer...%s"))
           ((equal subtree '(4))
            (org-back-to-heading)
            (setq beg (point) end (org-end-of-subtree t)
                  msg "Creating images for subtree...%s"))
           (t
            (if (setq at (org-inside-LaTeX-fragment-p))
                (goto-char (max (point-min) (- (cdr at) 2)))
              (org-back-to-heading))
            (setq beg (point) end (progn (outline-next-heading) (point))
                  msg (if at "Creating image...%s"
                        "Creating images for entry...%s"))))
          (message msg "")
          (narrow-to-region beg end)
          (goto-char beg)
          (org-format-latex
           (concat org-latex-preview-ltxpng-directory (file-name-sans-extension
                                                       (file-name-nondirectory
                                                        buffer-file-name)))
           default-directory 'overlays msg at 'forbuffer
           org-latex-create-formula-image-program)
          (message msg "done.  Use `C-c C-c' to remove images."))))))


texts: How would you customize a subsection of keywords in a major mode in Emacs?

texts:
Is it possible to customize some, not all, of keywords in a major mode?
(Pardon my vocabulary, since this is still new to me.)

For example, let's say these are keywords: function, new, throw, return.
And I want to override the look of throw and new, but leave function and return alone.


texts: Convert a MS Windows path to short filename / 8.3 filename / SFN

texts:
How can I programmatically convert a Windows OS path containing spaces to one without spaces that uses the tilde format?

BEFORE:   c:/Documents and Settings/Administrator/Desktop

AFTER:   "c:/docume~1/admini~1/desktop"


texts: How to add new themes to Spacemacs permanently?

texts:
The accepted answer here and other online resources suggest editing dotspacemacs-themes

dotspacemacs-themes '(solarized-light
                      solarized-dark)

I want to add two themes.

dotspacemacs-themes '(gruvbox
                      sanityinc-tomorrow-eighties)

On restart Spacemacs installs whichever theme is present on top. But after installation, if I change the order of themes, the new theme gets installed and previous theme for example "sanityinc-tomorrow-eighties" is lost.

I want to add themes such that when I do SpcTs (helm-themes) the theme appears in the list. Currently, only the top theme with other default themes appear in the list.

Edit:

I found Themes Megapack layer in official repository, which I think is relevant to my issue. But I don't understand how to use it. I suggests

  To use this configuration layer, add it to your ~/.spacemacs.

Where inside ~/.spacemacs?


texts: vc-git doesn't recognize that file is under version control

texts:
I initialized a Git repository outside emacs, added and committed the files.

Now if I a file in emacs that is under version control by Git and run C-x v = emacs tells me This file is not under version control.

It seems emacs missed that I added this file to Git already. How can I tell emacs that this file (and the whole directory) is already in Git, so that I can use the vc-git-* commands?


texts:
It is easy to present list of allowed characters as string, like " \n\t".

(char-before) return integer.

How can I check that a character is in a string?

There is What is the easiest way to check if a character belongs to a particular set of characters? where (memq ch (list ?a ?b)) is suggested.

I think that string is constant and don't need to be evaluated in comparison to (list ?a ?b).

I wrote (seq-some (lambda (el) (eq el 32)) "a b") but it also is too high level.

It is possible to convert a character to string: (string-match "[a b]" (char-to-string 32)).

If string is a sequence there is probably a function that detects element in a sequence... (member 32 "a b") doesn't work...


texts: `+` in dired-mode with icicles and ido enabled raises an error

texts:
I just installed icicles.

I use ido-mode for the minibuffer.

In a dired buffer, when I press + (bound to dired-create-directory), here is what happens:

the first time, the error icicle-restore-other-keymap-keys: Key sequence M-s M-s starts with non-prefix key M-s comes up
the second time and onward, the minibufferproperly comes up, but there's a twist. It says Create directory: [current dir] the first time as expected, then Create directory: [current dir][current dir] the next, etc. etc.

And after that, even other minibuffer interactions like define-variable would have [current dir][current dir]... in them.

My icicle configuration:

(use-package icicles
  :config (icy-mode 1))

My dired config:

(require 'dired-x)

(add-hook 'dired-mode-hook 'dired-hide-details-mode)

(setq global-auto-revert-non-file-buffers t)
(setq auto-revert-verbose nil)

(setq dired-dwim-target t)

(setq ls-lisp-use-insert-directory-program nil)
(require 'ls-lisp)

  (require 'dired)
  (defun dired-back-to-top ()
    (interactive)
    (beginning-of-buffer)
    (next-line 2))

  (define-key dired-mode-map
    (vector 'remap 'beginning-of-buffer) 'dired-back-to-top)

  (defun dired-jump-to-bottom ()
    (interactive)
    (end-of-buffer)
    (next-line -1))

  (define-key dired-mode-map
    (vector 'remap 'end-of-buffer) 'dired-jump-to-bottom)

I don't know enough about how icicles to know what's going on. I need some help.


texts:
This is what happened when I set my default font to a new font I bought called Cartograph. Looks cool, but I'm not sure I could get used to it. Anyone know what might have happened? It's an otf font. Looks normal in LibreWrite and gedit, BTW. Here's the init entry
'(default
    ((t (:inherit nil
         :stipple nil
         :inverse-video nil
         :box nil
         :strike-through nil
         :overline nil
         :underline nil
         :slant normal
         :weight normal
         :height 143
         :width normal
         :foundry "UKWN"
         :family "Cartograph CF"))))


texts:
I recently discovered that my org-roam installation is no longer working.  When I try to open a new file, I get this error message:
helm-M-x-execute-command: Cannot open load file: No such file or directory, org-eldoc

I'm not sure how my org-eldoc got corrupted, but what would be the easiest way to repair it?


texts: Python: check import module for local functions

texts:
For example I have a log() function under lib.py file: usage (from lib import log).

Afterwards I move log() function into utils.py file. So usage should be: (from utils import log).

But elpy or flycheck does not give any error for the wrong path imports. Since there are many files that using log I need to update manully the imports one by one.

=> Is there any way that emacs can able detect wrong imports for my local functions? or is there any tool to check import path under emacs?

I have followed this answer, which did not give any error for imports

I am using elpy and flycheck.

(package-initialize)
(require 'flycheck)
(require 'flycheck-mypy)

(add-hook 'python-mode-hook 'flycheck-mode) ;(add-hook 'after-init-hook #'global-flycheck-mode)
;;-----
(use-package elpy
  :ensure t
  :config
  (elpy-enable))

(setq elpy-rpc-backend "jedi")

(add-hook 'python-mode-hook
          (lambda ()
            (setq flycheck-python-pylint-executable "~/venv/bin/pylint")
            (setq flycheck-pylintrc "~/.pylintrc")))


texts: Evil-mode: delete until end of parens/quotes/brackets/etc

texts:
Given the following (cursor at |), how can I delete the text , int b?

foo(int a|, int b);

I was hoping to find a motion similar to how "inner" works (eg d i b), but which only captures the right-hand side from the current position.

d f ) also captures the found character, and I wanted to use this with all the usual motions.

Update: d t ) does what I want in this case, but only works on the current line, so I would still like to know if there is a general motion to go the end of what can be done with the inside motion.


texts:
Upon reading Search View

It state that

You can incrementally adjust a boolean search with the following keys

[   Add a positive search word
]   Add a negative search word
{   Add a positive regular expression
}   Add a negative regular expression

Try regex match algorithms

it return many non-matched results/

What's the problem?


texts: Is there a way to customize 'vc-update'?

texts: Currently, running vc-update in my Emacs runs git pull. Is there a way to customize it so that it runs something different like git pull --prune? Is it even advisable to do that?


texts: Extract value from org-babel-get-src-block-info

texts:
I have this elisp code:

#+BEGIN_SRC emacs-lisp :dir ~/org/test

(defun test ()
  (setq args '(org-babel-get-src-block-info))
  (cdr (assoc ':dir args)))
(test)

#+END_SRC

But when I execute the code block, I get a message saying that no output was produced... what am I doing wrong?


texts: Navigating to a `defconst` variable defined by a Lisp macro

texts:
My goal is to define a const variable within a non-trivial macro that can be navigated to after calling describe-variable.

The design goal of my macro works just fine if I define it like so:
(defmacro test (symbol)
  `(defconst ,symbol nil))
(test sym)

After my init file loads I can navigate to the exact location in the file in which it was defined.

But the design goal of my macro does not work if I define it like so:
(defmacro test (symbol)
  `(defconst ,(intern (concat "jd:" (symbol-name symbol))) nil))
(test sym)

The const variable is defined, but I can't navigate to the exact location in the file in which it was defined (I only get so far as the file); instead I'm met with the message:
Unable to find location in file.

How can I achieve the design goal of my macro in the non-trivial case?


texts: How to determine operating system bits (32 vs 64-bit) in elisp

texts:
I've tried searching around but have come up with nothing: How can I determine the bits (32-bit or 64-bit) of my operating system with elisp?

On my 64-bit Linux machine, system-configuration evaluates to "x86_64-unknown-linux-gnu". I don't have a Windows 32-bit machine available, but could I potentially do

(defconst 32-bit (not (null (string-match "^i386-.*" system-configuration))))
(defconst 64-bit (not (null (string-match "^x86_64-.*" system-configuration))))

to detect the bits?

Edit: "Why would you want to know that?" I wanted to write an Elisp script that would download and run the appropriate version of an executable (32 or 64-bit) for the user's OS.


texts:
After reading this article about readable closures, I check that:

  Since closures are byte-code function objects, they print readably.
  You can capture an environment in a closure, serialize it, read it
  back in, and evaluate it. That’s pretty cool! This means closures can
  be transmitted to other Emacs instances in a multi-processing setup
  (i.e. Elnode, Async)

So since we can do that, we can also write closures?
Should this be a real possibility and will have a real use?

Writing a normal closure

ELISP> (setq counter (let ((x 0)) (lambda () (cl-incf x))))
(closure
 ((x . 0)
  t)
 nil
 (cl-incf x))

ELISP> (funcall counter)
1 (#o1, #x1, ?\C-a)
ELISP> counter
(closure
 ((x . 1)
  t)
 nil
 (cl-incf x))

Writing a literal closure:

ELISP> (setq even-counter '(closure ((x . 0) t) nil (cl-incf x 2)))
(closure
 ((x . 0)
  t)
 nil
 (cl-incf x 2))

ELISP> (funcall even-counter)
2 (#o2, #x2, ?\C-b)
ELISP> even-counter)
*** IELM error ***  More than one sexp in input
ELISP> even-counter
(closure
 ((x . 2)
  t)
 nil
 (cl-incf x 2))

So they both work, and are the same type, since they don't will have non-readable types (i.e buffer) inside they will work equally. further more they are the same type:

ELISP> (type-of even-counter)
cons
ELISP> (type-of counter)
cons

But I couldn't find any constructor for building a closure.
So I suppose that his is one of the cases of homoiconicity of lisp.
To Sum up:

Will be useful to write/build literal closures?
Should it be a good practice? any example?
Why the closure is not a real type instead of cons?


texts: Org-drill How can you retest yourself on completed / rescheduled drills?

texts:
As an example say, I run M-x org-drill on the spanish.org and mark all of them as 5 for how well I did. All of the drills are rescheduled for 5 days. If I try to run org-drill again I get

I did not find any pending drill items.

and none of the tests will run again. I get that message running org-drill-cram as well. How would I run all the tests regardless of how well I did.

Related question but regarding the philosophy for org-drill, am I suppose to remind myself to check back to the org file on the scheduled date? Or will org-drill prompt me to retest on the scheduled date. (Looking to get some input on other people's workflows with org-drill if possible)


texts:
Emacs is aweseome but sometimes it feels it's too smart for its own good. You may feel you learned everything there's to know about a function and then someone tells you to try a prefix argument and suddenly it does something you never knew about.

For example - you can jump to Magit without opening a project, by calling magit-status with 2 prefix arguments (it will prompt you with a "choose directory" dialog) - I just learned that

So my question is: Is it possible to build a list of functions that take prefix arguments and for each row grab the description (maybe from describe-function) that explains what calling the function with a prefix would do?


texts: Hide DONE todos of subtrees by setting a special keyword or tag - to support focus

texts:
I would like to be able to set a keyword or tag for a subtree, which hides all todos in DONE states.
The Video of John Cleese about creativity states inspired me. He says that we enter a "closed mode" for getting work done, like going through a tunnel and at the end switch back in "open mode" for creative/planning tasks.
I would like such a "tunnel"-keyword or tag to help me focus on getting all tasks of a subtree done by hiding the DONE tasks (on the fly) as long as the keyword or tag persists. Maybe something similar to the COMMENT keyword before the heading.
I fear that archiving destroys the tree structure (e. g. for clock reports or later review). I would like to archive the whole project tree after a project is finished. Sparse trees don't update on the fly and I can not close and expand the parent heading without showing all the children again.
Example:

open mode / normal
* Heading 1
** TODO One Thing
** DONE Other Thing
* Heading 2
** DONE Another Thing

variant closed mode - with keyword like COMMENT
* TUNNEL Heading 1
** TODO One Thing
* Heading 2
** DONE Another Thing

variant closed mode - with tag
* Heading 1 :tunnel:
** TODO One Thing
* Heading 2
** DONE Another Thing

I am new to Emacs.


texts:
I would like to know if Emacs treats empty portions of the frame as faces. I want to know because I wonder if the background of an Emacs frame is drawn separately of other elements on the screen.

EDIT: I have done some experiments and found that on X11, Emacs uses the function "x_clear_area" to fill in the background color of empty potions of the frame. Background for spaces and non-visible characters is handled by the draw method of the "font_driver" struct (xfont_draw/xftfont_draw).

EDIT2: Now I am very confused, there seem to be multiple places where the background is being drawn. Does anybody know where are all the places this happens on X11 build ?


texts: Get process id for the Emacs own process

texts:
I'm supporting some elisp code that creates a temporary filename using a prefix and the user id. When I develop this, that is not enough since I will be running multiple instances concurrently.

So I'm looking for either a function to create a temporary filename which I can control to some extent, or some other component to add to the name.

I thought the second option should be straightforward so I looked at process-id, but that requires a process. (elisp manual: Process Information)

So I looked at get-process but that requires a name, which would also be ambiguous.

How do I get the process id for the running Emacs process?

EDIT: I solved my problem using make-temp-name (yeah, I know I should not use it, but I don't want to change the handling of temporary files at this point).

But for my edification, is there a way to get the process id for the Emacs process?


texts:
I'm trying to install elm-mode using MELPA. When I try to install it I get an error message:

https://melpa.org/packages/dash-20150829.433.el: Not found

I can install other things, bu not this.


texts: how to add a default-on option of magit log

texts:
Since the 'log --graph' is slow in the repo with long history, I wanna
add '--since' option for it.
I tried to add the following lines in my '.spacemacs' file.

(magit-define-popup-option 'magit-log-popup
                            ?x
                            "Since date"
                            "--since="
                            nil
                            (org-read-date nil nil "-1y")
                            )

but it doesn't work. so I wonder how to make it.


texts:
I am newbie here, need some help.

After upgrade magit to v2.1.0 this morning, i found some short keys are different from the early version. What bothers me is this:

when I use some short key(for example 'b'), it shows the option windows, in early version, i just type another short key in the option window to do the action (like checkout branch). But now in v2.1.0 i find i can't do it anymore. As I use evil-mode for vim operation, the option windows is in evil-mode, and i only can use magit short key after i enter the insert mode of evil-mode.

Can anyone tells me how to disable evil-mode in the whole magit?


texts:
When in press letter "b" within a elfeed search window,
the in-effect elfeed filter should change from
whatever it has (default -  @6-months-ago +unread)
to "foo"

How can I do it?

what I tried

(setq elfeed-search-filter "foo")


texts:
I have 2 files

/home/user/myproject/myfile.el
/ssh:user@myserver.org:/home/user/myproject/myfile.el

Content of both of them are same.  I want to make same change in both of them.  I can do it like:

1. Edit file in local machine.
2. Push the file to server.

Instead, I'd like to connect both files to same buffer.


texts:
I have a very large MAILv5 folder on macOS with 11 IMAP mail accounts over 1 TB of data so I don't want to re-download all but instead I want to use Gnus or other Emacs mail client to read mail without losing apple-ecosystem advantages like inserting mails in to reminder or finding them via Siri etc.. I want to have 2 different email clients to use same database on my hdd. How can I do this?

Note: AFAIK macOS mail.app uses mbox files


texts:
I have installed auto-complete in the /Users/angeldelcastillo/.emacs.d/auto-complete directory following the instruction on the website, using install.el. The process finishes all right, but when I open Emacs I get this:

  Warning (initialization): An error occurred while loading       >`/Users/angeldelcastillo/.emacs':

  File error: Cannot open load file, no such file or directory, popup

  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.

I have modified ~/.emacs as follows:

    ;; autocomplete-mode
    (add-to-list 'load-path "~/.emacs.d/auto-complete")
    (require 'auto-complete-config.el)
    (ac-config-default)

I'm using Emacs 24.4 on OSX. I have this installed on a Ubuntu machine and there it works. So the trouble is with the popup directory, which I don't know where to find. What am I doing wrong?


texts: Creating ctag DB gives "permission denied" error on git-bash (MS Windows)

texts:
I am a Linux user (world was pretty neat; less to no headache)-- I've been using vim with cscope to wade through huge code-base....... And for some reason, now I have to use windows machine, here are the things I do have on my PC

git-bash; downloaded Emacs (I start to love it); and within the Emacs package has ctags.exe.

So, I am trying to create the tag file from git-bash

~/Downloads/emacs-26.3-x86_64/bin/ctags.exe -R *

The tag file gets created, but it skips the source code present in the directories, after running the above command I get

bin: Permission denied
contrib: Permission denied
crypto: Permission denied
doc: Permission denied
etc: Permission denied
games: Permission denied
gnu: Permission denied
include: Permission denied
initrd: Permission denied
lib: Permission denied
libexec: Permission denied
nrelease: Permission denied
sbin: Permission denied

Really not sure what I am doing wrong here-- even ran git-bash as an administrator, tried creating tag file from cmd by running it as an admin, yet no luck-- same issue.

What can I do to fix this?


texts: emacsclient of 24.4 does not work on Yosemite

texts: I have used emacsclient without any problem on OSX. Usually I just start Emacs server by emacs --daemon in Console, and then emacsclient works. I use emacsclient -nc to create a new frame. However, after upgrading to Emacs 24.4, emacsclient just hangs on without printing any info when invoking the command. I tried both http://emacsformacosx.com/ and brew install, and I had the same problem. Can anyone help to look at this issue? Thanks.


texts: Make parts of a working buffer read-only

texts:
Is it possible to make only parts of a buffer read-only?

Say I have set two marks or line-numbers in the buffer and I would like to make everything between those two marks or line-numbers as read-only.

The function (read-only-mode) applies to the entire buffer but not to
parts of it.

Also, if possible, I would like the read-only parts of a buffer marked
with a different background color say light beige.


texts:
(defmacro condition-case-unless-debug (var bodyform &rest handlers)
  (let ((bodysym (make-symbol "body")))
    `(let ((,bodysym (lambda () ,bodyform)))
       (if debug-on-error
           (funcall ,bodysym)
         (condition-case ,var
             (funcall ,bodysym)
           ,@handlers)))))

I am trying to deep-dive into this macro definition and I have many questions:

This macro uses nested let blocks instead of a single let block? And doesnt the inner let block's bodysym variable always override the outer bodysym variable?
How is condition-case-unless-debug different from condition-case? Sorry folks, the elisp doc is not clear enough.
@handlers ---> what does @ symbol before a variable name stand for?


texts:
M-X compile and next-error are mostly simple and excellent tools.
But when you run long-running jobs, or as in my case a continuous file watcher/executor, the *compilation* buffer might not be visible when I get around to pressing next-error.
It seems that the *compilation* buffer is not always revealed/shown on next-error. The cursor gets positioned on the source of the error, but the error message that it detected is not shown. Switching to the *compilation* buffer I can see that the point in it is in the right spot.
Am I seeing a mis-feature, or is this intended behaviour?
If it's by design, is it possible to either ensure that the *compilation* buffer is unburied on next-error or augment next-error to show the message in the echo area?
If so, how? Example code would be excellent.
I'm running Emacs 27.1.


texts: I like using pdf-tools to annotate a pdf file. Is there a way of hand-drawing an arrow (by dragging the mouse) in pdf-tools? It would help a lot in annotating pdf files. Even a template arrow (instead of hand drawn) would be good. As a possible solution I noticed that forward search from latex to pdf-tools does put a temporary arrow in the pdf file. Maybe a similar mechanism can be used to add an annotation arrow?


texts: How can I see the changes made to a modified buffer since the last save?

texts: Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?


texts: How is #+BEGIN_SRC sh :results drawer different to #+BEGIN_SRC sh

texts:
While reading http://www.howardism.org/Technical/Emacs/literate-devops.html
I saw the author recommending

#+BEGIN_SRC sh :results drawer

for "time-consuming and verbose" commands. (I do a lot of time consuming and verbose commands.)

I don't understand how it's better than

#+BEGIN_SRC sh

I can expand/collopase the result either way.


texts: Is it possible to not close error tooltip?

texts: An error tooltip is automatically closed after like 5 seconds. Could you prevent this? So it would be closed only when you move cursor? I changed tooltip-hide-delay but it did't help.


texts:
By default, it looks like hexl-mode shows 16-bytes per row as the column numbers range from 0x0 - 0xf.

Is there a way to adjust how many byte are displayed per row?  E.g. 8-byes per row.


texts: desktop-save-mode: prevent emacs from showing each buffer on start-up

texts: If you use desktop-save-mode, and have several hundred buffers saved, when you start emacs, emacs cycles through these buffers and shows each of them for a split second. Can this be prevented?


texts: Unable to install Eclim for Eclipse in emacs

texts:
$ sudo apt install eclipse eclipse-jdt

Then, tried to install eclim using use-package in Emacs:

(use-package eclim
  :ensure t
  :config
   (require 'eclim)
   (setq eclimd-autostart t)
   (defun my-java-mode-hook ()
   (eclim-mode t))
   (add-hook 'java-mode-hook 'my-java-mode-hook))

It seems, it did not install it. Then, I used terminal:

downloaded:

eclim_2.8.0.bin

debian# cd Downloads

debian# ./eclim_2.8.0.bin

Welcome to the installer for eclim 2.8.0.
Please specify the root directory of your eclipse install.
  Ex: /opt/eclipse
      /usr/local/eclipse

> /home/tom/.eclipse/

The eclipse launcher/executable could not be found in that directory

eclipse is installed in ~/.eclipse

Also, how to configure executable directory path, using use-package in Emacs?


texts: Disabling automatic add after resolving git conflict

texts:
After updating emacs (to 25.2.2 as shipping in ubuntu 18.04) I notice a change that completely breaks my conflict resolution flow in git. Once I resolve a conflict using emacs and save the file, emacs automatically does "git add" on the file. This may seem convenient but it removes the chance to see the resulting "3-way conflict diff" (I have no idea what this is really called in git speak).

Is there a way to disable this auto-add of the resolved file? I have tried disabling smerge-mode in the buffer before saving but that does not seem to help. I can't even figure out which mode is doing the actual auto-add either.

On further investigation the problematic behaviour seems to be caused by the vc-git-resolve-when-done hook. So the question seems to be how to disable this after-save-hook.


texts:
Is it possible to use the jobs table (C-z bg jobs fg) in multi-term (or another emacs terminal emulator)?

At present when I press C-z all of emacs is backgrounded to the system jobs table


texts: Is there any Emacs built-in to list the keys of an associton list?

texts:
I could not find any function to list the keys of an associton list in Emacs documentation. So I wrote a simple one.

(defun my/keys (alist)
    "Return the keys of the given ALIST."
    (let ((value nil)
                (result-list ()))
    (dolist (value alist result-list)
        (setq result-list (cons (car value) result-list)))))

For which the following test evaluates true:

(ert-deftest keys-test ()
    (should (equal (my/keys '((key1 . "foo")
                              ("key2" . "bar")
                              (1 . "bazz")))
                             ;; result:
                             '(1 "key2" key1))))

I do not like reinventing the well are there any Emacs built-in function analogues with mine?


texts:
When Emacs saves a file (save-buffer, write-file etc.), does it overwrite files directly or does it create a temporary file first?

More specifically, if I edit /path-to/file.txt, will Emacs directly open that file and overwrite the contents in-place, or will it write to a temporary file and replace the original file by it after successfully closing the file handle?

The latter convention is seen in a lot of other software. If Emacs has this behavior, or can be configured to use it, for my purposes it would be safe to disable backup files (M-x customize-variable make-backup-files).


texts: Searching with DuckDuckGo Lite in emacs-w3m - broken

texts:
It used to work in DuckDuckGo with the following code in my dot-emacs:
(require 'w3m-search)
(setq w3m-search-default-engine "DuckDuck Go")
(add-to-list 'w3m-search-engine-alist
    '("DuckDuck Go" "https://duckduckgo.com/?q=%s"))

(global-set-key (kbd "M-g M-w") 'w3m-search)

(defadvice w3m-search (after change-default activate)
      (let ((engine (nth 1 minibuffer-history)))
  (when (assoc engine w3m-search-engine-alist)
    (setq w3m-search-default-engine engine))))

But recently DuckDuckGo redirect the search to https://lite.duckduckgo.com/lite/ and the GET method does not work anymore:
The (correct) search result page of https://lite.duckduckgo.com/lite/ contains no search string and its form use the POST method instead.
With a search string attached at the end of the URL, e.g. searching for 'emacsclient' with my code posted above (https://lite.duckduckgo.com/lite/?q=emacsclient) links of the search results become malformed, e.g. link to emacswiki's Emacsclient page will become
https://lite.duckduckgo.com/l/?kh=-1&uddg=https%3A%2F%2Fwww.emacswiki.org%2Femacs%2FEmacsClient instead of https://www.emacswiki.org/emacs/EmacsClient
Is it a bug in w3m-search or is there something w3m-search can do to make it work again?


texts: How do I search/replace with case sensitive search?

texts:
In emacs I'm using M-% to replace occurrences of b_abcd (of which there are only a few) with B_abcd (of which there are very many). Currently Emacs asks if it's OK to replace at each B_abcd, which takes a lot of time to wade through all B_abcds it finds.
How can I make Emacs ask only about replacing b_abcd occurrences?


texts: Python-mode: maintain indentation before closing brace?

texts:
Python's style guide (PEP 8: Indentation) suggests two alternatives for indenting the close paren for a multi-line function call.

some_function(
    first_long_argument,
    second_long_argument,
    )

or

some_function(
    first_long_argument,
    second_long_argument,
)

I'm getting the second style (with Emacs 24.5.1) with M-x indent-region but would like to know how to customize my .emacs configuration to get the first. I would like the first indentation to also result from tabbing the line with ')', as right now it remains unindented.


texts:
Emacs does not start in a new frame.

If I'm in a terminal running Bash and enter $>emacs the editor is opened inside this terminal, and produces exactly the same behavior as $>emacs -nw. I have what I think is an OK DISPLAY variable, :0.  If I try to start it using gmrun outside of a terminal, nothing happens.

I'm using Xmonad as a window manager.  I noticed something weird:  if I invoke $> gmrun from the command line in a window, I get the small window to type in the command. Entering emacs and hitting enter causes emacs to open inside the terminal in which the gmrun command was executed.

What configuration items would force emacs to start without creating a new frame?


texts:
The find-file command automatically selects and uses a preexisting buffer that is visiting the same file.

My problem is, when using the same buffer in multiple frames, the frames will lag significantly (slow response, delayed input, etc.). This problem also occurs when using indirect buffers.

Is there a way to tell Emacs to open a file in a new buffer instead of reusing a preexisting buffer?


texts: How to add a kill-buffer item at the beginning of the Buffers menu-bar menu?

texts:
When I want to kill a buffer and I have my hands on the keyboard it's simply
C-x k RET but if I have already the right hand on the mouse the k RET part is a bit out of reach for my left hand…
Fortunately in the toolbar there is a "kill this buffer" button but unfortunately I turned off the toolbar…
How can I add a "kill this buffer" entry to the "Buffers" menu?

Update²
I have implemented the solution proposed in comment but now I see two problems

easy-menu-add-item postpend to the "Buffer" menu, it's ergonomically speaking more logical to have kill-buffer at the top, but I can change the position only if I know the string that identifies the menu entry where I want to place kill-buffer and the buffer menu is inherently dynamic, so that I don't know how to resolve this issue.
kill-buffer still needs keyboard interaction, in the form of a confirmation RET in the minibuffer.I remembered that the toolbar "kill buffer" button did not ask for confirmation, so I activated the toolbar, C-h k click toolbar and now in my .emacs I have kill-this-buffer, issue resolved.

New question: how can I fix those two issues the position of the new menu entry?

Footnote
Researching this topic I've found this answer and this repo but I'd rather prefer just a few lines in my ~/.emacs if possible.


texts: cygwin emacs w32 does not ask to save edited files when shutting down windows

texts: I am running cyginw's native w32 emacs program on Windows 7.  If I edit a file in emacs, and don't save changes, when I shut down Windows, the emacs session is killed without asking to save edited files.  Is there a fix for this?  I realize I can manually quit emacs before shutting down, but it would be better to not have to think about this.


texts: How to "svn revert " with Emacs Version Control?

texts:
How can I do a svn revert <file> from Emacs Version Control?
I've read many parts of the manual, but can't find it.

I would like to do it over a file after opening it with vc-directory C-x v d, but any other way would be helpful.


texts:
I can't figure out how to have every character have the same fixed width in Latex. In this example:

I would like the characters

  {i \in \math

to have the same width as the others.


texts:
I'm having problem with GPG on emacs. It keeps saying

Failed to verify signature archive-contents.sig:
No public key for [some_weird_code_here] created at [date_here] using RSA Command output:
gpg: WARNING: unsafe permissions on homedir `c:/Users/[user]/AppData/Roaming/.emacs.d/elpa/gnupg'
gpg: Signature made [date_here] using RSA key ID [some_code]
gpg: Can't check signature: public key not found

How can I solve this gpg problem in GNU Emacs on my Windows 10 PC (64-bit)?

I googled the issue but still don't know how to solve it. Read some websites, installed Gpg4win software, etc. Thanks beforehand. I don't know what the gpg is, but that's another issue. I just want to solve this problem and go on with my own issues.


texts: How to raise an error when unrecogized keyword arguments are passed to a function?

texts:
With a function that uses keyword arguments using this style of function definition:

(defun some-name (&rest kwargs)
  (plist-get kwargs 'example))

Is there a convenient way to ensure only supported keyword-arguments as passed in?

So a typo in a keyword argument doesn't pass by unnoticed.


texts: How to customize face when use 'org-edit-latex-environment?

texts: When use org-edit-latex-environment(which opens another buffer so latex source code can be edited in more sophiscated environment, e.g. LaTeX) in org-mode, the source block will be highlight as yellow (just as figure below), which is kind of distracting. So, how can I customize this, for  example, how to change the color?


texts: Record command into bash source block using asciinema and org-babel

texts:
As you perhaps know, asciinema rec (asciinema rec path/to/file) and generate an asciicast file which contain all commands recorded on terminal.

I think using asciinema to replay this file (asciinema play /path/to/file.cast) in exported html was an interesting way for user to replay command with realist color, prompt shell, output log, etc.

Into a bash source block, i try to run the asciicema rec command, but nothing happen.

#+NAME: bashwithasciinema
#+BEGIN_SRC bash
asciicema rec myfile
mkdir "foo"
cd foo/
mkdir "bar
cd bar/
exit
#+END_SRC

Any idea of the problem ? Is it linked to shell management ?


texts:
I recently started using emacs to code in Python. I currently prefer to use python mode (defined in python.el) alongside ansi-term for the python interactive shell. I'm trying to change the behavior of C-c C-c in python mode so it sends the buffer into ansi-term to be executed. That is, I'd like it to act as if I wrote 'execfile([current .py file i'm working on])' in the ansi-term.

Is there a way to do this? If not specifically through C-c C-c, with some other shortcut/method?


texts: emacs debugging -interpreter-exec being displayed when should see string returned from function

texts:
This is a problem I am seeing running emacs v26.1 on Windows 7, but the problem does not appear to be present when running on ubuntu.
Code below:
#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::cin;
using std::string;

string getName() {
  string name;
  cin >> name;
  return name;
}

void PromptForName() {
  cout << "What is your name? ";
}

int main() {
  PromptForName();
  cout << "Hello " << getName() << ", nice to meet you!\n";
}

Debugging code like this:
g++ -g hello.cpp -o hello.exe

to debug in emacs:
m-x gdb
m-x gdb-many-windows

(gdb) run
What is your name? Starting program: d:\projects\chunks\programming\saying-hello\c++\hello.exe
[New Thread 16540.0x10b0]
Angus
Hello -interpreter-exec, nice to meet you!
[Inferior 1 (process 16540) exited normally]

Why do I get :
Hello -interpreter-exec, nice to meet you!

And not
Hello Angus, nice to meet you!

which is what I would expect.  It works fine if I run on ubuntu v16.04.6 LTS and emacs v24.5.1, gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12).
Version info on non working Windows 7:
windows 7 Professional 64 bit, Service Pack 1.
GNU Emacs 26.1 (build 1, i686-w64-mingw32)

g++ -v
gcc version 6.1.0 (GCC)

$ g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/6.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../src/configure --with-gmp=/c/temp/gcc/gmp --with-mpfr=/c/temp/gcc/mpfr --with-mpc=/c/temp/gcc/mpc --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib --prefix=/c/temp/gcc/dest --with-sysroot=/c/temp/gcc/dest --disable-libstdcxx-pch --disable-nls --disable-shared --disable-win32-registry --enable-checking=release --with-tune=haswell
Thread model: win32
gcc version 6.1.0 (GCC)

Is this likely to be a gdb or emacs problem?
session example, show args below.
Current directory is d:/projects/chunks/programming/saying-hello/c++/
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello.exe...done.
(gdb) show args
Argument list to give program being debugged when it is started is "".
Breakpoint 1 at 0x401639: file hello.cpp, line 21.
(gdb) run
Starting program: d:\projects\chunks\programming\saying-hello\c++\hello.exe
[New Thread 10464.0x2988]
warning: Can not parse XML library list; XML support was disabled at compile time

Breakpoint 1, main () at hello.cpp:21
21    cout << "Hello " << getName() << ", nice to meet you!\n";
(gdb) show args
Argument list to give program being debugged when it is started is "".
(gdb) c
What is your name? Continuing.
Angus
Hello -interpreter-exec, nice to meet you!
[Inferior 1 (process 10464) exited normally]
(gdb) n
The program is not being run.
(gdb)


texts: Replace org-open-link-from-string failure format

texts:
I'm not even sure I'm asking the right question, but here goes: I followed this guide which introduces a function to search an org-mode file for a reftex/bibtex key and jump to that position in the file. The function is as follows:

(defun org-mode-reftex-search ()
  ;;jump to the notes for the paper pointed to at from reftex search
  (interactive)
  (org-open-link-from-string (format "[[notes:%s]]" (first (reftex-citation t)))))

When I use the function and search reftex for a file that is in the buffer, everything works beautifully. When I search for a file that is not in the buffer, however, I get asked No match - create this as a new heading? (y or n). If I say y, a new top level entry is put into the buffer with the format:

* #BibtexKey

The problem is that I've taken the time to set up a better format for new entries in my org-mode notes file. What I would like is to use that format when the entry doesn't already exist. The format I'm using, again from that tutorial, is:

** %t
  :PROPERTIES:
  :Custom_ID: %l
  :END:

Where %t is the title of the paper and %l is the Bibtex key. How do I replace the default format of a reftex search?


texts: Can I get the auto complete window when ssh'd into a server running emacs?

texts:
If I have a virtual machine, and I ssh into that machine, then start emacs: (so at this point I am  looking at my terminal emulator, which is showing the command line version of emacs on the other machine)

is it possible to get the things which need some visual-ness (such as the autocomplete popup menu or multiple cursors etc.)?

Thanks.


texts: font-family-list function still returning nil

texts:
I have a hard time with fonts. I downloaded the package intlfonts-1.2.1 from the FSF website, and after some configure, make and install I get the following directory where all fonts are installed : /usr/local/share/emacs/fonts/bdf.
So I added to my init.el the following line:

(add-to-list 'bdf-directory-list "/usr/local/share/emacs/fonts/bdf")

I evaluated in a scratch buffer the function font-family-list but it returns nil.
What should I do then? I played around a bit with set-frame-font but as long as font-family-list is empty I suppose this is nonsense.
Thanks for your advice, the documentation I read so far did not help that much.

I'm using emacs 24.5 under Mac OSX.


texts: Schedule to "now" (current time) in date/time prompt (calendar)

texts:
I would like to be able to insert the current time with a shortcut when I schedule a task.

There is the "." for jumping to the current day (today), but I have not been able to figure out a shortcut to put the current time (now) in the org-schedule input line. I tried putting in "now", but it does not take effect.

The shortcut is useful if I have some Tasks scheduled without time for the day and would like to set them on the agenda time grid. Also when I get a unplanned tasks that I have to do right away this would be useful.

I know there is the C-u C-u C-c . command to insert a current timestamp, but it does not work in the date/time prompt.

Any idea is appreciated.


texts: How can I troubleshoot a very slow Emacs?

texts:
I am writing a document and I have a problem with Emacs' performance that I think appeared just yesterday. I haven't made any alterations in my init file or installed any new packages.

The problem is that while I am writing, there's a very noticeable lag between pressing the letters on the keyboard and having them show up on the screen. Sometimes I watch them still printing on the screen after I have finished typing the word.

I don't know if there are other issues except the speed of typing (I can only guess that there are) but I haven't noticed them.

What can cause this problem?
Is it caused by Emacs or it is due to my pc's performance? Generally what are the variables that affect Emacs' performance?

My Emacs' version is GNU Emacs 24.3.1

The major active mode is:

LaTeX

and the minor active modes are:

Auto-Complete
Auto-Composition
Auto-Compression
Auto-Encryption
Blink-Cursor
File-Name-Shadow
Font-Lock
Global-Auto-Complete
Global-Font-Lock Global-Hl-Line
Line-Number
Mouse-Wheel
Shell-Dirtrack
Show-Paren
Smartparens
Smartparens-Global
Tooltip Transient-Mark


texts: Irish (Gaeilge) dictionary Emacs on Windows

texts: How do I install an Irish (Gaeilge) dictionary for Emacs on Windows?


texts:
How can I export all the tables in org-mode file similar to that.
* May
:PROPERTIES:
:TABLE_EXPORT_FILE: ~/Desktop/may.csv
:TABLE_EXPORT_FORMAT: orgtbl-to-csv
:END:

|One|Two|
|---+---|

* June
:PROPERTIES:
:TABLE_EXPORT_FILE: ~/Desktop/june.csv
:TABLE_EXPORT_FORMAT: orgtbl-to-csv
:END:

|One|Two|
|---+---|

I want to run something like this to export all tables to the defined file.
emacs --batch table.org  --eval 'org-table-export'

The problem is that I have to be in the table.


texts: Indent each yasnippet line according to major mode

texts:
I want to use yasnippets to generate control flow statements in Lua.

-- a control flow statement in Lua
if foo then
   return "foo"
elseif bar then
   return "bar"
else
   return "baz"
end

First I make a yasnippet for if.

# -*- mode: snippet; require-final-newline: nil -*-
# name: if
# key: if
# binding: direct-keybinding
# --
if $1 then
  $0
end

No problem. Now I make a yasnippet for elseif

# -*- mode: snippet; require-final-newline: nil -*-
# name: elseif
# key: elseif
# binding: direct-keybinding
# --
elseif $1 then
  $0

...and one for else.

# -*- mode: snippet; require-final-newline: nil -*-
# name: else
# key: else
# binding: direct-keybinding
# --
else
  $0

However, using these snippets to generate the target control flow statement yields the following:

-- a misformatted control flow statement in Lua
if foo then
   return "foo"
   elseif bar then
     return "bar"
     else
       return "baz"
end

I want to have the statements automatically align themselves correctly, just as if I pressed Tab on each line. yas-indent-line is already set to the default value of 'auto, and of course setting it to 'fixed is not the solution. I could accomplish the reindentation by customizing yas-after-exit-snippet-hook, but that seems too heavyweight. Is there an option in yasnippets to automatically indent each line according to the mode's default indentation of the line?


texts: Windows 10 + Emacs shell--can't run processes from eshell; unwanted cmd windows open

texts:
I've been upgraded at work to a Windows 10 machine, from Windows 7. Apparently, this has caused problems.

First, eshell doesn't seem to be able to launch windows processes anymore. I get "Spawning child process: Exec format error". Googling around doesn't seem to give me anything useful.

Second, when I compile, I launch an external command into a build system, which actually runs a batch file in the end. For some annoying reason, this is opening a cmd window with the output, instead of it being captured in emacs' compile buffer (all I get in the compile buffer is the command being issued, and then the error code). That means I don't get a chance to parse the output and see what broke.

I've tried running with no init file, but the same behaviour persists, so at the very least, my .emacs is not interfering, but it's certainly not making things better.

Edit: Interesting note--some executables can't be run by cygwin in windows 10. They don't have a usable set of permissions, and even after I "chmod 777", bash claims that permission is denied when I try to run them. Related? Not sure.

I've included a chunk of my .emacs that might be pertinent.

(setenv "SHELL" "d:/Utilities/cygwin-64/bin/bash.exe")
(setenv "PATH" "d:/Utilities/cygwin-64/bin;d:/Utilities/gnuwin/bin;~/bin;d:/Utilities/emacs-24.5/bin;d:/Utilities/Everything;c:/Windows/System32;c:/ubiperl/script;c:/Perl/bin;d:/Utilities/gnuGlobal/bin;d:/Utilities/sift")
(setenv "MANPATH" "d:/Utilities/cygwin-64/usr/man/")
(setenv "GTAGSFORCECPP" "")
(setq exec-path (append exec-path '("d:/Utilities/cygwin-64/bin")))
(setq exec-path (append exec-path '("d:/Utilities/Everything")))
(setq exec-path (append exec-path '("d:/Utilities/gnuwin/bin")))
(setq exec-path (append exec-path '("d:/Utilities/gnuGlobal/bin")))
(setq exec-path (append exec-path '("d:/Utilities/emacs-24.5/bin")))
(setq exec-path (append exec-path '("d:/Utilities/sift")))
(setq project-grep-path '("e:/assassin/ace/dev/source/scimitar") )

(setq using-unix-filesystems t)
(setq shell-file-name "cmdproxy")
(setq explicit-shell-file-name "bash.exe")
(setq shell-command-switch "/C")
(setq archive-zip-use-pkzip nil)
;;(setq w32-quote-process-args ?\")
(setq w32-enable-italics t)
(setq comint-process-echoes nil)


texts: Why is Emacs hanging or seeming like it isin an infinite loop?

texts:
In my current Emacs major-mode for Tecplot macro development, I have a few functions defined:

(defconst tecplot-macro-mode-syntax-table
  (let ((table (make-syntax-table)))
    ;; ' is a string delimiter
    (modify-syntax-entry ?' "\"" table)
    ;; " is a string delimiter too
    (modify-syntax-entry ?\" "\"" table)
    ;; |...| delimits variable names
    (modify-syntax-entry ?| "_" table)
    ;; $!... delimits macro calls
    (modify-syntax-entry ?$ "_" table)
    (modify-syntax-entry ?! "_" table)

    ;; / is punctuation, but # is a comment starter
    (modify-syntax-entry ?# "<" table)
    (modify-syntax-entry ?\n ">" table)
    table))

(defvar tecplot-macro-mode-keywords
  '(("[^#|{! ][[:alpha:]]* =" . font-lock-keyword-face)
    ("$![[:alpha:]]+" . font-lock-function-name-face)
    ("|\\(?:[[:ascii:]]\\|\\s_\\)+|" . font-lock-variable-name-face))
  ;;  )
  "List of keywords for `tecplot-macro-mode'.")

(define-derived-mode tecplot-macro-mode prog-mode "Tecplot"
  "Mode for editing Tecplot macros."
  :syntax-table tecplot-macro-mode-syntax-table
  (setq font-lock-defaults '(tecplot-macro-mode-keywords))
  (font-lock-mode)
  )

For some reason, Emacs has begun hanging when I put in the font-lock-keyword-face regexp. Why would this cause Emacs to hang? Is there a better way to get the text that the regexp grabs properly type colored?


texts:
I am trying to install org-mac-link on my Mac. I have downloaded the file org-mac-link.el to .emacs.d and also customized the org group by typing M-x customize-group RET org RET, then expand the Modules section, and enabled mac-link. But when I use (require 'org-mac-link) in my init file emacs gives an error since it says it can not find org-mac-link file.

This is part of my init file:

 ;; org-mac-link
 (require 'org-mac-link)
 (add-hook 'org-mode-hook (lambda ()
   (define-key org-mode-map (kbd "C-c g") 'org-mac-grab-link)))


texts:
I want to create an org file with two sections, that reads in that order but
"tangles" first the second section. For example, if my org file is

* Generic section

#+BEGIN_SRC python :tangle yes
print(a+4)
#+END_SRC

* Preparation

#+BEGIN_SRC python :tangle yes
a = 4
#+END_SRC

the tangled output should be

a = 4
print(a+4)

One option would be using noweb syntax to input the first code block into the second, and avoid tangling the first block, but in the generated pdf I would have a codeblock with the full code and another one with only the second line. The pdf should be something like

Generic section

print(a+4)

Preparation

a = 4

How can I achieve this result?


texts: orgmode latex export: alternative to \newpage?

texts:
In orgmode, is there a property I can set to a section that will output a pagebreak before it?

Right now, I can do the following:

* Section 1

** Subsection 1
stuff

** Subsection 2
stuff

\newpage

* Section 2

but when I hide/show subtrees, the \newpage is treated as part of Subsection 2 when it is really part of Section 2.

I would like to include the pagebreak in a property drawer related to Section 2, i.e.,

* Section 1

** Subsection 1
stuff

** Subsection 2
stuff

* Section 2
  :PROPERTIES:
  :pagebreak: \newpage
  :END:

or something similar. Does such a property exist?


texts: is there a shortcut to re-type the original filename and then edit it, when at the dired copy (C) minibuffer prompt

texts: While in a dired buffer, after pressing C to copy a file, often the new filename you want  is actually a variation of the original file name. Is there a easy way to get original file name in to the minibuffer prompt?


texts:
How can I set which pdf viewer org-export uses when it exports to latex and pdf and views?

I'm using the command C-c C-e l o with default keybindings (Emacs 24.5). Currently it always uses xpdf, even though I am using pdf-tools and have set AUCTeX to use Zathura. I have also tried setting the openwith-associations variable to no avail.


texts: Dealing with org-macros: Undefined org macro; aborting

texts:
Do I have to activate something to allow Org-mode 9 to process macros?
An org-file with the following content gives me an error on export:

#+MACRO CANVAS @@html:
<canvas id="$1"></canvas>
@@
{{{CANVAS(thename)}}}

Would somebody be able to point me in the right direction?!

Error message:

  cond: Undefined Org macro: canvas; aborting


texts: Get the body of all nodes that match a criterion in an Org Mode document

texts:
Given an org document, I'd like to traverse all the nodes (headlines) that have the following property ARTICLE_TYPE, and extract the body (excluding the drawers) for each one.

I'm struggling to find the appropriate org-element-map expression that will give me this.

Any ideas?


texts: Japanese / CJK font settings for proper horizontal alignment

texts:
I've had this right at one point in the past on one machine with a certain font type at a particular font size, but I can't seem to get it right again.

Look e.g. at how my org mode tables look once I add Japanese characters. Here are two examples using fonts that were supposed to align properly (I read somewhere).

Help!

This is version

  GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2014-12-10 on gaia, modified by Debian

Edit A copy-and-pasteable version of a bunch of alignment problems for anyone who wants to try themselves:

| a 漢字       |   |
| b はどう     |   |
| f デショウ a |   |
| ﾊｰﾌ          |   |
| ｗｈｏｌｅ   |   |
| half         |   |
| ○            |   |


texts: Check agenda of a particular day from calendar

texts:
In calendar-mode to invoke d on a specified day, it will prompt the activitiesof the day from file ~/diary.

Is it possible to invoke an agenda view of a particular day from calendar?


texts: How can i make toggle shortcuts like org mode or magit

texts:
I am writing an elisp package currently I am using hydra, I would like to be able to have shortcuts you can toggle on and off for various flags.

You see this sort of thing in magit and org mode when you press the key and it hightlight the text another colour to indicate the flag is checked before selecting an actual option.

What are my options and can hydra do this sort of thing ?


texts: How i can navigate in buffers in specific .py files

texts:
I use emacs 24.5.1 and i use this hotkeys for navigate in my buffers, but I need navigate only in *.py files.

(global-set-key (kbd "C-;") 'next-buffer)
(global-set-key (kbd "C-'") 'previous-buffer)

I just started learning Lisp, I have no idea how I can do this. Thanks for any help.

UPD:
I want same as next-buffer but only in *.py files. For example, I have this buffers: file.txt, file.el, file.py and next-buffer, previous-buffer leafing through them all, but I need only in .py files and ignore any other.


texts: Define a keyboard macro to indefinitely execute another keyboard macro and then do something else

texts:
I've defined one keyboard macro, bound to keystroke 1, say, and I want to define a second keyboard macro that executes the first one indefinitely and then returns to the beginning of the buffer. I assume that the first one always terminates if iterated indefinitely. E.g., it could be a keyboard macro that operates on a line and then moves to the next line.

To define the new keyboard macro, I naively want to type:

C-x ( C-u 0 C-x C-k 1 C-u C-u C-x ( M-< C-x )

In other words, C-x ( to begin recording, C-u 0 to specify indefinite execution, C-x C-k 1 to specify that the indefinite execution refers to keyboard macro 1, C-u C-u C-x ( to resume recording the new keyboard macro (since recording automatically terminates after the last iteration of keyboard macro 1), M-< to return to the beginning of the buffer, and finally C-x ) to end recording.

If I bind all of that to a new key sequence and then invoke it, I find that this new keyboard macro goes as far as to execute keyboard macro 1 (as many times as it can) but fails to finish with the M-<. Am I doing something wrong? Is there another way to achieve what I want?


texts: Is there a way to see a pull-request review status in magit?

texts: I see I can view the github pull requests assigned to me with forge-list-requested-reviews. Is there a way to see the status of each review? For example I've approved some of the pull requests that are in that list, and requested changes on others, but I can't tell which without going to the GitHub web interface.


texts:
So this is some elisp code I have in my init.el file:

(defun complete-dollar ()
  (interactive)
  (insert "$$")
  (backward-char 1))

(defun my-latex-keys ()
  "Modify keymaps by latex-mode"
  (local-set-key (kbd "$") 'complete-dollar))

(add-hook 'latex-mode-hook 'my-latex-keys)

Now, I open a tex file to test it. And when I type a $ it just gives
me $ instead of $$ as expected from the above elisp code. This is
the value for the major-mode variable in the buffer:

  major-mode: latex-mode

Also the key $ is binded to autopair-insert-or-skip-paired-delimiter when I inspect it. Any
reason on why it's not working ? (Also, if my elisp code isn't the
correct way of doing this, I would love to know the recommended
approach)

Edit:
Ok, this made it to work:

(add-hook 'LaTeX-mode-hook 'sibi-latex-keys)

So my question is how to find which hook is the approriate one out of the following choices:

latex-mode-hook
LaTeX-mode-hook
tex-mode-hook


texts: Continue comment while editing lisp and when hitting enter

texts:
If I'm writing a comment
;; this is a comment
;; this is its second line

And I hit enter, I get a new line like this:
;; this is a comment
;; this is its second line

Instead of getting a new line with comments continued, like this:
;; this is a comment
;; this is its second line
;;

How do I get the latter behavior? I'm editing clojure if that matters


texts: Using 'create-image' with data, not a file

texts:
I am having trouble creating images with just data:

(web-http-get
 (lambda (con hdr data)
   (setq nic-profile-img-data data))
 :url "http://pbs.twimg.com/profile_images/494606908385288192/Vq16xxxu_normal.jpeg")

downloads an image from Twitter (yes, I'm writing a Twitter tool).

When I do this:

 (insert-image (create-image nic-profile-img-data 'jpeg))

I just get a blank square.

When I do this however:

(insert-image
 (progn
   (with-temp-file "/tmp/nic.jpg"
     (insert nic-profile-img-data))
   (create-image "/tmp/nic.jpg" 'jpeg)))

I get a nice picture of a really good looking Englishman.

I don't understand the difference here. I thought it might be encoding of the image data somehow, so I tried all sorts of different decoding and encoding (who understands that stuff in Emacs anyway?), but none of it made any difference.

The create-image with data stuff seems fairly new, and most code I've found uses files. I can use files, but it's an extra layer I didn't want.

How might this work and what, if anything I'm doing wrong?

Platform: Emacs 24-4 on GNU/Linux.


texts:
I use emacsclient as my git commit editor.

This is what I have in my init file:

(require 'git-commit)
(add-hook 'git-commit-mode-hook 'turn-on-flyspell)

I just made a huge commit (update of a third-party SDK, which I have in my own repo). Emacsclient took absurdly much time spell checking what looks to be all the source files, instead of the commit message only. Like 15 minutes.

The default commit message shows the name of all changed files.

is flyspell trying to spell check everything because the filenames are in the default commit message?
is magit the problem, trying to display diff? In that case, how can I setup my hook so that the commit message is spell checked, but not the source diff? I don't think I have spell check activated when I run magit normally.


texts:
I want to be able to attach files to a sub-tree from a Dired buffer. The org-mode manual gives instructions on how to do this in the link below:

https://orgmode.org/manual/Attachments.html

At the bottom of the article they have two pieces of code that one is to insert into one's init file to get this to work. However, neither set of lines work. I have tried them and they generate errors.

My goal is to be able to attach multiple files at one time to my org headlines. At present I use C-c C-a m which attaches a file at a time.


texts: Selecting (i.e., as the region) the current match in incremental search

texts:
When searching for a string with C-s, I want to be able to hit some key to exit search mode but still maintain the selection of the match. That way I can immediately start typing and replace the last match.

For example, say I have the following document:

The quick brown fox jumps over the lazy dog.

If I search for "lazy", emacs will select that word like so (square brackets are selection, pipe is cursor):

The quick brown fox jumps over the [lazy|] dog.

Now, if I press return, emacs will maintain my cursor position, but it will deselect "lazy":

The quick brown fox jumps over the lazy| dog.

Instead of this, I want a shortcut that will exit search mode but maintain the current match selection, like in the second state above.


texts: How can I limit an org-mode clock out, to some specified time of day?

texts:
I use org-mode clocks extensively for task tracking, with one exception. End of day. Depending on my location, amount of haste (trains or battery power) etc. I sometimes neglect clocking out at day end.

Is there a setting to set the maximum allowed day-time (same day) end?

Example: I start an action at 16:35, I run for a train at 17:45. I forgot to log out. On clocking in the next morning - I don't want the keep value of working on the last action overnight, but to a maximum time of say 17:30.


texts: Run an external shell command to mutate text

texts:
I would like to run par or fmt to format my .md file.
In vim this would be %!fmt (for the whole buffer) or 13,16!fmt (for line 13 - line 16).
What's the "emacs way" to achieve something like this
PS: I am aware of evil-mode(If I wanted vi keystrokes, I would have used vim) and the M-! key binding. I also am quite new to emacs


texts: My .org file is almost 2MB large. How can I narrow down what headers/sub-headers take so much space?


texts: Jump sequence for placeholders in yasnippet not working in org-property blocks

texts:
I use the yasnippet bundle and it works like charm.

When I want to include placeholders in a PROPERTIES section of an org-document it is not working.

Here's the snipper:

#type: snippet
# --
:PROPERTIES:
${1: :var: name="$2"}
${3: :var: url="$4"}
:END:
$0

What this does is to define 2 optional variables, "name" and "url".

When calling (yas-tryout-snippet) on the snippet above, the cursor is not positioned correctly.

Here where it should jump:

Press tab 1st: Make whole line ${1: :var: name="$2"} because it can be optional

Press tab 2nd: Make only "$2" in the line ${1: :var: name="$2"}.

Press tab 3rd: Make whole line ${3: :var: url="$4"} because it can be optional

... and so on

Here's what it actually  does:

Press tab 1st: Make whole line ${1: :var: name="$2"} because it can be optional

Press tab 2nd: Make whole line ${3: :var: url="$4"}

The problem seem to be produced by the :var: Keyword.

It stops yasnippet from jumping to the $2. If I change it to only var: or :var it will work. But then it won't be able to include these properties into a src code block and work with it.
It will also work if I remove the quotes from the placeholder. So this will work, but as before, then I cannot eval the url var in code blocks

${3: :var: url=$4}

I also tried excaping things with no luck:

${3: :var: url=\"$4\"}
or
${3: :var: url='$4'}
or
${3: \:var\: url="$4"}

Any ideas on how to write this snippet or what I'm doing wrong.


texts: How to keep keyboard focus on terminal after compiling tex?

texts:
My operation system is macOS Catalina. I am using iTerm2 in order to interact with emacs and my default pdf viewer is PDF Pro Reader Light. When a pdf file is updated, PDF Pro Reader Light automatically reloads the document.

I am using following keybinding to compile the latex files.

  C-c C-a (TeX-command-run-all) will do the job in AUCTeX 11.89.

After compilation is completed the keyboard focus is switch into the default pdf viewer and also the pdf view pops up in front of my terminal.

[Q] Is there any way to keep the focus on the terminal after compiling the tex and prevent pdf viewer to pop-up?


texts: Delete trailing white space from all projectile project files

texts:
Problem

So the problem is pretty straight forward I'm just trying to get delete trailing spaces from all files in a projectile project.

Here's what I've tried so far:

(defun projectile-delete-trailing-white-spaces-from-project-files ()
  "Deletes trailing spaces from all projectile project files."
  (interactive)
  (let* ((list (projectile-current-project-files))
         (buffer (car list)))
    (while buffer
      (message buffer)
      (when
        (when (file-exists-p buffer)
          (set-buffer (find-file-noselect buffer))
          (delete-trailing-whitespace) ;; <-- This isn't working?
          (save-buffer))               ;; <-- This isn't working?
        (setq list (cdr list))
        (setq buffer (car list))
        ))))


texts: org-metaup won't run for all cursors, regardless of status of cmds-to-run-for-all

texts:
When using multiple cursors for structural editing of org mode trees: org-metadown, org-metaleft and org-metaright function for all cursors, but org-metaup has no effect.
For example, if I have four headings, put cursors on the middle two, then M-<up> results in no change, whereas M-<down> results in the second and third headings moving down to positions three and four, i.e. M-<down> turns...

one
two
three
four

into...

one
four
two
three

Troubleshooting:
meta-up, meta-down, meta-left and meta-right are all in .mc-lists.el under (setq mc/cmds-to-run-for-all...). None of these commands are present elsewhere in multiple-cursors-core.el: neither in mc--default-cmds-to-run-for-all, nor mc--default-cmds-to-run-once.
I've tried removing the commands from .mc-lists.el and having multiple cursors add them back to .mc-list.el the next time I used the commands, but the errant behaviour of org-metaup persisted.
How can I fix this?


texts: Mac OS and possibly other GUIs: Why is default "s-g" behaving differently from "C-s" in isearch-mode

texts:
I don't really want s-g to exit the Isearch minor mode but it does. The reason this is happening to me is unclear, because investigation of the binding of s-g reveals it is supposed to be a standard isearch-repeat-forward. So it seems that Emacs has gotten into a state where two keys bound to the same thing have different behavior.
Question: Why is Emacs behaving this way, how is it happening, and is this intended behavior?

Edit contents of /tmp/blah.txt to be:

something
something

emacs -Q /tmp/blah.txt
s-fsomething -- modeline should now indicate you are in Isearch minor mode
Enter C-hks-g -- note that output indicates both s-g and C-s are bound to this function (isearch-repeat-forward)

s-g runs the command isearch-repeat-forward (found in global-map),
which is an interactive compiled Lisp function in ‘isearch.el’.

It is bound to C-s, C-M-s, <menu-bar> <search-menu>
<isearch-repeat-forward>, s-g.

Press one of

s-g -- modeline indicates Isearch minor mode is no longer active
C-s -- modeline indicates Isearch minor mode is still active

Start over and press the key you didn't press in step 4

My Emacs About panel indicates Version 28.0.50 (9.0).


texts:
I am going through emacs inbuilt Elisp tutorial. By default emacs fontifies( changes color ) visited  links color like this

This fontification lasts only for current session. If i restart emacs, all fontification will be lost.

How  can i make  emacs to remember visited  links even after  restarting emacs so that it will be much easier for me to resume where  i have stopped?


texts: Showing SCHEDULED entries few days in advance

texts:
How can I easily show SCHEDULED entries few times before it comes up given date?

Let's say I have to leave my car for repairs on monday, but I would like to have a reminder one day and one week earlier so I don't plan anything requiring a car or something.

I know I could use diary remind for

life:       Reminder: Only 2 weeks until Car repairs

But I don't know how to connect this with SCHEDULED entry.
Any ideas on how to do this? Am I missing something obvious here?


texts: Is there a way to revert only certain lines from a diff hunk?

texts:
I use the builtin VC package and it's very nice that when I do a diff of changes in the current file then I can revert any hunk in the diff quickly with C-a

But sometimes I don't want to revert the whole hunk, only certain lines and keep other changes in the hunk. Is it possible somehow? Reverting individual lines, instead of the whole hunk?


texts: xref-find-defnition not finding any definition

texts:
I am a newbie and in this part of the tutorial:
"  More generally, if you want to see a function in its original source
file, you can use the xref-find-definitions function to jump to it.
xref-find-definitions works with a wide variety of languages, not
just Lisp, and C, and it works with non-programming text as well.  For
example, xref-find-definition will jump to the various nodes in the
Texinfo source file of this document (provided that you've run the
`etags' utility to record all the nodes in the manuals that come with
Emacs;
"
M-. doesn't find any definition of functions even though the autocompletion in the call works.
I have no idea how to create a tag table, because the manual just states "etags inputfile" but again I have no idea which file i would need to create my tags on. Also find-function doesn't work either, it just states simple.el can't be found which is no surprise because only a simple.elc exists. so it searches for the wrong file by default but i don't know how to change that either. Can somebody help?


texts: Why won't `emacs -nw -f org-mode foo` open `foo` in `org-mode`?

texts: I want to open a file foo in org-mode on the terminal. However, Issuing emacs -nw -f org-mode foo opens foo in Fundamental mode. What's wrong with my command?


texts:
I am trying out the literate programming features of org mode and loving it! I will be using the noweb syntax of double angle brackets <<...>> heavily.

I want the named block to be inserted into the place of the double-brackets as intended, when I tangle the file (obviously)

However, when I export to HTML, I don't want the named block to be expanded, and just make <<block-name>> show up instead. This is useful to hide housekeeping code, since that often distracts my reading while reading the documentation.

In brief, how do I prevent expansion of <> while exporting to HTML and allow it while tangling?


texts:
Is there a way to customize how tags get sorted in org-agenda weekly view? I don't like the default which is sorting alphabetically (within tasks of the same date/priority).

It would be more useful if the sorting could be in the order tags are defined in the org file.


texts: Automatically locate & use the right etags file for each project?

texts:
I'm trying to port my tagging workflow from Vim & ctags to Emacs & etags. I currently use git hooks to write a tags file to .git/tags in ctags format whenever I commit/merge/etc. This keeps each project indexed with an up-to-date tags file.

fugitive.vim makes sure Vim will look for tags in the .git directory associated with the current buffer. For a Ruby project that uses gems, bundler.vim ensures Vim will look for tags in each included gem's directory.

This lets me navigate freely throughout various projects without having to tell Vim where to find tags. I've added a git hook to write tags to .git/etags in the etags format, but I'm not sure how to get Emacs to find tags files automatically. I'd like to avoid hard-coding the value of tags-table-list if possible.

Before I reinvent the wheel and translate the logic of fugitive.vim and bundler.vim into elisp, is there an existing solution for this kind of thing?


texts: how to paste a command's name into the helm minibuffer by using its binding?

texts:
It would be nice if I could paste a commands name into the helm minibuffer when I am using describe-function and find-function without typing.
Additionally I need the possibility to exclude certain bindings from this feature, that I use from within helm buffers.

Edit:
I've tried this command:

(defun my-insert-command-name-on-key (key)
  (interactive "kInsert function on key: ")
  (insert (symbol-name (key-binding key))))

But it doesn't work properly in helm buffers. Sometimes it pastes the name, but mostly it pastes "undefined".


texts:
This are the first 4 lines of my init.el

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(setq package-enable-at-startup nil)

After loading emacs all the entries (elpa/package.version) added by package-initialize to the load-path are in it twice, once without a trailing slash and once with it.

Does anyone know why it does this? Won't it slow things down by searching the directories twice?

It made me think I was adding them to the load path twice, but I'm not.


texts: How can I get Cask or Pallet to automatically install packages on startup?

texts: I manage packages in Emacs using Cask and Pallet.  Yesterday I upgraded to Emacs 24.4; it went well enough, but all of a sudden all my packages were missing.  Cask installs packages in separate directories by Emacs version, so everything was in .cask/24.3.1; there was nothing in .cask/24.4.1, and in fact the directory didn't exist.  Once I figured this out, I was able to run cask and install everything again -- but is there a way to make this happpen automagically, from within Emacs itself, when upgrading?


texts: init.el file loads, but not evaluating all of the expressions

texts:
for example

(show-paren-mode t)

not getting evaluated, I have to run this function every time even though it is in my init.el file and other


texts:
What is the argument count limit to a function call?

I think that max-specpdl-size is related to answer:

  This variable defines the limit on the total number of local variable
  bindings and ‘unwind-protect’ cleanups that are allowed before Emacs
  signals an error

but I don't think that defun makes local binding using let.

I try (macroexpand-all '(defun my (x) (+ x 1))) C-u C-x e and get:

(defalias (quote my) (function (lambda (x) (+ x 1))))

So I check eval.c for evaluator code:

apply_lambda (Lisp_Object fun, Lisp_Object args, ptrdiff_t count) {
  EMACS_INT numargs;
  register Lisp_Object *arg_vector;

  numargs = XFASTINT (Flength (args));
  SAFE_ALLOCA_LISP (arg_vector, numargs);
  ...

which leads to SAFE_ALLOCA_LISP:

#define SAFE_ALLOCA_LISP(buf, nelt)                            \
  do {                                                         \
    if ((nelt) <= lisp_word_count (sa_avail))                  \
      (buf) = AVAIL_ALLOCA ((nelt) * word_size);               \
    else if ((nelt) <= min (PTRDIFF_MAX, SIZE_MAX) / word_size) \
      {                                                        \
        Lisp_Object arg_;                                      \
        (buf) = xmalloc ((nelt) * word_size);                  \
        arg_ = make_save_memory (buf, nelt);                   \
        sa_must_free = true;                                   \
        record_unwind_protect (free_save_value, arg_);         \
      }                                                        \
    else                                                       \
      memory_full (SIZE_MAX);                                  \
  } while (false)

That piece is hard for me to understand… Rest of the code doesn't seem to
expose any restriction but I am unsure…

Compare with Common Lisp constants: LAMBDA-PARAMETERS-LIMIT and
CALL-ARGUMENTS-LIMIT.


texts:
I wrote a new major mode config-general-mode, which is derived from conf-mode. I like it a lot and want to have it as the default mode for all configuration files. Thus I tried:

(defalias 'conf-mode 'config-general-mode)

But this doesn't work, I get the error message:

Lisp nesting exceeds `max-lisp-eval-depth'

Of course I could (and probably will) just associate *.cfg and *.conf with my mode, but I am curious, if such an alias can be made possible somehow.


texts: How to show the output of a command in a quick-fix window?

texts:
If I have a command that runs and generates the following output.

/path/to/file.rst:1
/another/path/to/file.rst:42

How would I call the command so a buffer is opened and clicking on the line jumps to the file?


texts: How do I set the upstream branch to push a local branch to in magit?

texts:
From what I remember, if I am working on a branch, e.g., my-feature-branch, I used to be able to do this from the magit-status menu with P P, and then selecting the remote branch from a list which had origin/my-feature-branch at the top. This worked beautifully.

Recently, as of this discussion, I could do something similar with P -u e (opening the magit-push-popup, setting the --set-upstream flag, and using e for elsewhere), which would similarly let me pick from a list of branches starting with origin/my-feature-branch. This worked fine for me too. Even more recently however, this no longer works, and I haven't been able to figure out the best way to set an upstream branch.

When I use P e the first option for a branch to push to is origin/my-feature-branch, which is almost always what I want. However, it doesn't set origin/my-feature-branch as the upstream for my local branch. Using P u allows me to pick the upstream branch, but origin/my-feature-branch is not in the list, and I have to type out origin/my-feature-branch without tab completion (I know this is not hard, but it is prone to user error, and is slower than the command line).

Is this the only way to set an upstream branch now, or am I missing something? I have looked at other discussions and documentation related to the issue, but all the sources I have found seem to be out of date.


texts: Spacemacs pdf-tools inverse search with keyboard possible?

texts:
I am running spacemacs and pdf-tools on Ubuntu 18.04. It does work quite well, however now I asked myself whenever there is an option to do inverse search (or to make a new command doing inverse search) with a keyboard key.

The built in command Ctrl-Mouse-1 works well, but could I for example inverse search from the pdf back to the beginning of the page in the tex file with a keystroke? Or in a more sophisticated, but versatile way could I run pdf-occur, let the results show up and then go to the line in my editing file with a keyboard command?


texts:
Emacs has the function fill-paragraph. Is there any function which will do the opposite of that?

I have a paragraph which is already filled and instead I want it in a plain single line?


texts:
i installed and enabled flycheck but it doesn't find errors in my software (c code), errors that i deliberately inserted to test it

instead it works on a new minimal c file (also not saved)

what could be the problem? thanks in advance

emacs version

  GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.6)  of
  2015-12-14 on binet, modified by Debian

flycheck version

  Flycheck version: 0.26snapshot (package: 20151212.411)

flycheck-verify-setup

  Syntax checkers for buffer formelement.c in c-mode:

  c/c++-clang
      - predicate:  nil
      - executable: Not found

  c/c++-gcc
      - predicate:  t
      - executable: Found at /usr/bin/gcc

  c/c++-cppcheck
      - predicate:  nil
      - executable: Not found

  Flycheck Mode is enabled.